Example #1
0
 public function beforeroute()
 {
     $this->table = $this->fw->get('PARAMS.table');
     if (!\models\meta\Meta::getInstance()->exists($this->table)) {
         $this->fw->error(404);
     }
     $this->tableMeta = \models\meta\Meta::getInstance()->getTableMeta($this->table);
     //		Для типов контента, которые завияст от других, должен быть передан ID родительского объекта
     //		$this->meta_all = \models\ContentMeta::getMetaAll();
     //		$this->meta = $this->meta_all[$this->table];
     //		foreach ($this->meta_all as $meta) {
     //			if ($meta['depend'] == $this->table) {
     //				$this->dependants[] = $meta['type'];
     //			}
     //		}
     $class = $this->modelClass;
     $this->model = $class::getInstance($this->table);
     if ($this->tableMeta->isTree()) {
         $this->setPid();
     }
     if ($this->fw->get('use_app_routes')) {
         $this->fw->mset(array('ctrl_base' => $this->fw->get('app_backend_base.content'), 'core_ctrl_base' => $this->fw->get('app_backend_base.content_core')));
     } else {
         $this->fw->mset(array('ctrl_base' => $this->fw->get('backend_base.content'), 'core_ctrl_base' => $this->fw->get('backend_base.content_core')));
     }
     $this->fw->set('valid_items', $this->tableMeta->get('items'));
     parent::beforeroute();
     $this->setOwnerId();
 }
Example #2
0
 public function beforeroute()
 {
     parent::beforeroute();
     $this->table = $this->fw->get('PARAMS.table');
     $this->fw->copy('backend_base.meta', 'ctrl_base');
     $this->meta = \models\meta\Meta::getInstance();
 }
Example #3
0
 public function beforeroute()
 {
     parent::beforeroute();
     $this->fw->set('ctrl_slug', '/account/comment');
     $this->fw->set('pagination_slug', '/account/comments');
     $this->list_first_page_slug = 'account/comments';
     $this->fw->set('table_slug', '');
 }
Example #4
0
 public function beforeroute()
 {
     $this->model = \models\UserGroup::getInstance();
     parent::beforeroute();
     $this->table = 'groups';
     $this->fw->mset(['ctrl_base' => $this->fw->get('backend_base.group'), 'core_ctrl_base' => $this->fw->get('backend_base.group_core')]);
     $default_group = $this->model->getDefaultGroup();
     $this->fw->set('default_group', $default_group);
     $this->fw->set('no_bulk', 'true');
 }
Example #5
0
 public function beforeroute()
 {
     $this->model = \models\ACL::getInstance();
     parent::beforeroute();
     $this->fw->set('PARAMS.table', 'acl');
     // Для корректной работы именованных маршрутов
     $this->table = 'acl';
     $this->owner_id = $this->fw->get('account.user.id');
     $this->fw->set('ctrl_base', $this->fw->get('backend_base.acl'));
     $this->fw->set('no_bulk', 'true');
 }
Example #6
0
 public function beforeroute()
 {
     $this->model = \models\User::getInstance();
     parent::beforeroute();
     $this->fw->mset(['PARAMS.table' => 'user', 'ctrl_base' => $this->fw->get('backend_base.user'), 'core_ctrl_base' => $this->fw->get('backend_base.user_core')]);
 }
Example #7
0
 public function beforeroute()
 {
     parent::beforeroute();
     $this->metaManager = \models\meta\Meta::getInstance();
     $this->tableMeta = $this->metaManager->getTableMeta($this->fw->get('PARAMS.table'));
 }