public function getContent()
 {
     $box = new PageNotFoundBox();
     return $box->render();
 }
Exemple #2
0
    $action = PageActionMap::getActionByPageAndLanguage(Utils::get('action'));
    $actionClassName = ucfirst($action) . 'Action';
    // TODO caching
    if (LoggedUser::whoIsLogged() === NULL && $pageType['needs_login'] == 1) {
        if ($pageType['action'] != 'logout') {
            setcookie('ref_url', Utils::getActualUrl(), NULL, '/');
        }
        $page = PageActionMap::getPageByTypeAndLanguage('login', $language);
        $url = PageActionMap::createUrl($page['alias']);
        Utils::redirect($url);
    }
    $actionClass = new $actionClassName();
    MySmarty::assign('content', $actionClass->getContent());
} catch (Exception $e) {
    // TODO vsetky exceptions lokalizovat a hadzat uz lokalizovane aby sa tu mohli vypisat
    $pageNotFoundBox = new PageNotFoundBox();
    $pageNotFoundBox->setMessage($e->getMessage());
    $content = $pageNotFoundBox->render();
    MySmarty::assign('content', $content);
}
$upperPartBox = new UpperPartBox();
MySmarty::assign('upperPart', $upperPartBox->render());
// nacachujeme si menu
$memcache = BangMemcache::instance();
$key = 'main_menu_' . $language . '_' . $actionAlias;
$menu = $memcache->get($key);
if (!$menu) {
    $menuBox = new MenuBox();
    $menuBox->setActualAction($action);
    $menu = $menuBox->render();
    $memcache->set($key, $menu, NULL, '+2 hours');