and Terence J. Grant */ if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'admin.php'); //--- Exported code include_once(DOKU_PLUGIN.'googleads/code.php'); //--- Exported code /** * All DokuWiki plugins to extend the admin function * need to inherit from this class */ class admin_plugin_googleads extends DokuWiki_Admin_Plugin { var $state = 0; var $googleads = ''; /** * Constructor */ function admin_plugin_googleads() { $this->setupLocale(); } /** * return some info */ function getInfo() { return array( 'author' => 'Dirk Moeller', 'email' => 'dirk@systemengineers.de', 'date' => '2007-08-14', 'name' => 'Google Adsense Plugin', 'desc' => 'Plugin to embed your Google Adsense code in your site. Based on code from Bernd Zeimetz and Terence J.', 'url' => 'http://www.systemengineers.de/plugins/googleads', ); } /** * return sort order for position in admin menu */ function getMenuSort() { return 888; } /** * handle user request */ function handle() { $this->state = 0; if (!isset($_REQUEST['cmd'])) return; // first time - nothing to do if (!is_array($_REQUEST['cmd'])) return; $this->googleads = $_REQUEST['googleads']; if (is_array($this->googleads)) { $this->state = 1; } } /** * output appropriate html */ function html() { global $conf; global $gads_loaded, $gads_settings; if ($this->state != 0) //If we are to save now... { $gads_settings['enabled'] = $this->googleads['enabled'] == 'on' ? 'checked' : ''; $gads_settings['debug'] = $this->googleads['debug'] == 'on' ? 'checked' : ''; $gads_settings['dontcountadmin'] = $this->googleads['dontcountadmin'] == 'on' ? 'checked' : ''; $gads_settings['dontcountusers'] = $this->googleads['dontcountusers'] == 'on' ? 'checked' : ''; $gads_settings['google_ad_client'] = $this->googleads['google_ad_client']; $gads_settings['google_color_border'] = $this->googleads['google_color_border']; $gads_settings['google_color_bg'] = $this->googleads['google_color_bg']; $gads_settings['google_color_link'] = $this->googleads['google_color_link']; $gads_settings['google_color_url'] = $this->googleads['google_color_url']; $gads_settings['google_color_text'] = $this->googleads['google_color_text']; gads_save(); } print $this->plugin_locale_xhtml('intro'); ptln("
"); ptln(' '); ptln(' '); ptln(' '); print '
'; print ' '; // print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print ' '; print '
'.$this->getLang('gads_item_type').' '.$this->getLang('gads_item_option').'
'.$this->getLang('gads_googleads_code').'
'.$this->getLang('gads_enabled').'
'.$this->getLang('gads_debug').'
'.$this->getLang('gads_dont_count_admin').'
'.$this->getLang('gads_dont_count_users').'
'.$this->getLang('google_ad_client').'
'.$this->getLang('google_color_border').'
'.$this->getLang('google_color_bg').'
'.$this->getLang('google_color_link').'
'.$this->getLang('google_color_url').'
'.$this->getLang('google_color_text').'
'; print '
'; print '

'; print '
'; } }