protected function setup() { $characterAlias = Utils::get('identifier'); $characterRepository = new CharacterRepository(TRUE); $character = $characterRepository->getOneByAlias($characterAlias); BangSeo::addTitlePart($character['name']); if ($character->getLocalizedDescription()) { BangSeo::setDescription($character->getLocalizedDescription()); } MySmarty::assign('character', $character); }
protected function addSeo() { $action = Utils::get('action'); $pageRepository = new PageRepository(TRUE); $page = $pageRepository->getOneByAlias($action); if (self::$seoAdded === FALSE) { BangSeo::addTitlePart($page['title']); BangSeo::setDescription($page['meta_description']); BangSeo::addContentForKeywords($page['meta_keywords'], BangSeo::MEDIUM_PRIORITY); self::$seoAdded = TRUE; } }
protected function setup() { $cardAlias = Utils::get('identifier'); $cardBaseTypeRepository = new CardBaseTypeRepository(TRUE); $cardBaseType = $cardBaseTypeRepository->getOneByAlias($cardAlias); if ($cardBaseType) { $cardRepository = new CardRepository(TRUE); $card = $cardRepository->getOneByCardBaseType($cardBaseType['id']); } BangSeo::addTitlePart($card->getTitle()); if ($card->getDescription()) { BangSeo::setDescription($card->getDescription()); } MySmarty::assign('card', $card); }
/** * sets description of actual page * * @param string $description * @return void */ public static function setDescription($description) { $description = str_replace('"', "'", $description); self::$description = $description; self::addContentForKeywords($description, self::MEDIUM_PRIORITY); }
$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'); } MySmarty::assign('menu', $menu); MySmarty::assign('title', BangSeo::getTitle()); MySmarty::assign('description', BangSeo::getDescription()); MySmarty::assign('keywords', BangSeo::getKeywords()); MySmarty::assign('actualYear', date('Y')); MySmarty::assign('baseUrl', BASE_URL); echo MySmarty::fetch('index.tpl');