protected function doBuild(\PageContext $ctxt, \PageBuilderContext $builderCtxt, \RequestArrayAdapter $requestParams, \ArrayAdapter $buildParams) { //1. ЗАГОЛОВОК $builderCtxt->setTitle($this->authed ? 'Админка | ' . $this->adminPage->title() : 'xxx'); //2. JAVASCRIPT $builderCtxt->setJsParams($this->authed ? $this->adminPage->getJsParams() : null); //3. SMARTY RESOURCES if ($this->authed) { $builderCtxt->setSmartyParams4Resources($this->adminPage->getSmartyParams4Resources()); $builderCtxt->setSmartyParam4Resources('IDENT', $this->adminPage->getPageIdent()); $builderCtxt->setSmartyParam4Resources('TIMELINE_ENABE', true); } $smartyParams['authed'] = $this->authed; if (!$this->authed) { return $smartyParams; } //Запустим неограниченный по времени режим - мало ли, что мы там будем делать:) PsUtil::startUnlimitedMode(); //Получаем содержимое админской страницы $content = ContentHelper::getContent($this->adminPage); //Добавляем к ней ресурсы $content = APagesResources::inst()->getResourcesLinks($this->adminPage->getPageIdent(), $content); $smartyParams['page'] = $this->adminPage; $smartyParams['content'] = $content; $smartyParams['pagesLayout'] = AdminPagesManager::getInstance()->getLayout(); return $smartyParams; }
protected function doBuild(PageContext $ctxt, PageBuilderContext $builderCtxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams) { //1. ЗАГОЛОВОК $builderCtxt->setTitle($this->basicPage->getTitle()); //2. JAVASCRIPT $jsParams['postId'] = $ctxt->getPostId(); $jsParams['rubricId'] = $ctxt->getRubricId(); $jsParams['postType'] = $ctxt->getPostType(); $jsParams['isPostsListPage'] = $ctxt->isPostsListPage(); $jsParams['isRubricPage'] = $ctxt->isRubricPage(); $jsParams['isPostPage'] = $ctxt->isPostPage(); //Разборы, пройденные пользователем $passed = TrainManager::inst()->getUserPassedLessons(); $jsParams['passedLessons'] = empty($passed) ? null : $passed; //Структура проекта $jsParams['structure'] = NavigationManager::inst()->getStructure(); $builderCtxt->setJsParams($jsParams); //Параметры, зависимые от страницы $builderCtxt->setJsParams($this->basicPage->getJsParams()); //3. SMARTY RESOURCES $builderCtxt->setSmartyParams4Resources($this->basicPage->getSmartyParams4Resources()); //4. GET SMARTY PARAMS FOR TPL $smartyParams['host'] = ServerArrayAdapter::HTTP_HOST(); $smartyParams['content'] = BasicPagesManager::inst()->getResourcesLinks($this->basicPage->getIdent(), ContentHelper::getContent($this->basicPage)); return $smartyParams; }
/** * Фетчинг информационного шаблона без его кеширования */ public function getInfoTplCtt($ident, $tpl, array $smartyParams = array()) { $this->assertHasAccess($ident); $tpl = $tpl instanceof DirItem ? $tpl : $this->getInfoDi($ident, $tpl); FoldedInfoTplContext::getInstance()->setContextWithFoldedEntity($this->getFoldedEntity($ident, true)); $content = trim(ContentHelper::getContent(PSSmarty::template($tpl, $smartyParams))); FoldedInfoTplContext::getInstance()->dropContext(); return $content; }
public function getHtml() { return ContentHelper::getContent(PSSmarty::template($this->di)); }
/** * Метод фактически строит страницу. * Нам нужно выполнить множество различных действий, поэтому перенесём все их сюда. * К моменту выполнения у страницы уже вызван метод doProcess */ public function getPopupPageContent(BasePopupPage $page) { return $this->getResourcesLinks($page->getIdent(), ContentHelper::getContent($page)); }