* @since 1.0 * @package MammutCMS * @subpackage Module */ class Shop extends ShopBase { protected function getMyId() { return 'mcms.shop'; } 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', __CLASS__); $template->setParam('self', $_SERVER['PHP_SELF']); $template->setParam('instance', $activeInstance); $template->setParam('isUser', !is_null($system->getUserSvc()->getUser())); $response->setFragment('CONTENT', $template->getDocument()); } catch(FileNotFoundException $ex) { $response->setFragment('CONTENT', "file is missing: " . $tplfile); } } }