/**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ['columns' => [['attribute' => 'status', 'class' => \yii\grid\DataColumn::className(), 'filter' => \skeeks\cms\comments2\models\Comments2Message::$statuses, 'format' => 'raw', 'value' => function (\skeeks\cms\comments2\models\Comments2Message $model) {
         if ($model->status == \skeeks\cms\comments2\models\Comments2Message::STATUS_NEW) {
             $class = "default";
         } else {
             if ($model->status == \skeeks\cms\comments2\models\Comments2Message::STATUS_PROCESSED) {
                 $class = "warning";
             } else {
                 if ($model->status == \skeeks\cms\comments2\models\Comments2Message::STATUS_CANCELED) {
                     $class = "danger";
                 } else {
                     if ($model->status == \skeeks\cms\comments2\models\Comments2Message::STATUS_ALLOWED) {
                         $class = "success";
                     }
                 }
             }
         }
         return '<span class="label label-' . $class . '">' . \yii\helpers\ArrayHelper::getValue(\skeeks\cms\comments2\models\Comments2Message::$statuses, $model->status) . '</span>';
     }], ['class' => \skeeks\cms\grid\CreatedAtColumn::className(), 'label' => 'Добавлен'], ['class' => \skeeks\cms\grid\CreatedByColumn::className()], ['attribute' => 'site_code', 'class' => \yii\grid\DataColumn::className(), 'filter' => \yii\helpers\ArrayHelper::map(\skeeks\cms\models\CmsSite::find()->all(), 'code', 'name'), 'value' => function (\skeeks\cms\comments2\models\Comments2Message $model) {
         return $model->site->name;
     }], ['attribute' => 'element_id', 'relation' => 'element', 'class' => \skeeks\cms\grid\CmsContentElementColumn::className()], ['filter' => \yii\helpers\ArrayHelper::map(\skeeks\cms\models\CmsContent::find()->all(), 'id', 'name'), 'attribute' => 'content_id', 'class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\comments2\models\Comments2Message $model) {
         return $model->element->cmsContent->name;
     }]]], "status-allowed-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\comments2\Module::t('app', 'Approve'), "eachCallback" => [$this, 'eachMultiStatusAllowed']], "status-canceled-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\comments2\Module::t('app', 'Reject'), "eachCallback" => [$this, 'eachMultiStatusCanceled']], "status-processed-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\comments2\Module::t('app', 'In progress'), "eachCallback" => [$this, 'eachMultiStatusProcessed']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     $actions = ArrayHelper::merge(parent::actions(), ['index' => ["modelSearchClassName" => ShopCmsContentElementSearch::className(), "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('cmsContent');
         $query->with('relatedProperties');
         $query->with('relatedElementProperties');
         $query->with('cmsContentElementTrees.tree');
         $query->with('shopProduct');
         $query->with('shopProduct.baseProductPrice');
         //$query->with('shopProduct.minProductPrice');
     }], "create" => ['class' => AdminModelEditorCreateAction::className(), "callback" => [$this, 'create']], "update" => ['class' => AdminOneModelEditAction::className(), "callback" => [$this, 'update']], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/shop/app', 'Activate'), "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/shop/app', 'Deactivate'), "eachCallback" => [$this, 'eachMultiInActivate']], "change-tree-multi" => ['class' => AdminMultiDialogModelEditAction::class, "name" => \Yii::t('skeeks/shop/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::class, "name" => \Yii::t('skeeks/shop/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']], "rp" => ['class' => AdminMultiDialogModelEditAction::class, "name" => \Yii::t('skeeks/shop/app', 'Properties'), "viewDialog" => "@skeeks/cms/views/admin-cms-content-element/multi-rp", "eachCallback" => [\Yii::$app->createController('/cms/admin-cms-content-element')[0], 'eachRelatedProperties']]]);
     if (isset($actions['related-properties'])) {
         unset($actions['related-properties']);
     }
     if (isset($actions['shop'])) {
         unset($actions['shop']);
     }
     return $actions;
 }
 /**
  * @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']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ["def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/shop/app', 'Default'), "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => [['class' => \skeeks\cms\grid\ImageColumn2::className()], 'name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "def"], 'priority']], "def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "По умолчанию", "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => ['id', 'name', 'description', ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => "last_exec_at"], ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => "next_exec_at"], ['attribute' => "agent_interval"], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"]]], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['name', 'code', ['class' => DataColumn::className(), 'label' => \Yii::t('app', 'Number of sections'), 'value' => function (CmsTreeType $cmsTreeType) {
         return $cmsTreeType->getCmsTrees()->count();
     }], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active'], 'priority']], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ["status-allowed-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/reviews2', "Accept"), "eachCallback" => [$this, 'eachMultiStatusAllowed']], "status-canceled-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/reviews2', "Cancel"), "eachCallback" => [$this, 'eachMultiStatusCanceled']], "status-processed-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/reviews2', "In progress"), "eachCallback" => [$this, 'eachMultiStatusProcessed']]]);
 }
Exemple #10
0
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['create' => ['modelScenario' => 'create'], 'update' => ['modelScenario' => 'update'], 'change-password' => ["class" => AdminOneModelEditAction::className(), "name" => "Изменение пароля", "icon" => "glyphicon glyphicon-cog", "callback" => [$this, "actionChangePassword"]], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ["def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "По умолчанию", "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ['class' => ModelEditorGridAction::className(), 'name' => \Yii::t('app', 'List'), "icon" => "glyphicon glyphicon-th-list", "priority" => 10], 'create' => ['class' => AdminModelEditorCreateAction::className(), 'name' => \Yii::t('app', 'Add'), "icon" => "glyphicon glyphicon-plus"], "update" => ['class' => AdminOneModelUpdateAction::className(), "name" => \Yii::t('app', "Edit"), "icon" => "glyphicon glyphicon-pencil", "priority" => 10], "delete" => ['class' => AdminOneModelEditAction::className(), "name" => \Yii::t('app', "Delete"), "icon" => "glyphicon glyphicon-trash", "confirm" => \Yii::t('yii', 'Are you sure you want to delete this item?'), "method" => "post", "request" => "ajax", "callback" => [$this, 'actionDelete'], "priority" => 99999], "delete-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('app', "Delete"), "icon" => "glyphicon glyphicon-trash", "confirm" => \Yii::t('yii', 'Are you sure you want to permanently delete the selected items?'), "eachCallback" => [$this, 'eachMultiDelete'], "priority" => 99999]]);
 }
 public function actions()
 {
     $actions = ArrayHelper::merge(parent::actions(), ["index" => ['modelSearchClassName' => CmsUserSearch::className()], 'create' => ['class' => AdminModelEditorCreateAction::className(), "callback" => [$this, 'create']], 'update' => ['class' => AdminOneModelEditAction::className(), "callback" => [$this, 'update']], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]);
     return $actions;
 }
 public function actions()
 {
     $actions = ArrayHelper::merge(parent::actions(), ['update-all' => ["class" => AdminAction::className(), "name" => \Yii::t('skeeks/money', "Update all currencies"), "icon" => "glyphicon glyphicon-paperclip", "callback" => [$this, 'actionUpdateAll']], 'update-course' => ["class" => AdminAction::className(), "name" => \Yii::t('skeeks/money', "Refresh rate"), "icon" => "glyphicon glyphicon-paperclip", "callback" => [$this, 'actionUpdateCourse']], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/money', "Activate"), "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/money', "Deactivate"), "eachCallback" => [$this, 'eachMultiInActivate']]]);
     return $actions;
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     $actions = ArrayHelper::merge(parent::actions(), ["index" => ['modelSearchClassName' => CmsContentElementSearch::className()], "create" => ['class' => AdminModelEditorCreateAction::className(), "callback" => [$this, 'create']], "update" => ['class' => AdminOneModelEditAction::className(), "callback" => [$this, 'update']], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/cms', 'Activate'), "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/cms', 'Deactivate'), "eachCallback" => [$this, 'eachMultiInActivate']], "change-tree-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => \Yii::t('skeeks/cms', 'The main section'), "viewDialog" => "change-tree-form", "eachCallback" => [$this, 'eachMultiChangeTree']], "change-trees-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => \Yii::t('skeeks/cms', 'Related topics'), "viewDialog" => "change-trees-form", "eachCallback" => [$this, 'eachMultiChangeTrees']], "rp" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => \Yii::t('skeeks/cms', 'Properties'), "viewDialog" => "multi-rp", "eachCallback" => [$this, 'eachRelatedProperties']]]);
     return $actions;
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['code', 'name', 'priority', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "def"]]], "def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'Default'), "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => ['code', 'name', 'symbol_rus', 'symbol_intl', 'symbol_letter_intl', ['class' => BooleanColumn::className(), 'attribute' => 'def']]], "def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/measure', 'Default'), "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0]]);
 }