protected function beforeRender() { parent::beforeRender(); if ($this->isAjax() && $this->hasFlashSession()) { $this->redrawControl('flash'); } }
protected function beforeRender() { parent::beforeRender(); // TODO add excaption when paramets[site] not exists $this->template->production = !$this->context->parameters['site']['develMode']; $this->template->version = $this->context->parameters['site']['version']; }
/** * @todo Language switch */ public function beforeRender() { parent::beforeRender(); if (file_exists(APP_DIR . '/data/en/cv.json')) { $this->data = json_decode(file_get_contents(APP_DIR . '/data/en/cv.json'), true); } }
/** * Common template method */ protected function beforeRender() { parent::beforeRender(); $this->template->portal = $this->portal; $this->template->rev = $this->portal->expand('build.rev'); $this->template->debug = $this->portal->isDebug(); }
public function beforeRender() { parent::beforeRender(); $parameters = $this->context->parameters; $this->template->version = $parameters['version']; $this->template->debugMode = $parameters['debugMode']; }
public function beforeRender() { parent::beforeRender(); if (!$this->getUser()->isLoggedIn()) { $this->redirectUrl('/'); } }
public function beforeRender() { parent::beforeRender(); $this->template->locale = $this->locale; $this->template->production = !$this->siteLayout->develMode; $this->template->version = $this->siteLayout->versionName; }
public function beforeRender() { parent::beforeRender(); $this->template->projectName = $this->baseDataService->getProjectName(); $this->template->categories = $this->categoryService->getRoot(); $this->template->currentCategory = $this->currentCategory; }
protected function beforeRender() { parent::beforeRender(); if ($this->isAjax) { $this->redrawControl('flashMessages'); } }
protected function beforeRender() { parent::beforeRender(); $this->template->isLogged = $this->user->isLoggedIn(); if ($this->template->isLogged) { $this->template->uzivatel = $this->user->getIdentity()->jmeno; } }
public function beforeRender() { parent::beforeRender(); $this->getTemplate()->footer = $this->footerRepository->get(1); $this->getTemplate()->theme = "themes/" . $this->settings['theme']; $this->getTemplate()->ajax = $this->getParameter('ajax') == 'on'; $this->getTemplate()->settings = $this->settings; }
public function beforeRender() { parent::beforeRender(); if ($this->isAjax()) { $this->redrawControl('title'); $this->redrawControl('menu'); $this->redrawControl('content'); } }
public function beforeRender() { parent::beforeRender(); $this->knowledgebase->setLanguage($this->language); $this->template->knowledgebase = $this->knowledgebase; $this->template->language = $this->language; $this->template->production = !$this->context->parameters['site']['develMode']; $this->template->version = $this->context->parameters['site']['version']; }
protected function beforeRender() { parent::beforeRender(); $user_id = $this->user->id; if ($this->user->isLoggedIn() and $user_id != NULL) { $css = $this->baseModel->getCss($user_id); $this->template->userCss = $css->style; } else { $this->template->userCss = 1; } }
public function beforeRender() { parent::beforeRender(); if ($this->getName() != 'Sign' and $this->getName() != 'Init') { if (!$this->storage->isInitialized()) { $this->redirect(302, 'Init:default'); } } $this->template->loggedIn = $this->getUser()->isLoggedIn(); $this->template->url = $this->context->httpRequest->getUrl()->getAbsoluteUrl(); $this->template->presenter = $this->getName(); }
public function beforeRender() { parent::beforeRender(); if (isset($this->options[self::OPT_BANNER])) { $this->template->banner_file = '/images/' . $this->options[self::OPT_BANNER]; } if (isset($this->options[self::OPT_OPENED])) { $this->template->opened = $this->options[self::OPT_OPENED]; } $this->template->menuItems = array('Fitness' => array('link' => 'Homepage:fitness#anchor-top-section', 'linkSitemap' => '//Homepage:fitness', 'class' => 'nav-fitness'), 'Služby' => array('link' => 'Homepage:services#anchor-top-section', 'linkSitemap' => '//Homepage:services', 'class' => 'nav-services', 'anchors' => array('Recepce' => 'Homepage:services#reception', 'Spinning' => 'Homepage:services#spinning', 'Joga' => 'Homepage:services#yoga', 'Flowin' => 'Homepage:services#flowin', 'Bosu' => 'Homepage:services#bosu', 'Pilates' => 'Homepage:services#pilates', 'Kruhový trénink' => 'Homepage:services#circuit-training')), 'Trenéři' => array('link' => 'Homepage:team#anchor-top-section', 'linkSitemap' => '//Homepage:team', 'class' => 'nav-team'), 'Ceník' => array('link' => 'Homepage:pricing#anchor-top-section', 'linkSitemap' => '//Homepage:pricing', 'class' => 'nav-pricing'), 'Fotogalerie' => array('link' => 'Homepage:gallery#anchor-top-section', 'linkSitemap' => '//Homepage:gallery', 'class' => 'nav-gallery'), 'Kontakt' => array('link' => 'Homepage:contact#anchor-top-section', 'linkSitemap' => '//Homepage:contact', 'class' => 'nav-contact')); $this->template->news = $this->getNews(); $this->template->url = $this->httpRequest->getUrl(); }
protected function beforeRender() { parent::beforeRender(); // TODO add excaption when paramets[site] not exists $this->template->production = !$this->context->parameters['site']['develMode']; $this->template->version = $this->context->parameters['site']['version']; // TODO remove (it's from nette examples) $this->template->viewName = $this->view; $this->template->root = isset($_SERVER['SCRIPT_FILENAME']) ? realpath(dirname(dirname($_SERVER['SCRIPT_FILENAME']))) : NULL; $a = strrpos($this->name, ':'); if ($a === FALSE) { $this->template->moduleName = ''; $this->template->presenterName = $this->name; } else { $this->template->moduleName = substr($this->name, 0, $a + 1); $this->template->presenterName = substr($this->name, $a + 1); } }
protected function beforeRender() { parent::beforeRender(); $this->template->ajaxLayoutPath = __DIR__ . "/../Templates/@" . ($this->getModal()->isRequested() ? "modal" : "layout") . ".latte"; }
public function beforeRender() { parent::beforeRender(); $this->template->currentDate = $this->currentDate; $this->template->authorizator = $this->authorizator; }
/** * Common render method. * @return void */ protected function beforeRender() { parent::beforeRender(); $this->template->jsContainer = $this->jsModuleContainer; }
protected function beforeRender() { $file = '/static/bundle.css'; parent::beforeRender(); $bundleJs = $this->context->getParameters()['wwwDir'] . $file; $this->template->bundleCssVersion = file_exists($bundleJs) ? md5(file_get_contents($this->context->getParameters()['wwwDir'] . $file)) : "404"; }
public function beforeRender() { parent::beforeRender(); if ($this->isAjax()) { $this->redrawControl('content'); $this->redrawControl('navMenu'); } $this->template->actualDate = date('j. n. Y'); $this->template->nameday = $this->getActualNameday(); if ($this->user->isLoggedIn()) { Admin\LogActivityRepository::logActivity($this->em, $this->user->id); } if ($this->getPresenter()->name == 'Sign' && $this->getAction() == 'in' || $this->getPresenter()->name == 'AboutWebapp') { } else { $this->permissions('admin'); } if ($this->user->isLoggedIn()) { $actualUserDao = $this->em->getRepository(CModel\User\User::class); $actualUser = $actualUserDao->find($this->getUser()->id); $custDao = $this->em->getRepository(App\Cothema\Admin\Custom::class); $cust = $custDao->findAll(); $customOut = []; foreach ($cust as $custOne) { $userCustDao = $this->em->getRepository(App\Cothema\Admin\UserCustom::class); $userCust = $userCustDao->findBy(['user' => $this->getUser()->id, 'custom' => $custOne->id]); if (isset($userCust[0])) { $customOut[$custOne->alias] = $userCust[0]->custVal; } else { $customOut[$custOne->alias] = $custOne->defVal; } } $this->template->custom = (object) $customOut; $this->template->actualUser = $actualUser; } else { $custDao = $this->em->getRepository(App\Cothema\Admin\Custom::class); $cust = $custDao->findAll(); $customOut = []; foreach ($cust as $custOne) { $customOut[$custOne->alias] = $custOne->defVal; } $this->template->custom = (object) $customOut; $this->template->actualUser = NULL; } $cacheStorage = new CacheFileStorage(DIR_ROOT . '/temp/cache'); $beCache = new Cache($cacheStorage, 'Cothema.BE'); $webinfo = $beCache->load('webInfo', function () use($beCache) { return $beCache->save('webInfo', $this->getWebInfo(), [Cache::EXPIRE => '20 minutes']); }); $this->template->companyName = $webinfo->webName; $this->template->companyFullName = $webinfo->company; $this->template->companyWebsite = $webinfo->website; $this->template->urlStats = $webinfo->urlStats; $this->template->webinfo = $webinfo; $this->template->isPinned = $this->isPinned(); $this->template->isPinable = $this->isPinable(); $this->template->menu = $beCache->load('items', function () use($beCache) { return $beCache->save('items', $this->getBEMenuItems(), [Cache::EXPIRE => '20 minutes']); }); $this->template->otherWebsites = $beCache->load('otherWebsites', function () use($beCache) { return $beCache->save('otherWebsites', $this->getOtherWebsites(), [Cache::EXPIRE => '20 minutes']); }); $dirTemplates = __DIR__ . '/templates'; $this->template->mainLayoutPath = $dirTemplates . '/@layout.latte'; if ($this->getUser()->id) { $idUser = $this->getUser()->id; $profileUser = $beCache->load('activeUser_' . $idUser, function () use($beCache, $idUser) { return $beCache->save('activeUser_' . $idUser, $this->getActualUserFromDb(), [Cache::EXPIRE => '20 minutes']); }); $this->template->profileUser = $profileUser; } }
protected function beforeRender() { parent::beforeRender(); $this->redrawControl('flashMessages'); $this->template->useFullAssets = $this->context->parameters['useFullAssets']; }
/** * Common template method */ protected function beforeRender() { parent::beforeRender(); $this->response('No rendering in CLI'); }
protected function beforeRender() { parent::beforeRender(); $this->template->userLogged = $this->getUser()->isLoggedIn(); $this->template->cdnUrl = $this->environment->getCdn(); }
protected function beforeRender() { parent::beforeRender(); $this->template->production = $this->getContext()->parameters['production']; }
protected function beforeRender() { parent::beforeRender(); $this->template->locale = $this->locale; }
protected function beforeRender() { parent::beforeRender(); $this->template->portal = $this->status; $this->template->robots = $this->settings->get('meta_robots', 'index, follow'); $this->template->description = $this->settings->get('meta_description', 'Songator 3 je otevřený DJ\'s playlist a hitparáda v jednom'); $this->template->sitename = $this->settings->get('meta_sitename', 'Songator 3'); $this->template->ogimage = $this->settings->get('meta_ogimage', '/img/songator3-logo.png'); $this->template->title = $this->settings->get('meta_title', 'DJ\'s open playlist'); $this->template->author = $this->settings->get('meta_author', 'JDC Entertainment'); }
/** * On before render */ protected function beforeRender() { parent::beforeRender(); $this->sendResource(); }
protected function beforeRender() { parent::beforeRender(); $this->setLayout('publicLayout'); $this->template->setTranslator($this->translator); $appDir = $this->context->parameters['appDir']; $this->template->layoutsPath = $appDir . "/modules/SystemModule/templates/"; $this->template->layoutStyle = \App\Model\Misc\Enum\LayoutSectionStyle::INFO; $this->template->breadCrumbSeparator = "/"; $this->template->titleCrumbSeparator = "«"; $this->template->dateFormat = self::DATE_FORMAT; $this->template->dateTimeFormat = self::DATETIME_FORMAT; //$this->template->_imagePipe = $this->imagePipe; if ($this->isAjax()) { $this->redrawControl("flash"); } }