@@ -42,7 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | /** @var ActiveRecord $class */ |
44 | 44 | $class = $this->modelClass; |
45 | - $class::create($this->attributes,$this->runValidation); |
|
45 | + $class::create($this->attributes, $this->runValidation); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -40,30 +40,30 @@ |
||
40 | 40 | public function events() |
41 | 41 | { |
42 | 42 | return [ |
43 | - ActiveRecord::EVENT_INIT => function () { |
|
43 | + ActiveRecord::EVENT_INIT => function() { |
|
44 | 44 | $this->initialization(); |
45 | 45 | }, |
46 | - ActiveRecord::EVENT_AFTER_FIND => function () { |
|
46 | + ActiveRecord::EVENT_AFTER_FIND => function() { |
|
47 | 47 | $this->decode(); |
48 | 48 | }, |
49 | - ActiveRecord::EVENT_BEFORE_INSERT => function () { |
|
49 | + ActiveRecord::EVENT_BEFORE_INSERT => function() { |
|
50 | 50 | $this->encode(); |
51 | 51 | }, |
52 | - ActiveRecord::EVENT_BEFORE_UPDATE => function () { |
|
52 | + ActiveRecord::EVENT_BEFORE_UPDATE => function() { |
|
53 | 53 | $this->encode(); |
54 | 54 | }, |
55 | - ActiveRecord::EVENT_AFTER_INSERT => function () { |
|
55 | + ActiveRecord::EVENT_AFTER_INSERT => function() { |
|
56 | 56 | $this->decode(); |
57 | 57 | }, |
58 | - ActiveRecord::EVENT_AFTER_UPDATE => function () { |
|
58 | + ActiveRecord::EVENT_AFTER_UPDATE => function() { |
|
59 | 59 | $this->decode(); |
60 | 60 | }, |
61 | - ActiveRecord::EVENT_BEFORE_VALIDATE => function () { |
|
61 | + ActiveRecord::EVENT_BEFORE_VALIDATE => function() { |
|
62 | 62 | if ($this->encodeBeforeValidation) { |
63 | 63 | $this->encodeValidate(); |
64 | 64 | } |
65 | 65 | }, |
66 | - ActiveRecord::EVENT_AFTER_VALIDATE => function () { |
|
66 | + ActiveRecord::EVENT_AFTER_VALIDATE => function() { |
|
67 | 67 | if ($this->encodeBeforeValidation) { |
68 | 68 | $this->decode(); |
69 | 69 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | 'attribute' => 'description', |
82 | 82 | 'label' => Yii::t('yuncms', 'Role Description'), |
83 | 83 | ], |
84 | - ['class' => 'yuncms\grid\ActionColumn',], |
|
84 | + ['class' => 'yuncms\grid\ActionColumn', ], |
|
85 | 85 | ], |
86 | 86 | ]) |
87 | 87 | ?> |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'email:email', |
55 | 55 | [ |
56 | 56 | 'attribute' => 'status', |
57 | - 'value' => function ($model) { |
|
57 | + 'value' => function($model) { |
|
58 | 58 | return $model->status == Admin::STATUS_ACTIVE ? Yii::t('yuncms', 'Active') : Yii::t('yuncms', 'Disable'); |
59 | 59 | }, |
60 | 60 | 'label' => Yii::t('yuncms', 'Status'), |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | 'class' => 'yuncms\grid\ActionColumn', |
67 | 67 | 'header' => Yii::t('yuncms', 'Operation'), |
68 | 68 | 'template' => '{assignment} {view} {update} {delete}', |
69 | - 'buttons' => ['assignment' => function ($url, $model, $key) { |
|
69 | + 'buttons' => ['assignment' => function($url, $model, $key) { |
|
70 | 70 | return Html::a('<span class="glyphicon glyphicon-dashboard"></span>', |
71 | 71 | Url::toRoute(['assignment/view', 'id' => $model->id]), [ |
72 | 72 | 'title' => Yii::t('yuncms', 'Assignment'), |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /* @var $this yii\web\View */ |
20 | 20 | /* @var $model <?= ltrim($generator->modelClass, '\\') ?> */ |
21 | 21 | |
22 | -$this->title = <?= $generator->generateString('Update '.Inflector::camel2words(StringHelper::basename($generator->modelClass)))?> . ': ' . $model-><?= $generator->getNameAttribute() ?>; |
|
22 | +$this->title = <?= $generator->generateString('Update ' . Inflector::camel2words(StringHelper::basename($generator->modelClass)))?> . ': ' . $model-><?= $generator->getNameAttribute() ?>; |
|
23 | 23 | $this->params['breadcrumbs'][] = ['label' => <?= $generator->generateString('Manage ' . Inflector::camel2words(StringHelper::basename($generator->modelClass))) ?>, 'url' => ['index']]; |
24 | 24 | $this->params['breadcrumbs'][] = ['label' => $model-><?= $generator->getNameAttribute() ?>, 'url' => ['view', <?= $urlParams ?>]]; |
25 | 25 | $this->params['breadcrumbs'][] = Yii::t('yuncms', 'Update'); |
@@ -78,7 +78,7 @@ |
||
78 | 78 | } |
79 | 79 | return $model; |
80 | 80 | } else { |
81 | - throw new NotFoundHttpException ('User not found.'); |
|
81 | + throw new NotFoundHttpException('User not found.'); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | 'rules' => [ |
50 | 50 | [ |
51 | 51 | 'allow' => true, |
52 | - 'actions' => ['profile', 'account', 'privacy', 'avatar', 'confirm', 'networks', 'disconnect','follower-tag'], |
|
52 | + 'actions' => ['profile', 'account', 'privacy', 'avatar', 'confirm', 'networks', 'disconnect', 'follower-tag'], |
|
53 | 53 | 'roles' => ['@'], |
54 | 54 | ], |
55 | 55 | ], |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | Yii::$app->response->format = Response::FORMAT_JSON; |
130 | 130 | $tagId = Yii::$app->request->post('tag_id', null); |
131 | 131 | if (($tag = Tag::findOne($tagId)) == null) { |
132 | - throw new NotFoundHttpException (); |
|
132 | + throw new NotFoundHttpException(); |
|
133 | 133 | } else { |
134 | 134 | /** @var \yuncms\user\models\User $user */ |
135 | 135 | $user = Yii::$app->user->identity; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | public function actionConfirm($id, $code) |
158 | 158 | { |
159 | 159 | $user = User::findOne($id); |
160 | - if ($user === null || Yii::$app->settings->get('emailChangeStrategy','user') == UserSettings::STRATEGY_INSECURE) { |
|
160 | + if ($user === null || Yii::$app->settings->get('emailChangeStrategy', 'user') == UserSettings::STRATEGY_INSECURE) { |
|
161 | 161 | throw new NotFoundHttpException(); |
162 | 162 | } |
163 | 163 | $user->attemptEmailChange($code); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | if ($user->load(Yii::$app->request->post()) && $user->createUser()) { |
130 | 130 | $account->connect($user); |
131 | - Yii::$app->user->login($user, Yii::$app->settings->get('rememberFor','user')); |
|
131 | + Yii::$app->user->login($user, Yii::$app->settings->get('rememberFor', 'user')); |
|
132 | 132 | return $this->goBack(); |
133 | 133 | } |
134 | 134 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | public function actionConfirm($id, $code) |
150 | 150 | { |
151 | 151 | $user = User::findOne($id); |
152 | - if ($user === null || Yii::$app->settings->get('enableConfirmation','user') == false) { |
|
152 | + if ($user === null || Yii::$app->settings->get('enableConfirmation', 'user') == false) { |
|
153 | 153 | return $this->goBack(); |
154 | 154 | } |
155 | 155 | $user->attemptEmailConfirmation($code); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function actionResend() |
165 | 165 | { |
166 | - if (Yii::$app->settings->get('enableConfirmation','user') == false) { |
|
166 | + if (Yii::$app->settings->get('enableConfirmation', 'user') == false) { |
|
167 | 167 | return $this->goBack(); |
168 | 168 | } |
169 | 169 | /** @var ResendForm $model */ |
@@ -26,17 +26,17 @@ |
||
26 | 26 | return [ |
27 | 27 | 'id', |
28 | 28 | 'nickname', |
29 | - 'faceUrl' => function () { |
|
29 | + 'faceUrl' => function() { |
|
30 | 30 | return $this->getAvatar(AvatarHelper::AVATAR_MIDDLE); |
31 | 31 | }, |
32 | 32 | 'identified', |
33 | - "created_datetime" => function () { |
|
33 | + "created_datetime" => function() { |
|
34 | 34 | return gmdate(DATE_ISO8601, $this->created_at); |
35 | 35 | }, |
36 | - "updated_datetime" => function () { |
|
36 | + "updated_datetime" => function() { |
|
37 | 37 | return gmdate(DATE_ISO8601, $this->updated_at); |
38 | 38 | }, |
39 | - 'blocked_datetime' => function () { |
|
39 | + 'blocked_datetime' => function() { |
|
40 | 40 | return gmdate(DATE_ISO8601, $this->blocked_at); |
41 | 41 | } |
42 | 42 | ]; |