Commit 14adae3b3095b47e3e674f8b22898ccdd5e4d7ee
1 parent
6506d20d
Коммит админ меню
Showing
60 changed files
with
675 additions
and
0 deletions
Show diff stats
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\controllers; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use backend\models\AdminMenu; | ||
7 | +use backend\models\AdminMenuSearch; | ||
8 | +use yii\web\Controller; | ||
9 | +use yii\web\NotFoundHttpException; | ||
10 | +use yii\filters\VerbFilter; | ||
11 | + | ||
12 | +/** | ||
13 | + * AdminMenuController implements the CRUD actions for AdminMenu model. | ||
14 | + */ | ||
15 | +class AdminMenuController extends Controller | ||
16 | +{ | ||
17 | + public function behaviors() | ||
18 | + { | ||
19 | + return [ | ||
20 | + 'verbs' => [ | ||
21 | + 'class' => VerbFilter::className(), | ||
22 | + 'actions' => [ | ||
23 | + 'delete' => ['post'], | ||
24 | + ], | ||
25 | + ], | ||
26 | + ]; | ||
27 | + } | ||
28 | + | ||
29 | + /** | ||
30 | + * Lists all AdminMenu models. | ||
31 | + * @return mixed | ||
32 | + */ | ||
33 | + public function actionIndex() | ||
34 | + { | ||
35 | + $searchModel = new AdminMenuSearch(); | ||
36 | + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | ||
37 | + | ||
38 | + return $this->render('index', [ | ||
39 | + 'searchModel' => $searchModel, | ||
40 | + 'dataProvider' => $dataProvider, | ||
41 | + ]); | ||
42 | + } | ||
43 | + | ||
44 | + /** | ||
45 | + * Displays a single AdminMenu model. | ||
46 | + * @param integer $id | ||
47 | + * @return mixed | ||
48 | + */ | ||
49 | + public function actionView($id) | ||
50 | + { | ||
51 | + return $this->render('view', [ | ||
52 | + 'model' => $this->findModel($id), | ||
53 | + ]); | ||
54 | + } | ||
55 | + | ||
56 | + /** | ||
57 | + * Creates a new AdminMenu model. | ||
58 | + * If creation is successful, the browser will be redirected to the 'view' page. | ||
59 | + * @return mixed | ||
60 | + */ | ||
61 | + public function actionCreate() | ||
62 | + { | ||
63 | + $model = new AdminMenu(); | ||
64 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
65 | + return $this->redirect(['view', 'id' => $model->id]); | ||
66 | + } else { | ||
67 | + return $this->render('create', [ | ||
68 | + 'model' => $model, | ||
69 | + ]); | ||
70 | + } | ||
71 | + } | ||
72 | + | ||
73 | + /** | ||
74 | + * Updates an existing AdminMenu model. | ||
75 | + * If update is successful, the browser will be redirected to the 'view' page. | ||
76 | + * @param integer $id | ||
77 | + * @return mixed | ||
78 | + */ | ||
79 | + public function actionUpdate($id) | ||
80 | + { | ||
81 | + $model = $this->findModel($id); | ||
82 | + | ||
83 | + if ($model->load(Yii::$app->request->post()) && $model->save()) { | ||
84 | + return $this->redirect(['view', 'id' => $model->id]); | ||
85 | + } else { | ||
86 | + return $this->render('update', [ | ||
87 | + 'model' => $model, | ||
88 | + ]); | ||
89 | + } | ||
90 | + } | ||
91 | + | ||
92 | + /** | ||
93 | + * Deletes an existing AdminMenu model. | ||
94 | + * If deletion is successful, the browser will be redirected to the 'index' page. | ||
95 | + * @param integer $id | ||
96 | + * @return mixed | ||
97 | + */ | ||
98 | + public function actionDelete($id) | ||
99 | + { | ||
100 | + $this->findModel($id)->delete(); | ||
101 | + | ||
102 | + return $this->redirect(['index']); | ||
103 | + } | ||
104 | + | ||
105 | + /** | ||
106 | + * Finds the AdminMenu model based on its primary key value. | ||
107 | + * If the model is not found, a 404 HTTP exception will be thrown. | ||
108 | + * @param integer $id | ||
109 | + * @return AdminMenu the loaded model | ||
110 | + * @throws NotFoundHttpException if the model cannot be found | ||
111 | + */ | ||
112 | + protected function findModel($id) | ||
113 | + { | ||
114 | + if (($model = AdminMenu::findOne($id)) !== null) { | ||
115 | + return $model; | ||
116 | + } else { | ||
117 | + throw new NotFoundHttpException('The requested page does not exist.'); | ||
118 | + } | ||
119 | + } | ||
120 | +} |
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | + | ||
7 | +/** | ||
8 | + * This is the model class for table "admin_menu". | ||
9 | + * | ||
10 | + * @property integer $id | ||
11 | + * @property integer $parent_id | ||
12 | + * @property integer $active | ||
13 | + * @property integer $hide_min | ||
14 | + * @property integer $sort | ||
15 | + * @property string $name | ||
16 | + * @property string $path | ||
17 | + * @property string $params | ||
18 | + * | ||
19 | + * @property AdminMenu $parent | ||
20 | + * @property AdminMenu[] $adminMenus | ||
21 | + * @property AdminMenuAccessGroup[] $adminMenuAccessGroups | ||
22 | + * @property AdminMenuAccessUser[] $adminMenuAccessUsers | ||
23 | + */ | ||
24 | +class AdminMenu extends \yii\db\ActiveRecord | ||
25 | +{ | ||
26 | + /** | ||
27 | + * @inheritdoc | ||
28 | + */ | ||
29 | + public static function tableName() | ||
30 | + { | ||
31 | + return 'admin_menu'; | ||
32 | + } | ||
33 | + | ||
34 | + /** | ||
35 | + * @inheritdoc | ||
36 | + */ | ||
37 | + public function rules() | ||
38 | + { | ||
39 | + return [ | ||
40 | + [['parent_id', 'active', 'hide_min', 'sort'], 'integer'], | ||
41 | + [['name'], 'required'], | ||
42 | + [['name', 'path', 'params'], 'string'] | ||
43 | + ]; | ||
44 | + } | ||
45 | + | ||
46 | + /** | ||
47 | + * @inheritdoc | ||
48 | + */ | ||
49 | + public function attributeLabels() | ||
50 | + { | ||
51 | + return [ | ||
52 | + 'id' => Yii::t('app', 'ID'), | ||
53 | + 'parent_id' => Yii::t('app', 'Parent ID'), | ||
54 | + 'active' => Yii::t('app', 'Active'), | ||
55 | + 'hide_min' => Yii::t('app', 'Hide Min'), | ||
56 | + 'sort' => Yii::t('app', 'Sort'), | ||
57 | + 'name' => Yii::t('app', 'Name'), | ||
58 | + 'path' => Yii::t('app', 'Path'), | ||
59 | + 'params' => Yii::t('app', 'Params'), | ||
60 | + ]; | ||
61 | + } | ||
62 | + | ||
63 | + /** | ||
64 | + * @return \yii\db\ActiveQuery | ||
65 | + */ | ||
66 | + public function getParent() | ||
67 | + { | ||
68 | + return $this->hasOne(AdminMenu::className(), ['id' => 'parent_id']); | ||
69 | + } | ||
70 | + | ||
71 | + /** | ||
72 | + * @return \yii\db\ActiveQuery | ||
73 | + */ | ||
74 | + public function getAdminMenus() | ||
75 | + { | ||
76 | + return $this->hasMany(AdminMenu::className(), ['parent_id' => 'id']); | ||
77 | + } | ||
78 | + | ||
79 | + /** | ||
80 | + * @return \yii\db\ActiveQuery | ||
81 | + */ | ||
82 | + public function getAdminMenuAccessGroups() | ||
83 | + { | ||
84 | + return $this->hasMany(AdminMenuAccessGroup::className(), ['menu_id' => 'id']); | ||
85 | + } | ||
86 | + | ||
87 | + /** | ||
88 | + * @return \yii\db\ActiveQuery | ||
89 | + */ | ||
90 | + public function getAdminMenuAccessUsers() | ||
91 | + { | ||
92 | + return $this->hasMany(AdminMenuAccessUser::className(), ['menu_id' => 'id']); | ||
93 | + } | ||
94 | + | ||
95 | + public static function buildMenu($withValues = false) | ||
96 | + { | ||
97 | + $result = []; | ||
98 | + $roots = self::find()->where(['parent_id' => NULL])->with(['adminMenus'])->all(); | ||
99 | + foreach($roots as $root) { | ||
100 | + if($root->adminMenus) { | ||
101 | + $result[] = ['label' => $root->name, 'id' => $root->id, 'options' => ['class' => 'header']]; | ||
102 | + foreach($root->adminMenus as $submenu) { | ||
103 | + if($submenu->adminMenus) { | ||
104 | + $items = []; | ||
105 | + foreach($submenu->adminMenus as $item) { | ||
106 | + $items[] = ['label' => $item->name, 'id' => $item->id, 'icon' => 'fa fa-circle-o', 'url' => array_merge([$item->path], \common\models\Tools::parseUrlParams($item->params))]; | ||
107 | + } | ||
108 | + $result[] = ['label' => $submenu->name, 'id' => $submenu->id, 'icon' => 'fa fa-circle-o', 'url' => '#', 'items' => $items]; | ||
109 | + unset($items); | ||
110 | + } else { | ||
111 | + $result[] = ['label' => $submenu->name, 'id' => $submenu->id, 'icon' => 'fa fa-circle-o', 'url' => array_merge([$submenu->path], \common\models\Tools::parseUrlParams($submenu->params))]; | ||
112 | + } | ||
113 | + } | ||
114 | + } | ||
115 | + } | ||
116 | + return $result; | ||
117 | + } | ||
118 | + | ||
119 | + public static function buildMenuSelect() | ||
120 | + { | ||
121 | + $result = []; | ||
122 | + $roots = self::find()->where(['parent_id' => NULL])->with(['adminMenus'])->all(); | ||
123 | + foreach($roots as $root) { | ||
124 | + if($root->adminMenus) { | ||
125 | + $items = []; | ||
126 | + foreach($root->adminMenus as $submenu) { | ||
127 | + $items[] = ['label' => $submenu->name, 'id' => $submenu->id]; | ||
128 | + } | ||
129 | + $result[] = ['label' => $root->name, 'id' => $root->id, 'items' => $items]; | ||
130 | + unset($items); | ||
131 | + } else { | ||
132 | + $result[] = ['label' => $root->name, 'id' => $root->id]; | ||
133 | + } | ||
134 | + } | ||
135 | + return $result; | ||
136 | + } | ||
137 | +} |
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | + | ||
7 | +/** | ||
8 | + * This is the model class for table "admin_menu_access_group". | ||
9 | + * | ||
10 | + * @property integer $id | ||
11 | + * @property integer $menu_id | ||
12 | + * @property string $group | ||
13 | + * | ||
14 | + * @property AdminMenu $menu | ||
15 | + * @property AuthRule $group0 | ||
16 | + */ | ||
17 | +class AdminMenuAccessGroup extends \yii\db\ActiveRecord | ||
18 | +{ | ||
19 | + /** | ||
20 | + * @inheritdoc | ||
21 | + */ | ||
22 | + public static function tableName() | ||
23 | + { | ||
24 | + return 'admin_menu_access_group'; | ||
25 | + } | ||
26 | + | ||
27 | + /** | ||
28 | + * @inheritdoc | ||
29 | + */ | ||
30 | + public function rules() | ||
31 | + { | ||
32 | + return [ | ||
33 | + [['menu_id'], 'integer'], | ||
34 | + [['group'], 'string'] | ||
35 | + ]; | ||
36 | + } | ||
37 | + | ||
38 | + /** | ||
39 | + * @inheritdoc | ||
40 | + */ | ||
41 | + public function attributeLabels() | ||
42 | + { | ||
43 | + return [ | ||
44 | + 'id' => Yii::t('app', 'ID'), | ||
45 | + 'menu_id' => Yii::t('app', 'Menu ID'), | ||
46 | + 'group' => Yii::t('app', 'Group'), | ||
47 | + ]; | ||
48 | + } | ||
49 | + | ||
50 | + /** | ||
51 | + * @return \yii\db\ActiveQuery | ||
52 | + */ | ||
53 | + public function getMenu() | ||
54 | + { | ||
55 | + return $this->hasOne(AdminMenu::className(), ['id' => 'menu_id']); | ||
56 | + } | ||
57 | + | ||
58 | + /** | ||
59 | + * @return \yii\db\ActiveQuery | ||
60 | + */ | ||
61 | + public function getGroup0() | ||
62 | + { | ||
63 | + return $this->hasOne(AuthRule::className(), ['name' => 'group']); | ||
64 | + } | ||
65 | +} |
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | + | ||
7 | +/** | ||
8 | + * This is the model class for table "admin_menu_access_user". | ||
9 | + * | ||
10 | + * @property integer $menu_id | ||
11 | + * @property integer $user_id | ||
12 | + * @property integer $id | ||
13 | + * | ||
14 | + * @property AdminMenu $menu | ||
15 | + * @property User $user | ||
16 | + */ | ||
17 | +class AdminMenuAccessUser extends \yii\db\ActiveRecord | ||
18 | +{ | ||
19 | + /** | ||
20 | + * @inheritdoc | ||
21 | + */ | ||
22 | + public static function tableName() | ||
23 | + { | ||
24 | + return 'admin_menu_access_user'; | ||
25 | + } | ||
26 | + | ||
27 | + /** | ||
28 | + * @inheritdoc | ||
29 | + */ | ||
30 | + public function rules() | ||
31 | + { | ||
32 | + return [ | ||
33 | + [['menu_id', 'user_id'], 'integer'] | ||
34 | + ]; | ||
35 | + } | ||
36 | + | ||
37 | + /** | ||
38 | + * @inheritdoc | ||
39 | + */ | ||
40 | + public function attributeLabels() | ||
41 | + { | ||
42 | + return [ | ||
43 | + 'menu_id' => Yii::t('app', 'Menu ID'), | ||
44 | + 'user_id' => Yii::t('app', 'User ID'), | ||
45 | + 'id' => Yii::t('app', 'ID'), | ||
46 | + ]; | ||
47 | + } | ||
48 | + | ||
49 | + /** | ||
50 | + * @return \yii\db\ActiveQuery | ||
51 | + */ | ||
52 | + public function getMenu() | ||
53 | + { | ||
54 | + return $this->hasOne(AdminMenu::className(), ['id' => 'menu_id']); | ||
55 | + } | ||
56 | + | ||
57 | + /** | ||
58 | + * @return \yii\db\ActiveQuery | ||
59 | + */ | ||
60 | + public function getUser() | ||
61 | + { | ||
62 | + return $this->hasOne(User::className(), ['id' => 'user_id']); | ||
63 | + } | ||
64 | +} |
1 | +<?php | ||
2 | + | ||
3 | +namespace backend\models; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use yii\base\Model; | ||
7 | +use yii\data\ActiveDataProvider; | ||
8 | +use backend\models\AdminMenu; | ||
9 | + | ||
10 | +/** | ||
11 | + * AdminMenuSearch represents the model behind the search form about `backend\models\AdminMenu`. | ||
12 | + */ | ||
13 | +class AdminMenuSearch extends AdminMenu | ||
14 | +{ | ||
15 | + /** | ||
16 | + * @inheritdoc | ||
17 | + */ | ||
18 | + public function rules() | ||
19 | + { | ||
20 | + return [ | ||
21 | + [['id', 'parent_id', 'active', 'hide_min', 'sort'], 'integer'], | ||
22 | + [['name', 'path', 'params'], 'safe'], | ||
23 | + ]; | ||
24 | + } | ||
25 | + | ||
26 | + /** | ||
27 | + * @inheritdoc | ||
28 | + */ | ||
29 | + public function scenarios() | ||
30 | + { | ||
31 | + // bypass scenarios() implementation in the parent class | ||
32 | + return Model::scenarios(); | ||
33 | + } | ||
34 | + | ||
35 | + /** | ||
36 | + * Creates data provider instance with search query applied | ||
37 | + * | ||
38 | + * @param array $params | ||
39 | + * | ||
40 | + * @return ActiveDataProvider | ||
41 | + */ | ||
42 | + public function search($params) | ||
43 | + { | ||
44 | + $query = AdminMenu::find(); | ||
45 | + | ||
46 | + $dataProvider = new ActiveDataProvider([ | ||
47 | + 'query' => $query, | ||
48 | + ]); | ||
49 | + | ||
50 | + $this->load($params); | ||
51 | + | ||
52 | + if (!$this->validate()) { | ||
53 | + // uncomment the following line if you do not want to return any records when validation fails | ||
54 | + // $query->where('0=1'); | ||
55 | + return $dataProvider; | ||
56 | + } | ||
57 | + | ||
58 | + $query->andFilterWhere([ | ||
59 | + 'id' => $this->id, | ||
60 | + 'parent_id' => $this->parent_id, | ||
61 | + 'active' => $this->active, | ||
62 | + 'hide_min' => $this->hide_min, | ||
63 | + 'sort' => $this->sort, | ||
64 | + ]); | ||
65 | + | ||
66 | + $query->andFilterWhere(['like', 'name', $this->name]) | ||
67 | + ->andFilterWhere(['like', 'path', $this->path]) | ||
68 | + ->andFilterWhere(['like', 'params', $this->params]); | ||
69 | + | ||
70 | + return $dataProvider; | ||
71 | + } | ||
72 | +} |
1 | +<?php | ||
2 | + | ||
3 | +use backend\models\AdminMenu; | ||
4 | +use common\models\Tools; | ||
5 | +use yii\helpers\Html; | ||
6 | +use yii\widgets\ActiveForm; | ||
7 | + | ||
8 | +/* @var $this yii\web\View */ | ||
9 | +/* @var $model backend\models\AdminMenu */ | ||
10 | +/* @var $form yii\widgets\ActiveForm */ | ||
11 | +?> | ||
12 | + | ||
13 | +<div class="admin-menu-form"> | ||
14 | + | ||
15 | + <?php $form = ActiveForm::begin(); ?> | ||
16 | + | ||
17 | + <?= $form->field($model, 'name')->textInput() ?> | ||
18 | + | ||
19 | + <p><strong><?= Yii::t('app', 'parent_id') ?></strong></p> | ||
20 | + <ul class="list-group checkboxer"> | ||
21 | + <?php | ||
22 | + $roots = AdminMenu::buildMenuSelect(); | ||
23 | + 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']]); | ||
24 | + foreach($roots as $root) { | ||
25 | + 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']]); | ||
26 | + if($root['items']) { | ||
27 | + foreach($root['items'] as $submenu) { | ||
28 | + 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']]); | ||
29 | + } | ||
30 | + } | ||
31 | + } | ||
32 | + ?> | ||
33 | + </ul> | ||
34 | + | ||
35 | + <?= $form->field($model, 'active')->checkbox() ?> | ||
36 | + | ||
37 | + <?= $form->field($model, 'hide_min')->checkbox() ?> | ||
38 | + | ||
39 | + <?= $form->field($model, 'path')->textInput() ?> | ||
40 | + | ||
41 | + <?= $form->field($model, 'params')->textInput() ?> | ||
42 | + | ||
43 | + <div class="form-group"> | ||
44 | + <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | ||
45 | + </div> | ||
46 | + | ||
47 | + <?php ActiveForm::end(); ?> | ||
48 | + | ||
49 | +</div> |
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\ActiveForm; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\AdminMenuSearch */ | ||
8 | +/* @var $form yii\widgets\ActiveForm */ | ||
9 | +?> | ||
10 | + | ||
11 | +<div class="admin-menu-search"> | ||
12 | + | ||
13 | + <?php $form = ActiveForm::begin([ | ||
14 | + 'action' => ['index'], | ||
15 | + 'method' => 'get', | ||
16 | + ]); ?> | ||
17 | + | ||
18 | + <?= $form->field($model, 'id') ?> | ||
19 | + | ||
20 | + <?= $form->field($model, 'parent_id') ?> | ||
21 | + | ||
22 | + <?= $form->field($model, 'active') ?> | ||
23 | + | ||
24 | + <?= $form->field($model, 'hide_min') ?> | ||
25 | + | ||
26 | + <?= $form->field($model, 'sort') ?> | ||
27 | + | ||
28 | + <?php // echo $form->field($model, 'name') ?> | ||
29 | + | ||
30 | + <?php // echo $form->field($model, 'path') ?> | ||
31 | + | ||
32 | + <?php // echo $form->field($model, 'params') ?> | ||
33 | + | ||
34 | + <div class="form-group"> | ||
35 | + <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?> | ||
36 | + <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?> | ||
37 | + </div> | ||
38 | + | ||
39 | + <?php ActiveForm::end(); ?> | ||
40 | + | ||
41 | +</div> |
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\AdminMenu */ | ||
8 | + | ||
9 | +$this->title = Yii::t('app', 'Create Admin Menu'); | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Admin Menus'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="admin-menu-create"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <?= $this->render('_form', [ | ||
18 | + 'model' => $model, | ||
19 | + ]) ?> | ||
20 | + | ||
21 | +</div> |
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\grid\GridView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $searchModel backend\models\AdminMenuSearch */ | ||
8 | +/* @var $dataProvider yii\data\ActiveDataProvider */ | ||
9 | + | ||
10 | +$this->title = Yii::t('app', 'Admin Menus'); | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="admin-menu-index"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | ||
17 | + | ||
18 | + <p> | ||
19 | + <?= Html::a(Yii::t('app', 'Create Admin Menu'), ['create'], ['class' => 'btn btn-success']) ?> | ||
20 | + </p> | ||
21 | + | ||
22 | + <?= GridView::widget([ | ||
23 | + 'dataProvider' => $dataProvider, | ||
24 | + 'filterModel' => $searchModel, | ||
25 | + 'columns' => [ | ||
26 | + ['class' => 'yii\grid\SerialColumn'], | ||
27 | + | ||
28 | + 'id', | ||
29 | + 'parent_id', | ||
30 | + 'active', | ||
31 | + 'hide_min', | ||
32 | + 'sort', | ||
33 | + // 'name', | ||
34 | + // 'path', | ||
35 | + // 'params', | ||
36 | + | ||
37 | + ['class' => 'yii\grid\ActionColumn'], | ||
38 | + ], | ||
39 | + ]); ?> | ||
40 | + | ||
41 | +</div> |
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | + | ||
5 | +/* @var $this yii\web\View */ | ||
6 | +/* @var $model backend\models\AdminMenu */ | ||
7 | + | ||
8 | +$this->title = Yii::t('app', 'Update {modelClass}: ', [ | ||
9 | + 'modelClass' => 'Admin Menu', | ||
10 | +]) . ' ' . $model->name; | ||
11 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Admin Menus'), 'url' => ['index']]; | ||
12 | +$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; | ||
13 | +$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); | ||
14 | +?> | ||
15 | +<div class="admin-menu-update"> | ||
16 | + | ||
17 | + <h1><?= Html::encode($this->title) ?></h1> | ||
18 | + | ||
19 | + <?= $this->render('_form', [ | ||
20 | + 'model' => $model, | ||
21 | + ]) ?> | ||
22 | + | ||
23 | +</div> |
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Html; | ||
4 | +use yii\widgets\DetailView; | ||
5 | + | ||
6 | +/* @var $this yii\web\View */ | ||
7 | +/* @var $model backend\models\AdminMenu */ | ||
8 | + | ||
9 | +$this->title = $model->name; | ||
10 | +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Admin Menus'), 'url' => ['index']]; | ||
11 | +$this->params['breadcrumbs'][] = $this->title; | ||
12 | +?> | ||
13 | +<div class="admin-menu-view"> | ||
14 | + | ||
15 | + <h1><?= Html::encode($this->title) ?></h1> | ||
16 | + | ||
17 | + <p> | ||
18 | + <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | ||
19 | + <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [ | ||
20 | + 'class' => 'btn btn-danger', | ||
21 | + 'data' => [ | ||
22 | + 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), | ||
23 | + 'method' => 'post', | ||
24 | + ], | ||
25 | + ]) ?> | ||
26 | + </p> | ||
27 | + | ||
28 | + <?= DetailView::widget([ | ||
29 | + 'model' => $model, | ||
30 | + 'attributes' => [ | ||
31 | + 'id', | ||
32 | + 'parent_id', | ||
33 | + 'active', | ||
34 | + 'hide_min', | ||
35 | + 'sort', | ||
36 | + 'name', | ||
37 | + 'path', | ||
38 | + 'params', | ||
39 | + ], | ||
40 | + ]) ?> | ||
41 | + | ||
42 | +</div> |
No preview for this file type
frontend/web/images/upload/0ba9d6a23ce996f8f6894545721a9417ZKA-O/original.jpg
0 → 100644
80.2 KB
frontend/web/images/upload/1882770d9bde9932666c75b63da8a55bA5OLs/original.jpg
0 → 100644
90 KB
frontend/web/images/upload/1882770d9bde9932666c75b63da8a55bAGkF2/original.jpg
0 → 100644
90 KB
frontend/web/images/upload/1882770d9bde9932666c75b63da8a55bNqFYc/original.jpg
0 → 100644
90 KB
frontend/web/images/upload/1882770d9bde9932666c75b63da8a55bcdvDU/original.jpg
0 → 100644
90 KB
frontend/web/images/upload/2d5d104fda828bd7122f1372ffe941cdM1XGy/original.jpg
0 → 100644
95.8 KB
frontend/web/images/upload/2d5d104fda828bd7122f1372ffe941cdMO2On/original.jpg
0 → 100644
95.8 KB
frontend/web/images/upload/416becfedaed921abc6ca696e2ff51dbIxY64/original.jpg
0 → 100644
122 KB
frontend/web/images/upload/416becfedaed921abc6ca696e2ff51dbNCozs/original.jpg
0 → 100644
122 KB
frontend/web/images/upload/5ee447f553cd4b615e0107772e72469ccmchQ/original.jpg
0 → 100644
45.3 KB
frontend/web/images/upload/68ea5e978068f52504ba9f2f10a3eca8Nj3zD/original.jpg
0 → 100644
46.1 KB
frontend/web/images/upload/7b3166bbb0497ab11649b502f98a9f71-NXzA/original.jpg
0 → 100644
77.3 KB
frontend/web/images/upload/7b3166bbb0497ab11649b502f98a9f717ntFu/original.jpg
0 → 100644
77.3 KB
frontend/web/images/upload/7b3166bbb0497ab11649b502f98a9f71O4IC7/original.jpg
0 → 100644
77.3 KB
frontend/web/images/upload/7b3166bbb0497ab11649b502f98a9f71Qkhxq/original.jpg
0 → 100644
77.3 KB
frontend/web/images/upload/7b3166bbb0497ab11649b502f98a9f71iN0HJ/original.jpg
0 → 100644
77.3 KB
frontend/web/images/upload/7b3166bbb0497ab11649b502f98a9f71r-uW4/original.jpg
0 → 100644
77.3 KB
frontend/web/images/upload/7b3166bbb0497ab11649b502f98a9f71v4k-p/original.jpg
0 → 100644
77.3 KB
frontend/web/images/upload/7c0beac302dbe743c2fec948bd232d7dFPPuQ/original.jpg
0 → 100644
14.9 KB
frontend/web/images/upload/7da01e1c36c2ddb3140557dc087012510LVuC/original.jpg
0 → 100644
55 KB
frontend/web/images/upload/954377695246c868d41932f4d4ad6bdc4H6Sa/original.jpg
0 → 100644
142 KB
frontend/web/images/upload/954377695246c868d41932f4d4ad6bdcYQ6Gt/original.jpg
0 → 100644
142 KB
frontend/web/images/upload/998f255851230d82d29c7a218cfdb104AsZKg/original.png
0 → 100644
214 KB
frontend/web/images/upload/998f255851230d82d29c7a218cfdb104oT-cN/original.png
0 → 100644
214 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e0853tHa/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e085W3TX/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e086mNnr/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e089XVmJ/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08HLPep/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08HlucN/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08K3ZX-/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08O4h7I/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08Ru9T4/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08Vr17d/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08aHlil/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08ajC__/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08eTlWW/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08f_eyp/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08kGamn/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08pgbJ2/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08twxWX/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/b8d32a4542d55ba60684bb1c2d486e08xitCT/original.jpg
0 → 100644
51.7 KB
frontend/web/images/upload/bcdc328db35813ea7b1a4b85a71def67HOooH/original.jpg
0 → 100644
21.4 KB
frontend/web/images/upload/bcdc328db35813ea7b1a4b85a71def67IJ5q7/original.jpg
0 → 100644
21.4 KB
frontend/web/images/upload/bcdc328db35813ea7b1a4b85a71def67JnlT_/original.jpg
0 → 100644
21.4 KB
frontend/web/images/upload/bcdc328db35813ea7b1a4b85a71def67VrxQl/original.jpg
0 → 100644
21.4 KB
frontend/web/images/upload/bcdc328db35813ea7b1a4b85a71def67dgBqI/original.jpg
0 → 100644
21.4 KB
frontend/web/images/upload/bcdc328db35813ea7b1a4b85a71def67qv-lM/original.jpg
0 → 100644
21.4 KB