Esempio n. 1
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');
 }
Esempio n. 2
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();
 }
Esempio n. 3
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();
 }
Esempio 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();
 }
 /**
  * Gets and checks the requested user
  * @return boolean False if processing can continue
  */
 protected function BeforeInit()
 {
     $this->user = User::Schema()->ByID(Request::GetData('user'));
     if (!$this->user || !self::Guard()->Allow(BackendAction::AssignGroups(), $this->user)) {
         //TODO: Error message
         Response::Redirect(BackendRouter::ModuleUrl(new UserList()));
     }
     return parent::BeforeInit();
 }
Esempio 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;
 }
Esempio 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();
 }
Esempio 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();
 }
Esempio n. 9
0
 /**
  * Initializes the member form
  * @return boolean Returns false to continue processing
  */
 protected function Init()
 {
     $this->member = new Member(Request::GetData('member'));
     $this->groupsExist = Membergroup::Schema()->Count() > 0;
     $this->AddNameField();
     $this->AddEMailField();
     $this->AddPasswordField();
     $this->AddMemberGroupField();
     $this->AddSubmit();
     return parent::Init();
 }
Esempio n. 10
0
 /**
  * Initializes the form
  * @return boolean
  */
 protected function Init()
 {
     $this->user = new User(Request::GetData('user'));
     $this->AddNameField();
     $this->AddEmailField();
     $this->AddPasswordField();
     $this->AddPasswordRepeatField();
     $this->AddIsAdminField();
     $this->AddLanguageField();
     $this->AddSubmit();
     return parent::Init();
 }
Esempio n. 11
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();
 }
Esempio n. 12
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();
 }
Esempio n. 13
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();
 }
Esempio n. 14
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();
 }
Esempio n. 15
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();
 }
Esempio n. 16
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();
 }
 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();
 }
Esempio 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();
 }
 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();
 }
Esempio n. 20
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);
 }
Esempio n. 21
0
 /**
  * Gets the module from request url
  * @return ModuleBase Returns the backend module
  */
 static function UrlModule()
 {
     $module = Request::GetData('module');
     return ClassFinder::CreateBackendModule($module);
 }
Esempio n. 22
0
 /**
  * 
  * @return string
  * @throws \LogicException Raises an error if no different redirect page is found
  */
 private function NextUrl()
 {
     $nextUrl = String::Trim(Request::GetData('nextUrl'));
     if ($nextUrl) {
         return $nextUrl;
     }
     $nextPageUrl = $this->login->GetNextUrl();
     if ($nextPageUrl) {
         return FrontendRouter::Url($nextPageUrl);
     }
     return '';
 }
Esempio n. 23
0
 /**
  * Initializes the form
  * @return boolean
  */
 protected function Init()
 {
     $this->page = new Page(Request::GetData('page'));
     $this->parent = Page::Schema()->ByID(Request::GetData('parent'));
     $this->previous = Page::Schema()->ByID(Request::GetData('previous'));
     $this->site = $this->page->Exists() ? $this->page->GetSite() : Site::Schema()->ByID(Request::GetData('site'));
     $this->dateFormat = Trans('Core.DateFormat');
     $this->InitPageRights();
     if (!$this->page->Exists() && !$this->site->Exists()) {
         Response::Redirect(BackendRouter::ModuleUrl(new SiteList()));
         return true;
     }
     $this->AddLayoutField();
     $this->AddNameField();
     $this->AddUrlField();
     $this->AddTitleField();
     $this->AddDescriptionField();
     $this->AddKeywordsField();
     $this->AddMenuAccessField();
     $this->AddUserGroupField();
     $this->AddGuestsOnlyField();
     $this->AddMemberGroupField();
     $this->AddPublishField();
     $this->AddSubmit();
     $this->AddPublishFromDateField();
     $this->AddPublishFromHourField();
     $this->AddPublishFromMinuteField();
     $this->AddPublishToDateField();
     $this->AddPublishToHourField();
     $this->AddPublishToMinuteField();
     $this->AddSitemapRelevanceField();
     $this->AddSitemapChangeFrequencyField();
     $this->AddTypeField();
     $this->AddRedirectTargetSelector();
     return parent::Init();
 }
Esempio n. 24
0
 /**
  * Adds the module type option, if allowed
  * @param Select $select The select box
  * @param string $type The module type
  */
 private function AddModuleTypeOption(Select $select, $type)
 {
     if ($type != 'BuiltIn-Container' || !Request::GetData('container') && Container::Schema()->Count() > 0) {
         $select->AddOption($type, Trans($type));
     }
 }
Esempio n. 25
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));
 }
Esempio n. 26
0
 private function GetTreeItem($requestParam)
 {
     switch ($this->Location()) {
         case Enums\ContentLocation::Layout():
             $result = new LayoutContent(Request::GetData($requestParam));
             break;
         case Enums\ContentLocation::Page():
             $result = new PageContent(Request::GetData($requestParam));
             break;
         case Enums\ContentLocation::Container():
             $result = new ContainerContent(Request::GetData($requestParam));
             break;
     }
     return $result;
 }