@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * @var array |
43 | 43 | */ |
44 | - public $albums = []; |
|
44 | + public $albums = [ ]; |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * @var int |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | ], |
107 | 107 | [ |
108 | 108 | UploadModelInterface::FILE_TYPE_THUMB, |
109 | - function($attribute){ |
|
110 | - if (!is_numeric($this->{$attribute}) && !is_string($this->{$attribute})){ |
|
109 | + function($attribute) { |
|
110 | + if (!is_numeric($this->{$attribute}) && !is_string($this->{$attribute})) { |
|
111 | 111 | $this->addError($attribute, 'Tumbnail content must be a numeric or string.'); |
112 | 112 | } |
113 | 113 | }, |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | [ |
117 | 117 | 'albums', |
118 | 118 | 'each', |
119 | - 'rule' => ['integer'], |
|
119 | + 'rule' => [ 'integer' ], |
|
120 | 120 | ], |
121 | 121 | ]; |
122 | 122 | } |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | * |
272 | 272 | * @return mixed |
273 | 273 | */ |
274 | - public function getDefaultThumbImage(array $options = []) |
|
274 | + public function getDefaultThumbImage(array $options = [ ]) |
|
275 | 275 | { |
276 | 276 | $thumbnailModel = $this->getThumbnailModel(); |
277 | 277 | |
278 | - if (null === $thumbnailModel){ |
|
278 | + if (null === $thumbnailModel) { |
|
279 | 279 | return null; |
280 | 280 | } |
281 | 281 | |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | return null; |
286 | 286 | } |
287 | 287 | |
288 | - if (empty($options['alt'])) { |
|
289 | - $options['alt'] = $thumbnailModel->alt; |
|
288 | + if (empty($options[ 'alt' ])) { |
|
289 | + $options[ 'alt' ] = $thumbnailModel->alt; |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | return Html::img($url, $options); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * @var array |
48 | 48 | */ |
49 | - public $albums = []; |
|
49 | + public $albums = [ ]; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @var array|null|\yii\db\ActiveRecord|Mediafile |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | 'exist', |
114 | 114 | 'skipOnError' => true, |
115 | 115 | 'targetClass' => Page::class, |
116 | - 'targetAttribute' => ['pageId' => 'id'] |
|
116 | + 'targetAttribute' => [ 'pageId' => 'id' ] |
|
117 | 117 | ], |
118 | 118 | [ |
119 | 119 | UploadModelInterface::FILE_TYPE_THUMB, |
120 | - function($attribute){ |
|
121 | - if (!is_numeric($this->{$attribute}) && !is_string($this->{$attribute})){ |
|
120 | + function($attribute) { |
|
121 | + if (!is_numeric($this->{$attribute}) && !is_string($this->{$attribute})) { |
|
122 | 122 | $this->addError($attribute, 'Tumbnail content must be a numeric or string.'); |
123 | 123 | } |
124 | 124 | }, |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | [ |
137 | 137 | 'albums', |
138 | 138 | 'each', |
139 | - 'rule' => ['integer'], |
|
139 | + 'rule' => [ 'integer' ], |
|
140 | 140 | ], |
141 | 141 | ]; |
142 | 142 | } |
@@ -251,11 +251,11 @@ discard block |
||
251 | 251 | * |
252 | 252 | * @return mixed |
253 | 253 | */ |
254 | - public function getDefaultThumbImage(array $options = []) |
|
254 | + public function getDefaultThumbImage(array $options = [ ]) |
|
255 | 255 | { |
256 | 256 | $thumbnailModel = $this->getThumbnailModel(); |
257 | 257 | |
258 | - if (null === $thumbnailModel){ |
|
258 | + if (null === $thumbnailModel) { |
|
259 | 259 | return null; |
260 | 260 | } |
261 | 261 | |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | return null; |
266 | 266 | } |
267 | 267 | |
268 | - if (empty($options['alt'])) { |
|
269 | - $options['alt'] = $thumbnailModel->alt; |
|
268 | + if (empty($options[ 'alt' ])) { |
|
269 | + $options[ 'alt' ] = $thumbnailModel->alt; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | return Html::img($url, $options); |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | 'filebrowserWindowHeight' => '700', |
52 | 52 | 'extraPlugins' => 'pbckcode', |
53 | 53 | 'toolbarGroups' => [ |
54 | - ['name' => 'pbckcode'] |
|
54 | + [ 'name' => 'pbckcode' ] |
|
55 | 55 | ], |
56 | 56 | 'allowedContent' => true, |
57 | - 'language' => $this->params['shortLanguage'], |
|
57 | + 'language' => $this->params[ 'shortLanguage' ], |
|
58 | 58 | ] |
59 | 59 | ], |
60 | 60 | [ |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | ])->label(Yii::t('app', 'Icon html class')); ?> |
80 | 80 | <div class="row" style="margin-bottom: 15px;"> |
81 | 81 | <div class="col-md-4"> |
82 | - <?php if(!$model->mainModel->isNewRecord): ?> |
|
83 | - <?php echo Html::tag('i', '', ['class' => empty($model->mainModel->icon) ? 'fa fa-file fa-2x' : $model->mainModel->icon]) ?> |
|
82 | + <?php if (!$model->mainModel->isNewRecord): ?> |
|
83 | + <?php echo Html::tag('i', '', [ 'class' => empty($model->mainModel->icon) ? 'fa fa-file fa-2x' : $model->mainModel->icon ]) ?> |
|
84 | 84 | <?php endif; ?> |
85 | 85 | <?php echo Html::a('Fontawesome icons', Url::to('https://fontawesome.ru/all-icons/'), [ |
86 | 86 | 'target' => '_blank' |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | <!-- Thumbnail end --> |
101 | 101 | |
102 | 102 | <?php echo $form->field($model, 'active') |
103 | - ->radioList([1 => Yii::t('app', 'Active'), 0 => Yii::t('app', 'Inactive')]) |
|
103 | + ->radioList([ 1 => Yii::t('app', 'Active'), 0 => Yii::t('app', 'Inactive') ]) |
|
104 | 104 | ->label(Yii::t('app', 'Active status')); ?> |
105 | 105 | |
106 | 106 | <?php echo Html::label(Yii::t('app', 'Parent object'), 'multi-level-menu', [ |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | ], |
116 | 116 | 'mainContainerOptions' => [ |
117 | 117 | 'levels' => [ |
118 | - ['style' => 'margin-left: 0; padding-left: 0;'], |
|
119 | - ['style' => 'margin-left: 10px; padding-left: 10px;'], |
|
118 | + [ 'style' => 'margin-left: 0; padding-left: 0;' ], |
|
119 | + [ 'style' => 'margin-left: 10px; padding-left: 10px;' ], |
|
120 | 120 | ] |
121 | 121 | ], |
122 | 122 | 'itemContainerOptions' => [ |
@@ -5,21 +5,21 @@ |
||
5 | 5 | /* @var $pages array|\yii\db\ActiveRecord[] */ |
6 | 6 | /* @var $albums Itstructure\MFUploader\models\album\Album[] */ |
7 | 7 | |
8 | -$this->title = Yii::t('pages', 'Update page').': ' . $model->mainModel->getDefaultTranslate('title'); |
|
9 | -$this->params['breadcrumbs'][] = [ |
|
8 | +$this->title = Yii::t('pages', 'Update page').': '.$model->mainModel->getDefaultTranslate('title'); |
|
9 | +$this->params[ 'breadcrumbs' ][ ] = [ |
|
10 | 10 | 'label' => Yii::t('pages', 'Pages'), |
11 | 11 | 'url' => [ |
12 | - $this->params['urlPrefix'].'index' |
|
12 | + $this->params[ 'urlPrefix' ].'index' |
|
13 | 13 | ] |
14 | 14 | ]; |
15 | -$this->params['breadcrumbs'][] = [ |
|
15 | +$this->params[ 'breadcrumbs' ][ ] = [ |
|
16 | 16 | 'label' => $model->mainModel->getDefaultTranslate('title'), |
17 | 17 | 'url' => [ |
18 | - $this->params['urlPrefix'].'view', |
|
18 | + $this->params[ 'urlPrefix' ].'view', |
|
19 | 19 | 'id' => $model->id |
20 | 20 | ] |
21 | 21 | ]; |
22 | -$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); |
|
22 | +$this->params[ 'breadcrumbs' ][ ] = Yii::t('app', 'Update'); |
|
23 | 23 | ?> |
24 | 24 | <div class="page-update"> |
25 | 25 |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | /* @var $albumsDataProvider yii\data\ArrayDataProvider */ |
16 | 16 | |
17 | 17 | $this->title = $model->getDefaultTranslate('title'); |
18 | -$this->params['breadcrumbs'][] = [ |
|
18 | +$this->params[ 'breadcrumbs' ][ ] = [ |
|
19 | 19 | 'label' => Yii::t('pages', 'Pages'), |
20 | 20 | 'url' => [ |
21 | - $this->params['urlPrefix'].'index' |
|
21 | + $this->params[ 'urlPrefix' ].'index' |
|
22 | 22 | ] |
23 | 23 | ]; |
24 | -$this->params['breadcrumbs'][] = $this->title; |
|
24 | +$this->params[ 'breadcrumbs' ][ ] = $this->title; |
|
25 | 25 | ?> |
26 | 26 | |
27 | 27 | <style> |
@@ -35,14 +35,14 @@ discard block |
||
35 | 35 | |
36 | 36 | <p> |
37 | 37 | <?php echo Html::a(Yii::t('app', 'Update'), [ |
38 | - $this->params['urlPrefix'].'update', |
|
38 | + $this->params[ 'urlPrefix' ].'update', |
|
39 | 39 | 'id' => $model->id |
40 | 40 | ], [ |
41 | 41 | 'class' => 'btn btn-primary' |
42 | 42 | ]) ?> |
43 | 43 | |
44 | 44 | <?php echo Html::a(Yii::t('app', 'Delete'), [ |
45 | - $this->params['urlPrefix'].'delete', |
|
45 | + $this->params[ 'urlPrefix' ].'delete', |
|
46 | 46 | 'id' => $model->id |
47 | 47 | ], [ |
48 | 48 | 'class' => 'btn btn-danger', |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | 'label' => Yii::t('app', 'Icon'), |
90 | 90 | 'value' => function($model) { |
91 | 91 | /* @var $model Page */ |
92 | - return Html::tag('i', '', ['class' => empty($model->icon) ? 'fa fa-file fa-2x' : $model->icon]); |
|
92 | + return Html::tag('i', '', [ 'class' => empty($model->icon) ? 'fa fa-file fa-2x' : $model->icon ]); |
|
93 | 93 | }, |
94 | 94 | 'format' => 'raw', |
95 | 95 | ], |
96 | 96 | 'thumbnail' => [ |
97 | 97 | 'label' => MFUModule::t('main', 'Thumbnail'), |
98 | - 'value' => function ($model) { |
|
98 | + 'value' => function($model) { |
|
99 | 99 | /* @var $model Page */ |
100 | 100 | $thumbnailModel = $model->getThumbnailModel(); |
101 | 101 | return $thumbnailModel == null ? '' : Html::a($model->getDefaultThumbImage(), Url::to($thumbnailModel->getThumbUrl(MFUModule::THUMB_ALIAS_LARGE)), [ |
@@ -108,22 +108,22 @@ discard block |
||
108 | 108 | 'label' => Yii::t('app', 'Active status'), |
109 | 109 | 'value' => function($model) { |
110 | 110 | /* @var $model Page */ |
111 | - if ($model->active == 1){ |
|
112 | - return '<i class="fa fa-check-circle text-success"> ' . Yii::t('app', 'Active') . '</i>'; |
|
111 | + if ($model->active == 1) { |
|
112 | + return '<i class="fa fa-check-circle text-success"> '.Yii::t('app', 'Active').'</i>'; |
|
113 | 113 | } else { |
114 | - return '<i class="fa fa-times text-danger"> ' . Yii::t('app', 'Inactive') . '</i>'; |
|
114 | + return '<i class="fa fa-times text-danger"> '.Yii::t('app', 'Inactive').'</i>'; |
|
115 | 115 | } |
116 | 116 | }, |
117 | 117 | 'format' => 'raw', |
118 | 118 | ], |
119 | 119 | [ |
120 | 120 | 'attribute' => 'created_at', |
121 | - 'format' => ['date', 'dd.MM.Y HH:mm:ss'], |
|
121 | + 'format' => [ 'date', 'dd.MM.Y HH:mm:ss' ], |
|
122 | 122 | 'label' => Yii::t('app', 'Created date'), |
123 | 123 | ], |
124 | 124 | [ |
125 | 125 | 'attribute' => 'updated_at', |
126 | - 'format' => ['date', 'dd.MM.Y HH:mm:ss'], |
|
126 | + 'format' => [ 'date', 'dd.MM.Y HH:mm:ss' ], |
|
127 | 127 | 'label' => Yii::t('app', 'Updated date'), |
128 | 128 | ], |
129 | 129 | ], |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | return Html::a( |
143 | 143 | $item->getDefaultThumbImage(), |
144 | 144 | Url::to([ |
145 | - '/'.$this->params['shortLanguage'].'/mfuploader/'.$item->getFileType($item->type).'-album/view', 'id' => $item->id |
|
145 | + '/'.$this->params[ 'shortLanguage' ].'/mfuploader/'.$item->getFileType($item->type).'-album/view', 'id' => $item->id |
|
146 | 146 | ]) |
147 | 147 | ); |
148 | 148 | }, |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | return Html::a( |
156 | 156 | Html::encode($item->title), |
157 | 157 | Url::to([ |
158 | - '/'.$this->params['shortLanguage'].'/mfuploader/'.$item->getFileType($item->type).'-album/view', 'id' => $item->id |
|
158 | + '/'.$this->params[ 'shortLanguage' ].'/mfuploader/'.$item->getFileType($item->type).'-album/view', 'id' => $item->id |
|
159 | 159 | ]) |
160 | 160 | ); |
161 | 161 | }, |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | ]); ?> |
166 | 166 | |
167 | 167 | <?php echo Html::a(Yii::t('pages', 'View products'), [ |
168 | - '/'.$this->params['shortLanguage'].'/admin/products/index', 'ProductSearch[pageId]' => $model->id |
|
168 | + '/'.$this->params[ 'shortLanguage' ].'/admin/products/index', 'ProductSearch[pageId]' => $model->id |
|
169 | 169 | ], [ |
170 | 170 | 'class' => 'btn btn-primary' |
171 | 171 | ]) ?> |
@@ -6,13 +6,13 @@ |
||
6 | 6 | /* @var $albums Itstructure\MFUploader\models\album\Album[] */ |
7 | 7 | |
8 | 8 | $this->title = Yii::t('pages', 'Create page'); |
9 | -$this->params['breadcrumbs'][] = [ |
|
9 | +$this->params[ 'breadcrumbs' ][ ] = [ |
|
10 | 10 | 'label' => Yii::t('pages', 'Pages'), |
11 | 11 | 'url' => [ |
12 | - $this->params['urlPrefix'].'index' |
|
12 | + $this->params[ 'urlPrefix' ].'index' |
|
13 | 13 | ] |
14 | 14 | ]; |
15 | -$this->params['breadcrumbs'][] = Yii::t('app', 'Create'); |
|
15 | +$this->params[ 'breadcrumbs' ][ ] = Yii::t('app', 'Create'); |
|
16 | 16 | ?> |
17 | 17 | <div class="page-create"> |
18 | 18 |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | 'filebrowserWindowHeight' => '700', |
58 | 58 | 'extraPlugins' => 'pbckcode', |
59 | 59 | 'toolbarGroups' => [ |
60 | - ['name' => 'pbckcode'] |
|
60 | + [ 'name' => 'pbckcode' ] |
|
61 | 61 | ], |
62 | 62 | 'allowedContent' => true, |
63 | - 'language' => $this->params['shortLanguage'], |
|
63 | + 'language' => $this->params[ 'shortLanguage' ], |
|
64 | 64 | ] |
65 | 65 | ], |
66 | 66 | [ |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | ])->label(Yii::t('app', 'Icon html class')); ?> |
86 | 86 | <div class="row" style="margin-bottom: 15px;"> |
87 | 87 | <div class="col-md-12"> |
88 | - <?php if(!$model->mainModel->isNewRecord): ?> |
|
89 | - <?php echo Html::tag('i', '', ['class' => empty($model->mainModel->icon) ? 'fa fa-file fa-2x' : $model->mainModel->icon]) ?> |
|
88 | + <?php if (!$model->mainModel->isNewRecord): ?> |
|
89 | + <?php echo Html::tag('i', '', [ 'class' => empty($model->mainModel->icon) ? 'fa fa-file fa-2x' : $model->mainModel->icon ]) ?> |
|
90 | 90 | <?php endif; ?> |
91 | 91 | <?php echo Html::a('Fontawesome icons', Url::to('https://fontawesome.ru/all-icons/'), [ |
92 | 92 | 'target' => '_blank' |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | <?php |
95 | 95 | Modal::begin([ |
96 | 96 | 'header' => '<h2>Fe icons</h2>', |
97 | - 'toggleButton' => ['label' => 'Fe icons'] |
|
97 | + 'toggleButton' => [ 'label' => 'Fe icons' ] |
|
98 | 98 | ]); |
99 | 99 | require __DIR__.'/../icons/fe-icons.php'; |
100 | 100 | Modal::end(); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | <!-- Thumbnail end --> |
115 | 115 | |
116 | 116 | <?php echo $form->field($model, 'active') |
117 | - ->radioList([1 => Yii::t('app', 'Active'), 0 => Yii::t('app', 'Inactive')]) |
|
117 | + ->radioList([ 1 => Yii::t('app', 'Active'), 0 => Yii::t('app', 'Inactive') ]) |
|
118 | 118 | ->label(Yii::t('app', 'Active status')); ?> |
119 | 119 | |
120 | 120 | <div class="form-group <?php if ($model->hasErrors('pageId')):?>has-error<?php endif; ?>"> |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | ], |
131 | 131 | 'mainContainerOptions' => [ |
132 | 132 | 'levels' => [ |
133 | - ['style' => 'margin-left: 0; padding-left: 0;'], |
|
134 | - ['style' => 'margin-left: 10px; padding-left: 10px;'], |
|
133 | + [ 'style' => 'margin-left: 0; padding-left: 0;' ], |
|
134 | + [ 'style' => 'margin-left: 10px; padding-left: 10px;' ], |
|
135 | 135 | ] |
136 | 136 | ], |
137 | 137 | 'itemContainerOptions' => [ |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | <div class="row"> |
163 | 163 | <div class="col-md-12"> |
164 | 164 | <h5><?php echo MFUModule::t('main', 'New files'); ?></h5> |
165 | - <?php for ($i=1; $i < 5; $i++): ?> |
|
165 | + <?php for ($i = 1; $i < 5; $i++): ?> |
|
166 | 166 | <?php echo $this->render('../mediafiles/_new-mediafiles', [ |
167 | 167 | 'model' => $model, |
168 | 168 | 'fileType' => UploadModelInterface::FILE_TYPE_IMAGE, |
@@ -9,21 +9,21 @@ |
||
9 | 9 | /* @var $images Mediafile[] */ |
10 | 10 | /* @var $media_pages Pagination */ |
11 | 11 | |
12 | -$this->title = Yii::t('products', 'Update product').': ' . $model->mainModel->getDefaultTranslate('title'); |
|
13 | -$this->params['breadcrumbs'][] = [ |
|
12 | +$this->title = Yii::t('products', 'Update product').': '.$model->mainModel->getDefaultTranslate('title'); |
|
13 | +$this->params[ 'breadcrumbs' ][ ] = [ |
|
14 | 14 | 'label' => Yii::t('products', 'Products'), |
15 | 15 | 'url' => [ |
16 | - $this->params['urlPrefix'].'index' |
|
16 | + $this->params[ 'urlPrefix' ].'index' |
|
17 | 17 | ] |
18 | 18 | ]; |
19 | -$this->params['breadcrumbs'][] = [ |
|
19 | +$this->params[ 'breadcrumbs' ][ ] = [ |
|
20 | 20 | 'label' => $model->mainModel->getDefaultTranslate('title'), |
21 | 21 | 'url' => [ |
22 | - $this->params['urlPrefix'].'view', |
|
22 | + $this->params[ 'urlPrefix' ].'view', |
|
23 | 23 | 'id' => $model->id |
24 | 24 | ] |
25 | 25 | ]; |
26 | -$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); |
|
26 | +$this->params[ 'breadcrumbs' ][ ] = Yii::t('app', 'Update'); |
|
27 | 27 | ?> |
28 | 28 | <div class="product-update"> |
29 | 29 |
@@ -11,21 +11,21 @@ discard block |
||
11 | 11 | /* @var $this Itstructure\AdminModule\components\AdminView */ |
12 | 12 | |
13 | 13 | $this->title = Yii::t('products', 'Products'); |
14 | -$this->params['breadcrumbs'][] = $this->title; |
|
14 | +$this->params[ 'breadcrumbs' ][ ] = $this->title; |
|
15 | 15 | ?> |
16 | 16 | <div class="product-index"> |
17 | 17 | |
18 | - <?php echo $this->render('_search', ['model' => $searchModel]); ?> |
|
18 | + <?php echo $this->render('_search', [ 'model' => $searchModel ]); ?> |
|
19 | 19 | |
20 | 20 | <p> |
21 | 21 | <?php echo Html::a(Yii::t('products', 'Create product'), [ |
22 | - $this->params['urlPrefix'].'create' |
|
22 | + $this->params[ 'urlPrefix' ].'create' |
|
23 | 23 | ], [ |
24 | 24 | 'class' => 'btn btn-success' |
25 | 25 | ]) ?> |
26 | 26 | </p> |
27 | 27 | |
28 | - <?php echo LinkPager::widget(['pagination' => $dataProvider->getPagination()]) ?> |
|
28 | + <?php echo LinkPager::widget([ 'pagination' => $dataProvider->getPagination() ]) ?> |
|
29 | 29 | |
30 | 30 | <?php echo GridView::widget([ |
31 | 31 | 'dataProvider' => $dataProvider, |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | 'value' => function($searchModel) { |
39 | 39 | /* @var $searchModel ProductSearch */ |
40 | 40 | return Html::a( |
41 | - Html::tag('i', '', ['class' => empty($searchModel->icon) ? 'fa fa-file fa-2x' : $searchModel->icon]), |
|
42 | - Url::to([$this->params['urlPrefix'].'view', 'id' => $searchModel->id]) |
|
41 | + Html::tag('i', '', [ 'class' => empty($searchModel->icon) ? 'fa fa-file fa-2x' : $searchModel->icon ]), |
|
42 | + Url::to([ $this->params[ 'urlPrefix' ].'view', 'id' => $searchModel->id ]) |
|
43 | 43 | ); |
44 | 44 | }, |
45 | 45 | 'format' => 'raw', |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | /* @var $data ProductSearch */ |
51 | 51 | $defaultThumbImage = $data->getDefaultThumbImage(); |
52 | 52 | return !empty($defaultThumbImage) ? Html::a($defaultThumbImage, Url::to([ |
53 | - $this->params['urlPrefix'].'view', |
|
53 | + $this->params[ 'urlPrefix' ].'view', |
|
54 | 54 | 'id' => $data->id |
55 | 55 | ])) : ''; |
56 | 56 | }, |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /* @var $searchModel ProductSearch */ |
63 | 63 | return Html::a( |
64 | 64 | Html::encode($searchModel->getDefaultTranslate('title')), |
65 | - Url::to([$this->params['urlPrefix'].'view', 'id' => $searchModel->id]) |
|
65 | + Url::to([ $this->params[ 'urlPrefix' ].'view', 'id' => $searchModel->id ]) |
|
66 | 66 | ); |
67 | 67 | }, |
68 | 68 | 'format' => 'raw', |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | ], |
78 | 78 | 'page' => [ |
79 | 79 | 'label' => Yii::t('products', 'Parent page'), |
80 | - 'value' => function ($searchModel) { |
|
80 | + 'value' => function($searchModel) { |
|
81 | 81 | /* @var $searchModel app\models\ProductSearch */ |
82 | 82 | return null === $searchModel->page ? '' : Html::a( |
83 | 83 | $searchModel->page->getDefaultTranslate('title'), |
84 | - Url::to(['/'.$this->params['shortLanguage'].'/admin/pages/view', 'id' => $searchModel->page->id]), |
|
84 | + Url::to([ '/'.$this->params[ 'shortLanguage' ].'/admin/pages/view', 'id' => $searchModel->page->id ]), |
|
85 | 85 | [ |
86 | 86 | 'target' => '_blank' |
87 | 87 | ] |
@@ -91,22 +91,22 @@ discard block |
||
91 | 91 | ], |
92 | 92 | [ |
93 | 93 | 'attribute' => 'created_at', |
94 | - 'format' => ['date', 'dd.MM.Y HH:mm:ss'], |
|
94 | + 'format' => [ 'date', 'dd.MM.Y HH:mm:ss' ], |
|
95 | 95 | 'label' => Yii::t('app', 'Created date'), |
96 | 96 | ], |
97 | 97 | [ |
98 | 98 | 'attribute' => 'updated_at', |
99 | - 'format' => ['date', 'dd.MM.Y HH:mm:ss'], |
|
99 | + 'format' => [ 'date', 'dd.MM.Y HH:mm:ss' ], |
|
100 | 100 | 'label' => Yii::t('app', 'Updated date'), |
101 | 101 | ], |
102 | 102 | 'active' => [ |
103 | 103 | 'label' => Yii::t('app', 'Active status'), |
104 | 104 | 'value' => function($searchModel) { |
105 | 105 | /* @var $searchModel app\models\Product */ |
106 | - if ($searchModel->active == 1){ |
|
107 | - return '<i class="fa fa-check-circle text-success"> ' . Yii::t('app', 'Active') . '</i>'; |
|
106 | + if ($searchModel->active == 1) { |
|
107 | + return '<i class="fa fa-check-circle text-success"> '.Yii::t('app', 'Active').'</i>'; |
|
108 | 108 | } else { |
109 | - return '<i class="fa fa-times text-danger"> ' . Yii::t('app', 'Inactive') . '</i>'; |
|
109 | + return '<i class="fa fa-times text-danger"> '.Yii::t('app', 'Inactive').'</i>'; |
|
110 | 110 | } |
111 | 111 | }, |
112 | 112 | 'format' => 'raw', |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | 'class' => 'yii\grid\ActionColumn', |
116 | 116 | 'header' => Yii::t('app', 'Actions'), |
117 | 117 | 'template' => '{view} {update} {delete}', |
118 | - 'urlCreator'=>function($action, $model, $key, $index){ |
|
118 | + 'urlCreator'=>function($action, $model, $key, $index) { |
|
119 | 119 | return Url::to([ |
120 | - $this->params['urlPrefix'].$action, |
|
120 | + $this->params[ 'urlPrefix' ].$action, |
|
121 | 121 | 'id' => $model->id |
122 | 122 | ]); |
123 | 123 | } |