/**
  * @return bool
  */
 public function isVisible()
 {
     if (!parent::isVisible()) {
         return false;
     }
     return $this->checkUpdateAccess();
 }
Beispiel #2
0
 /**
  * Renders a view
  *
  * @param string $viewName view name
  * @return string result of the rendering
  */
 protected function render($viewName)
 {
     try {
         //Если шаблона нет в стандартном пути, или в нем ошибки берем базовый
         $result = parent::render($viewName);
     } catch (\Exception $e) {
         $result = $this->controller->render("@skeeks/cms/modules/admin/views/base-actions/grid-standart", (array) $this->viewParams);
     }
     return $result;
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $dataProvider) {
         $query = $dataProvider->query;
         /**
          * @var ActiveQuery $query
          */
         //$query->select(['app_company.*', 'count(`app_company_officer_user`.`id`) as countOfficer']);
         $query->with('image');
         $query->with('cmsTree');
         $query->with('cmsContentElementTrees');
         $query->with('cmsContentElementTrees.tree');
     }], 'settings' => ['class' => AdminModelEditorAction::className(), 'name' => 'Настройки', "icon" => "glyphicon glyphicon-cog"], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']], "change-tree-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => "Основной раздел", "viewDialog" => "change-tree-form", "eachCallback" => [$this, 'eachMultiChangeTree']], "change-trees-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => "Дополнительные разделы", "viewDialog" => "change-trees-form", "eachCallback" => [$this, 'eachMultiChangeTrees']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $dataProvider) {
         $query = $dataProvider->query;
         /**
          * @var ActiveQuery $query
          */
         //$query->select(['app_company.*', 'count(`app_company_officer_user`.`id`) as countOfficer']);
         $query->with('image');
         $query->with('cmsTree');
         $query->with('cmsContentElementTrees');
         $query->with('cmsContentElementTrees.tree');
     }], 'settings' => ['class' => AdminModelEditorAction::className(), 'name' => \skeeks\cms\shop\Module::t('app', 'Settings'), "icon" => "glyphicon glyphicon-cog"], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'Activate'), "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'Deactivate'), "eachCallback" => [$this, 'eachMultiInActivate']], "change-tree-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'The main section'), "viewDialog" => "@skeeks/cms/views/admin-cms-content-element/change-tree-form", "eachCallback" => [\Yii::$app->createController('/cms/admin-cms-content-element')[0], 'eachMultiChangeTree']], "change-trees-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'Related topics'), "viewDialog" => "@skeeks/cms/views/admin-cms-content-element/change-trees-form", "eachCallback" => [\Yii::$app->createController('/cms/admin-cms-content-element')[0], 'eachMultiChangeTrees']]]);
 }
 public function init()
 {
     parent::init();
     $this->method = 'post';
     $this->request = 'ajax';
 }
 /**
  * Renders a view
  *
  * @param string $viewName view name
  * @return string result of the rendering
  */
 protected function render($viewName)
 {
     try {
         $output = parent::render($viewName);
     } catch (InvalidParamException $e) {
         $output = parent::render('_form');
     }
     return $output;
 }