예제 #1
0
 /**
  * @return bool
  */
 public function isVisible()
 {
     if (!parent::isVisible()) {
         return false;
     }
     if (!Validate::validate(new HasBehaviorsOr([TimestampBehavior::className(), TimestampPublishedBehavior::className(), BlameableBehavior::className()]), $this->controller->model)->isValid()) {
         return false;
     }
     return $this->checkAdvancedAccess();
 }
예제 #2
0
 /**
  * @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]]);
 }