Exemplo n.º 1
0
 public function buildLayout()
 {
     $options = [];
     $options['clearSelect'] = true;
     $options['select'][] = \Rebond\Cms\Layout\Data::getList(['id', 'title']);
     $models = \Rebond\Cms\Layout\Data::loadAll($options);
     return Util\Form::buildDropdownList('layoutId' . $this->unique, $models, 'id', 'title', $this->getModel()->getLayoutId(), $this->layoutValidator['foreignKey']);
 }
Exemplo n.º 2
0
 public function layout()
 {
     // auth
     Auth::isAdminAuthorized($this->signedUser, 'admin.cms.layout', true, '/cms');
     $layouts = \Rebond\Cms\Layout\Data::loadAll();
     // view
     $this->setTpl();
     // filter
     $tplFilter = new Template(Template::MODULE, ['cms', 'layout']);
     $tplFilter->set('count', count($layouts));
     // main
     $tplMain = new Template(Template::MODULE, ['cms', 'layout']);
     $tplMain->set('items', $layouts);
     // layout
     $this->tplLayout->set('column1', $tplFilter->render('filter'));
     $this->tplLayout->set('column2', $tplMain->render('listing'));
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-2-row'));
     return $this->tplMaster->render('tpl-default');
 }