* @since 1.0 * @package MammutCMS * @subpackage Module */ class Blog extends BlogBase { protected function getMyId() { return 'mcms.blog'; } public function runIndex(Request $request, Response $response, $activeInstance) { $system = \MCMS\System::getInstance(); $tplfile = __DIR__ . '/_layout_/_default_/' . 'tpl.' . $system->getTarget('action') . '.php'; // define the template file try { $template = new CTemplate(); $template->loadTemplate($tplfile); $template->setParam('title', 'User'); $template->setParam('self', $_SERVER['PHP_SELF']); $template->setParam('logoutLink', $_SERVER['PHP_SELF'] . '?mod=' . $activeInstance . '&view=logout'); $template->setParam('instance', $activeInstance); $template->setParam('isUser', !is_null($system->getUserSvc()->getUser())); $template->setParam('error', !empty($_REQUEST['errno']) ? $errors[$_REQUEST['errno']] : false); $response->setFragment('CONTENT', $template->getDocument()); } catch(FileNotFoundException $ex) { $response->setFragment('CONTENT', "file is missing: " . $tplfile); } } }