getEnabled()) { $this->addHelpData(); HookRegistry::register ('LoadHandler', array(&$this, 'handleRequest')); } return true; } return false; } function handleRequest($hookName, $args) { $page =& $args[0]; $op =& $args[1]; $sourceFile =& $args[2]; if ($page === 'translate') { $this->import('TranslatorHandler'); Registry::set('plugin', $this); define('HANDLER_CLASS', 'TranslatorHandler'); return true; } return false; } function getDisplayName() { return __('plugins.generic.translator.name'); } function getDescription() { return __('plugins.generic.translator.description'); } function isSitePlugin() { return true; } function getManagementVerbs() { $verbs = array(); if ($this->getEnabled()) { $verbs[] = array('translate', __('plugins.generic.translator.translate')); } return parent::getManagementVerbs($verbs); } /** * Execute a management verb on this plugin * @param $verb string * @param $args array * @param $message string Result status message * @param $messageParams array Parameters for the message key * @return boolean */ function manage($verb, $args, &$message, &$messageParams) { if (!parent::manage($verb, $args, $message, $messageParams)) return false; switch ($verb) { case 'translate': Request::redirect('index', 'translate'); return false; default: // Unknown management verb assert(false); return false; } } } ?>