*/ /** * Google Analytics for DokuWiki * * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * @author 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.'geourl/code.php'); //--- Exported code /** * All DokuWiki plugins to extend the admin function * need to inherit from this class */ class admin_plugin_geourl extends DokuWiki_Admin_Plugin { var $state = 0; var $geourl = ''; /** * Constructor */ function admin_plugin_geourl() { $this->setupLocale(); } /** * return some info */ function getInfo() { return array( 'author' => 'Terence J. Grant and Krzysztof Burghardt', 'email' => 'krzysztof@burghardt.pl', 'date' => '2006-09-14', 'name' => 'GeoURL Plugin', 'desc' => 'Plugin to embed your location into GeoURL.', 'url' => 'http://www.burghardt.pl/wiki/software/geourl_for_dokuwiki', ); } /** * return sort order for position in admin menu */ function getMenuSort() { return 998; } /** * return a menu prompt for the admin menu * NOT REQUIRED - its better to place $lang['menu'] string in localised string file * only use this function when you need to vary the string returned */ function getMenuText() { return 'GeoURL'; } /** * 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->geourl = $_REQUEST['geourl']; if (is_array($this->geourl)) { $this->state = 1; } } /** * output appropriate html */ function html() { global $conf; global $gu_loaded, $gu_settings; if ($this->state != 0) //If we are to save now... { $gu_settings['latitude'] = $this->geourl['latitude']; $gu_settings['longitude'] = $this->geourl['longitude']; gu_save(); } print $this->plugin_locale_xhtml('intro'); ptln("
"); ptln(' '); ptln(' '); ptln(' '); print '
'; print ' '; print ' '; print ' '; print '
'.$this->getLang('gu_item_type').' '.$this->getLang('gu_item_option').'
'.$this->getLang('gu_geourl_latitude').'
'.$this->getLang('gu_geourl_longitude').'
'; print '
'; print '

'; print '
'; } }