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 onBeforeWrite() { //create iLike Counter if it does not yet exist if (!$this->ILikeCountID) { $ILikeCount = ILikeCount::create(); $ILikeCount->Count = $this->ILikeCountCount; $ILikeCount->write(); $this->ILikeCountID = $ILikeCount->ID; } //edit iLine Counter Count directly via TextField if ($this->ILikeCountCount) { // update existing relation $ILikeCount = $this->ILikeCount(); $ILikeCount->Count = $this->ILikeCountCount; $ILikeCount->write(); } parent::onBeforeWrite(); }
public function getFooterPages() { return BasicPage::get()->filter(array('ShowPageInFooter' => '1')); }
public function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldFromTab('Root.Main', 'ShowSocial'); return $fields; }
function __construct($titul, $user, $topmenu, $leftmenu, $redir = NULL, $descr = NULL) { parent::__construct($titul, $user, $topmenu, $leftmenu, $redir, $descr); $this->h2 = $titul; $this->rowspan = 2; }