Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 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;
 }