Exemplo n.º 1
0
 private function HandlePost()
 {
     if (Request::PostData($this->triggerName)) {
         self::Guard()->Logout();
         Response::Redirect($this->RedirectUrl());
     }
 }
Exemplo n.º 2
0
 /**
  * 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');
 }
Exemplo n.º 3
0
 /**
  * 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();
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 5
0
 /**
  * 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();
 }
Exemplo n.º 6
0
 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;
 }
Exemplo n.º 7
0
 protected function Init()
 {
     $this->group = new Usergroup(Request::GetData('usergroup'));
     $this->AddNameField();
     $this->AddCreateLayoutsField();
     $this->AddCreateContainersField();
     $this->AddCreateSitesField();
     $this->AddSubmit();
     return parent::Init();
 }
Exemplo n.º 8
0
 /**
  * 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();
 }
Exemplo n.º 9
0
 /**
  * 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();
 }
Exemplo n.º 10
0
 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();
 }
Exemplo n.º 11
0
 /**
  * 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;
 }
Exemplo n.º 12
0
 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();
 }
Exemplo n.º 13
0
 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();
 }
Exemplo n.º 14
0
 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();
 }
Exemplo n.º 15
0
 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();
 }
Exemplo n.º 16
0
 /**
  * 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();
 }
Exemplo n.º 17
0
 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();
 }
Exemplo n.º 18
0
 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();
 }
Exemplo n.º 19
0
 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();
 }
Exemplo n.º 20
0
 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);
 }
Exemplo n.º 21
0
 /**
  * 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;
 }
Exemplo n.º 22
0
 /**
  * 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')));
     }
 }
Exemplo n.º 23
0
 private function DoRedirect(ContentForm $contentForm)
 {
     $params = Request::GetArray();
     Response::Redirect(BackendRouter::ModuleUrl($contentForm, $params));
 }
Exemplo n.º 24
0
 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;
 }
Exemplo n.º 25
0
 /**
  * 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;
 }
Exemplo n.º 26
0
/**
 * The current, full url
 * @return string Returns the current url
 */
function CurrentUrl()
{
    return Request::FullUrl();
}
Exemplo n.º 27
0
 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));
 }
Exemplo n.º 28
0
 /**
  * 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);
 }
Exemplo n.º 29
0
 /**
  * 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();
         }
     }
 }