protected function initDefaultButtons()
{
$this->buttons = ArrayHelper::merge(['view' => ['icon' => 'eye-open', 'options' => ['title' => Yii::t('yii', 'View'), 'aria-label' => Yii::t('yii', 'View'), 'data-pjax' => '0']], 'update' => ['icon' => 'pencil', 'options' => ['title' => Yii::t('yii', 'Update'), 'aria-label' => Yii::t('yii', 'Update'), 'data-pjax' => '0']], 'delete' => ['icon' => 'trash', 'visible' => function ($model) {
/* @var $model \yii\db\BaseActiveRecord */
if (is_object($model) && $model->canGetProperty('isDeleted')) {
return !$model->isDeleted;
}
return true;
}, 'options' => ['title' => Yii::t('yii', 'Delete'), 'aria-label' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']], 'restore' => ['icon' => 'repeat', 'visible' => function ($model) {
/* @var $model \yii\db\BaseActiveRecord */
if (is_object($model) && $model->canGetProperty('isDeleted')) {
return $model->isDeleted;
}
return false;
}, 'options' => ['title' => Yii::t('yii2tech-admin', 'Restore'), 'aria-label' => Yii::t('yii2tech-admin', 'Restore'), 'data-confirm' => Yii::t('yii2tech-admin', 'Are you sure you want to restore this item?'), 'data-method' => 'post', 'data-pjax' => '0']]], $this->buttons);
}