Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     if (!$this->visible) {
         return "";
     }
     if (empty($this->optionsOk["id"])) {
         $this->optionsOk["id"] = static::ID_PREF . uniqid(rand());
     }
     parent::init();
 }
Exemplo n.º 2
0
 /**
  * Кнопки групповых операций по умолчанию
  * @return array
  */
 protected function defaultGroupButtons()
 {
     $model = $this->model;
     $arr = ["delete" => ["class" => \common\widgets\admin\ActionButton::className(), "label" => Yii::t('core', 'Delete'), "visible" => Yii::$app->user->can('deleteModels', ['model' => $model]), "options" => ['id' => 'group-delete', 'class' => 'btn btn-danger'], "route" => $this->baseRoute . "/groupdelete"]];
     if ($this->tree and !Yii::$app->request->get($this->extFilterParam)) {
         $arr["replace"] = ["class" => \common\widgets\admin\ReplaceInTreeButton::className(), "visible" => Yii::$app->user->can('updateModels', ['model' => $model]), "label" => Yii::t('core', 'Replace'), "options" => ['id' => 'group-replace', 'class' => 'btn btn-primary'], "optionsOk" => ['id' => 'group-replace-ok', 'class' => 'btn btn-primary'], "route" => $this->baseRoute . "/replace"];
     }
     return $arr;
 }