@@ -60,7 +60,7 @@ |
||
60 | 60 | [ |
61 | 61 | 'actions' => ['signup'], |
62 | 62 | 'allow' => true, |
63 | - 'matchCallback' => function () { |
|
63 | + 'matchCallback' => function() { |
|
64 | 64 | return Option::get('allow_signup') && Yii::$app->user->isGuest; |
65 | 65 | }, |
66 | 66 | ], |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | [ |
68 | 68 | 'attribute' => 'content', |
69 | 69 | 'format' => 'html', |
70 | - 'value' => function ($model) { |
|
70 | + 'value' => function($model) { |
|
71 | 71 | return substr(strip_tags($model->content), 0, 150) . '...'; |
72 | 72 | }, |
73 | 73 | ], |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | 'class' => 'yii\grid\ActionColumn', |
81 | 81 | 'template' => Yii::$app->user->can('editor') ? '{view} {update} {delete} {reply}' : '{view}', |
82 | 82 | 'buttons' => [ |
83 | - 'view' => function ($url, $model) { |
|
83 | + 'view' => function($url, $model) { |
|
84 | 84 | return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', |
85 | 85 | $model->commentMedia->url . '#comment' . $model->id, [ |
86 | 86 | 'title' => Yii::t('yii', 'View'), |
87 | 87 | 'data-pjax' => '0', |
88 | 88 | ]); |
89 | 89 | }, |
90 | - 'reply' => function ($url, $model) { |
|
90 | + 'reply' => function($url, $model) { |
|
91 | 91 | return Html::a('<span class="glyphicon glyphicon-share-alt"></span>', [ |
92 | 92 | 'reply', |
93 | 93 | 'id' => $model->id, |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | 'columns' => [ |
51 | 51 | [ |
52 | 52 | 'class' => 'yii\grid\CheckboxColumn', |
53 | - 'checkboxOptions' => function ($model) { |
|
53 | + 'checkboxOptions' => function($model) { |
|
54 | 54 | if (!Yii::$app->user->can('editor') && $model->author !== Yii::$app->user->id) { |
55 | 55 | return ['disabled' => 'disabled']; |
56 | 56 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | [ |
62 | 62 | 'attribute' => Yii::t('writesdown', 'Preview'), |
63 | 63 | 'format' => 'raw', |
64 | - 'value' => function ($model) { |
|
64 | + 'value' => function($model) { |
|
65 | 65 | /* @var $model common\models\Media */ |
66 | 66 | $metadata = $model->getMeta('metadata'); |
67 | 67 | if (preg_match('/^image\//', $model->mime_type)) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | [ |
81 | 81 | 'label' => Yii::t('writesdown', 'File Name'), |
82 | 82 | 'format' => 'html', |
83 | - 'value' => function ($model) { |
|
83 | + 'value' => function($model) { |
|
84 | 84 | /* @var $model common\models\Media */ |
85 | 85 | $metadata = $model->getMeta('metadata'); |
86 | 86 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | ], |
90 | 90 | [ |
91 | 91 | 'attribute' => 'username', |
92 | - 'value' => function ($model) { |
|
92 | + 'value' => function($model) { |
|
93 | 93 | return $model->mediaAuthor->username; |
94 | 94 | }, |
95 | 95 | ], |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | [ |
99 | 99 | 'class' => 'yii\grid\ActionColumn', |
100 | 100 | 'buttons' => [ |
101 | - 'view' => function ($url, $model) { |
|
101 | + 'view' => function($url, $model) { |
|
102 | 102 | return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $model->url, [ |
103 | 103 | 'title' => Yii::t('yii', 'View'), |
104 | 104 | 'data-pjax' => '0', |
105 | 105 | ]); |
106 | 106 | }, |
107 | - 'update' => function ($url, $model) { |
|
107 | + 'update' => function($url, $model) { |
|
108 | 108 | if (!Yii::$app->user->can('editor') && $model->author !== Yii::$app->user->id) { |
109 | 109 | return ''; |
110 | 110 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | 'data-pjax' => '0', |
115 | 115 | ]); |
116 | 116 | }, |
117 | - 'delete' => function ($url, $model) { |
|
117 | + 'delete' => function($url, $model) { |
|
118 | 118 | if (!Yii::$app->user->can('editor') && $model->author !== Yii::$app->user->id) { |
119 | 119 | return ''; |
120 | 120 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * @param $type string |
22 | 22 | * @param $oldKey null|array |
23 | 23 | */ |
24 | -$renderConfig = function ($form, $model, $config, $type, $oldKey = null) use (&$renderConfig) { |
|
24 | +$renderConfig = function($form, $model, $config, $type, $oldKey = null) use (&$renderConfig) { |
|
25 | 25 | echo '<ul>'; |
26 | 26 | |
27 | 27 | foreach ($config as $key => $value) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | [ |
66 | 66 | 'attribute' => 'content', |
67 | 67 | 'format' => 'html', |
68 | - 'value' => function ($model) { |
|
68 | + 'value' => function($model) { |
|
69 | 69 | return substr(strip_tags($model->content), 0, 150) . '...'; |
70 | 70 | }, |
71 | 71 | ], |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | 'class' => 'yii\grid\ActionColumn', |
80 | 80 | 'template' => Yii::$app->user->can('editor') ? '{view} {update} {delete} {reply}' : '{view}', |
81 | 81 | 'buttons' => [ |
82 | - 'view' => function ($url, $model) { |
|
82 | + 'view' => function($url, $model) { |
|
83 | 83 | return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', |
84 | 84 | $model->commentPost->url . '#comment-' . $model->id, [ |
85 | 85 | 'title' => Yii::t('yii', 'View'), |
86 | 86 | 'data-pjax' => '0', |
87 | 87 | ]); |
88 | 88 | }, |
89 | - 'reply' => function ($url, $model) { |
|
89 | + 'reply' => function($url, $model) { |
|
90 | 90 | return Html::a('<span class="glyphicon glyphicon-share-alt"></span>', [ |
91 | 91 | 'reply', |
92 | 92 | 'id' => $model->id, |
@@ -57,7 +57,7 @@ |
||
57 | 57 | [ |
58 | 58 | 'attribute' => 'icon', |
59 | 59 | 'format' => 'raw', |
60 | - 'value' => function ($model) { |
|
60 | + 'value' => function($model) { |
|
61 | 61 | return Html::tag('i', '', ['class' => $model->icon]); |
62 | 62 | }, |
63 | 63 | 'filter' => false, |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ] |
43 | 43 | ) ?> |
44 | 44 | |
45 | - <?php else: ?> |
|
45 | + <?php else : ?> |
|
46 | 46 | <?= Html::dropDownList( |
47 | 47 | 'termIds', |
48 | 48 | ArrayHelper::getColumn( |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | </div> |
93 | 93 | </div> |
94 | - <?php else: ?> |
|
94 | + <?php else : ?> |
|
95 | 95 | <?= Yii::t( |
96 | 96 | 'writesdown', 'Choose the {taxonomyName} above', |
97 | 97 | ['taxonomyName' => $taxonomy->singular_name] |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'columns' => [ |
74 | 74 | [ |
75 | 75 | 'class' => 'yii\grid\CheckboxColumn', |
76 | - 'checkboxOptions' => function ($model) { |
|
76 | + 'checkboxOptions' => function($model) { |
|
77 | 77 | /* @var $model \common\models\search\Post */ |
78 | 78 | if ($model->getPermission()) { |
79 | 79 | return ['value' => $model->id]; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ], |
85 | 85 | [ |
86 | 86 | 'attribute' => 'username', |
87 | - 'value' => function ($model) { |
|
87 | + 'value' => function($model) { |
|
88 | 88 | /* @var $model \common\models\search\Post */ |
89 | 89 | return $model->postAuthor->username; |
90 | 90 | }, |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | [ |
99 | 99 | 'class' => 'yii\grid\ActionColumn', |
100 | 100 | 'buttons' => [ |
101 | - 'view' => function ($url, $model) { |
|
101 | + 'view' => function($url, $model) { |
|
102 | 102 | return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $model->url, [ |
103 | 103 | 'title' => Yii::t('yii', 'View'), |
104 | 104 | 'data-pjax' => '0', |
105 | 105 | ]); |
106 | 106 | }, |
107 | - 'update' => function ($url, $model) { |
|
107 | + 'update' => function($url, $model) { |
|
108 | 108 | /* @var $model \common\models\search\Post */ |
109 | 109 | if ($model->getPermission()) { |
110 | 110 | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [ |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | return ''; |
117 | 117 | }, |
118 | - 'delete' => function ($url, $model) { |
|
118 | + 'delete' => function($url, $model) { |
|
119 | 119 | /* @var $model \common\models\search\Post */ |
120 | 120 | if ($model->getPermission()) { |
121 | 121 | return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [ |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'class' => 'yii\grid\ActionColumn', |
34 | 34 | 'template' => '{update} {delete}', |
35 | 35 | 'buttons' => [ |
36 | - 'update' => function ($url, $model) { |
|
36 | + 'update' => function($url, $model) { |
|
37 | 37 | return Html::a('<span class="glyphicon glyphicon-pencil"></span>', [ |
38 | 38 | '/taxonomy/update-term', |
39 | 39 | 'id' => $model->taxonomy->id, |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'data-pjax' => '0', |
44 | 44 | ]); |
45 | 45 | }, |
46 | - 'delete' => function ($url, $model) { |
|
46 | + 'delete' => function($url, $model) { |
|
47 | 47 | return Html::a('<span class="glyphicon glyphicon-trash"></span>', [ |
48 | 48 | '/taxonomy/delete-term', |
49 | 49 | 'id' => $model->taxonomy->id, |