Esempio n. 1
0
 function Init()
 {
     $sql = Access::SqlBuilder();
     $tblLayout = Layout::Schema()->Table();
     $orderBy = $sql->OrderList($sql->OrderAsc($tblLayout->Field('Name')));
     $this->layouts = Layout::Schema()->Fetch(false, null, $orderBy);
     return parent::Init();
 }
Esempio n. 2
0
 /**
  * Initiaizes the set of groups
  */
 protected function Init()
 {
     $sql = Access::SqlBuilder();
     $tbl = Membergroup::Schema()->Table();
     $order = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));
     $this->groups = Membergroup::Schema()->Fetch(false, null, $order);
     return parent::Init();
 }
Esempio n. 3
0
 function Init()
 {
     $sql = Access::SqlBuilder();
     $tblContainer = Container::Schema()->Table();
     $orderBy = $sql->OrderList($sql->OrderAsc($tblContainer->Field('Name')));
     $this->containers = Container::Schema()->Fetch(false, null, $orderBy);
     return parent::Init();
 }
Esempio n. 4
0
 /**
  * Execute delete hooks
  */
 protected function BeforeDelete()
 {
     foreach (self::$deleteHooks as $hook) {
         $hook->BeforeDelete($this->item);
     }
     $logger = new Logger(BackendModule::Guard()->GetUser());
     $logger->ReportAreaAction($this->item, Action::Delete());
 }
Esempio n. 5
0
 protected function Init()
 {
     $this->bundlesModules = ClassFinder::BackendNavModules();
     $coreModules = $this->bundlesModules['Core'];
     //unset overview module
     unset($coreModules[0]);
     $this->bundlesModules['Core'] = array_values($coreModules);
     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();
 }
 /**
  * Deletes the container contents related to the container
  * @param Container $item The container to be deleted
  */
 public function BeforeDelete($item)
 {
     $contContainers = ContentContainer::Schema()->FetchByContainer(true, $item);
     $logger = new Logger(BackendModule::Guard()->GetUser());
     foreach ($contContainers as $contContainer) {
         $content = $contContainer->GetContent();
         $provider = ContentTreeUtil::GetTreeProvider($content);
         $tree = new TreeBuilder($provider);
         $logger->ReportContentAction($content, Action::Delete());
         $tree->Remove($provider->ItemByContent($content));
     }
 }
Esempio n. 8
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. 9
0
 /**
  * Remove htaccess page commands before page is deleted
  */
 protected function BeforeDelete()
 {
     foreach (self::$deleteHooks as $hook) {
         $hook->BeforeDelete($this->item);
     }
     $logger = new Logger(BackendModule::Guard()->GetUser());
     $logger->ReportPageAction($this->item, Action::Delete());
     $file = Path::Combine(PHINE_PATH, 'Public/.htaccess');
     if (!File::Exists($file)) {
         return;
     }
     $this->UpdateHtaccess($file);
 }
Esempio n. 10
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. 11
0
 /**
  * Initiaizes the set of sites
  */
 protected function Init()
 {
     $sql = Access::SqlBuilder();
     $tbl = Site::Schema()->Table();
     $order = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));
     $sites = Site::Schema()->Fetch(false, null, $order);
     $this->sites = array();
     foreach ($sites as $site) {
         if (self::Guard()->Allow(BackendAction::Read(), $site)) {
             $this->sites[] = $site;
         }
     }
     return parent::Init();
 }
Esempio n. 12
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();
 }
 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. 14
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();
 }
Esempio n. 15
0
 /**
  * Adds the module to the side navigation
  * @param array &$result The resulting array
  * @param BackendModule $module The backend module
  */
 private static function AddBackendNavModule(array &$result, BackendModule $module)
 {
     $bundle = $module->MyBundle();
     if (!isset($result[$bundle])) {
         $result[$bundle] = array();
     }
     $result[$bundle][$module->SideNavIndex()] = $module;
 }
Esempio n. 16
0
 /**
  * Initializes the set of users
  */
 protected function Init()
 {
     $this->InitUsers();
     return parent::Init();
 }
Esempio n. 17
0
 /**
  * Loads backend translations of the bundle
  */
 private function LoadBackendTranslations()
 {
     $backendUser = BackendModule::Guard()->GetUser();
     if ($backendUser) {
         $backendLanguage = $backendUser->GetLanguage()->GetCode();
         $backendTranslations = PathUtil::BackendBundleTranslationFile($this->BundleName(), $backendLanguage);
         if (File::Exists($backendTranslations)) {
             require_once $backendTranslations;
         }
     }
 }
 /**
  * Grant creation in root level 
  * @return GrantResult
  */
 protected function GrantCreateInRoot()
 {
     return BackendModule::Guard()->GrantAddContentToContainer($this->container);
 }
Esempio n. 19
0
 /**
  * Initializes the side navigation
  */
 protected function Init()
 {
     $this->bundleModules = ClassFinder::BackendNavModules();
     return parent::Init();
 }
Esempio n. 20
0
 protected function GrantCreateInRoot()
 {
     return BackendModule::Guard()->GrantAddContentToPageArea($this->page, $this->area);
 }
 protected function BeforeDelete()
 {
     $logger = new Logger(BackendModule::Guard()->GetUser());
     $logger->ReportContentAction($this->TreeProvider()->ContentByItem($this->item), Action::Delete());
 }
Esempio n. 22
0
 /**
  * Initializes the template list
  * @return boolean Returns false if anything is OK
  */
 protected function Init()
 {
     $this->InitBundles();
     return parent::Init();
 }
Esempio n. 23
0
 /**
  * True if the area is locked
  * @param Area $area
  * @return bool
  */
 protected function IsLocked(Area $area)
 {
     return !BackendModule::Guard()->Allow(BackendAction::Read(), $area);
 }
Esempio n. 24
0
 protected function Init()
 {
     $this->InitGroups();
     return parent::Init();
 }
Esempio n. 25
0
 /**
  * True if there can be content created after
  * @return boolean
  */
 protected final function CanCreateAfter()
 {
     $parentItem = $this->tree->ParentOf($this->item);
     if ($parentItem) {
         $parent = $this->tree->ContentByItem($parentItem);
         return BackendModule::Guard()->Allow(BackendAction::Create(), $parent);
     }
     return $this->GrantCreateInRoot()->ToBool();
 }