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);
    }
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);
    }
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 ) ; }
Adds the layout field to the form
Adds the layout field to the form