@@ -63,7 +63,7 @@ |
||
63 | 63 | 'range' => static::find()->select(['name'])->column(), |
64 | 64 | 'message' => 'Menu "{value}" not found.'], |
65 | 65 | [['parent', 'route', 'icon', 'data', 'sort'], 'default'], |
66 | - [['parent'], 'filterParent', 'when' => function () { |
|
66 | + [['parent'], 'filterParent', 'when' => function() { |
|
67 | 67 | return !$this->isNewRecord; |
68 | 68 | }], |
69 | 69 | [['sort'], 'integer'], |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | [ |
76 | 76 | 'first' => [ |
77 | 77 | 'icon' => 'triangle-top', |
78 | - 'visible' => function ($model) { |
|
78 | + 'visible' => function($model) { |
|
79 | 79 | /* @var $model \yii\db\BaseActiveRecord */ |
80 | 80 | if ($this->attribute !== null && isset($model[$this->attribute])) { |
81 | 81 | return $model[$this->attribute] > 1; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ], |
91 | 91 | 'last' => [ |
92 | 92 | 'icon' => 'triangle-bottom', |
93 | - 'visible' => function ($model) { |
|
93 | + 'visible' => function($model) { |
|
94 | 94 | /* @var $model \yii\db\BaseActiveRecord */ |
95 | 95 | if ($this->attribute !== null && isset($model[$this->attribute])) { |
96 | 96 | return $model[$this->attribute] < $this->grid->dataProvider->getTotalCount(); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | ], |
106 | 106 | 'prev' => [ |
107 | 107 | 'icon' => 'arrow-up', |
108 | - 'visible' => function ($model) { |
|
108 | + 'visible' => function($model) { |
|
109 | 109 | /* @var $model \yii\db\BaseActiveRecord */ |
110 | 110 | if ($this->attribute !== null && isset($model[$this->attribute])) { |
111 | 111 | return $model[$this->attribute] > 1; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | ], |
121 | 121 | 'next' => [ |
122 | 122 | 'icon' => 'arrow-down', |
123 | - 'visible' => function ($model) { |
|
123 | + 'visible' => function($model) { |
|
124 | 124 | /* @var $model \yii\db\BaseActiveRecord */ |
125 | 125 | if ($this->attribute !== null && isset($model[$this->attribute])) { |
126 | 126 | return $model[$this->attribute] < $this->grid->dataProvider->getTotalCount(); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | protected function renderDataCellContent($model, $key, $index) |
145 | 145 | { |
146 | 146 | if ($this->content === null) { |
147 | - return preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches) use ($model, $key, $index) { |
|
147 | + return preg_replace_callback('/\\{([\w\-\/]+)\\}/', function($matches) use ($model, $key, $index) { |
|
148 | 148 | $name = $matches[1]; |
149 | 149 | if ($name === 'value') { |
150 | 150 | return $this->grid->formatter->format($this->getDataCellValue($model, $key, $index), $this->format); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } else { |
243 | 243 | $params = array_merge( |
244 | 244 | Yii::$app->getRequest()->getQueryParams(), |
245 | - is_array($key) ? $key : ['id' => (string) $key] |
|
245 | + is_array($key) ? $key : ['id' => (string)$key] |
|
246 | 246 | ); |
247 | 247 | $params[$this->positionParam] = $position; |
248 | 248 | $params[0] = $this->route; |
@@ -244,14 +244,14 @@ discard block |
||
244 | 244 | } else { |
245 | 245 | $options = $this->rowOptions; |
246 | 246 | } |
247 | - $options['data-key'] = is_array($key) ? json_encode($key) : (string) $key; |
|
247 | + $options['data-key'] = is_array($key) ? json_encode($key) : (string)$key; |
|
248 | 248 | |
249 | 249 | $id = ArrayHelper::getValue($model, $this->keyColumnName); |
250 | 250 | Html::addCssClass($options, "treegrid-$id"); |
251 | 251 | |
252 | 252 | $parentId = ArrayHelper::getValue($model, $this->parentColumnName); |
253 | 253 | if ($parentId) { |
254 | - if(ArrayHelper::getValue($this->pluginOptions, 'initialState') == 'collapsed'){ |
|
254 | + if (ArrayHelper::getValue($this->pluginOptions, 'initialState') == 'collapsed') { |
|
255 | 255 | Html::addCssStyle($options, 'display: none;'); |
256 | 256 | } |
257 | 257 | Html::addCssClass($options, "treegrid-parent-$parentId"); |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $column = $this->createDataColumn($column); |
345 | 345 | } else { |
346 | 346 | $column = Yii::createObject(array_merge([ |
347 | - 'class' => $this->dataColumnClass ? : TreeColumn::class, |
|
347 | + 'class' => $this->dataColumnClass ?: TreeColumn::class, |
|
348 | 348 | 'grid' => $this, |
349 | 349 | ], $column)); |
350 | 350 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | } |
370 | 370 | |
371 | 371 | return Yii::createObject([ |
372 | - 'class' => $this->dataColumnClass ? : TreeColumn::class, |
|
372 | + 'class' => $this->dataColumnClass ?: TreeColumn::class, |
|
373 | 373 | 'grid' => $this, |
374 | 374 | 'attribute' => $matches[1], |
375 | 375 | 'format' => isset($matches[3]) ? $matches[3] : 'text', |
@@ -56,7 +56,7 @@ |
||
56 | 56 | 'autocomplete' => 'off', |
57 | 57 | 'placeholder' => Yii::t('yuncms', 'Password') |
58 | 58 | ], |
59 | - 'errorOptions' => ['class' => 'help-block help-block-error full-width','style'=>'text-align:left'], |
|
59 | + 'errorOptions' => ['class' => 'help-block help-block-error full-width','style'=>'text-align:left'], |
|
60 | 60 | ])->passwordInput()->label(false) ?> |
61 | 61 | |
62 | 62 | <?= $form->field($model, 'verifyCode', [ |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | 'autocomplete' => 'off', |
49 | 49 | 'placeholder' => Yii::t('yuncms', 'Username') |
50 | 50 | ], |
51 | - 'errorOptions' => ['class' => 'help-block help-block-error full-width','style'=>'text-align:left'], |
|
51 | + 'errorOptions' => ['class' => 'help-block help-block-error full-width', 'style'=>'text-align:left'], |
|
52 | 52 | ])->label(false); ?> |
53 | 53 | |
54 | 54 | <?= $form->field($model, 'password', [ |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | 'autocomplete' => 'off', |
57 | 57 | 'placeholder' => Yii::t('yuncms', 'Password') |
58 | 58 | ], |
59 | - 'errorOptions' => ['class' => 'help-block help-block-error full-width','style'=>'text-align:left'], |
|
59 | + 'errorOptions' => ['class' => 'help-block help-block-error full-width', 'style'=>'text-align:left'], |
|
60 | 60 | ])->passwordInput()->label(false) ?> |
61 | 61 | |
62 | 62 | <?= $form->field($model, 'verifyCode', [ |
63 | - 'errorOptions' => ['class' => 'help-block help-block-error full-width','style'=>'text-align:left'], |
|
63 | + 'errorOptions' => ['class' => 'help-block help-block-error full-width', 'style'=>'text-align:left'], |
|
64 | 64 | ])->widget(Captcha::class, [ |
65 | 65 | 'captchaAction' => '/admin/security/captcha', |
66 | 66 | 'options' => [ |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | $model = new AdminBizRule(null); |
72 | 72 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
73 | 73 | RBACHelper::invalidate(); |
74 | - Yii::$app->getSession()->setFlash('success', Yii::t('yuncms','Create success.')); |
|
74 | + Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Create success.')); |
|
75 | 75 | return $this->redirect(['view', 'id' => $model->name]); |
76 | 76 | } else { |
77 | - return $this->render('create', ['model' => $model,]); |
|
77 | + return $this->render('create', ['model' => $model, ]); |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | $model = $this->findModel($id); |
92 | 92 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
93 | 93 | RBACHelper::invalidate(); |
94 | - Yii::$app->getSession()->setFlash('success', Yii::t('yuncms','Update success.')); |
|
94 | + Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Update success.')); |
|
95 | 95 | return $this->redirect(['view', 'id' => $model->name]); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render('update', ['model' => $model,]); |
|
98 | + return $this->render('update', ['model' => $model, ]); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $model = $this->findModel($id); |
111 | 111 | Yii::$app->authManager->remove($model->item); |
112 | 112 | RBACHelper::invalidate(); |
113 | - Yii::$app->getSession()->setFlash('success', Yii::t('yuncms','Delete success.')); |
|
113 | + Yii::$app->getSession()->setFlash('success', Yii::t('yuncms', 'Delete success.')); |
|
114 | 114 | return $this->redirect(['index']); |
115 | 115 | } |
116 | 116 |
@@ -206,7 +206,7 @@ |
||
206 | 206 | |
207 | 207 | foreach ((array)$message as $key => $value) { |
208 | 208 | if (is_scalar($value)) { |
209 | - $value = preg_replace_callback("/{(\\w+)}/", function ($matches) use ($params) { |
|
209 | + $value = preg_replace_callback("/{(\\w+)}/", function($matches) use ($params) { |
|
210 | 210 | $paramName = $matches[1]; |
211 | 211 | return isset($params[$paramName]) ? $params[$paramName] : $paramName; |
212 | 212 | }, $value); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | return $item; |
140 | 140 | } |
141 | 141 | if (!isset ($item['label'])) { |
142 | - throw new InvalidConfigException ("The 'label' option is required."); |
|
142 | + throw new InvalidConfigException("The 'label' option is required."); |
|
143 | 143 | } |
144 | 144 | $encodeLabel = isset ($item['encode']) ? $item['encode'] : $this->encodeLabels; |
145 | 145 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | $subItems = $this->renderItems($subItems); |
171 | - if($subItems){ |
|
171 | + if ($subItems) { |
|
172 | 172 | $submenuTemplate = ArrayHelper::getValue($item, 'submenuTemplate', $this->submenuTemplate); |
173 | 173 | $subItems = strtr($submenuTemplate, [ |
174 | 174 | '{items}' => $this->renderItems($subItems), |
@@ -4,25 +4,25 @@ |
||
4 | 4 | * @copyright Copyright (c) 2012 TintSoft Technology Co. Ltd. |
5 | 5 | * @license http://www.tintsoft.com/license/ |
6 | 6 | */ |
7 | - namespace xutl\inspinia; |
|
7 | + namespace xutl\inspinia; |
|
8 | 8 | |
9 | - use yii\web\View; |
|
10 | - use yii\web\AssetBundle; |
|
9 | + use yii\web\View; |
|
10 | + use yii\web\AssetBundle; |
|
11 | 11 | |
12 | - class PaceAsset extends AssetBundle{ |
|
13 | - public $sourcePath = '@yuncms/admin/resources/assets'; |
|
12 | + class PaceAsset extends AssetBundle{ |
|
13 | + public $sourcePath = '@yuncms/admin/resources/assets'; |
|
14 | 14 | |
15 | - /** |
|
16 | - * 发布参数 |
|
17 | - * |
|
18 | - * @var array |
|
19 | - */ |
|
20 | - public $jsOptions = [ |
|
21 | - 'position' => View::POS_HEAD, |
|
22 | - 'data-pace-options' => ['restartOnRequestAfter' => true] |
|
23 | - ]; |
|
15 | + /** |
|
16 | + * 发布参数 |
|
17 | + * |
|
18 | + * @var array |
|
19 | + */ |
|
20 | + public $jsOptions = [ |
|
21 | + 'position' => View::POS_HEAD, |
|
22 | + 'data-pace-options' => ['restartOnRequestAfter' => true] |
|
23 | + ]; |
|
24 | 24 | |
25 | - public $js = [ |
|
26 | - 'js/plugins/pace/pace.min.js' |
|
27 | - ]; |
|
28 | - } |
|
29 | 25 | \ No newline at end of file |
26 | + public $js = [ |
|
27 | + 'js/plugins/pace/pace.min.js' |
|
28 | + ]; |
|
29 | + } |
|
30 | 30 | \ No newline at end of file |
@@ -9,7 +9,7 @@ |
||
9 | 9 | use yii\web\View; |
10 | 10 | use yii\web\AssetBundle; |
11 | 11 | |
12 | - class PaceAsset extends AssetBundle{ |
|
12 | + class PaceAsset extends AssetBundle { |
|
13 | 13 | public $sourcePath = '@yuncms/admin/resources/assets'; |
14 | 14 | |
15 | 15 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. |
39 | 39 | * @since 2.0.1 |
40 | 40 | */ |
41 | - public $footerOptions =[]; |
|
41 | + public $footerOptions = []; |
|
42 | 42 | |
43 | 43 | public $closeButton = true; |
44 | 44 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | protected function renderTools() |
135 | 135 | { |
136 | 136 | $tools = ''; |
137 | - if($this->collapseButton !== false){ |
|
137 | + if ($this->collapseButton !== false) { |
|
138 | 138 | $tools .= '<a class="collapse-link"><i class="fa fa-chevron-up"></i></a>'; |
139 | 139 | } |
140 | 140 | if ($this->closeButton !== false) { |