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->popupPage->getTitle()); //2. JAVASCRIPT $builderCtxt->setJsParams($this->popupPage->getJsParams()); //3. SMARTY RESOURCES $builderCtxt->setSmartyParam4Resources('IDENT', $this->popupPage->getIdent()); $builderCtxt->setSmartyParam4Resources('MATHJAX_DISABLE', true); $builderCtxt->setSmartyParams4Resources($this->popupPage->getSmartyParams4Resources()); //4. GET SMARTY PARAMS FOR TPL $smartyParams['page'] = $this->popupPage; $smartyParams['content'] = $this->PPM->getPopupPageContent($this->popupPage); $smartyParams['header'] = PopupPagesManager::inst()->isShowPageHeader(); $smartyParams['list'] = $this->popupPage->getIdent() == PP_404::getIdent(); return $smartyParams; }
protected function doBuild(PageContext $ctxt, PageBuilderContext $builderCtxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams) { //1. ЗАГОЛОВОК $builderCtxt->setTitle('Тестовая страница'); //2. NO JAVASCRIPT //3. SMARTY RESOURCES $builderCtxt->setSmartyParam4Resources('MATHJAX_DISABLE', true); $builderCtxt->setSmartyParam4Resources('TIMELINE_ENABE', true); $builderCtxt->setSmartyParam4Resources('UPLOADIFY_ENABE', true); //4. GET SMARTY PARAMS FOR TPL //Подсчитаем кол-во тестовых страниц по кол-ву шаблонов $SM = PSSmarty::smarty(); $cnt = 0; do { ++$cnt; } while ($SM->templateExists("test/page{$cnt}.tpl")); $content = $this->getContentImpl($requestParams, $SM); $smartyParams['cnt'] = $cnt; $smartyParams['content'] = $content; return $smartyParams; }
protected function doBuild(PageContext $ctxt, PageBuilderContext $builderCtxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams) { //1. ЗАГОЛОВОК $builderCtxt->setTitle('Моя страница'); //2. JAVASCRIPT $jsParams['param1'] = $ctxt->getPostId(); $jsParams['param2'] = 'My value'; $builderCtxt->setJsParams($jsParams); //3. SMARTY RESOURCES $builderCtxt->setSmartyParam4Resources('TIMELINE_ENABE', true); //4. GET SMARTY PARAMS FOR TPL $smartyParams['host'] = ServerArrayAdapter::HTTP_HOST(); return $smartyParams; }
protected function doBuild(PageContext $ctxt, PageBuilderContext $builderCtxt, RequestArrayAdapter $requestParams, ArrayAdapter $buildParams) { //1. ЗАГОЛОВОК $builderCtxt->setTitle('Тестовая страница'); //2. NO JAVASCRIPT //3. SMARTY RESOURCES $builderCtxt->setSmartyParam4Resources('MATHJAX_DISABLE', true); $builderCtxt->setSmartyParam4Resources('TIMELINE_ENABE', true); //4. GET SMARTY PARAMS FOR TPL //Подсчитаем кол-во тестовых страниц по кол-ву шаблонов $SM = PSSmarty::smarty(); $cnt = 0; do { ++$cnt; } while ($SM->templateExists("test/page{$cnt}.tpl")); $content = $this->getContentImpl($requestParams, $SM); $galls = DirManager::mmedia()->getDirContent('gallery', DirItemFilter::DIRS); $smartyParams['cnt'] = $cnt; $smartyParams['galls'] = $galls; $smartyParams['content'] = $content; $smartyParams['processors'] = Handlers::getInstance()->getPostsProcessors(); return $smartyParams; }