private function InitSites()
 {
     $siteID = Request::GetData('site');
     if ($siteID) {
         $this->sites = array(Site::Schema()->ByID($siteID));
         return;
     }
     $sql = Access::SqlBuilder();
     $tblSite = Site::Schema()->Table();
     $orderBy = $sql->OrderList($sql->OrderAsc($tblSite->Field('Name')));
     $this->sites = Site::Schema()->Fetch(false, null, $orderBy);
 }
Exemple #2
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();
 }
Exemple #3
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();
 }