Example #1
0
 function __construct(Page $page)
 {
     $this->page = $page;
     $this->tree = new PageTreeProvider($this->page->GetSite());
     $areaList = new AreaListProvider($page->GetLayout());
     $this->areas = $areaList->ToArray();
     $this->child = $this->tree->FirstChildOf($this->page);
 }
Example #2
0
 /**
  * Adds the layout field to the form
  */
 private function AddLayoutField()
 {
     $name = 'Layout';
     $select = new Select($name);
     if ($this->page->Exists()) {
         $select->SetValue($this->page->GetLayout()->GetID());
     }
     $select->AddOption('', Trans('Core.PleaseSelect'));
     $sql = Access::SqlBuilder();
     $tbl = Layout::Schema()->Table();
     $order = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));
     $layouts = Layout::Schema()->Fetch(false, null, $order);
     foreach ($layouts as $layout) {
         $select->AddOption($layout->GetID(), $layout->GetName());
     }
     $this->AddField($select);
     $this->SetRequired($name);
 }
Example #3
0
 function SetPage(Page $page)
 {
     $this->page = $page;
     $this->layout = $page->GetLayout();
     $this->InitAreas();
 }