open/close config block for superblock addon

This commit is contained in:
Tobias Diekershoff 2017-04-21 08:47:33 +02:00
parent 342d1398b7
commit 6b054dcd27

View file

@ -36,20 +36,26 @@ function superblock_uninstall() {
function superblock_addon_settings(&$a,&$s) { function superblock_addon_settings(&$a,&$s) {
if(! local_user()) if(! local_user()) {
return; return;
}
/* Add our stylesheet to the page so we can make our settings look nice */ /* 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/superblock/superblock.css' . '" media="all" />' . "\r\n"; $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/superblock/superblock.css' . '" media="all" />' . "\r\n";
$words = get_pconfig(local_user(),'system','blocked'); $words = get_pconfig(local_user(),'system','blocked');
if(! $words) if(! $words) {
$words = ''; $words = '';
}
$s .= '<div class="settings-block">'; $s .= '<span id="settings_superblock_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_superblock_expanded\'); openClose(\'settings_superblock_inflated\');">';
$s .= '<h3>' . t('"Superblock" Settings') . '</h3>'; $s .= '<h3>' . t('"Superblock"') . '</h3>';
$s .= '</span>';
$s .= '<div id="settings_superblock_expanded" class="settings-block" style="display: none;">';
$s .= '<span class="fakelink" onclick="openClose(\'settings_superblock_expanded\'); openClose(\'settings_superblock_inflated\');">';
$s .= '<h3>' . t('"Superblock"') . '</h3>';
$s .= '</span>';
$s .= '<div id="superblock-wrapper">'; $s .= '<div id="superblock-wrapper">';
$s .= '<label id="superblock-label" for="superblock-words">' . t('Comma separated profile URLS to block') . ' </label>'; $s .= '<label id="superblock-label" for="superblock-words">' . t('Comma separated profile URLS to block') . ' </label>';
$s .= '<textarea id="superblock-words" type="text" name="superblock-words" >' . htmlspecialchars($words) . '</textarea>'; $s .= '<textarea id="superblock-words" type="text" name="superblock-words" >' . htmlspecialchars($words) . '</textarea>';
@ -58,7 +64,6 @@ function superblock_addon_settings(&$a,&$s) {
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="superblock-submit" name="superblock-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>'; $s .= '<div class="settings-submit-wrapper" ><input type="submit" id="superblock-submit" name="superblock-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
return; return;
} }
function superblock_addon_settings_post(&$a,&$b) { function superblock_addon_settings_post(&$a,&$b) {