Example #1
0
 private function AddModulesField()
 {
     $name = 'Module';
     $select = new Select($name, '');
     $select->AddOption('', Trans('Core.PleaseSelect'));
     $this->AddField($select);
     $this->SetRequired($name);
     foreach (PathUtil::Bundles() as $bundle) {
         $modules = PathUtil::FrontendModules($bundle);
         foreach ($modules as $moduleName) {
             $type = ClassFinder::CalcModuleType($bundle, $moduleName);
             $module = ClassFinder::CreateFrontendModule($type);
             if ($module instanceof FrontendModule && self::Guard()->Allow(BackendAction::UseIt(), $module->ContentForm())) {
                 $this->AddModuleTypeOption($select, $type);
             }
             //$select->AddOption($type, Trans($type));
         }
     }
 }
 /**
  * True if member can be edited
  * @param Membergroup $group
  * @return bool
  */
 protected function CanEdit(Membergroup $group)
 {
     return self::Guard()->Allow(BackendAction::Edit(), $group) && self::Guard()->Allow(BackendAction::UseIt(), new MembergroupForm());
 }
Example #3
0
 /**
  * True if area can be edited
  * @param Area $area
  * @return bool Returns true if the area can be edited
  */
 protected function CanEdit(Area $area)
 {
     return self::Guard()->Allow(BackendAction::Edit(), $area) && self::Guard()->Allow(BackendAction::UseIt(), new AreaForm());
 }
 /**
  * True if contents can be added to root element
  * @return boolean
  */
 protected function CanCreateIn()
 {
     return self::Guard()->GrantAddContentToContainer($this->container)->ToBool() && self::Guard()->Allow(BackendAction::UseIt(), new ModuleForm());
 }
Example #5
0
 /**
  * True if member can be edited
  * @param Member $member
  * @return bool
  */
 protected function CanEdit(Member $member)
 {
     return self::Guard()->Allow(BackendAction::Edit(), $member) && self::Guard()->Allow(BackendAction::UseIt(), new MemberForm());
 }
Example #6
0
 /**
  * True if site can be edited
  * @param Site $site
  * @return bool
  */
 protected function CanEdit(Site $site)
 {
     return self::Guard()->Allow(BackendAction::Edit(), $site) && self::Guard()->Allow(BackendAction::UseIt(), new SiteForm());
 }
Example #7
0
 /**
  * True if layout can be deleted
  * @param Layout $layout The layout
  * @return boo
  */
 protected function CanDelete(Layout $layout)
 {
     return self::Guard()->Allow(BackendAction::Delete(), $layout) && self::Guard()->Allow(BackendAction::UseIt(), new LayoutForm());
 }
Example #8
0
 protected function CanCreateIn()
 {
     return self::Guard()->GrantAddPageToSite($this->site)->ToBool() && self::Guard()->Allow(BackendAction::UseIt(), new PageForm());
 }
Example #9
0
 /**
  * True if the container can be edited
  * @param Container $container
  * @return boolean
  */
 protected function CanEdit(Container $container)
 {
     return self::Guard()->Allow(BackendAction::Edit(), $container) && self::Guard()->Allow(BackendAction::UseIt(), new ContainerForm());
 }
Example #10
0
 /**
  * True if contents can be added to root element
  * @return boolean
  */
 protected function CanCreateIn()
 {
     return self::Guard()->GrantAddContentToPageArea($this->page, $this->area)->ToBool() && self::Guard()->Allow(BackendAction::UseIt(), new ModuleForm());
 }