* Hauke Altmann * */ function pledgie_install() { register_hook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); register_hook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); register_hook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); } function pledgie_uninstall() { unregister_hook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); unregister_hook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); unregister_hook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); } function pledgie_addon_settings(&$a,&$s) { if(! is_site_admin()) return; /* Add our stylesheet to the page so we can make our settings look nice */ $a->page['htmlhead'] .= '' . "\r\n"; $campaign = get_config('pledgie-campaign','text'); $describe = get_config('pledgie-describe','text'); if(! $campaign) $campaign = ''; if(! describe) $describe = ''; $s .= '
'; $s .= '

' . t('"pledgie" Settings') . '

'; $s .= '
'; $s .= ''; $s .= ''; $s .= '
'; $s .= '
'; $s .= ''; $s .= ''; $s .= '
'; $s .= '
'; return; } function pledgie_addon_settings_post(&$a,&$b) { if(! is_site_admin()) return; if($_POST['pledgie-submit']) { set_config('pledgie-describe','text',trim(strip_tags($_POST['pledgie-describe']))); set_config('pledgie-campaign','text',trim(strip_tags($_POST['pledgie-campaign']))); info( t('pledgie Settings saved.') . EOL); } } function pledgie_active(&$a,&$b) { $campaign = get_config('pledgie-campaign','text'); $describe = get_config('pledgie-describe','text'); $b .= '
'; $b .= $describe . '
\'Click
'; }