Completed
Push — master ( fb7a26...d5e2d7 )
by Agiel Kurniawan
04:29
created
common/components/BackendBootstrap.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
         /* TIME ZONE */
45 45
         $app->timeZone = Option::get('time_zone');
46 46
         /* DATE TIME */
47
-        $app->formatter->dateFormat = 'php:' . Option::get('date_format');
48
-        $app->formatter->timeFormat = 'php:' . Option::get('time_format');
49
-        $app->formatter->datetimeFormat = 'php:' . Option::get('date_format') . ' ' . Option::get('time_format');
47
+        $app->formatter->dateFormat = 'php:'.Option::get('date_format');
48
+        $app->formatter->timeFormat = 'php:'.Option::get('time_format');
49
+        $app->formatter->datetimeFormat = 'php:'.Option::get('date_format').' '.Option::get('time_format');
50 50
     }
51 51
 
52 52
     /**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     protected function setTheme($app)
58 58
     {
59 59
         /* THEME CONFIG */
60
-        $paramsPath = Yii::getAlias('@themes/') . Option::get('theme') . '/config/params.php';
60
+        $paramsPath = Yii::getAlias('@themes/').Option::get('theme').'/config/params.php';
61 61
 
62 62
         if (is_file($paramsPath)) {
63 63
             $params = require($paramsPath);
Please login to merge, or discard this patch.
common/components/FrontendBootstrap.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
         $app->timeZone = Option::get('time_zone');
46 46
 
47 47
         /* DATE TIME */
48
-        $app->formatter->dateFormat = 'php:' . Option::get('date_format');
49
-        $app->formatter->timeFormat = 'php:' . Option::get('time_format');
50
-        $app->formatter->datetimeFormat = 'php:' . Option::get('date_format') . ' ' . Option::get('time_format');
48
+        $app->formatter->dateFormat = 'php:'.Option::get('date_format');
49
+        $app->formatter->timeFormat = 'php:'.Option::get('time_format');
50
+        $app->formatter->datetimeFormat = 'php:'.Option::get('date_format').' '.Option::get('time_format');
51 51
     }
52 52
 
53 53
     /**
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
      */
58 58
     protected function setTheme($app)
59 59
     {
60
-        $app->view->theme->basePath = '@themes/' . Option::get('theme');
61
-        $app->view->theme->baseUrl = '@web/themes/' . Option::get('theme');
60
+        $app->view->theme->basePath = '@themes/'.Option::get('theme');
61
+        $app->view->theme->baseUrl = '@web/themes/'.Option::get('theme');
62 62
         $app->view->theme->pathMap = [
63
-            '@app/views' => '@themes/' . Option::get('theme'),
64
-            '@app/views/post' => '@themes/' . Option::get('theme') . '/post',
63
+            '@app/views' => '@themes/'.Option::get('theme'),
64
+            '@app/views/post' => '@themes/'.Option::get('theme').'/post',
65 65
         ];
66
-        $paramsPath = Yii::getAlias('@themes/') . Option::get('theme') . '/config/params.php';
66
+        $paramsPath = Yii::getAlias('@themes/').Option::get('theme').'/config/params.php';
67 67
 
68 68
         if (is_file($paramsPath)) {
69 69
             $params = require($paramsPath);
Please login to merge, or discard this patch.
backend/views/media/index.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         'columns' => [
52 52
             [
53 53
                 'class' => 'yii\grid\CheckboxColumn',
54
-                'checkboxOptions' => function ($model) {
54
+                'checkboxOptions' => function($model) {
55 55
                     if (!Yii::$app->user->can('editor') && $model->author !== Yii::$app->user->id) {
56 56
                         return ['disabled' => 'disabled'];
57 57
                     }
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
             [
63 63
                 'attribute' => Yii::t('writesdown', 'Preview'),
64 64
                 'format' => 'raw',
65
-                'value' => function ($model) {
65
+                'value' => function($model) {
66 66
                     /* @var $model common\models\Media */
67 67
                     $metadata = $model->getMeta('metadata');
68 68
                     $iconUrl = ArrayHelper::getValue($metadata, 'icon_url');
69 69
 
70 70
                     if (preg_match('/^image\//', $model->mime_type)) {
71
-                        return Html::a(Html::img($model->getUploadUrl() . $iconUrl), [
71
+                        return Html::a(Html::img($model->getUploadUrl().$iconUrl), [
72 72
                             'update',
73 73
                             'id' => $model->id,
74 74
                         ], ['class' => 'media-mime-icon']);
75 75
                     }
76 76
 
77
-                    return Html::a(Html::img(Url::base(true) . '/' . $iconUrl), [
77
+                    return Html::a(Html::img(Url::base(true).'/'.$iconUrl), [
78 78
                         'update',
79 79
                         'id' => $model->id,
80 80
                     ], ['class' => 'media-mime-icon']);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             [
84 84
                 'label' => Yii::t('writesdown', 'File Name'),
85 85
                 'format' => 'html',
86
-                'value' => function ($model) {
86
+                'value' => function($model) {
87 87
                     /* @var $model common\models\Media */
88 88
                     $metadata = $model->getMeta('metadata');
89 89
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             ],
93 93
             [
94 94
                 'attribute' => 'username',
95
-                'value' => function ($model) {
95
+                'value' => function($model) {
96 96
                     return $model->mediaAuthor->username;
97 97
                 },
98 98
             ],
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
             [
102 102
                 'class' => 'yii\grid\ActionColumn',
103 103
                 'buttons' => [
104
-                    'view' => function ($url, $model) {
104
+                    'view' => function($url, $model) {
105 105
                         return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $model->url, [
106 106
                             'title' => Yii::t('yii', 'View'),
107 107
                             'data-pjax' => '0',
108 108
                         ]);
109 109
                     },
110
-                    'update' => function ($url, $model) {
110
+                    'update' => function($url, $model) {
111 111
                         if (!Yii::$app->user->can('editor') && $model->author !== Yii::$app->user->id) {
112 112
                             return '';
113 113
                         }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                             'data-pjax' => '0',
118 118
                         ]);
119 119
                     },
120
-                    'delete' => function ($url, $model) {
120
+                    'delete' => function($url, $model) {
121 121
                         if (!Yii::$app->user->can('editor') && $model->author !== Yii::$app->user->id) {
122 122
                             return '';
123 123
                         }
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
 </div>
140 140
 <?php $this->registerJs('jQuery(document).on("click", ".bulk-button", function(e){
141 141
     e.preventDefault();
142
-    if(confirm("' . Yii::t('writesdown', 'Are you sure?') . '")){
142
+    if(confirm("' . Yii::t('writesdown', 'Are you sure?').'")){
143 143
         var ids     = $("#media-grid-view").yiiGridView("getSelectedRows");
144 144
         var action  = $(this).closest(".form-group").find(".bulk-action").val();
145 145
         $.ajax({
146
-            url: "' . Url::to(['bulk-action']) . '",
146
+            url: "' . Url::to(['bulk-action']).'",
147 147
             data: { ids: ids, action: action, _csrf: yii.getCsrfToken() },
148 148
             type: "POST",
149 149
             success: function(data){
Please login to merge, or discard this patch.
backend/views/media/_form.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     ])->textInput(['placeholder' => $model->getAttributeLabel('title')]) ?>
26 26
 
27 27
     <?= $form->field($model, 'slug', [
28
-        'template' => '<span class="input-group-addon">' . $model->getAttributeLabel('slug') . '</span>{input}',
28
+        'template' => '<span class="input-group-addon">'.$model->getAttributeLabel('slug').'</span>{input}',
29 29
         'options' => ['class' => 'input-group form-group input-group-sm'],
30 30
     ])->textInput(['maxlength' => 255, 'placeholder' => $model->getAttributeLabel('slug')]) ?>
31 31
 
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
             <?= $model->getThumbnail('full', ['class' => 'thumbnail']) ?>
37 37
         <?php elseif (preg_match('/^video\//', $model->mime_type)): ?>
38 38
             <video controls class="full-width">
39
-                <source src="<?= $model->getUploadUrl() . ArrayHelper::getValue($metadata, 'versions.full.url') ?>"
39
+                <source src="<?= $model->getUploadUrl().ArrayHelper::getValue($metadata, 'versions.full.url') ?>"
40 40
                         type="<?= $model->mime_type ?>">
41 41
                 <?= Yii::t('writesdown', 'Your browser does not support HTML5 video.') ?>
42 42
             </video>
43 43
         <?php elseif (preg_match('/^audio\//', $model->mime_type)): ?>
44 44
             <audio controls class="full-width">
45
-                <source src="<?= $model->getUploadUrl() . ArrayHelper::getValue($metadata, 'versions.full.url') ?>"
45
+                <source src="<?= $model->getUploadUrl().ArrayHelper::getValue($metadata, 'versions.full.url') ?>"
46 46
                         type="<?= $model->mime_type ?>">
47 47
                 <?= Yii::t('writesdown', 'Your browser does not support HTML5 audio.') ?>
48 48
             </audio>
49 49
         <?php else: ?>
50 50
             <?= Html::textInput(
51
-                'media-file-name', $model->getUploadUrl() . ArrayHelper::getValue($metadata, 'versions.full.url'),
51
+                'media-file-name', $model->getUploadUrl().ArrayHelper::getValue($metadata, 'versions.full.url'),
52 52
                 ['class' => 'form-control input-sm', 'readonly' => 'readonly'])
53 53
             ?>
54 54
         <?php endif ?>
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             'compressorRoute' => 'editor/compressor',
65 65
             'settings' => [
66 66
                 'menubar' => false,
67
-                'skin_url' => Url::base(true) . '/editor/skins/writesdown',
67
+                'skin_url' => Url::base(true).'/editor/skins/writesdown',
68 68
                 'toolbar_items_size' => 'medium',
69 69
                 'toolbar' => 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter '
70 70
                     . 'alignright alignjustify | bullist numlist outdent indent | link image | code fullscreen',
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             'load' => new JsExpression('function (query, callback) {
102 102
                 if (!query.length) return callback();
103 103
                 $.ajax({
104
-                    url: "' . Url::to(['/post/ajax-search']) . '",
104
+                    url: "' . Url::to(['/post/ajax-search']).'",
105 105
                     type: "POST",
106 106
                     dataType: "json",
107 107
                     data: {
Please login to merge, or discard this patch.
backend/controllers/MediaController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@
 block discarded – undo
181 181
             ],
182 182
         ];
183 183
 
184
-        if($userVersions = ArrayHelper::getValue(Yii::$app->params, 'media.versions', [])){
184
+        if ($userVersions = ArrayHelper::getValue(Yii::$app->params, 'media.versions', [])) {
185 185
             $versions = ArrayHelper::merge($versions, $userVersions);
186 186
         }
187 187
 
Please login to merge, or discard this patch.
backend/controllers/MediaBrowserController.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -181,32 +181,32 @@  discard block
 block discarded – undo
181 181
         $meta = $model->getMeta('metadata');
182 182
         $image = $model->getThumbnail(ArrayHelper::getValue($media, 'version'), [
183 183
                 'data-id' => $model->id,
184
-                'class' => 'media-image media-' . $model->id . ' ' . ArrayHelper::getValue($media, 'align', 'none'),
185
-            ]) . "\n";
184
+                'class' => 'media-image media-'.$model->id.' '.ArrayHelper::getValue($media, 'align', 'none'),
185
+            ])."\n";
186 186
 
187 187
         if ($model->excerpt) {
188 188
             $result .= Html::beginTag('div', [
189
-                    'class' => ArrayHelper::getValue($media, 'align', 'none') . ' media-caption',
190
-                    'style' => 'width: ' . $meta['versions'][$media['version']]['width'] . 'px',
191
-                ]) . "\n";
189
+                    'class' => ArrayHelper::getValue($media, 'align', 'none').' media-caption',
190
+                    'style' => 'width: '.$meta['versions'][$media['version']]['width'].'px',
191
+                ])."\n";
192 192
         }
193 193
 
194 194
         if ($linkValue = ArrayHelper::getValue($media, 'link_value')) {
195 195
             $result .= Html::beginTag('a', [
196 196
                     'href' => $linkValue,
197 197
                     'class' => ArrayHelper::getValue($media, 'align', 'none'),
198
-                ]) . "\n";
198
+                ])."\n";
199 199
         }
200 200
 
201 201
         $result .= $image;
202 202
 
203 203
         if ($linkValue = ArrayHelper::getValue($media, 'link_value')) {
204
-            $result .= Html::endTag('a') . "\n";
204
+            $result .= Html::endTag('a')."\n";
205 205
         }
206 206
 
207 207
         if ($model->excerpt) {
208
-            $result .= Html::tag('div', $model->excerpt, ['class' => 'media-caption-text']) . "\n";
209
-            $result .= Html::endTag('div') . "\n";
208
+            $result .= Html::tag('div', $model->excerpt, ['class' => 'media-caption-text'])."\n";
209
+            $result .= Html::endTag('div')."\n";
210 210
         }
211 211
 
212 212
         return $result;
@@ -225,14 +225,14 @@  discard block
 block discarded – undo
225 225
         $meta = $model->getMeta('metadata');
226 226
         $result = Html::beginTag('video', [
227 227
                 'controls' => true,
228
-                'class' => 'media-video media-' . $model->id,
229
-            ]) . "\n";
228
+                'class' => 'media-video media-'.$model->id,
229
+            ])."\n";
230 230
         $result .= Html::tag('source', '', [
231
-                'src' => $model->getUploadUrl() . ArrayHelper::getValue($meta, 'versions.full.url'),
231
+                'src' => $model->getUploadUrl().ArrayHelper::getValue($meta, 'versions.full.url'),
232 232
                 'type' => $model->mime_type,
233
-            ]) . "\n";
234
-        $result .= 'Your browser does not support the <code>video</code> element.' . "\n";
235
-        $result .= Html::endTag('video') . "\n";
233
+            ])."\n";
234
+        $result .= 'Your browser does not support the <code>video</code> element.'."\n";
235
+        $result .= Html::endTag('video')."\n";
236 236
 
237 237
         return $result;
238 238
     }
@@ -250,14 +250,14 @@  discard block
 block discarded – undo
250 250
         $meta = $model->getMeta('metadata');
251 251
         $result = Html::beginTag('audio', [
252 252
                 'controls' => true,
253
-                'class' => 'media-audio media-' . $model->id,
254
-            ]) . "\n";
253
+                'class' => 'media-audio media-'.$model->id,
254
+            ])."\n";
255 255
         $result .= Html::tag('source', '', [
256
-                'src' => $model->getUploadUrl() . ArrayHelper::getValue($meta, 'versions.full.url'),
256
+                'src' => $model->getUploadUrl().ArrayHelper::getValue($meta, 'versions.full.url'),
257 257
                 'type' => $model->mime_type,
258
-            ]) . "\n";
259
-        $result .= 'Your browser does not support the <code>video</code> element.' . "\n";
260
-        $result .= Html::endTag('audio') . "\n";
258
+            ])."\n";
259
+        $result .= 'Your browser does not support the <code>video</code> element.'."\n";
260
+        $result .= Html::endTag('audio')."\n";
261 261
 
262 262
         return $result;
263 263
     }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         return Html::a(
277 277
             $model->title,
278 278
             ArrayHelper::getValue($media, 'link_value'),
279
-            ['class' => 'media-file media-' . $model->id]
279
+            ['class' => 'media-file media-'.$model->id]
280 280
         );
281 281
     }
282 282
 }
Please login to merge, or discard this patch.