예제 #1
0
파일: admin.php 프로젝트: ilivanoff/www
 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;
 }
예제 #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;
 }
예제 #3
0
 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;
 }
예제 #4
0
파일: popup.php 프로젝트: ilivanoff/www
 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;
 }
예제 #5
0
 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;
 }
예제 #6
0
파일: test.php 프로젝트: ilivanoff/www
 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;
 }