db = System::getInstance()->getDB(); } public function getContentType($actionId, $medium) { return 'text/html'; } public function handleAction(Response &$response) { $system = System::getInstance(); $activeInstance = $system->getTarget('instance'); $activeAction = $system->getTarget('action'); $request = $system->getRequest(); $method = 'run' . ucfirst($activeAction); if(method_exists($this, $method)) $this->$method($request, $response, $activeInstance); else throw new PageNotFoundException($activeInstance . ':' . $activeAction); } public function handleIAction(Response &$response) { $system = System::getInstance(); $request = $system->getRequest(); $param = $request->getParam(); $activeInstance = !empty($param['instance']) ? $param['instance'] : false; $activeAction = !empty($param['iaction']) ? $param['iaction'] : 'index'; $method = 'irun' . ucfirst($activeAction); if(method_exists($this, $method)) $this->$method($request, $response, $activeInstance); else throw new PageNotFoundException($activeInstance . ':' . $activeAction); } /** * creates an help link */ public static function genHelpLink($topic, $text = '', $icon = true, $locale = NULL) { $baseurl = _BASEURL_ . '/data/manual/module/'; $basedir = _BASEPATH_ . '/data/manual/module/'; $topicurl = $baseurl . str_replace('.', '/', $topic); $topicdir = $basedir . str_replace('.', __DS__, $topic); if(is_null($locale)) $locale = System::getInstance()->getActiveLocale(); if(file_exists($topicdir . '-' . $locale . '.html')) $topicurl = $topicurl . '-' . $locale . '.html'; else $topicurl = $topicurl . '-en.html'; // default fallback if($icon === true) $icon = './layout/default/admin/images/actions/help.png'; $st = '' . ($icon ? ' ' : '') . $text . ''; return $st; } }