$post["url"] = $b["plink"];
} elseif (strpos($b["body"], "[share") !== false)
$post["url"] = $b["plink"];
+ elseif (get_pconfig($b["uid"], "system", "no_intelligent_shortening"))
+ $post["url"] = $b["plink"];
$msg = shortenmsg($msg, $limit);
}
check_form_security_token_redirectOnErr('/settings/connectors', 'settings_connectors');
- if(x($_POST, 'imap-submit')) {
+ if(x($_POST, 'general-submit')) {
+ set_pconfig(local_user(), 'system', 'no_intelligent_shortening', $_POST['no_intelligent_shortening']);
+ } elseif(x($_POST, 'imap-submit')) {
$mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : '');
$mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : '');
if(($a->argc > 1) && ($a->argv[1] === 'connectors')) {
- $settings_connectors = "";
+ $settings_connectors = '<span id="settings_general_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_general_expanded\'); openClose(\'settings_general_inflated\');">';
+ $settings_connectors .= '<h3 class="connector">'. t('General Social Media Settings').'</h3>';
+ $settings_connectors .= '</span>';
+ $settings_connectors .= '<div id="settings_general_expanded" class="settings-block" style="display: none;">';
+ $settings_connectors .= '<span class="fakelink" onclick="openClose(\'settings_general_expanded\'); openClose(\'settings_general_inflated\');">';
+ $settings_connectors .= '<h3 class="connector">'. t('General Social Media Settings').'</h3>';
+ $settings_connectors .= '</span>';
+
+ $checked = ((get_pconfig(local_user(), 'system', 'no_intelligent_shortening')) ? ' checked="checked" ' : '');
+
+ $settings_connectors .= '<div id="general-shortening-wrapper">';
+ $settings_connectors .= '<label id="general-shortening-label" for="shortening-checkbox">'. t('Disable intelligent shortening'). '</label>';
+ $settings_connectors .= '<input id="shortening-checkbox" type="checkbox" name="no_intelligent_shortening" value="1" ' . $checked . '/>';
+ $settings_connectors .= '</div>';
+
+ $settings_connectors .= '<div class="settings-submit-wrapper" ><input type="submit" name="general-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div>';
+
+ $settings_connectors .= '</div><div class="clear"></div>';
call_hooks('connector_settings', $settings_connectors);