-}
-
-function diaspora_settings(&$a,&$s) {
-
- if(! local_user())
- return;
-
- /* Add our stylesheet to the page so we can make our settings look nice */
-
- $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/diaspora/diaspora.css' . '" media="all" />' . "\r\n";
-
- /* Get the current state of our config variables */
-
- $enabled = get_pconfig(local_user(),'diaspora','post');
-
- $checked = (($enabled) ? ' checked="checked" ' : '');
-
- $def_enabled = get_pconfig(local_user(),'diaspora','post_by_default');
-
- $def_checked = (($def_enabled) ? ' checked="checked" ' : '');
-
- $diaspora_username = get_pconfig(local_user(), 'diaspora', 'diaspora_username');
- $diaspora_password = get_pconfig(local_user(), 'diaspora', 'diaspora_password');
- $diaspora_url = get_pconfig(local_user(), 'diaspora', 'diaspora_url');
-
-
- /* Add some HTML to the existing form */
-
- $s .= '<span id="settings_diaspora_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_diaspora_expanded\'); openClose(\'settings_diaspora_inflated\');">';
- $s .= '<h3>' . t('Diaspora') . '</h3>';
- $s .= '</span>';
- $s .= '<div id="settings_diaspora_expanded" class="settings-block" style="display: none;">';
- $s .= '<span class="fakelink" onclick="openClose(\'settings_diaspora_expanded\'); openClose(\'settings_diaspora_inflated\');">';
- $s .= '<h3>' . t('Diaspora') . '</h3>';
- $s .= '</span>';
-
- $s .= '<div id="diaspora-enable-wrapper">';
- $s .= '<label id="diaspora-enable-label" for="diaspora-checkbox">' . t('Enable Diaspora Post Plugin') . '</label>';
- $s .= '<input id="diaspora-checkbox" type="checkbox" name="diaspora" value="1" ' . $checked . '/>';
- $s .= '</div><div class="clear"></div>';
-
- $s .= '<div id="diaspora-username-wrapper">';
- $s .= '<label id="diaspora-username-label" for="diaspora-username">' . t('Diaspora username') . '</label>';
- $s .= '<input id="diaspora-username" type="text" name="diaspora_username" value="' . $diaspora_username . '" />';
- $s .= '</div><div class="clear"></div>';
-
- $s .= '<div id="diaspora-password-wrapper">';
- $s .= '<label id="diaspora-password-label" for="diaspora-password">' . t('Diaspora password') . '</label>';
- $s .= '<input id="diaspora-password" type="password" name="diaspora_password" value="' . $diaspora_password . '" />';
- $s .= '</div><div class="clear"></div>';
-
- $s .= '<div id="diaspora-url-wrapper">';
- $s .= '<label id="diaspora-url-label" for="diaspora-url">' . t('Diaspora site URL') . '</label>';
- $s .= '<input id="diaspora-url" type="text" name="diaspora_url" value="' . $diaspora_url . '" />';
- $s .= '</div><div class="clear"></div>';
-
- $s .= '<div id="diaspora-bydefault-wrapper">';
- $s .= '<label id="diaspora-bydefault-label" for="diaspora-bydefault">' . t('Post to Diaspora by default') . '</label>';
- $s .= '<input id="diaspora-bydefault" type="checkbox" name="diaspora_bydefault" value="1" ' . $def_checked . '/>';
- $s .= '</div><div class="clear"></div>';
-
- /* provide a submit button */
-
- $s .= '<div class="settings-submit-wrapper" ><input type="submit" id="diaspora-submit" name="diaspora-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';