-
- $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 = ((PConfig::get(local_user(), 'system', 'no_intelligent_shortening')) ? ' checked="checked" ' : '');
-
- $settings_connectors .= '<div id="no_intelligent_shortening" class="field checkbox">';
- $settings_connectors .= '<label id="no_intelligent_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 .= '<span class="field_help">'.t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.').'</span>';
- $settings_connectors .= '</div>';
-
- $checked = ((PConfig::get(local_user(), 'system', 'ostatus_autofriend')) ? ' checked="checked" ' : '');
-
- $settings_connectors .= '<div id="snautofollow-wrapper" class="field checkbox">';
- $settings_connectors .= '<label id="snautofollow-label" for="snautofollow-checkbox">'. t('Automatically follow any GNU Social (OStatus) followers/mentioners'). '</label>';
- $settings_connectors .= '<input id="snautofollow-checkbox" type="checkbox" name="snautofollow" value="1" ' . $checked . '/>';
- $settings_connectors .= '<span class="field_help">'.t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.').'</span>';
- $settings_connectors .= '</div>';
-
- $default_group = PConfig::get(local_user(), 'ostatus', 'default_group');
- $legacy_contact = PConfig::get(local_user(), 'ostatus', 'legacy_contact');
-
- $settings_connectors .= Group::displayGroupSelection(local_user(), $default_group, t("Default group for OStatus contacts"));
-
- /// @TODO Found to much different usage to test empty/non-empty strings (e.g. empty(), trim() == '') which is wanted?
- if ($legacy_contact != "") {
- $a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL='.System::baseUrl().'/ostatus_subscribe?url='.urlencode($legacy_contact).'">';
+ $no_intelligent_shortening = intval(PConfig::get(local_user(), 'system', 'no_intelligent_shortening'));
+ $ostatus_autofriend = intval(PConfig::get(local_user(), 'system', 'ostatus_autofriend'));
+ $default_group = PConfig::get(local_user(), 'ostatus', 'default_group');
+ $legacy_contact = PConfig::get(local_user(), 'ostatus', 'legacy_contact');
+
+ if (x($legacy_contact)) {
+ /// @todo Isn't it supposed to be a goaway() call?
+ $a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . System::baseUrl().'/ostatus_subscribe?url=' . urlencode($legacy_contact) . '">';