/** * Initializes the html frontend module * @return boolean */ protected function Init() { $htmlWrap = ContentHtmlWrap::Schema()->ByContent($this->content); $this->html = $htmlWrap->GetHtml(); $this->currentChild = $this->tree->FirstChildOf($this->item); return parent::Init(); }
/** * Initializes the repeater frontend module * @return boolean Returns tru */ protected function Init() { $this->repeater = ContentRepeater::Schema()->ByContent($this->content); $this->current = $this->tree->FirstChildOf($this->item); $this->isEmpty = !$this->current; return parent::Init(); }
protected function UpdateUsages($newTemplate) { $sql = Access::SqlBuilder(); $tblContent = Content::Schema()->Table(); $where = $sql->Equals($tblContent->Field('Template'), $sql->Value($this->template))->And_($sql->Equals($tblContent->Field('Type'), $sql->Value($this->module->MyType()))); $setList = $sql->SetList('Template', $sql->Value($newTemplate)); Content::Schema()->Update($setList, $where); }
/** * Initializes the html frontend module * @return boolean */ protected function Init() { $contentContainer = ContentContainer::Schema()->ByContent($this->content); $tree = new ContainerContentTreeProvider($contentContainer->GetContainer()); $renderer = new ContentsRenderer($tree->TopMost(), $tree); $this->contents = $renderer->Render(); return parent::Init(); }
protected function Init() { $this->navi = ContentNavigation::Schema()->ByContent($this->content); $this->naviTree = new NavigationTreeProvider($this->navi); $this->level = 0; $this->naviItem = $this->naviTree->FirstChildOf($this->naviParent); $this->isEmpty = $this->naviItem == null; $this->CalcLevel(); return parent::Init(); }
protected function Init() { if (self::Guard()->Accessor()->IsUndefined()) { return true; } $this->logout = ContentLogout::Schema()->ByContent($this->Content()); $this->triggerName = 'Logout-' . $this->Content()->GetID(); $this->HandlePost(); return parent::Init(); }
/** * Initializes the confirm element * @return boolean Returns true if redirect happens */ protected function Init() { $this->confirm = ContentRegisterConfirm::Schema()->ByContent($this->Content()); $this->confirmer = new Confirmer(); $this->isValid = $this->confirmer->Check(Request::GetArray()); if ($this->isValid) { $this->OnSuccess(); } else { if ($this->confirm->GetErrorUrl()) { Response::Redirect(FrontendRouter::Url($this->confirm->GetErrorUrl())); return true; } } return parent::Init(); }
private function DeleteUsages(FrontendModule $module, $templateName) { $sql = Access::SqlBuilder(); $tblContent = Content::Schema()->Table(); $where = $sql->Equals($tblContent->Field('Type'), $sql->Value($module->MyType()))->And_($sql->Equals($tblContent->Field('Template'), $sql->Value($templateName))); $setList = $sql->SetList('Template', $sql->Value('')); Content::Schema()->Update($setList, $where); }
protected function BeforeGather() { \header('Content-Type: application\\json'); return parent::BeforeGather(); }
/** * Initializes the html code frontend module * @return boolean */ protected function Init() { $htmlCode = ContentHtmlCode::Schema()->ByContent($this->content); $this->code = $htmlCode->GetCode(); return parent::Init(); }
/** * Initializes the html frontend module * @return boolean */ protected function Init() { $html = ContentHtml::Schema()->ByContent($this->content); $this->html = $html->GetHtml(); return parent::Init(); }
/** * True if the the content can be edited * @return Boolean */ protected final function CanEdit() { $form = $this->module->ContentForm(); return BackendModule::Guard()->Allow(BackendAction::Edit(), $this->content) && BackendModule::Guard()->Allow(BackendAction::Read(), $form); }
/** * The name of the cache file * @param FrontendModule $module * @return string The name of the cache file, it needn't exist yet * @throws \Exception Raises an error in case the cache key is not alphanumeric */ static function ContentCacheFile(FrontendModule $module) { $file = $module->Content()->GetID(); $cacheKey = $module->CacheKey(); if ($cacheKey) { if (!ctype_alnum($cacheKey)) { throw new \Exception(Trans('Core.CacheKey.Error.NotAlphaNumeric')); } $file .= '-' . $cacheKey; } $cacheFolder = Path::Combine(PHINE_PATH, 'Cache/Content'); return Path::AddExtension(Path::Combine($cacheFolder, $file), 'phtml'); }
/** * Initializes the html frontend module * @return boolean */ protected function Init() { $block = ContentBlock::Schema()->ByContent($this->content); $this->tag = $block->GetTagName(); return parent::Init(); }