Blame view

backend/views/admin-menu/_form.php 2.85 KB
14adae3b   Yarik   Коммит админ меню
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  <?php
  
  use backend\models\AdminMenu;
  use common\models\Tools;
  use yii\helpers\Html;
  use yii\widgets\ActiveForm;
  
  /* @var $this yii\web\View */
  /* @var $model backend\models\AdminMenu */
  /* @var $form yii\widgets\ActiveForm */
  ?>
  
  <div class="admin-menu-form">
  
      <?php $form = ActiveForm::begin(); ?>
  
      <?= $form->field($model, 'name')->textInput() ?>
  
14adae3b   Yarik   Коммит админ меню
19
20
21
22
23
24
25
26
      <?= $form->field($model, 'active')->checkbox() ?>
  
      <?= $form->field($model, 'hide_min')->checkbox() ?>
  
      <?= $form->field($model, 'path')->textInput() ?>
  
      <?= $form->field($model, 'params')->textInput() ?>
  
5dfa349e   Yarik   Коммит последний ...
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
      <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
          <div class="panel panel-default">
              <div class="panel-heading" role="tab" id="headingOne">
                  <h4 class="panel-title">
                      <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                          <?= Yii::t('app', 'Parent menu item') ?>
                      </a>
                  </h4>
              </div>
              <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
                  <ul class="list-group checkboxer">
                      <?php
                      $roots = AdminMenu::buildMenuSelect();
                      echo $form->field($model, 'parent_id', ['options' => ['class' => 'form-group list-group-item level0 checkboxer_container', 'tag' => 'li']])->error(false)->radio(['value' => 0, 'uncheck' => null, 'label' => Yii::t('app', 'root'), 'labelOptions' => ['class' => 'checkboxer_label']]);
                      foreach($roots as $root) {
                          echo $form->field($model, 'parent_id', ['options' => ['class' => 'form-group list-group-item level1 checkboxer_container', 'tag' => 'li']])->error(false)->radio(['value' => $root['id'], 'uncheck' => null, 'label' => Yii::t('app', $root['label']), 'labelOptions' => ['class' => 'checkboxer_label']]);
                          if($root['items']) {
                              foreach($root['items'] as $submenu) {
                                  echo $form->field($model, 'parent_id', ['options' => ['class' => 'form-group list-group-item level2 checkboxer_container', 'tag' => 'li']])->error(false)->radio(['value' => $submenu['id'], 'uncheck' => null, 'label' => Yii::t('app', $submenu['label']), 'labelOptions' => ['class' => 'checkboxer_label']]);
                              }
                          }
                      }
                      ?>
                  </ul>
              </div>
          </div>
      </div>
  
14adae3b   Yarik   Коммит админ меню
55
      <div class="form-group">
5dfa349e   Yarik   Коммит последний ...
56
          <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' =>  ($model->isNewRecord ? 'btn btn-success' : 'btn btn-primary') . ' btn-flat']) ?>
14adae3b   Yarik   Коммит админ меню
57
58
59
60
61
      </div>
  
      <?php ActiveForm::end(); ?>
  
  </div>