Commit 21aedefeed0a22c8419daa654fe596d9766226ee
1 parent
81d4bf8b
Another one admin fix
Showing
39 changed files
with
731 additions
and
913 deletions
Show diff stats
backend/controllers/BgController.php
... | ... | @@ -154,7 +154,11 @@ |
154 | 154 | */ |
155 | 155 | protected function findModel($id) |
156 | 156 | { |
157 | - if(( $model = Bg::findOne($id) ) !== NULL) { | |
157 | + if(( $model = Bg::find() | |
158 | + ->where([ 'id' => $id ]) | |
159 | + ->with('lang') | |
160 | + ->one() ) !== NULL | |
161 | + ) { | |
158 | 162 | return $model; |
159 | 163 | } else { |
160 | 164 | throw new NotFoundHttpException('The requested page does not exist.'); | ... | ... |
backend/controllers/SeoCategoryController.php
... | ... | @@ -59,20 +59,6 @@ |
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * Displays a single SeoCategory model. | |
63 | - * | |
64 | - * @param integer $id | |
65 | - * | |
66 | - * @return mixed | |
67 | - */ | |
68 | - public function actionView($id) | |
69 | - { | |
70 | - return $this->render('view', [ | |
71 | - 'model' => $this->findModel($id), | |
72 | - ]); | |
73 | - } | |
74 | - | |
75 | - /** | |
76 | 62 | * Creates a new SeoCategory model. |
77 | 63 | * If creation is successful, the browser will be redirected to the 'view' page. |
78 | 64 | * @return mixed |
... | ... | @@ -151,7 +137,11 @@ |
151 | 137 | */ |
152 | 138 | protected function findModel($id) |
153 | 139 | { |
154 | - if(( $model = SeoCategory::findOne($id) ) !== NULL) { | |
140 | + if(( $model = SeoCategory::find() | |
141 | + ->where([ 'seo_category_id' => $id ]) | |
142 | + ->with('lang') | |
143 | + ->one() ) !== NULL | |
144 | + ) { | |
155 | 145 | return $model; |
156 | 146 | } else { |
157 | 147 | throw new NotFoundHttpException('The requested page does not exist.'); | ... | ... |
backend/controllers/SeoController.php
... | ... | @@ -151,7 +151,11 @@ |
151 | 151 | */ |
152 | 152 | protected function findModel($id) |
153 | 153 | { |
154 | - if(( $model = Seo::findOne($id) ) !== NULL) { | |
154 | + if(( $model = Seo::find() | |
155 | + ->where([ 'seo_id' => $id ]) | |
156 | + ->with('lang') | |
157 | + ->one() ) !== NULL | |
158 | + ) { | |
155 | 159 | return $model; |
156 | 160 | } else { |
157 | 161 | throw new NotFoundHttpException('The requested page does not exist.'); | ... | ... |
backend/controllers/SeoDynamicController.php
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | namespace backend\controllers; |
4 | 4 | |
5 | + use common\models\SeoCategory; | |
5 | 6 | use Yii; |
6 | 7 | use common\models\SeoDynamic; |
7 | 8 | use common\models\SeoDynamicSearch; |
... | ... | @@ -45,42 +46,52 @@ |
45 | 46 | |
46 | 47 | /** |
47 | 48 | * Lists all SeoDynamic models. |
49 | + * | |
50 | + * @param int $seo_category_id | |
51 | + * | |
48 | 52 | * @return mixed |
49 | 53 | */ |
50 | 54 | public function actionIndex($seo_category_id) |
51 | 55 | { |
56 | + $seo_category = $this->findCategory($seo_category_id); | |
52 | 57 | $searchModel = new SeoDynamicSearch(); |
53 | 58 | $dataProvider = $searchModel->search($seo_category_id, Yii::$app->request->queryParams); |
54 | 59 | |
55 | 60 | return $this->render('index', [ |
56 | - 'searchModel' => $searchModel, | |
57 | - 'dataProvider' => $dataProvider, | |
58 | - 'seo_category_id' => $seo_category_id, | |
61 | + 'searchModel' => $searchModel, | |
62 | + 'dataProvider' => $dataProvider, | |
63 | + 'seo_category' => $seo_category, | |
59 | 64 | ]); |
60 | 65 | } |
61 | 66 | |
62 | 67 | /** |
63 | 68 | * Displays a single SeoDynamic model. |
64 | 69 | * |
70 | + * @param integer $seo_category_id | |
65 | 71 | * @param integer $id |
66 | 72 | * |
67 | 73 | * @return mixed |
68 | 74 | */ |
69 | 75 | public function actionView($seo_category_id, $id) |
70 | 76 | { |
77 | + $seo_category = $this->findCategory($seo_category_id); | |
71 | 78 | return $this->render('view', [ |
72 | - 'model' => $this->findModel($id), | |
73 | - 'seo_category_id' => $seo_category_id, | |
79 | + 'model' => $this->findModel($id), | |
80 | + 'seo_category' => $seo_category, | |
74 | 81 | ]); |
75 | 82 | } |
76 | 83 | |
77 | 84 | /** |
78 | 85 | * Creates a new SeoDynamic model. |
79 | 86 | * If creation is successful, the browser will be redirected to the 'view' page. |
87 | + * | |
88 | + * @param integer $seo_category_id | |
89 | + * | |
80 | 90 | * @return mixed |
81 | 91 | */ |
82 | 92 | public function actionCreate($seo_category_id) |
83 | 93 | { |
94 | + $seo_category = $this->findCategory($seo_category_id); | |
84 | 95 | $model = new SeoDynamic(); |
85 | 96 | $model->generateLangs(); |
86 | 97 | if($model->load(Yii::$app->request->post())) { |
... | ... | @@ -89,14 +100,14 @@ |
89 | 100 | if($model->save() && $model->transactionStatus) { |
90 | 101 | return $this->redirect([ |
91 | 102 | 'index', |
92 | - 'seo_category_id' => $model->seo_category_id, | |
103 | + 'seo_category_id' => $seo_category_id, | |
93 | 104 | ]); |
94 | 105 | } |
95 | 106 | } |
96 | 107 | return $this->render('create', [ |
97 | - 'model' => $model, | |
98 | - 'model_langs' => $model->model_langs, | |
99 | - 'seo_category_id' => $seo_category_id, | |
108 | + 'model' => $model, | |
109 | + 'model_langs' => $model->model_langs, | |
110 | + 'seo_category' => $seo_category, | |
100 | 111 | ]); |
101 | 112 | } |
102 | 113 | |
... | ... | @@ -104,27 +115,29 @@ |
104 | 115 | * Updates an existing SeoDynamic model. |
105 | 116 | * If update is successful, the browser will be redirected to the 'view' page. |
106 | 117 | * |
118 | + * @param integer $seo_category_id | |
107 | 119 | * @param integer $id |
108 | 120 | * |
109 | 121 | * @return mixed |
110 | 122 | */ |
111 | 123 | public function actionUpdate($seo_category_id, $id) |
112 | 124 | { |
125 | + $seo_category = $this->findCategory($seo_category_id); | |
113 | 126 | $model = $this->findModel($id); |
114 | - $model_langs = $model->generateLangs(); | |
127 | + $model->generateLangs(); | |
115 | 128 | if($model->load(Yii::$app->request->post())) { |
116 | 129 | $model->loadLangs(\Yii::$app->request); |
117 | 130 | if($model->save() && $model->transactionStatus) { |
118 | 131 | return $this->redirect([ |
119 | 132 | 'index', |
120 | - 'seo_category_id' => $model->seo_category_id, | |
133 | + 'seo_category_id' => $seo_category_id, | |
121 | 134 | ]); |
122 | 135 | } |
123 | 136 | } |
124 | 137 | return $this->render('update', [ |
125 | - 'model' => $model, | |
126 | - 'model_langs' => $model_langs, | |
127 | - 'seo_category_id' => $seo_category_id, | |
138 | + 'model' => $model, | |
139 | + 'model_langs' => $model->model_langs, | |
140 | + 'seo_category' => $seo_category, | |
128 | 141 | ]); |
129 | 142 | } |
130 | 143 | |
... | ... | @@ -132,6 +145,7 @@ |
132 | 145 | * Deletes an existing SeoDynamic model. |
133 | 146 | * If deletion is successful, the browser will be redirected to the 'index' page. |
134 | 147 | * |
148 | + * @param integer $seo_category_id | |
135 | 149 | * @param integer $id |
136 | 150 | * |
137 | 151 | * @return mixed |
... | ... | @@ -158,7 +172,24 @@ |
158 | 172 | */ |
159 | 173 | protected function findModel($id) |
160 | 174 | { |
161 | - if(( $model = SeoDynamic::findOne($id) ) !== NULL) { | |
175 | + if(( $model = SeoDynamic::find() | |
176 | + ->where([ 'seo_dynamic_id' => $id ]) | |
177 | + ->with('lang') | |
178 | + ->one() ) !== NULL | |
179 | + ) { | |
180 | + return $model; | |
181 | + } else { | |
182 | + throw new NotFoundHttpException('The requested page does not exist.'); | |
183 | + } | |
184 | + } | |
185 | + | |
186 | + protected function findCategory($id) | |
187 | + { | |
188 | + if(( $model = SeoCategory::find() | |
189 | + ->where([ 'seo_category_id' => $id ]) | |
190 | + ->with('lang') | |
191 | + ->one() ) !== NULL | |
192 | + ) { | |
162 | 193 | return $model; |
163 | 194 | } else { |
164 | 195 | throw new NotFoundHttpException('The requested page does not exist.'); | ... | ... |
backend/controllers/SubscribeController.php deleted
1 | -<?php | |
2 | - | |
3 | -namespace backend\controllers; | |
4 | - | |
5 | -use Yii; | |
6 | -use common\models\Subscribe; | |
7 | -use common\models\SubscribeSearch; | |
8 | -use yii\web\Controller; | |
9 | -use yii\web\NotFoundHttpException; | |
10 | -use yii\filters\VerbFilter; | |
11 | -use developeruz\db_rbac\behaviors\AccessBehavior; | |
12 | -/** | |
13 | - * SubscribeController implements the CRUD actions for Subscribe model. | |
14 | - */ | |
15 | -class SubscribeController extends Controller | |
16 | -{ | |
17 | - /** | |
18 | - * @inheritdoc | |
19 | - */ | |
20 | - public function behaviors() | |
21 | - { | |
22 | - return [ | |
23 | - 'access'=>[ | |
24 | - 'class' => AccessBehavior::className(), | |
25 | - 'rules' => | |
26 | - ['site' => | |
27 | - [ | |
28 | - [ | |
29 | - 'actions' => ['login', 'error'], | |
30 | - 'allow' => true, | |
31 | - ] | |
32 | - ] | |
33 | - ] | |
34 | - ], | |
35 | - 'verbs' => [ | |
36 | - 'class' => VerbFilter::className(), | |
37 | - 'actions' => [ | |
38 | - 'delete' => ['POST'], | |
39 | - ], | |
40 | - ], | |
41 | - ]; | |
42 | - } | |
43 | - | |
44 | - /** | |
45 | - * Lists all Subscribe models. | |
46 | - * @return mixed | |
47 | - */ | |
48 | - public function actionIndex() | |
49 | - { | |
50 | - $searchModel = new SubscribeSearch(); | |
51 | - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | |
52 | - | |
53 | - return $this->render('index', [ | |
54 | - 'searchModel' => $searchModel, | |
55 | - 'dataProvider' => $dataProvider, | |
56 | - ]); | |
57 | - } | |
58 | - | |
59 | - /** | |
60 | - * Displays a single Subscribe model. | |
61 | - * @param integer $id | |
62 | - * @return mixed | |
63 | - */ | |
64 | - public function actionView($id) | |
65 | - { | |
66 | - return $this->render('view', [ | |
67 | - 'model' => $this->findModel($id), | |
68 | - ]); | |
69 | - } | |
70 | - | |
71 | - /** | |
72 | - * Creates a new Subscribe model. | |
73 | - * If creation is successful, the browser will be redirected to the 'view' page. | |
74 | - * @return mixed | |
75 | - */ | |
76 | - public function actionCreate() | |
77 | - { | |
78 | - $model = new Subscribe(); | |
79 | - | |
80 | - if ($model->load(Yii::$app->request->post()) && $model->save()) { | |
81 | - return $this->redirect(['view', 'id' => $model->id]); | |
82 | - } else { | |
83 | - return $this->render('create', [ | |
84 | - 'model' => $model, | |
85 | - ]); | |
86 | - } | |
87 | - } | |
88 | - | |
89 | - /** | |
90 | - * Updates an existing Subscribe model. | |
91 | - * If update is successful, the browser will be redirected to the 'view' page. | |
92 | - * @param integer $id | |
93 | - * @return mixed | |
94 | - */ | |
95 | - public function actionUpdate($id) | |
96 | - { | |
97 | - $model = $this->findModel($id); | |
98 | - | |
99 | - if ($model->load(Yii::$app->request->post()) && $model->save()) { | |
100 | - return $this->redirect(['view', 'id' => $model->id]); | |
101 | - } else { | |
102 | - return $this->render('update', [ | |
103 | - 'model' => $model, | |
104 | - ]); | |
105 | - } | |
106 | - } | |
107 | - | |
108 | - /** | |
109 | - * Deletes an existing Subscribe model. | |
110 | - * If deletion is successful, the browser will be redirected to the 'index' page. | |
111 | - * @param integer $id | |
112 | - * @return mixed | |
113 | - */ | |
114 | - public function actionDelete($id) | |
115 | - { | |
116 | - $this->findModel($id)->delete(); | |
117 | - | |
118 | - return $this->redirect(['index']); | |
119 | - } | |
120 | - | |
121 | - /** | |
122 | - * Finds the Subscribe model based on its primary key value. | |
123 | - * If the model is not found, a 404 HTTP exception will be thrown. | |
124 | - * @param integer $id | |
125 | - * @return Subscribe the loaded model | |
126 | - * @throws NotFoundHttpException if the model cannot be found | |
127 | - */ | |
128 | - protected function findModel($id) | |
129 | - { | |
130 | - if (($model = Subscribe::findOne($id)) !== null) { | |
131 | - return $model; | |
132 | - } else { | |
133 | - throw new NotFoundHttpException('The requested page does not exist.'); | |
134 | - } | |
135 | - } | |
136 | -} |
backend/views/bg/index.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\grid\GridView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $searchModel common\models\BgSearch */ | |
8 | -/* @var $dataProvider yii\data\ActiveDataProvider */ | |
9 | - | |
10 | -$this->title = \Yii::t('app', 'Bgs'); | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\grid\GridView; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\BgSearch $searchModel | |
9 | + * @var yii\data\ActiveDataProvider $dataProvider | |
10 | + */ | |
11 | + $this->title = \Yii::t('app', 'Bgs'); | |
12 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
12 | 13 | ?> |
13 | 14 | <div class="bg-index"> |
14 | - | |
15 | + | |
15 | 16 | <h1><?= Html::encode($this->title) ?></h1> |
16 | - <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | |
17 | - | |
17 | + | |
18 | 18 | <p> |
19 | - <?= Html::a(\Yii::t('app', 'Create Bg'), ['create'], ['class' => 'btn btn-success']) ?> | |
19 | + <?= Html::a(\Yii::t('app', 'Create Bg'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?> | |
20 | 20 | </p> |
21 | 21 | <?= GridView::widget([ |
22 | 22 | 'dataProvider' => $dataProvider, |
23 | - 'filterModel' => $searchModel, | |
24 | - 'columns' => [ | |
25 | - ['class' => 'yii\grid\SerialColumn'], | |
23 | + 'filterModel' => $searchModel, | |
24 | + 'columns' => [ | |
25 | + [ 'class' => 'yii\grid\SerialColumn' ], | |
26 | 26 | 'id', |
27 | - 'url', | |
27 | + 'url:url', | |
28 | + [ | |
29 | + 'attribute' => 'title', | |
30 | + 'value' => 'lang.title', | |
31 | + ], | |
28 | 32 | 'imageUrl:image', |
29 | - ['class' => 'yii\grid\ActionColumn'], | |
33 | + [ 'class' => 'yii\grid\ActionColumn' ], | |
30 | 34 | ], |
31 | 35 | ]); ?> |
32 | 36 | </div> | ... | ... |
backend/views/bg/update.php
... | ... | @@ -11,13 +11,13 @@ |
11 | 11 | * @var BgLang[] $model_langs |
12 | 12 | */ |
13 | 13 | |
14 | - $this->title = \Yii::t('app', 'Update Bg: ') . $model->id; | |
14 | + $this->title = \Yii::t('app', 'Update Bg: ') . $model->lang->title; | |
15 | 15 | $this->params[ 'breadcrumbs' ][] = [ |
16 | 16 | 'label' => \Yii::t('app', 'Bgs'), |
17 | 17 | 'url' => [ 'index' ], |
18 | 18 | ]; |
19 | 19 | $this->params[ 'breadcrumbs' ][] = [ |
20 | - 'label' => $model->id, | |
20 | + 'label' => $model->lang->title, | |
21 | 21 | 'url' => [ |
22 | 22 | 'view', |
23 | 23 | 'id' => $model->id, | ... | ... |
backend/views/bg/view.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\DetailView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Bg */ | |
8 | - | |
9 | -$this->title = $model->id; | |
10 | -$this->params['breadcrumbs'][] = ['label' => \Yii::t('app', 'Bgs'), 'url' => ['index']]; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\widgets\DetailView; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\Bg $model | |
9 | + */ | |
10 | + $this->title = $model->lang->title; | |
11 | + $this->params[ 'breadcrumbs' ][] = [ | |
12 | + 'label' => \Yii::t('app', 'Bgs'), | |
13 | + 'url' => [ 'index' ], | |
14 | + ]; | |
15 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
12 | 16 | ?> |
13 | 17 | <div class="bg-view"> |
14 | - | |
18 | + | |
15 | 19 | <h1><?= Html::encode($this->title) ?></h1> |
16 | - | |
20 | + | |
17 | 21 | <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], [ | |
22 | + <?= Html::a(\Yii::t('app', 'Update'), [ | |
23 | + 'update', | |
24 | + 'id' => $model->id, | |
25 | + ], [ 'class' => 'btn btn-primary' ]) ?> | |
26 | + <?= Html::a(\Yii::t('app', 'Delete'), [ | |
27 | + 'delete', | |
28 | + 'id' => $model->id, | |
29 | + ], [ | |
20 | 30 | 'class' => 'btn btn-danger', |
21 | - 'data' => [ | |
31 | + 'data' => [ | |
22 | 32 | 'confirm' => \Yii::t('app', 'Are you sure you want to delete this item?'), |
23 | - 'method' => 'post', | |
33 | + 'method' => 'post', | |
24 | 34 | ], |
25 | 35 | ]) ?> |
26 | 36 | </p> |
27 | - | |
37 | + | |
28 | 38 | <?= DetailView::widget([ |
29 | - 'model' => $model, | |
39 | + 'model' => $model, | |
30 | 40 | 'attributes' => [ |
31 | 41 | 'id', |
32 | - 'url', | |
42 | + 'lang.title', | |
43 | + 'url:url', | |
33 | 44 | 'imageUrl:image', |
34 | 45 | ], |
35 | 46 | ]) ?> | ... | ... |
backend/views/certificate/index.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\grid\GridView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $searchModel common\models\CertificateSearch */ | |
8 | -/* @var $dataProvider yii\data\ActiveDataProvider */ | |
9 | - | |
10 | -$this->title = 'Certificates'; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
2 | + | |
3 | + use common\models\Certificate; | |
4 | + use yii\helpers\Html; | |
5 | + use yii\grid\GridView; | |
6 | + | |
7 | + /** | |
8 | + * @var yii\web\View $this | |
9 | + * @var common\models\CertificateSearch $searchModel | |
10 | + * @var yii\data\ActiveDataProvider $dataProvider | |
11 | + */ | |
12 | + $this->title = 'Certificates'; | |
13 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
12 | 14 | ?> |
13 | 15 | <div class="certificate-index"> |
14 | - | |
16 | + | |
15 | 17 | <h1><?= Html::encode($this->title) ?></h1> |
16 | - <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | |
17 | - | |
18 | + | |
18 | 19 | <p> |
19 | - <?= Html::a('Create Certificate', ['create'], ['class' => 'btn btn-success']) ?> | |
20 | + <?= Html::a('Create Certificate', [ 'create' ], [ 'class' => 'btn btn-success' ]) ?> | |
20 | 21 | </p> |
21 | 22 | <?= GridView::widget([ |
22 | 23 | 'dataProvider' => $dataProvider, |
23 | - 'filterModel' => $searchModel, | |
24 | - 'columns' => [ | |
25 | - ['class' => 'yii\grid\SerialColumn'], | |
26 | - | |
24 | + 'filterModel' => $searchModel, | |
25 | + 'columns' => [ | |
26 | + [ 'class' => 'yii\grid\SerialColumn' ], | |
27 | 27 | 'certificate_id', |
28 | 28 | 'name', |
29 | - 'link', | |
30 | - | |
31 | - ['class' => 'yii\grid\ActionColumn'], | |
29 | + [ | |
30 | + 'attribute' => 'link', | |
31 | + 'value' => function($model) { | |
32 | + /** | |
33 | + * @var Certificate $model | |
34 | + */ | |
35 | + return Html::a($model->link, $model->getCertificateUrl()); | |
36 | + }, | |
37 | + 'format' => 'html', | |
38 | + ], | |
39 | + [ 'class' => 'yii\grid\ActionColumn' ], | |
32 | 40 | ], |
33 | 41 | ]); ?> |
34 | 42 | </div> | ... | ... |
backend/views/certificate/view.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\DetailView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Certificate */ | |
8 | - | |
9 | -$this->title = $model->name; | |
10 | -$this->params['breadcrumbs'][] = ['label' => 'Certificates', 'url' => ['index']]; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\widgets\DetailView; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\Certificate $model | |
9 | + */ | |
10 | + $this->title = $model->name; | |
11 | + $this->params[ 'breadcrumbs' ][] = [ | |
12 | + 'label' => 'Certificates', | |
13 | + 'url' => [ 'index' ], | |
14 | + ]; | |
15 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
12 | 16 | ?> |
13 | 17 | <div class="certificate-view"> |
14 | - | |
18 | + | |
15 | 19 | <h1><?= Html::encode($this->title) ?></h1> |
16 | - | |
20 | + | |
17 | 21 | <p> |
18 | - <?= Html::a('Update', ['update', 'id' => $model->certificate_id], ['class' => 'btn btn-primary']) ?> | |
19 | - <?= Html::a('Delete', ['delete', 'id' => $model->certificate_id], [ | |
22 | + <?= Html::a('Update', [ | |
23 | + 'update', | |
24 | + 'id' => $model->certificate_id, | |
25 | + ], [ 'class' => 'btn btn-primary' ]) ?> | |
26 | + <?= Html::a('Delete', [ | |
27 | + 'delete', | |
28 | + 'id' => $model->certificate_id, | |
29 | + ], [ | |
20 | 30 | 'class' => 'btn btn-danger', |
21 | - 'data' => [ | |
31 | + 'data' => [ | |
22 | 32 | 'confirm' => 'Are you sure you want to delete this item?', |
23 | - 'method' => 'post', | |
33 | + 'method' => 'post', | |
24 | 34 | ], |
25 | 35 | ]) ?> |
26 | 36 | </p> |
27 | - | |
37 | + | |
28 | 38 | <?= DetailView::widget([ |
29 | - 'model' => $model, | |
39 | + 'model' => $model, | |
30 | 40 | 'attributes' => [ |
31 | 41 | 'certificate_id', |
32 | 42 | 'name', |
33 | - 'link', | |
43 | + [ | |
44 | + 'attribute' => 'link', | |
45 | + 'value' => Html::a($model->link, $model->getCertificateUrl()), | |
46 | + 'format' => 'html', | |
47 | + ], | |
34 | 48 | ], |
35 | 49 | ]) ?> |
36 | 50 | ... | ... |
backend/views/customer/_form.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\ActiveForm; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Customer */ | |
8 | -/* @var $form yii\widgets\ActiveForm */ | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\widgets\ActiveForm; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\Customer $model | |
9 | + * @var yii\widgets\ActiveForm $form | |
10 | + */ | |
9 | 11 | ?> |
10 | 12 | <div class="customer-form"> |
11 | - | |
13 | + | |
12 | 14 | <?php $form = ActiveForm::begin(); ?> |
13 | - | |
14 | - <?= $form->field($model, 'id')->textInput() ?> | |
15 | - | |
16 | - <?= $form->field($model, 'username')->textInput(['maxlength' => true]) ?> | |
17 | - | |
18 | - <?= $form->field($model, 'password')->passwordInput(['maxlength' => true]) ?> | |
19 | - | |
20 | - <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?> | |
21 | - | |
22 | - <?= $form->field($model, 'surname')->textInput(['maxlength' => true]) ?> | |
23 | - | |
24 | - <?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?> | |
25 | 15 | |
26 | - <?= $form->field($model, 'gender')->textInput(['maxlength' => true]) ?> | |
27 | - | |
28 | - <?= $form->field($model, 'birth_day')->textInput() ?> | |
29 | - | |
30 | - <?= $form->field($model, 'birth_month')->textInput() ?> | |
31 | - | |
32 | - <?= $form->field($model, 'birth_year')->textInput() ?> | |
33 | - | |
34 | - <?= $form->field($model, 'body')->textarea(['rows' => 6]) ?> | |
35 | - | |
36 | - <?= $form->field($model, 'group_id')->textInput() ?> | |
37 | - | |
16 | + <?= $form->field($model, 'username') | |
17 | + ->textInput([ 'maxlength' => true ]) ?> | |
18 | + | |
19 | + <?= $form->field($model, 'name') | |
20 | + ->textInput([ 'maxlength' => true ]) ?> | |
21 | + | |
22 | + <?= $form->field($model, 'surname') | |
23 | + ->textInput([ 'maxlength' => true ]) ?> | |
24 | + | |
25 | + <?= $form->field($model, 'phone') | |
26 | + ->textInput([ 'maxlength' => true ]) ?> | |
27 | + | |
28 | + <?= $form->field($model, 'gender') | |
29 | + ->textInput([ 'maxlength' => true ]) ?> | |
30 | + | |
31 | + <?= $form->field($model, 'birth_day') | |
32 | + ->textInput() ?> | |
33 | + | |
34 | + <?= $form->field($model, 'birth_month') | |
35 | + ->textInput() ?> | |
36 | + | |
37 | + <?= $form->field($model, 'birth_year') | |
38 | + ->textInput() ?> | |
39 | + | |
40 | + <?= $form->field($model, 'body') | |
41 | + ->textarea([ 'rows' => 6 ]) ?> | |
42 | + | |
43 | + <?= $form->field($model, 'group_id') | |
44 | + ->textInput() ?> | |
45 | + | |
38 | 46 | <div class="form-group"> |
39 | - <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | |
47 | + <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]) ?> | |
40 | 48 | </div> |
41 | - | |
49 | + | |
42 | 50 | <?php ActiveForm::end(); ?> |
43 | 51 | |
44 | 52 | </div> | ... | ... |
backend/views/customer/_search.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\ActiveForm; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\CustomerSearch */ | |
8 | -/* @var $form yii\widgets\ActiveForm */ | |
9 | -?> | |
10 | - | |
11 | -<div class="customer-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, 'username') ?> | |
21 | - | |
22 | - <?= $form->field($model, 'password') ?> | |
23 | - | |
24 | - <?= $form->field($model, 'name') ?> | |
25 | - | |
26 | - <?= $form->field($model, 'surname') ?> | |
27 | - | |
28 | - <div class="form-group"> | |
29 | - <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> | |
30 | - <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?> | |
31 | - </div> | |
32 | - | |
33 | - <?php ActiveForm::end(); ?> | |
34 | - | |
35 | -</div> |
backend/views/customer/index.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\grid\GridView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $searchModel common\models\CustomerSearch */ | |
8 | -/* @var $dataProvider yii\data\ActiveDataProvider */ | |
9 | - | |
10 | -$this->title = 'Customers'; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\grid\GridView; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\CustomerSearch $searchModel | |
9 | + * @var yii\data\ActiveDataProvider $dataProvider | |
10 | + */ | |
11 | + $this->title = 'Customers'; | |
12 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
12 | 13 | ?> |
13 | 14 | <div class="customer-index"> |
14 | - | |
15 | + | |
15 | 16 | <h1><?= Html::encode($this->title) ?></h1> |
16 | - <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | |
17 | - | |
17 | + | |
18 | 18 | <p> |
19 | - <?= Html::a('Create Customer', ['create'], ['class' => 'btn btn-success']) ?> | |
19 | + <?= Html::a('Create Customer', [ 'create' ], [ 'class' => 'btn btn-success' ]) ?> | |
20 | 20 | </p> |
21 | 21 | <?= GridView::widget([ |
22 | 22 | 'dataProvider' => $dataProvider, |
23 | - 'filterModel' => $searchModel, | |
24 | - 'columns' => [ | |
25 | - ['class' => 'yii\grid\SerialColumn'], | |
26 | - | |
23 | + 'filterModel' => $searchModel, | |
24 | + 'columns' => [ | |
25 | + [ 'class' => 'yii\grid\SerialColumn' ], | |
26 | + | |
27 | 27 | 'id', |
28 | 28 | 'username', |
29 | 29 | 'name', |
30 | 30 | 'surname', |
31 | - 'phone', | |
32 | - | |
33 | - ['class' => 'yii\grid\ActionColumn'], | |
31 | + 'phone', | |
32 | + 'email', | |
33 | + | |
34 | + [ 'class' => 'yii\grid\ActionColumn' ], | |
34 | 35 | ], |
35 | 36 | ]); ?> |
36 | 37 | </div> | ... | ... |
backend/views/customer/update.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | - | |
5 | -/* @var $this yii\web\View */ | |
6 | -/* @var $model common\models\Customer */ | |
7 | - | |
8 | -$this->title = 'Update Customer: ' . $model->name; | |
9 | -$this->params['breadcrumbs'][] = ['label' => 'Customers', 'url' => ['index']]; | |
10 | -$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; | |
11 | -$this->params['breadcrumbs'][] = 'Update'; | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + | |
5 | + /** | |
6 | + * @var yii\web\View $this | |
7 | + * @var common\models\Customer $model | |
8 | + */ | |
9 | + $this->title = 'Update Customer: ' . $model->name; | |
10 | + $this->params[ 'breadcrumbs' ][] = [ | |
11 | + 'label' => 'Customers', | |
12 | + 'url' => [ 'index' ], | |
13 | + ]; | |
14 | + $this->params[ 'breadcrumbs' ][] = [ | |
15 | + 'label' => $model->name, | |
16 | + 'url' => [ | |
17 | + 'view', | |
18 | + 'id' => $model->id, | |
19 | + ], | |
20 | + ]; | |
21 | + $this->params[ 'breadcrumbs' ][] = 'Update'; | |
12 | 22 | ?> |
13 | 23 | <div class="customer-update"> |
14 | - | |
24 | + | |
15 | 25 | <h1><?= Html::encode($this->title) ?></h1> |
16 | - | |
26 | + | |
17 | 27 | <?= $this->render('_form', [ |
18 | 28 | 'model' => $model, |
19 | 29 | ]) ?> | ... | ... |
backend/views/customer/view.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\DetailView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Customer */ | |
8 | - | |
9 | -$this->title = $model->name; | |
10 | -$this->params['breadcrumbs'][] = ['label' => 'Customers', 'url' => ['index']]; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\widgets\DetailView; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\Customer $model | |
9 | + */ | |
10 | + $this->title = $model->name; | |
11 | + $this->params[ 'breadcrumbs' ][] = [ | |
12 | + 'label' => 'Customers', | |
13 | + 'url' => [ 'index' ], | |
14 | + ]; | |
15 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
12 | 16 | ?> |
13 | 17 | <div class="customer-view"> |
14 | - | |
18 | + | |
15 | 19 | <h1><?= Html::encode($this->title) ?></h1> |
16 | - | |
20 | + | |
17 | 21 | <p> |
18 | - <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | |
19 | - <?= Html::a('Delete', ['delete', 'id' => $model->id], [ | |
22 | + <?= Html::a('Update', [ | |
23 | + 'update', | |
24 | + 'id' => $model->id, | |
25 | + ], [ 'class' => 'btn btn-primary' ]) ?> | |
26 | + <?= Html::a('Delete', [ | |
27 | + 'delete', | |
28 | + 'id' => $model->id, | |
29 | + ], [ | |
20 | 30 | 'class' => 'btn btn-danger', |
21 | - 'data' => [ | |
31 | + 'data' => [ | |
22 | 32 | 'confirm' => 'Are you sure you want to delete this item?', |
23 | - 'method' => 'post', | |
33 | + 'method' => 'post', | |
24 | 34 | ], |
25 | 35 | ]) ?> |
26 | 36 | </p> |
27 | - | |
37 | + | |
28 | 38 | <?= DetailView::widget([ |
29 | - 'model' => $model, | |
39 | + 'model' => $model, | |
30 | 40 | 'attributes' => [ |
31 | 41 | 'id', |
32 | 42 | 'username', |
... | ... | @@ -39,6 +49,8 @@ $this->params['breadcrumbs'][] = $this->title; |
39 | 49 | 'birth_year', |
40 | 50 | 'body:ntext', |
41 | 51 | 'group_id', |
52 | + 'email', | |
53 | + 'created_at:date', | |
42 | 54 | ], |
43 | 55 | ]) ?> |
44 | 56 | ... | ... |
backend/views/layouts/main-sidebar.php
... | ... | @@ -164,12 +164,6 @@ use yii\widgets\Menu; |
164 | 164 | 'options' => ['class'=>\Yii::$app->user->can('bg')? '' :'hide'] |
165 | 165 | ], |
166 | 166 | [ |
167 | - 'label' => 'ะะพะดะฟะธัะบะฐ', | |
168 | - 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-envelope"></i> <span>{label}</span></a>', | |
169 | - 'url' => ['/subscribe/index'], | |
170 | - 'options' => ['class'=>\Yii::$app->user->can('subscribe') ? '' :'hide'], | |
171 | - ], | |
172 | - [ | |
173 | 167 | 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-user"></i> <span>{label}</span></a>', |
174 | 168 | 'label' => 'ะะพะปัะทะพะฒะฐัะตะปะธ', |
175 | 169 | 'url' => ['/customer/index'], | ... | ... |
backend/views/seo-category/index.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\grid\GridView; | |
5 | -use yii\helpers\Url; | |
6 | - | |
7 | -/* @var $this yii\web\View */ | |
8 | -/* @var $searchModel common\models\SeoCategorySearch */ | |
9 | -/* @var $dataProvider yii\data\ActiveDataProvider */ | |
10 | - | |
11 | -$this->title = Yii::t('app', 'Seo Categories'); | |
12 | -$this->params['breadcrumbs'][] = $this->title; | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\grid\GridView; | |
5 | + use yii\helpers\Url; | |
6 | + | |
7 | + /** | |
8 | + * @var yii\web\View $this | |
9 | + * @var common\models\SeoCategorySearch $searchModel | |
10 | + * @var yii\data\ActiveDataProvider $dataProvider | |
11 | + */ | |
12 | + $this->title = Yii::t('app', 'Seo Categories'); | |
13 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
13 | 14 | ?> |
14 | 15 | <div class="seo-category-index"> |
15 | - | |
16 | + | |
16 | 17 | <h1><?= Html::encode($this->title) ?></h1> |
17 | - <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | |
18 | - | |
18 | + | |
19 | 19 | <p> |
20 | - <?= Html::a(Yii::t('app', 'Create Seo Category'), ['create'], ['class' => 'btn btn-success']) ?> | |
20 | + <?= Html::a(Yii::t('app', 'Create Seo Category'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?> | |
21 | 21 | </p> |
22 | 22 | <?= GridView::widget([ |
23 | 23 | 'dataProvider' => $dataProvider, |
24 | - 'filterModel' => $searchModel, | |
25 | - 'columns' => [ | |
26 | - ['class' => 'yii\grid\SerialColumn'], | |
24 | + 'filterModel' => $searchModel, | |
25 | + 'columns' => [ | |
26 | + [ 'class' => 'yii\grid\SerialColumn' ], | |
27 | 27 | 'seo_category_id', |
28 | 28 | 'controller', |
29 | + [ | |
30 | + 'attribute' => 'name', | |
31 | + 'value' => 'lang.name', | |
32 | + ], | |
29 | 33 | 'status', |
30 | 34 | [ |
31 | - 'class' => 'yii\grid\ActionColumn', | |
32 | - 'template' => '{update} {image} {delete}', | |
33 | - 'buttons' => [ | |
34 | - 'update' => function ($url, $model) | |
35 | - { | |
36 | - return Html::a ( | |
37 | - '<span class="glyphicon glyphicon-pencil"></span>', | |
38 | - Url::toRoute(['seo-category/update', 'id' => $model->seo_category_id]), | |
39 | - [ | |
40 | - 'title' => "ะ ะตะดะฐะบัะธัะพะฒะฐัั", | |
41 | - ] | |
42 | - ); | |
43 | - }, | |
44 | - 'image' => function ($url, $model) | |
45 | - { | |
46 | - return Html::a ( | |
47 | - '<span class="glyphicon glyphicon-picture"></span>', | |
48 | - Url::toRoute(['seo-dynamic/index', 'seo_category_id' => $model->seo_category_id]), | |
49 | - [ | |
50 | - 'title' => "ัะปะฐะนะดั", | |
51 | - ] | |
52 | - ); | |
53 | - }, | |
54 | - 'delete' => function ($url, $model) | |
55 | - { | |
56 | - return Html::a ( | |
57 | - '<span class="glyphicon glyphicon-trash"></span>', | |
58 | - Url::toRoute(['seo-category/delete', 'id' => $model->seo_category_id]), | |
59 | - [ | |
60 | - 'title' => "ะฃะดะฐะปะธัั", | |
61 | - ] | |
62 | - ); | |
35 | + 'class' => 'yii\grid\ActionColumn', | |
36 | + 'template' => '{update} {image} {delete}', | |
37 | + 'buttons' => [ | |
38 | + 'image' => function($url, $model) { | |
39 | + return Html::a('<span class="glyphicon glyphicon-picture"></span>', Url::toRoute([ | |
40 | + 'seo-dynamic/index', | |
41 | + 'seo_category_id' => $model->seo_category_id, | |
42 | + ]), [ | |
43 | + 'title' => \Yii::t('app', 'ัะปะฐะนะดั'), | |
44 | + ]); | |
63 | 45 | }, |
64 | 46 | ], |
65 | - 'contentOptions' => ['style' => 'width: 70px;'], | |
66 | 47 | ], |
67 | 48 | ], |
68 | 49 | ]); ?> | ... | ... |
backend/views/seo-category/update.php
... | ... | @@ -13,13 +13,13 @@ |
13 | 13 | |
14 | 14 | $this->title = Yii::t('app', 'Update {modelClass}: ', [ |
15 | 15 | 'modelClass' => 'Seo Category', |
16 | - ]) . $model->seo_category_id; | |
16 | + ]) . $model->lang->name; | |
17 | 17 | $this->params[ 'breadcrumbs' ][] = [ |
18 | 18 | 'label' => Yii::t('app', 'Seo Categories'), |
19 | 19 | 'url' => [ 'index' ], |
20 | 20 | ]; |
21 | 21 | $this->params[ 'breadcrumbs' ][] = [ |
22 | - 'label' => $model->seo_category_id, | |
22 | + 'label' => $model->lang->name, | |
23 | 23 | 'url' => [ |
24 | 24 | 'view', |
25 | 25 | 'id' => $model->seo_category_id, | ... | ... |
backend/views/seo-category/view.php deleted
1 | -<?php | |
2 | - | |
3 | - use yii\helpers\Html; | |
4 | - use yii\widgets\DetailView; | |
5 | - | |
6 | - /* @var $this yii\web\View */ | |
7 | - /* @var $model common\models\SeoCategory */ | |
8 | - | |
9 | - $this->title = $model->seo_category_id; | |
10 | - $this->params[ 'breadcrumbs' ][] = [ | |
11 | - 'label' => Yii::t('app', 'Seo Categories'), | |
12 | - 'url' => [ 'index' ], | |
13 | - ]; | |
14 | - $this->params[ 'breadcrumbs' ][] = $this->title; | |
15 | -?> | |
16 | -<div class="seo-category-view"> | |
17 | - | |
18 | - <h1><?= Html::encode($this->title) ?></h1> | |
19 | - | |
20 | - <p> | |
21 | - <?= Html::a(Yii::t('app', 'Update'), [ | |
22 | - 'update', | |
23 | - 'id' => $model->seo_category_id, | |
24 | - ], [ 'class' => 'btn btn-primary' ]) ?> | |
25 | - <?= Html::a(Yii::t('app', 'Delete'), [ | |
26 | - 'delete', | |
27 | - 'id' => $model->seo_category_id, | |
28 | - ], [ | |
29 | - 'class' => 'btn btn-danger', | |
30 | - 'data' => [ | |
31 | - 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), | |
32 | - 'method' => 'post', | |
33 | - ], | |
34 | - ]) ?> | |
35 | - </p> | |
36 | - | |
37 | - <?= DetailView::widget([ | |
38 | - 'model' => $model, | |
39 | - 'attributes' => [ | |
40 | - 'seo_category_id', | |
41 | - 'controller', | |
42 | - 'status', | |
43 | - ], | |
44 | - ]) ?> | |
45 | - | |
46 | -</div> |
backend/views/seo-dynamic/create.php
1 | 1 | <?php |
2 | 2 | |
3 | + use common\models\SeoCategory; | |
3 | 4 | use common\models\SeoDynamic; |
4 | 5 | use common\models\SeoDynamicLang; |
5 | 6 | use yii\helpers\Html; |
... | ... | @@ -10,16 +11,20 @@ |
10 | 11 | * @var View $this |
11 | 12 | * @var SeoDynamic $model |
12 | 13 | * @var SeoDynamicLang[] $model_langs |
13 | - * @var int $seo_category_id | |
14 | + * @var SeoCategory $seo_category | |
14 | 15 | */ |
15 | 16 | |
16 | 17 | $this->title = Yii::t('app', 'Create Seo Dynamic'); |
17 | 18 | $this->params[ 'breadcrumbs' ][] = [ |
18 | - 'label' => Yii::t('app', 'Seo Dynamics'), | |
19 | - 'url' => Url::toRoute([ | |
19 | + 'label' => Yii::t('app', 'Seo Categories'), | |
20 | + 'url' => [ '/seo-category/index' ], | |
21 | + ]; | |
22 | + $this->params[ 'breadcrumbs' ][] = [ | |
23 | + 'label' => $seo_category->lang->name, | |
24 | + 'url' => [ | |
20 | 25 | 'index', |
21 | - 'seo_category_id' => $seo_category_id, | |
22 | - ]), | |
26 | + 'seo_category_id' => $seo_category->seo_category_id, | |
27 | + ], | |
23 | 28 | ]; |
24 | 29 | $this->params[ 'breadcrumbs' ][] = $this->title; |
25 | 30 | ?> | ... | ... |
backend/views/seo-dynamic/index.php
1 | 1 | <?php |
2 | 2 | |
3 | + use common\models\SeoCategory; | |
3 | 4 | use yii\helpers\Html; |
4 | 5 | use yii\grid\GridView; |
5 | 6 | use yii\helpers\Url; |
6 | 7 | |
7 | - /* @var $this yii\web\View */ | |
8 | - /* @var $searchModel common\models\SeoDynamicSearch */ | |
9 | - /* @var $dataProvider yii\data\ActiveDataProvider */ | |
10 | - | |
11 | - $this->title = Yii::t('app', 'Seo Dynamics'); | |
8 | + /** | |
9 | + * @var yii\web\View $this | |
10 | + * @var common\models\SeoDynamicSearch $searchModel | |
11 | + * @var yii\data\ActiveDataProvider $dataProvider | |
12 | + * @var SeoCategory $seo_category | |
13 | + */ | |
14 | + $this->title = Yii::t('app', 'Seo Dynamics for {seo_category}', [ | |
15 | + 'seo_category' => $seo_category->lang->name, | |
16 | + ]); | |
17 | + $this->params[ 'breadcrumbs' ][] = [ | |
18 | + 'label' => \Yii::t('app', 'Seo Categories'), | |
19 | + 'url' => [ '/seo-category/index' ], | |
20 | + ]; | |
12 | 21 | $this->params[ 'breadcrumbs' ][] = $this->title; |
13 | 22 | ?> |
14 | 23 | <div class="seo-dynamic-index"> |
15 | 24 | |
16 | 25 | <h1><?= Html::encode($this->title) ?></h1> |
17 | - <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | |
18 | 26 | |
19 | 27 | <p> |
20 | 28 | <?= Html::a(Yii::t('app', 'Create Seo Dynamic'), Url::toRoute([ |
21 | 29 | 'create', |
22 | - 'seo_category_id' => $seo_category_id, | |
30 | + 'seo_category_id' => $seo_category->seo_category_id, | |
23 | 31 | ]), [ 'class' => 'btn btn-success' ]) ?> |
24 | 32 | </p> |
25 | 33 | <?= GridView::widget([ |
... | ... | @@ -28,30 +36,34 @@ |
28 | 36 | 'columns' => [ |
29 | 37 | [ 'class' => 'yii\grid\SerialColumn' ], |
30 | 38 | 'seo_dynamic_id', |
31 | - 'seo_category_id', | |
39 | + [ | |
40 | + 'attribute' => 'name', | |
41 | + 'value' => 'lang.name', | |
42 | + ], | |
32 | 43 | 'action', |
33 | 44 | 'fields', |
45 | + 'param', | |
34 | 46 | 'status', |
35 | 47 | [ |
36 | 48 | 'class' => 'yii\grid\ActionColumn', |
37 | 49 | 'buttons' => [ |
38 | 50 | 'view' => function($url, $model) { |
39 | - return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', Url::toRoute([ | |
51 | + return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', [ | |
40 | 52 | 'view', |
41 | 53 | 'seo_category_id' => $model->seo_category_id, |
42 | 54 | 'id' => $model->seo_dynamic_id, |
43 | - ]), [ | |
44 | - 'title' => "ะัะพัะผะพัั", | |
45 | - ]); | |
55 | + ], [ | |
56 | + 'title' => \Yii::t('app', 'ะัะพัะผะพัั'), | |
57 | + ]); | |
46 | 58 | }, |
47 | 59 | 'update' => function($url, $model) { |
48 | - return Html::a('<span class="glyphicon glyphicon-pencil"></span>', Url::toRoute([ | |
60 | + return Html::a('<span class="glyphicon glyphicon-pencil"></span>', [ | |
49 | 61 | 'update', |
50 | 62 | 'seo_category_id' => $model->seo_category_id, |
51 | 63 | 'id' => $model->seo_dynamic_id, |
52 | - ]), [ | |
53 | - 'title' => "ะ ะตะดะฐะบัะธัะพะฒะฐัั", | |
54 | - ]); | |
64 | + ], [ | |
65 | + 'title' => \Yii::t('app', 'ะ ะตะดะฐะบัะธัะพะฒะฐัั'), | |
66 | + ]); | |
55 | 67 | }, |
56 | 68 | 'delete' => function($url, $model) { |
57 | 69 | ... | ... |
backend/views/seo-dynamic/update.php
1 | 1 | <?php |
2 | 2 | |
3 | + use common\models\SeoCategory; | |
3 | 4 | use common\models\SeoDynamic; |
4 | 5 | use common\models\SeoDynamicLang; |
5 | 6 | use yii\helpers\Html; |
6 | - use yii\helpers\Url; | |
7 | 7 | use yii\web\View; |
8 | 8 | |
9 | 9 | /** |
10 | 10 | * @var View $this |
11 | 11 | * @var SeoDynamic $model |
12 | 12 | * @var SeoDynamicLang[] $model_langs |
13 | - * @var int $seo_category_id | |
13 | + * @var SeoCategory $seo_category | |
14 | 14 | */ |
15 | 15 | |
16 | 16 | $this->title = Yii::t('app', 'Update {modelClass}: ', [ |
17 | 17 | 'modelClass' => 'Seo Dynamic', |
18 | - ]) . $model->seo_dynamic_id; | |
18 | + ]) . $model->lang->name; | |
19 | 19 | $this->params[ 'breadcrumbs' ][] = [ |
20 | - 'label' => Yii::t('app', 'Seo Dynamics'), | |
21 | - 'url' => Url::toRoute([ | |
20 | + 'label' => Yii::t('app', 'Seo Categories'), | |
21 | + 'url' => [ '/seo-category/index' ], | |
22 | + ]; | |
23 | + $this->params[ 'breadcrumbs' ][] = [ | |
24 | + 'label' => $seo_category->lang->name, | |
25 | + 'url' => [ | |
22 | 26 | 'index', |
23 | - 'seo_category_id' => $seo_category_id, | |
24 | - ]), | |
27 | + 'seo_category_id' => $seo_category->seo_category_id, | |
28 | + ], | |
25 | 29 | ]; |
26 | 30 | $this->params[ 'breadcrumbs' ][] = [ |
27 | - 'label' => $model->seo_dynamic_id, | |
28 | - 'url' => Url::toRoute([ | |
31 | + 'label' => $model->lang->name, | |
32 | + 'url' => [ | |
29 | 33 | 'view', |
30 | - 'seo_category_id' => $seo_category_id, | |
34 | + 'seo_category_id' => $seo_category->seo_category_id, | |
31 | 35 | 'id' => $model->seo_dynamic_id, |
32 | - ]), | |
36 | + ], | |
33 | 37 | ]; |
34 | 38 | $this->params[ 'breadcrumbs' ][] = Yii::t('app', 'Update'); |
35 | 39 | ?> | ... | ... |
backend/views/seo-dynamic/view.php
1 | 1 | <?php |
2 | 2 | |
3 | + use common\models\SeoCategory; | |
3 | 4 | use yii\helpers\Html; |
4 | 5 | use yii\widgets\DetailView; |
5 | 6 | |
6 | - /* @var $this yii\web\View */ | |
7 | - /* @var $model common\models\SeoDynamic */ | |
8 | - | |
9 | - $this->title = $model->seo_dynamic_id; | |
7 | + /** | |
8 | + * @var yii\web\View $this | |
9 | + * @var common\models\SeoDynamic $model | |
10 | + * @var SeoCategory $seo_category | |
11 | + */ | |
12 | + $this->title = $model->lang->name; | |
10 | 13 | $this->params[ 'breadcrumbs' ][] = [ |
11 | - 'label' => Yii::t('app', 'Seo Dynamics'), | |
12 | - 'url' => [ 'index' ], | |
14 | + 'label' => Yii::t('app', 'Seo Categories'), | |
15 | + 'url' => [ '/seo-category/index' ], | |
16 | + ]; | |
17 | + $this->params[ 'breadcrumbs' ][] = [ | |
18 | + 'label' => $seo_category->lang->name, | |
19 | + 'url' => [ | |
20 | + 'index', | |
21 | + 'seo_category_id' => $seo_category->seo_category_id, | |
22 | + ], | |
13 | 23 | ]; |
14 | 24 | $this->params[ 'breadcrumbs' ][] = $this->title; |
15 | 25 | ?> |
... | ... | @@ -20,11 +30,13 @@ |
20 | 30 | <p> |
21 | 31 | <?= Html::a(Yii::t('app', 'Update'), [ |
22 | 32 | 'update', |
23 | - 'id' => $model->seo_dynamic_id, | |
33 | + 'id' => $model->seo_dynamic_id, | |
34 | + 'seo_category_id' => $seo_category->seo_category_id, | |
24 | 35 | ], [ 'class' => 'btn btn-primary' ]) ?> |
25 | 36 | <?= Html::a(Yii::t('app', 'Delete'), [ |
26 | 37 | 'delete', |
27 | - 'id' => $model->seo_dynamic_id, | |
38 | + 'id' => $model->seo_dynamic_id, | |
39 | + 'seo_category_id' => $seo_category->seo_category_id, | |
28 | 40 | ], [ |
29 | 41 | 'class' => 'btn btn-danger', |
30 | 42 | 'data' => [ |
... | ... | @@ -35,13 +47,28 @@ |
35 | 47 | </p> |
36 | 48 | |
37 | 49 | <?= DetailView::widget([ |
38 | - 'model' => $model, | |
50 | + 'model' => $model, | |
39 | 51 | 'attributes' => [ |
40 | 52 | 'seo_dynamic_id', |
41 | - 'seo_category_id', | |
53 | + [ | |
54 | + 'label' => \Yii::t('app', 'Seo Category'), | |
55 | + 'value' => Html::a($seo_category->lang->name, [ | |
56 | + 'index', | |
57 | + 'seo_category_id' => $seo_category->seo_category_id, | |
58 | + ]), | |
59 | + 'format' => 'html', | |
60 | + ], | |
61 | + 'lang.name', | |
42 | 62 | 'action', |
43 | 63 | 'fields', |
64 | + 'param', | |
44 | 65 | 'status', |
66 | + 'lang.title', | |
67 | + 'lang.h1', | |
68 | + 'lang.key', | |
69 | + 'lang.meta', | |
70 | + 'lang.description', | |
71 | + 'lang.seo_text', | |
45 | 72 | ], |
46 | 73 | ]) ?> |
47 | 74 | ... | ... |
backend/views/seo/index.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\grid\GridView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $searchModel common\models\SeoSearch */ | |
8 | -/* @var $dataProvider yii\data\ActiveDataProvider */ | |
9 | - | |
10 | -$this->title = Yii::t('app', 'Seo'); | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\grid\GridView; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\SeoSearch $searchModel | |
9 | + * @var yii\data\ActiveDataProvider $dataProvider | |
10 | + */ | |
11 | + $this->title = Yii::t('app', 'Seo'); | |
12 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
12 | 13 | ?> |
13 | 14 | <div class="seo-index"> |
14 | - | |
15 | + | |
15 | 16 | <h1><?= Html::encode($this->title) ?></h1> |
16 | - <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | |
17 | - | |
17 | + | |
18 | 18 | <p> |
19 | - <?= Html::a(Yii::t('app', 'Create Seo'), ['create'], ['class' => 'btn btn-success']) ?> | |
19 | + <?= Html::a(Yii::t('app', 'Create Seo'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?> | |
20 | 20 | </p> |
21 | 21 | <?= GridView::widget([ |
22 | 22 | 'dataProvider' => $dataProvider, |
23 | - 'filterModel' => $searchModel, | |
24 | - 'columns' => [ | |
25 | - ['class' => 'yii\grid\SerialColumn'], | |
23 | + 'filterModel' => $searchModel, | |
24 | + 'columns' => [ | |
25 | + [ 'class' => 'yii\grid\SerialColumn' ], | |
26 | 26 | 'seo_id', |
27 | 27 | 'url', |
28 | - ['class' => 'yii\grid\ActionColumn'], | |
28 | + [ | |
29 | + 'attribute' => 'title', | |
30 | + 'value' => 'lang.title', | |
31 | + ], | |
32 | + [ | |
33 | + 'attribute' => 'description', | |
34 | + 'value' => 'lang.description', | |
35 | + ], | |
36 | + [ | |
37 | + 'attribute' => 'h1', | |
38 | + 'value' => 'lang.h1', | |
39 | + ], | |
40 | + [ | |
41 | + 'attribute' => 'meta', | |
42 | + 'value' => 'lang.meta', | |
43 | + ], | |
44 | + [ | |
45 | + 'attribute' => 'seo_text', | |
46 | + 'value' => 'lang.seo_text', | |
47 | + ], | |
48 | + [ 'class' => 'yii\grid\ActionColumn' ], | |
29 | 49 | ], |
30 | 50 | ]); ?> |
31 | 51 | </div> | ... | ... |
backend/views/seo/update.php
... | ... | @@ -13,13 +13,13 @@ |
13 | 13 | |
14 | 14 | $this->title = Yii::t('app', 'Update {modelClass}: ', [ |
15 | 15 | 'modelClass' => 'Seo', |
16 | - ]) . $model->title; | |
16 | + ]) . $model->url; | |
17 | 17 | $this->params[ 'breadcrumbs' ][] = [ |
18 | 18 | 'label' => Yii::t('app', 'Seos'), |
19 | 19 | 'url' => [ 'index' ], |
20 | 20 | ]; |
21 | 21 | $this->params[ 'breadcrumbs' ][] = [ |
22 | - 'label' => $model->seo_id, | |
22 | + 'label' => $model->url, | |
23 | 23 | 'url' => [ |
24 | 24 | 'view', |
25 | 25 | 'id' => $model->seo_id, | ... | ... |
backend/views/seo/view.php
1 | 1 | <?php |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\DetailView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Seo */ | |
8 | - | |
9 | -$this->title = $model->seo_id; | |
10 | -$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Seos'), 'url' => ['index']]; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
2 | + | |
3 | + use yii\helpers\Html; | |
4 | + use yii\widgets\DetailView; | |
5 | + | |
6 | + /** | |
7 | + * @var yii\web\View $this | |
8 | + * @var common\models\Seo $model | |
9 | + */ | |
10 | + $this->title = $model->url; | |
11 | + $this->params[ 'breadcrumbs' ][] = [ | |
12 | + 'label' => Yii::t('app', 'Seos'), | |
13 | + 'url' => [ 'index' ], | |
14 | + ]; | |
15 | + $this->params[ 'breadcrumbs' ][] = $this->title; | |
12 | 16 | ?> |
13 | 17 | <div class="seo-view"> |
14 | - | |
18 | + | |
15 | 19 | <h1><?= Html::encode($this->title) ?></h1> |
16 | - | |
20 | + | |
17 | 21 | <p> |
18 | - <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->seo_id], ['class' => 'btn btn-primary']) ?> | |
19 | - <?= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->seo_id], [ | |
22 | + <?= Html::a(Yii::t('app', 'Update'), [ | |
23 | + 'update', | |
24 | + 'id' => $model->seo_id, | |
25 | + ], [ 'class' => 'btn btn-primary' ]) ?> | |
26 | + <?= Html::a(Yii::t('app', 'Delete'), [ | |
27 | + 'delete', | |
28 | + 'id' => $model->seo_id, | |
29 | + ], [ | |
20 | 30 | 'class' => 'btn btn-danger', |
21 | - 'data' => [ | |
31 | + 'data' => [ | |
22 | 32 | 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), |
23 | - 'method' => 'post', | |
33 | + 'method' => 'post', | |
24 | 34 | ], |
25 | 35 | ]) ?> |
26 | 36 | </p> |
27 | - | |
37 | + | |
28 | 38 | <?= DetailView::widget([ |
29 | - 'model' => $model, | |
39 | + 'model' => $model, | |
30 | 40 | 'attributes' => [ |
31 | 41 | 'seo_id', |
32 | 42 | 'url', |
43 | + 'lang.title', | |
44 | + 'lang.description', | |
45 | + 'lang.h1', | |
46 | + 'lang.meta', | |
47 | + 'lang.seo_text', | |
33 | 48 | ], |
34 | 49 | ]) ?> |
35 | 50 | ... | ... |
backend/views/subscribe/_form.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\ActiveForm; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Subscribe */ | |
8 | -/* @var $form yii\widgets\ActiveForm */ | |
9 | -?> | |
10 | - | |
11 | -<div class="subscribe-form"> | |
12 | - | |
13 | - <?php $form = ActiveForm::begin(); ?> | |
14 | - | |
15 | - <?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?> | |
16 | - | |
17 | - <?= $form->field($model, 'sale')->textInput() ?> | |
18 | - | |
19 | - <div class="form-group"> | |
20 | - <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> | |
21 | - </div> | |
22 | - | |
23 | - <?php ActiveForm::end(); ?> | |
24 | - | |
25 | -</div> |
backend/views/subscribe/_search.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\ActiveForm; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\SubscribeSearch */ | |
8 | -/* @var $form yii\widgets\ActiveForm */ | |
9 | -?> | |
10 | - | |
11 | -<div class="subscribe-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, 'email') ?> | |
21 | - | |
22 | - <?= $form->field($model, 'sale') ?> | |
23 | - | |
24 | - <?= $form->field($model, 'sand') ?> | |
25 | - | |
26 | - <div class="form-group"> | |
27 | - <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> | |
28 | - <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?> | |
29 | - </div> | |
30 | - | |
31 | - <?php ActiveForm::end(); ?> | |
32 | - | |
33 | -</div> |
backend/views/subscribe/create.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | - | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Subscribe */ | |
8 | - | |
9 | -$this->title = 'Create Subscribe'; | |
10 | -$this->params['breadcrumbs'][] = ['label' => 'Subscribes', 'url' => ['index']]; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
12 | -?> | |
13 | -<div class="subscribe-create"> | |
14 | - | |
15 | - <h1><?= Html::encode($this->title) ?></h1> | |
16 | - | |
17 | - <?= $this->render('_form', [ | |
18 | - 'model' => $model, | |
19 | - ]) ?> | |
20 | - | |
21 | -</div> |
backend/views/subscribe/index.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\grid\GridView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $searchModel common\models\SubscribeSearch */ | |
8 | -/* @var $dataProvider yii\data\ActiveDataProvider */ | |
9 | - | |
10 | -$this->title = 'Subscribes'; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
12 | -?> | |
13 | -<div class="subscribe-index"> | |
14 | - | |
15 | - <h1><?= Html::encode($this->title) ?></h1> | |
16 | - <?php // echo $this->render('_search', ['model' => $searchModel]); ?> | |
17 | - | |
18 | - <p> | |
19 | - <?= Html::a('Create Subscribe', ['create'], ['class' => 'btn btn-success']) ?> | |
20 | - </p> | |
21 | - <?= GridView::widget([ | |
22 | - 'dataProvider' => $dataProvider, | |
23 | - 'filterModel' => $searchModel, | |
24 | - 'columns' => [ | |
25 | - ['class' => 'yii\grid\SerialColumn'], | |
26 | - | |
27 | - 'id', | |
28 | - 'email:email', | |
29 | - 'sale', | |
30 | - 'sand', | |
31 | - | |
32 | - ['class' => 'yii\grid\ActionColumn'], | |
33 | - ], | |
34 | - ]); ?> | |
35 | -</div> |
backend/views/subscribe/update.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | - | |
5 | -/* @var $this yii\web\View */ | |
6 | -/* @var $model common\models\Subscribe */ | |
7 | - | |
8 | -$this->title = 'Update Subscribe: ' . $model->id; | |
9 | -$this->params['breadcrumbs'][] = ['label' => 'Subscribes', 'url' => ['index']]; | |
10 | -$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]]; | |
11 | -$this->params['breadcrumbs'][] = 'Update'; | |
12 | -?> | |
13 | -<div class="subscribe-update"> | |
14 | - | |
15 | - <h1><?= Html::encode($this->title) ?></h1> | |
16 | - | |
17 | - <?= $this->render('_form', [ | |
18 | - 'model' => $model, | |
19 | - ]) ?> | |
20 | - | |
21 | -</div> |
backend/views/subscribe/view.php deleted
1 | -<?php | |
2 | - | |
3 | -use yii\helpers\Html; | |
4 | -use yii\widgets\DetailView; | |
5 | - | |
6 | -/* @var $this yii\web\View */ | |
7 | -/* @var $model common\models\Subscribe */ | |
8 | - | |
9 | -$this->title = $model->id; | |
10 | -$this->params['breadcrumbs'][] = ['label' => 'Subscribes', 'url' => ['index']]; | |
11 | -$this->params['breadcrumbs'][] = $this->title; | |
12 | -?> | |
13 | -<div class="subscribe-view"> | |
14 | - | |
15 | - <h1><?= Html::encode($this->title) ?></h1> | |
16 | - | |
17 | - <p> | |
18 | - <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?> | |
19 | - <?= Html::a('Delete', ['delete', 'id' => $model->id], [ | |
20 | - 'class' => 'btn btn-danger', | |
21 | - 'data' => [ | |
22 | - 'confirm' => '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 | - 'email:email', | |
33 | - 'sale', | |
34 | - 'sand', | |
35 | - ], | |
36 | - ]) ?> | |
37 | - | |
38 | -</div> |
common/models/Bg.php
common/models/BgSearch.php
... | ... | @@ -11,6 +11,8 @@ |
11 | 11 | class BgSearch extends Bg |
12 | 12 | { |
13 | 13 | |
14 | + public $title; | |
15 | + | |
14 | 16 | /** |
15 | 17 | * @inheritdoc |
16 | 18 | */ |
... | ... | @@ -22,7 +24,10 @@ |
22 | 24 | 'integer', |
23 | 25 | ], |
24 | 26 | [ |
25 | - [ 'url' ], | |
27 | + [ | |
28 | + 'url', | |
29 | + 'title', | |
30 | + ], | |
26 | 31 | 'safe', |
27 | 32 | ], |
28 | 33 | ]; |
... | ... | @@ -51,12 +56,23 @@ |
51 | 56 | */ |
52 | 57 | public function search($params) |
53 | 58 | { |
54 | - $query = Bg::find(); | |
59 | + $query = Bg::find() | |
60 | + ->joinWith('lang'); | |
55 | 61 | |
56 | 62 | // add conditions that should always apply here |
57 | 63 | |
58 | 64 | $dataProvider = new ActiveDataProvider([ |
59 | 65 | 'query' => $query, |
66 | + 'sort' => [ | |
67 | + 'attributes' => [ | |
68 | + 'id', | |
69 | + 'url', | |
70 | + 'title' => [ | |
71 | + 'asc' => [ 'bg_lang.title' => SORT_ASC ], | |
72 | + 'desc' => [ 'bg_lang.title' => SORT_DESC ], | |
73 | + ], | |
74 | + ], | |
75 | + ], | |
60 | 76 | ]); |
61 | 77 | |
62 | 78 | $this->load($params); |
... | ... | @@ -76,7 +92,12 @@ |
76 | 92 | 'like', |
77 | 93 | 'url', |
78 | 94 | $this->url, |
79 | - ]); | |
95 | + ]) | |
96 | + ->andFilterWhere([ | |
97 | + 'ilike', | |
98 | + 'bg_lang.title', | |
99 | + $this->title, | |
100 | + ]); | |
80 | 101 | |
81 | 102 | return $dataProvider; |
82 | 103 | } | ... | ... |
common/models/SeoCategorySearch.php
... | ... | @@ -12,6 +12,8 @@ |
12 | 12 | class SeoCategorySearch extends SeoCategory |
13 | 13 | { |
14 | 14 | |
15 | + public $name; | |
16 | + | |
15 | 17 | public function behaviors() |
16 | 18 | { |
17 | 19 | return []; |
... | ... | @@ -31,7 +33,10 @@ |
31 | 33 | 'integer', |
32 | 34 | ], |
33 | 35 | [ |
34 | - [ 'controller' ], | |
36 | + [ | |
37 | + 'controller', | |
38 | + 'name', | |
39 | + ], | |
35 | 40 | 'safe', |
36 | 41 | ], |
37 | 42 | ]; |
... | ... | @@ -55,12 +60,24 @@ |
55 | 60 | */ |
56 | 61 | public function search($params) |
57 | 62 | { |
58 | - $query = SeoCategory::find(); | |
63 | + $query = SeoCategory::find() | |
64 | + ->joinWith('lang'); | |
59 | 65 | |
60 | 66 | // add conditions that should always apply here |
61 | 67 | |
62 | 68 | $dataProvider = new ActiveDataProvider([ |
63 | 69 | 'query' => $query, |
70 | + 'sort' => [ | |
71 | + 'attributes' => [ | |
72 | + 'seo_category_id', | |
73 | + 'controller', | |
74 | + 'status', | |
75 | + 'name' => [ | |
76 | + 'asc' => [ 'seo_category_lang' => SORT_ASC ], | |
77 | + 'desc' => [ 'seo_category_lang' => SORT_DESC ], | |
78 | + ], | |
79 | + ], | |
80 | + ], | |
64 | 81 | ]); |
65 | 82 | |
66 | 83 | $this->load($params); |
... | ... | @@ -78,10 +95,15 @@ |
78 | 95 | ]); |
79 | 96 | |
80 | 97 | $query->andFilterWhere([ |
81 | - 'like', | |
82 | - 'controller', | |
83 | - $this->controller, | |
84 | - ]); | |
98 | + 'like', | |
99 | + 'controller', | |
100 | + $this->controller, | |
101 | + ]) | |
102 | + ->andFilterWhere([ | |
103 | + 'ilike', | |
104 | + 'seo_category_lang.name', | |
105 | + $this->name, | |
106 | + ]); | |
85 | 107 | |
86 | 108 | return $dataProvider; |
87 | 109 | } | ... | ... |
common/models/SeoDynamicSearch.php
... | ... | @@ -12,6 +12,8 @@ |
12 | 12 | class SeoDynamicSearch extends SeoDynamic |
13 | 13 | { |
14 | 14 | |
15 | + public $name; | |
16 | + | |
15 | 17 | public function behaviors() |
16 | 18 | { |
17 | 19 | return []; |
... | ... | @@ -26,7 +28,6 @@ |
26 | 28 | [ |
27 | 29 | [ |
28 | 30 | 'seo_dynamic_id', |
29 | - 'seo_category_id', | |
30 | 31 | 'status', |
31 | 32 | ], |
32 | 33 | 'integer', |
... | ... | @@ -35,6 +36,8 @@ |
35 | 36 | [ |
36 | 37 | 'action', |
37 | 38 | 'fields', |
39 | + 'name', | |
40 | + 'param', | |
38 | 41 | ], |
39 | 42 | 'safe', |
40 | 43 | ], |
... | ... | @@ -53,18 +56,33 @@ |
53 | 56 | /** |
54 | 57 | * Creates data provider instance with search query applied |
55 | 58 | * |
56 | - * @param array $params | |
59 | + * @param integer $seo_category_id | |
60 | + * @param array $params | |
57 | 61 | * |
58 | 62 | * @return ActiveDataProvider |
59 | 63 | */ |
60 | 64 | public function search($seo_category_id, $params) |
61 | 65 | { |
62 | - $query = SeoDynamic::find(); | |
66 | + $query = SeoDynamic::find() | |
67 | + ->joinWith('lang'); | |
63 | 68 | |
64 | 69 | // add conditions that should always apply here |
65 | 70 | |
66 | 71 | $dataProvider = new ActiveDataProvider([ |
67 | 72 | 'query' => $query, |
73 | + 'sort' => [ | |
74 | + 'attributes' => [ | |
75 | + 'seo_dynamic_id', | |
76 | + 'action', | |
77 | + 'fields', | |
78 | + 'status', | |
79 | + 'param', | |
80 | + 'name' => [ | |
81 | + 'asc' => [ 'seo_dynamic_lang.name' => SORT_ASC ], | |
82 | + 'desc' => [ 'seo_dynamic_lang.name' => SORT_DESC ], | |
83 | + ], | |
84 | + ], | |
85 | + ], | |
68 | 86 | ]); |
69 | 87 | |
70 | 88 | $this->load($params); |
... | ... | @@ -76,21 +94,33 @@ |
76 | 94 | } |
77 | 95 | |
78 | 96 | // grid filtering conditions |
79 | - $query->andFilterWhere([ | |
80 | - 'seo_dynamic_id' => $this->seo_dynamic_id, | |
97 | + $query->andWhere([ | |
81 | 98 | 'seo_category_id' => $seo_category_id, |
82 | - 'status' => $this->status, | |
83 | - ]); | |
99 | + ]) | |
100 | + ->andFilterWhere([ | |
101 | + 'seo_dynamic_id' => $this->seo_dynamic_id, | |
102 | + 'status' => $this->status, | |
103 | + ]); | |
84 | 104 | |
85 | 105 | $query->andFilterWhere([ |
86 | - 'like', | |
87 | - 'action', | |
88 | - $this->action, | |
89 | - ]) | |
106 | + 'ilike', | |
107 | + 'action', | |
108 | + $this->action, | |
109 | + ]) | |
90 | 110 | ->andFilterWhere([ |
91 | - 'like', | |
111 | + 'ilike', | |
92 | 112 | 'fields', |
93 | 113 | $this->fields, |
114 | + ]) | |
115 | + ->andFilterWhere([ | |
116 | + 'ilike', | |
117 | + 'param', | |
118 | + $this->param, | |
119 | + ]) | |
120 | + ->andFilterWhere([ | |
121 | + 'ilike', | |
122 | + 'seo_dynamic_lang.name', | |
123 | + $this->name, | |
94 | 124 | ]); |
95 | 125 | |
96 | 126 | return $dataProvider; | ... | ... |
common/models/SeoSearch.php
1 | 1 | <?php |
2 | - | |
3 | -namespace common\models; | |
4 | - | |
5 | -use yii\base\Model; | |
6 | -use yii\data\ActiveDataProvider; | |
7 | - | |
8 | -/** | |
9 | - * SeoSearch represents the model behind the search form about `common\models\Seo`. | |
10 | - */ | |
11 | -class SeoSearch extends Seo | |
12 | -{ | |
13 | 2 | |
14 | - public function behaviors() | |
15 | - { | |
16 | - return []; | |
17 | - } | |
3 | + namespace common\models; | |
4 | + | |
5 | + use yii\base\Model; | |
6 | + use yii\data\ActiveDataProvider; | |
18 | 7 | |
19 | 8 | /** |
20 | - * @inheritdoc | |
21 | - */ | |
22 | - public function rules() | |
23 | - { | |
24 | - return [ | |
25 | - [['seo_id'], 'integer'], | |
26 | - [['url'], 'safe'], | |
27 | - ]; | |
28 | - } | |
29 | - | |
30 | - /** | |
31 | - * @inheritdoc | |
32 | - */ | |
33 | - public function scenarios() | |
34 | - { | |
35 | - // bypass scenarios() implementation in the parent class | |
36 | - return Model::scenarios(); | |
37 | - } | |
38 | - | |
39 | - /** | |
40 | - * Creates data provider instance with search query applied | |
41 | - * | |
42 | - * @param array $params | |
43 | - * | |
44 | - * @return ActiveDataProvider | |
9 | + * SeoSearch represents the model behind the search form about `common\models\Seo`. | |
45 | 10 | */ |
46 | - public function search($params) | |
11 | + class SeoSearch extends Seo | |
47 | 12 | { |
48 | - $query = Seo::find(); | |
49 | - | |
50 | - // add conditions that should always apply here | |
51 | - | |
52 | - $dataProvider = new ActiveDataProvider([ | |
53 | - 'query' => $query, | |
54 | - ]); | |
55 | - | |
56 | - $this->load($params); | |
57 | - | |
58 | - if (!$this->validate()) { | |
59 | - // uncomment the following line if you do not want to return any records when validation fails | |
60 | - // $query->where('0=1'); | |
13 | + | |
14 | + public $title; | |
15 | + | |
16 | + public $description; | |
17 | + | |
18 | + public $h1; | |
19 | + | |
20 | + public $meta; | |
21 | + | |
22 | + public $seo_text; | |
23 | + | |
24 | + public function behaviors() | |
25 | + { | |
26 | + return []; | |
27 | + } | |
28 | + | |
29 | + /** | |
30 | + * @inheritdoc | |
31 | + */ | |
32 | + public function rules() | |
33 | + { | |
34 | + return [ | |
35 | + [ | |
36 | + [ 'seo_id' ], | |
37 | + 'integer', | |
38 | + ], | |
39 | + [ | |
40 | + [ | |
41 | + 'url', | |
42 | + 'title', | |
43 | + 'description', | |
44 | + 'h1', | |
45 | + 'meta', | |
46 | + 'seo_text', | |
47 | + ], | |
48 | + 'safe', | |
49 | + ], | |
50 | + ]; | |
51 | + } | |
52 | + | |
53 | + /** | |
54 | + * @inheritdoc | |
55 | + */ | |
56 | + public function scenarios() | |
57 | + { | |
58 | + // bypass scenarios() implementation in the parent class | |
59 | + return Model::scenarios(); | |
60 | + } | |
61 | + | |
62 | + /** | |
63 | + * Creates data provider instance with search query applied | |
64 | + * | |
65 | + * @param array $params | |
66 | + * | |
67 | + * @return ActiveDataProvider | |
68 | + */ | |
69 | + public function search($params) | |
70 | + { | |
71 | + $query = Seo::find() | |
72 | + ->joinWith('lang'); | |
73 | + | |
74 | + // add conditions that should always apply here | |
75 | + | |
76 | + $dataProvider = new ActiveDataProvider([ | |
77 | + 'query' => $query, | |
78 | + 'sort' => [ | |
79 | + 'attributes' => [ | |
80 | + 'seo_id', | |
81 | + 'url', | |
82 | + 'title' => [ | |
83 | + 'asc' => [ 'seo_lang.title' => SORT_ASC ], | |
84 | + 'desc' => [ 'seo_lang.title' => SORT_DESC ], | |
85 | + ], | |
86 | + 'description' => [ | |
87 | + 'asc' => [ 'seo_lang.description' => SORT_ASC ], | |
88 | + 'desc' => [ 'seo_lang.description' => SORT_DESC ], | |
89 | + ], | |
90 | + 'h1' => [ | |
91 | + 'asc' => [ 'seo_lang.h1' => SORT_ASC ], | |
92 | + 'desc' => [ 'seo_lang.h1' => SORT_DESC ], | |
93 | + ], | |
94 | + 'meta' => [ | |
95 | + 'asc' => [ 'seo_lang.meta' => SORT_ASC ], | |
96 | + 'desc' => [ 'seo_lang.meta' => SORT_DESC ], | |
97 | + ], | |
98 | + 'seo_text' => [ | |
99 | + 'asc' => [ 'seo_lang.seo_text' => SORT_ASC ], | |
100 | + 'desc' => [ 'seo_lang.seo_text' => SORT_DESC ], | |
101 | + ], | |
102 | + ], | |
103 | + ], | |
104 | + ]); | |
105 | + | |
106 | + $this->load($params); | |
107 | + | |
108 | + if(!$this->validate()) { | |
109 | + // uncomment the following line if you do not want to return any records when validation fails | |
110 | + // $query->where('0=1'); | |
111 | + return $dataProvider; | |
112 | + } | |
113 | + | |
114 | + // grid filtering conditions | |
115 | + $query->andFilterWhere([ | |
116 | + 'seo_id' => $this->seo_id, | |
117 | + ]); | |
118 | + | |
119 | + $query->andFilterWhere([ | |
120 | + 'like', | |
121 | + 'url', | |
122 | + $this->url, | |
123 | + ]) | |
124 | + ->andFilterWhere([ | |
125 | + 'ilike', | |
126 | + 'seo_lang.title', | |
127 | + $this->title, | |
128 | + ]) | |
129 | + ->andFilterWhere([ | |
130 | + 'ilike', | |
131 | + 'seo_lang.description', | |
132 | + $this->description, | |
133 | + ]) | |
134 | + ->andFilterWhere([ | |
135 | + 'ilike', | |
136 | + 'seo_lang.h1', | |
137 | + $this->h1, | |
138 | + ]) | |
139 | + ->andFilterWhere([ | |
140 | + 'ilike', | |
141 | + 'seo_lang.meta', | |
142 | + $this->meta, | |
143 | + ]) | |
144 | + ->andFilterWhere([ | |
145 | + 'ilike', | |
146 | + 'seo_lang.seo_text', | |
147 | + $this->seo_text, | |
148 | + ]); | |
149 | + | |
61 | 150 | return $dataProvider; |
62 | 151 | } |
63 | - | |
64 | - // grid filtering conditions | |
65 | - $query->andFilterWhere([ | |
66 | - 'seo_id' => $this->seo_id, | |
67 | - ]); | |
68 | - | |
69 | - $query->andFilterWhere(['like', 'url', $this->url]); | |
70 | - | |
71 | - return $dataProvider; | |
72 | 152 | } |
73 | -} | ... | ... |
common/models/Subscribe.php deleted
1 | -<?php | |
2 | - | |
3 | -namespace common\models; | |
4 | - | |
5 | -use Yii; | |
6 | - | |
7 | -class Subscribe extends \yii\db\ActiveRecord | |
8 | -{ | |
9 | - public static function tableName() | |
10 | - { | |
11 | - return 'subscribe'; | |
12 | - } | |
13 | - | |
14 | - public function rules() | |
15 | - { | |
16 | - return [ | |
17 | - [['email','sale'], 'required'], | |
18 | - [['email'], 'email'], | |
19 | - [['email'], 'is_email'], | |
20 | - ]; | |
21 | - } | |
22 | - | |
23 | - public function is_email($attribute){ | |
24 | - if(self::find() | |
25 | - ->where('email = :email', [':email' => $this->email]) | |
26 | - ->exists()) | |
27 | - $this->addError('email', Yii::t('app', 'emailis')); | |
28 | - } | |
29 | - | |
30 | -} | |
31 | 0 | \ No newline at end of file |
common/models/SubscribeSearch.php deleted
1 | -<?php | |
2 | - | |
3 | -namespace common\models; | |
4 | - | |
5 | -use Yii; | |
6 | -use yii\base\Model; | |
7 | -use yii\data\ActiveDataProvider; | |
8 | -use common\models\Subscribe; | |
9 | - | |
10 | -/** | |
11 | - * SubscribeSearch represents the model behind the search form about `common\models\Subscribe`. | |
12 | - */ | |
13 | -class SubscribeSearch extends Subscribe | |
14 | -{ | |
15 | - /** | |
16 | - * @inheritdoc | |
17 | - */ | |
18 | - public function rules() | |
19 | - { | |
20 | - return [ | |
21 | - [['id', 'sale', 'sand'], 'integer'], | |
22 | - [['email'], '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 = Subscribe::find(); | |
45 | - | |
46 | - // add conditions that should always apply here | |
47 | - | |
48 | - $dataProvider = new ActiveDataProvider([ | |
49 | - 'query' => $query, | |
50 | - ]); | |
51 | - | |
52 | - $this->load($params); | |
53 | - | |
54 | - if (!$this->validate()) { | |
55 | - // uncomment the following line if you do not want to return any records when validation fails | |
56 | - // $query->where('0=1'); | |
57 | - return $dataProvider; | |
58 | - } | |
59 | - | |
60 | - // grid filtering conditions | |
61 | - $query->andFilterWhere([ | |
62 | - 'id' => $this->id, | |
63 | - 'sale' => $this->sale, | |
64 | - 'sand' => $this->sand, | |
65 | - ]); | |
66 | - | |
67 | - $query->andFilterWhere(['like', 'email', $this->email]); | |
68 | - | |
69 | - return $dataProvider; | |
70 | - } | |
71 | -} |