Пример #1
0
 protected function BeforeInit()
 {
     if (!self::Guard()->Allow(BackendAction::Read(), $this)) {
         //TODO: message
         Response::Redirect(BackendRouter::ModuleUrl(new Overview()));
         return false;
     }
     return parent::BeforeInit();
 }
Пример #2
0
 protected function CreateAfterUrl()
 {
     $args = array('navigation' => $this->navigation->GetID());
     $args['previous'] = $this->item->GetID();
     $parent = $this->item->GetParent();
     if ($parent) {
         $args['parent'] = $parent->GetID();
     }
     return BackendRouter::ModuleUrl(new NavigationItemForm(), $args);
 }
Пример #3
0
 /**
  * Saves the group and redirects to the list
  */
 protected function OnSuccess()
 {
     $action = $this->group->Exists() ? Action::Update() : Action::Create();
     $this->group->SetName($this->Value('Name'));
     $this->group->SetCreateContainers((bool) $this->Value('CreateContainers'));
     $this->group->SetCreateLayouts((bool) $this->Value('CreateLayouts'));
     $this->group->SetCreateContainers((bool) $this->Value('CreateContainers'));
     $this->group->Save();
     $logger = new Logger(self::Guard()->GetUser());
     $logger->ReportUserGroupAction($this->group, $action);
     $target = BackendRouter::ModuleUrl(new UsergroupList());
     Response::Redirect($target);
 }
Пример #4
0
 /**
  * Gets the content tree url
  * @param Area $area
  * @return string Returns the page content tree url
  */
 protected function AreaUrl(Area $area)
 {
     $params = array();
     $params['page'] = $this->page->GetID();
     $params['area'] = $area->GetID();
     return BackendRouter::ModuleUrl(new PageContentTree(), $params);
 }
Пример #5
0
 private function ContainerBackLink($selected)
 {
     $params = array();
     $params['container'] = $this->Container()->GetID();
     if ($selected) {
         $params['selected'] = $selected;
     }
     return BackendRouter::ModuleUrl(new ContainerContentTree(), $params);
 }
Пример #6
0
 /**
  * The json url for the ajax "tree"
  * @return string
  */
 protected function JsonUrl()
 {
     return BackendRouter::AjaxUrl(new JsonAreaList());
 }
Пример #7
0
 protected function BackLink()
 {
     return BackendRouter::ModuleUrl(new LayoutList());
 }
Пример #8
0
 /**
  * Saves the area
  */
 protected function OnSuccess()
 {
     $action = $this->user->Exists() ? Action::Update() : Action::Create();
     $this->user->SetName($this->Value('Name'));
     $this->user->SetEMail($this->Value('EMail'));
     $this->user->SetLanguage(new Language($this->Value('Language')));
     if ($this->CanChangeIsAdmin()) {
         $this->user->SetIsAdmin((bool) $this->Value('IsAdmin'));
     }
     $this->SavePassword();
     $this->user->Save();
     $logger = new Logger(self::Guard()->GetUser());
     $logger->ReportUserAction($this->user, $action);
     Response::Redirect(BackendRouter::ModuleUrl(new UserList()));
 }
Пример #9
0
 /**
  * The url for creating content after the current item
  * @return type
  */
 protected final function CreateAfterUrl()
 {
     $args = $this->EditParams();
     $args['previous'] = $this->item->GetID();
     return BackendRouter::ModuleUrl(new ModuleForm(), $args);
 }
Пример #10
0
 protected function SettingsFormLink()
 {
     return BackendRouter::ModuleUrl(new SettingsForm());
 }
 /**
  * The backlink
  * @return string
  */
 protected function BackLink()
 {
     $module = new NavigationTree();
     $params = array('navigation' => $this->navi->GetID());
     return BackendRouter::ModuleUrl($module, $params);
 }
Пример #12
0
 /**
  * The link for the back button
  * @return string Returns the url to the member list
  */
 protected function BackLink()
 {
     return BackendRouter::ModuleUrl(new MembergroupList());
 }
Пример #13
0
 protected function OpenUrl()
 {
     $args = array('pageOnly' => '1');
     if (count($this->disabledPageIDs) > 0) {
         $args['disabled'] = $this->disabledPageIDs;
     }
     if ($this->site) {
         $args['site'] = $this->site->GetID();
     }
     return BackendRouter::AjaxUrl(new AjaxSelectPage(), $args);
 }
 protected function OnSuccess()
 {
     $postedGroupIDs = $this->PostedGroupIDs();
     foreach ($this->currentGroups as $currentGroup) {
         if (!in_array($currentGroup->GetID(), $postedGroupIDs)) {
             $this->DeleteGroupAssignment($currentGroup);
         }
     }
     foreach ($postedGroupIDs as $postedGroupID) {
         if (!$this->HasGroup(new Usergroup($postedGroupID))) {
             $uug = new UserUsergroup();
             $uug->SetUser($this->user);
             $uug->SetUserGroup(new Usergroup($postedGroupID));
             $uug->Save();
         }
     }
     Response::Redirect(BackendRouter::ModuleUrl(new UserList()));
 }
Пример #15
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));
 }
Пример #16
0
 private function DoRedirect(ContentForm $contentForm)
 {
     $params = Request::GetArray();
     Response::Redirect(BackendRouter::ModuleUrl($contentForm, $params));
 }
Пример #17
0
 /**
  * The link for the back button
  * @return string Returns the url to the page tree
  */
 protected function BackLink()
 {
     $params = array('site' => $this->site->GetID());
     if ($this->page->Exists()) {
         $params['selected'] = $this->page->GetID();
     } else {
         if ($this->previous) {
             $params['selected'] = $this->previous->GetID();
         } else {
             if ($this->parent) {
                 $params['selected'] = $this->parent->GetID();
             }
         }
     }
     return BackendRouter::ModuleUrl(new PageTree(), $params);
 }
Пример #18
0
 /**
  * The link for the back button
  * @return string Returns the url to the container list
  */
 protected function BackLink()
 {
     return BackendRouter::ModuleUrl(new ContainerList());
 }
Пример #19
0
 protected function TemplateFormUrl(Layout $layout)
 {
     return BackendRouter::ModuleUrl(new LayoutTemplateForm(), array('layout' => $layout->GetID()));
 }
Пример #20
0
 protected function AfterSave()
 {
     $params = array('navigation' => $this->navi->GetID());
     Response::Redirect(BackendRouter::ModuleUrl(new NavigationTree(), $params));
 }
Пример #21
0
 protected function OnSuccess()
 {
     $this->DeleteUnselected();
     $bundles = $this->Bundles();
     foreach ($bundles as $bundle) {
         if ($this->Value($bundle)) {
             $this->SaveLock($bundle);
             continue;
         }
         $modules = $this->Modules($bundle);
         foreach ($modules as $module) {
             if ($this->Value($this->FieldName($bundle, $module))) {
                 $this->SaveLock($bundle, $module);
             }
         }
     }
     Response::Redirect(BackendRouter::ModuleUrl(new UsergroupList()));
 }
Пример #22
0
 protected function BackLink()
 {
     return BackendRouter::ModuleUrl(new TemplateList());
 }
Пример #23
0
 protected function JsonUrl()
 {
     return BackendRouter::AjaxUrl(new JsonNavigationTree());
 }
Пример #24
0
 /**
  * The link for the back button
  * @return string Returns the url to the overview
  */
 protected function BackLink()
 {
     return BackendRouter::ModuleUrl(new Overview());
 }
Пример #25
0
 /**
  * The link for the back button
  * @return string Returns the url to the page tree
  */
 protected function BackLink()
 {
     $params = array('site' => $this->page->GetSite()->GetID());
     $params['selected'] = $this->page->GetID();
     return BackendRouter::ModuleUrl(new PageTree(), $params);
 }