private function HandlePost() { if (Request::PostData($this->triggerName)) { self::Guard()->Logout(); Response::Redirect($this->RedirectUrl()); } }
/** * Adds the fragment field */ private function AddFragmentField() { $name = 'Fragment'; $field = Input::Text($name, Request::GetData($this->prefix . 'Fragment')); $this->AddField($field); $this->SetTransAttribute($name, 'placeholder'); }
/** * Initializes the member form * @return boolean Returns false to continue processing */ protected function Init() { $this->group = new Membergroup(Request::GetData('membergroup')); $this->AddNameField(); $this->AddSubmit(); return parent::Init(); }
protected function BeforeInit() { $this->group = Usergroup::Schema()->ByID(Request::GetData('usergroup')); if (!$this->group || !self::Guard()->GetUser()->GetIsAdmin()) { //TODO: Message Response::Redirect(BackendRouter::ModuleUrl(new Overview())); } return parent::BeforeInit(); }
/** * Initializes the container form * @return boolea True if processing shall continue */ protected function Init() { $this->container = new Container(Request::GetData('container')); $this->containerRights = new ContainerRights($this->container->GetUserGroupRights()); $this->AddNameField(); $this->AddUserGroupField(); $this->AddSubmit(); return parent::Init(); }
protected function BeforeInit() { $templateID = Request::GetData('template'); $idParts = explode('/', $templateID); $this->InitModule($idParts); $this->folder = PathUtil::ModuleCustomTemplatesFolder($this->module); $this->template = isset($idParts[1]) ? $idParts[1] : ''; return !$this->module; }
protected function Init() { $this->group = new Usergroup(Request::GetData('usergroup')); $this->AddNameField(); $this->AddCreateLayoutsField(); $this->AddCreateContainersField(); $this->AddCreateSitesField(); $this->AddSubmit(); return parent::Init(); }
/** * Initializes the layout form * @return boolea */ protected function Init() { $this->layout = new Layout(Request::GetData('layout')); $this->layoutRights = new LayoutRights($this->layout->GetUserGroupRights()); $this->InitAreas(); $this->AddNameField(); $this->AddAreasField(); $this->AddUserGroupField(); $this->AddSubmit(); return parent::Init(); }
/** * Initializes the list * @return boolean */ protected function Init() { $this->layout = new Layout(Request::GetData('layout')); if (!$this->layout->Exists()) { Response::Redirect(BackendRouter::ModuleUrl(new LayoutList())); return true; } $this->listProvider = new AreaListProvider($this->layout); $this->area = $this->listProvider->TopMost(); $this->hasAreas = (bool) $this->area; return parent::Init(); }
protected function Init() { $this->navigation = new ContentNavigation(Request::GetData('navigation')); if (!$this->navigation->Exists()) { Response::Redirect(BackendRouter::ModuleUrl(new Overview())); return true; } $this->tree = new NavigationTreeProvider($this->navigation); $this->item = $this->tree->TopMost(); $this->hasItems = (bool) $this->item; return parent::Init(); }
/** * Gets the posted value of the name, optional name prefix automatically attached * @param string $name The checkbox name without prefix */ protected function Value($name) { if (Request::IsPost()) { return (bool) trim(Request::PostData($this->namePrefix . $name)); } if ($this->Rights()) { return $this->Rights()->{$name}; } if ($this->ParentRights()) { return $this->ParentRights()->{$name}; } return false; }
protected function Init() { $this->site = new Site(Request::GetData('site')); $this->siteRights = new SiteRights($this->site->GetUserGroupRights()); $this->AddNameField(); $this->AddUrlField(); $this->AddLanguageField(); $this->AddSubmit(); $this->AddUserGroupField(); $this->AddSitemapActiveField(); $this->AddSitemapCacheLifetimeField(); return parent::Init(); }
protected function Init() { $this->site = new Site(Request::GetData('site')); $selectedID = Request::GetData('selected'); $this->selected = $selectedID ? Page::Schema()->ByID($selectedID) : null; if (!$this->site->Exists()) { Response::Redirect(BackendRouter::ModuleUrl(new SiteList())); return true; } $this->tree = new PageTreeProvider($this->site); $this->page = $this->tree->TopMost(); $this->hasPages = (bool) $this->page; return parent::Init(); }
protected function Init() { $this->area = new Area(Request::GetData('area')); $selectedID = Request::GetData('selected'); $this->selected = $selectedID ? LayoutContent::Schema()->ByID($selectedID) : null; if (!$this->area->Exists()) { Response::Redirect(BackendRouter::ModuleUrl(new LayoutList())); return true; } $this->tree = new LayoutContentTreeProvider($this->area); $this->layoutContent = $this->tree->TopMost(); $this->hasContents = (bool) $this->layoutContent; return parent::Init(); }
protected function BeforeInit() { $this->layout = Layout::Schema()->ByID(Request::GetData('layout')); if (!$this->layout) { //TODO: Message Response::Redirect($this->BackLink()); } $this->file = PathUtil::LayoutTemplate($this->layout); if (!File::Exists($this->file)) { //TODO: Message Response::Redirect($this->BackLink()); } $this->contents = File::GetContents($this->file); return parent::BeforeInit(); }
/** * 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(); }
protected function Init() { $this->container = new Container(Request::GetData('container')); $selectedID = Request::GetData('selected'); $this->selected = $selectedID ? ContainerContent::Schema()->ByID($selectedID) : null; if (!$this->container->Exists()) { //TODO: error Response::Redirect(BackendRouter::ModuleUrl(new ContainerList())); return true; } $this->tree = new ContainerContentTreeProvider($this->container); $this->containerContent = $this->tree->TopMost(); $this->hasContents = (bool) $this->containerContent; return parent::Init(); }
protected function Init() { $this->page = new Page(Request::GetData('page')); $selectedID = Request::GetData('selected'); $this->selected = $selectedID ? PageContent::Schema()->ByID($selectedID) : null; if (!$this->page->Exists()) { Response::Redirect(BackendRouter::ModuleUrl(new SiteList())); return true; } $this->area = new Area(Request::GetData('area')); if (!$this->area->Exists()) { $params = array('site' => $this->page->GetSite()->GetID()); Response::Redirect(BackendRouter::ModuleUrl(new PageTree(), $params)); return true; } $this->tree = new PageContentTreeProvider($this->page, $this->area); $this->pageContent = $this->tree->TopMost(); $this->hasContents = (bool) $this->pageContent; return parent::Init(); }
protected function Init() { $this->navi = new ContentNavigation(Request::GetData('navigation')); $this->naviTree = new NavigationTreeProvider($this->navi); $this->tree = new TreeBuilder($this->naviTree); $this->naviItem = new NavigationItem(Request::GetData('item')); if (Request::GetData('previous')) { $this->previous = NavigationItem::Schema()->ByID(Request::GetData('previous')); } if (Request::GetData('parent')) { $this->parent = NavigationItem::Schema()->ByID(Request::GetData('parent')); } $this->AddTypeField(); $this->AddNameField(); $this->AddPageItemSelector(); //$this->AddPageField(); //$this->AddParametersField(); $this->AddUrlField(); $this->AddSubmit(); return parent::Init(); }
private function SaveMemberGroups() { $selectedIDs = Request::PostArray('MemberGroup'); if ($this->Content()->GetGuestsOnly()) { $selectedIDs = array(); } $exIDs = Membergroup::GetKeyList(MembergroupUtil::ContentMembergroups($this->Content())); $this->DeleteOldMemberGroups($selectedIDs); $this->SaveNewMemberGroups($selectedIDs, $exIDs); }
/** * Gets the layout that is requested to be removed * @return Layout The removal layout */ protected function RemovalObject() { $id = Request::PostData('delete'); return $id ? Layout::Schema()->ByID($id) : null; }
/** * Adds the locked field */ private function AddPasswordRepeatField() { $name = 'PasswordRepeat'; $this->AddField(Input::Password($name)); if (Request::PostData('Password')) { $this->SetRequired($name); $this->AddValidator($name, CompareCheck::Equals($this->Value('Password'))); } }
private function DoRedirect(ContentForm $contentForm) { $params = Request::GetArray(); Response::Redirect(BackendRouter::ModuleUrl($contentForm, $params)); }
private function RemoveTemplate() { $id = Request::PostData('delete'); if (!$id) { return false; } $idParts = \explode('/', $id); $module = $this->RemovalTemplateModule($idParts); $templateName = trim($idParts[1]); if (!$module || !$templateName) { return false; } $logger = new Logger(self::Guard()->GetUser()); $logger->ReportTemplateAction($module->MyType(), $templateName, Action::Delete()); $folder = PathUtil::ModuleCustomTemplatesFolder($module); $template = Path::Combine($folder, Path::AddExtension($templateName, 'phtml')); if (File::Exists($template)) { File::Delete($template); } $this->DeleteUsages($module, $templateName); return true; }
/** * Can be used to add logic after deletion in using classes; * by default, it redirects to the current url */ protected function AfterRemove() { Response::Redirect(Request::Uri()); return true; }
/** * The current, full url * @return string Returns the current url */ function CurrentUrl() { return Request::FullUrl(); }
protected function OnSuccess() { $page = $this->Value('page'); if (!$page) { $this->UnsetPage(); $this->CloseModal(); } else { if ($this->pageOnly) { $objPage = Page::Schema()->ByID($page); $page = $this->SetJSFieldValue('#' . $this->prefix . 'Page', $page); $this->SetJSHtml('#' . $this->prefix . 'Name', $objPage->GetName()); $this->CloseModal(); return; } } $params = array(); $params['prefix'] = $this->prefix; $params['page'] = $this->Value('page'); $params['params'] = Request::GetData('params'); $params['fragment'] = Request::GetData('fragment'); $this->RedirectModal(BackendRouter::AjaxUrl(new AjaxPageParams(), $params)); }
/** * Gets the method argument of current request * @param string $method The called method * @param string $paramName The parameter name of the called function * @return string */ function MethodArgument($method, $paramName) { return Http\Request::GetData($paramName); }
/** * Gets the member group for removal if delete id is posted * @return MembergroupList */ protected function RemovalObject() { $id = Request::PostData('delete'); return $id ? new Membergroup($id) : null; }
/** * Saves the groups */ private function SaveGroups() { $assignedIDs = $this->AssignedGroupIDs(); $selectedIDs = Request::PostArray('Group'); $this->ClearMembergroups($selectedIDs); foreach ($selectedIDs as $selectedID) { if (!in_array($selectedID, $assignedIDs)) { $confirmGroup = new RegisterConfirmMembergroup(); $confirmGroup->SetConfirm($this->confirm); $confirmGroup->SetMemberGroup(Membergroup::Schema()->ByID($selectedID)); $confirmGroup->Save(); } } }