Completed
Push — master ( fb7a26...d5e2d7 )
by Agiel Kurniawan
04:29
created
console/migrations/m000000_000007_post_type.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@
 block discarded – undo
24 24
 
25 25
         $this->createTable('{{%post_type}}', [
26 26
             'id' => Schema::TYPE_PK,
27
-            'name' => Schema::TYPE_STRING . '(64) NOT NULL',
28
-            'slug' => Schema::TYPE_STRING . '(64) NOT NULL',
27
+            'name' => Schema::TYPE_STRING.'(64) NOT NULL',
28
+            'slug' => Schema::TYPE_STRING.'(64) NOT NULL',
29 29
             'description' => Schema::TYPE_TEXT,
30
-            'icon' => Schema::TYPE_STRING . '(255)',
31
-            'singular_name' => Schema::TYPE_STRING . '(255) NOT NULL',
32
-            'plural_name' => Schema::TYPE_STRING . '(255) NOT NULL',
33
-            'menu_builder' => Schema::TYPE_SMALLINT . '(1) NOT NULL DEFAULT 0',
34
-            'permission' => Schema::TYPE_STRING . '(64) NOT NULL',
30
+            'icon' => Schema::TYPE_STRING.'(255)',
31
+            'singular_name' => Schema::TYPE_STRING.'(255) NOT NULL',
32
+            'plural_name' => Schema::TYPE_STRING.'(255) NOT NULL',
33
+            'menu_builder' => Schema::TYPE_SMALLINT.'(1) NOT NULL DEFAULT 0',
34
+            'permission' => Schema::TYPE_STRING.'(64) NOT NULL',
35 35
         ], $tableOptions);
36 36
 
37 37
         /**
Please login to merge, or discard this patch.
console/migrations/m000000_000017_media_comment.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@
 block discarded – undo
23 23
 
24 24
         $this->createTable('{{%media_comment}}', [
25 25
             'id' => Schema::TYPE_PK,
26
-            'media_id' => Schema::TYPE_INTEGER . '(11) NOT NULL',
26
+            'media_id' => Schema::TYPE_INTEGER.'(11) NOT NULL',
27 27
             'author' => Schema::TYPE_TEXT,
28
-            'email' => Schema::TYPE_STRING . '(100)',
29
-            'url' => Schema::TYPE_STRING . '(255)',
30
-            'ip' => Schema::TYPE_STRING . '(100) NOT NULL',
31
-            'date' => Schema::TYPE_DATETIME . ' NOT NULL',
32
-            'content' => Schema::TYPE_TEXT . ' NOT NULL',
33
-            'status' => Schema::TYPE_STRING . '(20) NOT NULL',
34
-            'agent' => Schema::TYPE_STRING . '(255) NOT NULL',
35
-            'parent' => Schema::TYPE_INTEGER . '(11) DEFAULT 0',
36
-            'user_id' => Schema::TYPE_INTEGER . '(11)',
28
+            'email' => Schema::TYPE_STRING.'(100)',
29
+            'url' => Schema::TYPE_STRING.'(255)',
30
+            'ip' => Schema::TYPE_STRING.'(100) NOT NULL',
31
+            'date' => Schema::TYPE_DATETIME.' NOT NULL',
32
+            'content' => Schema::TYPE_TEXT.' NOT NULL',
33
+            'status' => Schema::TYPE_STRING.'(20) NOT NULL',
34
+            'agent' => Schema::TYPE_STRING.'(255) NOT NULL',
35
+            'parent' => Schema::TYPE_INTEGER.'(11) DEFAULT 0',
36
+            'user_id' => Schema::TYPE_INTEGER.'(11)',
37 37
             'FOREIGN KEY ([[media_id]]) REFERENCES {{%media}} ([[id]]) ON DELETE CASCADE ON UPDATE CASCADE',
38 38
         ], $tableOptions);
39 39
     }
Please login to merge, or discard this patch.
console/config/main.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 $params = array_merge(
3
-    require(__DIR__ . '/../../common/config/params.php'),
4
-    require(__DIR__ . '/../../common/config/params-local.php'),
5
-    require(__DIR__ . '/params.php'),
6
-    require(__DIR__ . '/params-local.php')
3
+    require(__DIR__.'/../../common/config/params.php'),
4
+    require(__DIR__.'/../../common/config/params-local.php'),
5
+    require(__DIR__.'/params.php'),
6
+    require(__DIR__.'/params-local.php')
7 7
 );
8 8
 
9 9
 return [
Please login to merge, or discard this patch.
backend/controllers/TermController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,13 +75,13 @@
 block discarded – undo
75 75
                     if ($termRelationship->save()) {
76 76
                         $item = $item
77 77
                             . '<br />'
78
-                            . Html::label(Html::checkbox('termIds[]', true, ['value' => $term->id]) . $term->name);
78
+                            . Html::label(Html::checkbox('termIds[]', true, ['value' => $term->id]).$term->name);
79 79
                     }
80 80
                 }
81 81
             } elseif ($term->save()) {
82 82
                 $item = $item
83 83
                     . '<br />'
84
-                    . Html::label(Html::checkbox('termIds[]', true, ['value' => $term->id]) . $term->name);
84
+                    . Html::label(Html::checkbox('termIds[]', true, ['value' => $term->id]).$term->name);
85 85
             }
86 86
         }
87 87
 
Please login to merge, or discard this patch.
backend/controllers/ThemeController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $arrThemes = scandir($this->_dir);
93 93
 
94 94
         foreach ($arrThemes as $theme) {
95
-            if (is_dir($this->_dir . $theme) && $theme !== '.' && $theme !== '..' && $theme !== $installed) {
95
+            if (is_dir($this->_dir.$theme) && $theme !== '.' && $theme !== '..' && $theme !== $installed) {
96 96
                 $themes[] = $this->getConfig($theme);
97 97
             }
98 98
         }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         }
132 132
 
133 133
         if (($model->file = UploadedFile::getInstance($model, 'file')) && $model->validate()) {
134
-            $themeTempPath = $this->_tmp . $model->file->name;
134
+            $themeTempPath = $this->_tmp.$model->file->name;
135 135
 
136 136
             if (!$model->file->saveAs($themeTempPath)) {
137 137
                 return $this->render('upload', [
@@ -156,15 +156,15 @@  discard block
 block discarded – undo
156 156
             $baseDir = substr($zipArchive->getNameIndex(0), 0, strpos($zipArchive->getNameIndex(0), '/'));
157 157
             $zipArchive->close();
158 158
 
159
-            if (is_dir($this->_dir . $baseDir)) {
159
+            if (is_dir($this->_dir.$baseDir)) {
160 160
                 FileHelper::removeDirectory($this->_tmp);
161 161
                 $errors[] = Yii::t('writesdown', 'Theme with the same directory already exist.');
162 162
             } else {
163
-                rename($this->_tmp . $baseDir, $this->_dir . $baseDir);
163
+                rename($this->_tmp.$baseDir, $this->_dir.$baseDir);
164 164
                 FileHelper::removeDirectory($this->_tmp);
165 165
 
166
-                if (is_file($this->_dir . $baseDir . '/screenshot.png')) {
167
-                    copy($this->_dir . $baseDir . '/screenshot.png', $this->_thumbDir . $baseDir . '.png');
166
+                if (is_file($this->_dir.$baseDir.'/screenshot.png')) {
167
+                    copy($this->_dir.$baseDir.'/screenshot.png', $this->_thumbDir.$baseDir.'.png');
168 168
                 }
169 169
 
170 170
                 $config = $this->getConfig($baseDir);
@@ -262,10 +262,10 @@  discard block
 block discarded – undo
262 262
                 }
263 263
             }
264 264
 
265
-            FileHelper::removeDirectory($this->_dir . $theme);
265
+            FileHelper::removeDirectory($this->_dir.$theme);
266 266
 
267
-            if (is_file($this->_thumbDir . $theme . '.png')) {
268
-                unlink($this->_thumbDir . $theme . '.png');
267
+            if (is_file($this->_thumbDir.$theme.'.png')) {
268
+                unlink($this->_thumbDir.$theme.'.png');
269 269
             }
270 270
         }
271 271
 
@@ -313,14 +313,14 @@  discard block
 block discarded – undo
313 313
     protected function getConfig($theme)
314 314
     {
315 315
         $config = [];
316
-        $configPath = $this->_dir . $theme . '/config/main.php';
316
+        $configPath = $this->_dir.$theme.'/config/main.php';
317 317
 
318 318
         if (is_file($configPath)) {
319 319
             $config = require($configPath);
320 320
         }
321 321
 
322
-        $config['thumbnail'] = is_file($this->_thumbDir . $theme . '.png')
323
-            ? $this->_thumbBaseUrl . $theme . '.png'
322
+        $config['thumbnail'] = is_file($this->_thumbDir.$theme.'.png')
323
+            ? $this->_thumbBaseUrl.$theme.'.png'
324 324
             : Yii::getAlias('@web/img/themes.png');
325 325
         $config['directory'] = $theme;
326 326
 
Please login to merge, or discard this patch.
backend/views/theme/_navigation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@
 block discarded – undo
11 11
 echo Nav::widget([
12 12
     'items' => [
13 13
         [
14
-            'label' => '<i class="fa fa-list"></i> <span>' . Yii::t('writesdown', 'Available Themes') . '</span>',
14
+            'label' => '<i class="fa fa-list"></i> <span>'.Yii::t('writesdown', 'Available Themes').'</span>',
15 15
             'url' => ['index'],
16 16
         ],
17 17
         [
18
-            'label' => '<i class="fa fa-upload"></i> <span>' . Yii::t('writesdown', 'Add New Theme') . '</span>',
18
+            'label' => '<i class="fa fa-upload"></i> <span>'.Yii::t('writesdown', 'Add New Theme').'</span>',
19 19
             'url' => ['upload'],
20 20
         ],
21 21
     ],
Please login to merge, or discard this patch.
backend/views/post/_form-term-js.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 if (!$model->isNewRecord) {
18 18
     $onItemRemove = 'onItemRemove: function (value) {
19 19
         $.ajax({
20
-            url: "' . Url::to(['/term-relationship/ajax-delete-non-hierarchical']) . '",
20
+            url: "' . Url::to(['/term-relationship/ajax-delete-non-hierarchical']).'",
21 21
             data: {
22 22
                 TermRelationship: {
23
-                    post_id: "' . $model->id . '",
23
+                    post_id: "' . $model->id.'",
24 24
                     term_id: value
25 25
                 },
26 26
                 _csrf: yii.getCsrfToken()
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
     },';
31 31
     $onItemAdd = 'onItemAdd: function (value) {
32 32
         $.ajax({
33
-            url: "' . Url::to(['/term-relationship/ajax-create-non-hierarchical']) . '",
33
+            url: "' . Url::to(['/term-relationship/ajax-create-non-hierarchical']).'",
34 34
             data: {
35 35
                 TermRelationship: {
36
-                    post_id: "' . $model->id . '",
36
+                    post_id: "' . $model->id.'",
37 37
                     term_id: value
38 38
                 },
39 39
                 _csrf: yii.getCsrfToken()
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             plugins: ["remove_button"],
54 54
             create: function (input, callback) {
55 55
                 $.ajax({
56
-                    url: "' . Url::to(['/term/ajax-create-non-hierarchical']) . '",
56
+                    url: "' . Url::to(['/term/ajax-create-non-hierarchical']).'",
57 57
                     data: {
58 58
                         Term: {
59 59
                             name: input,
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     . 'load: function (query, callback) {
73 73
             if (!query.length) return callback();
74 74
                 $.ajax({
75
-                    url: "' . Url::to(['/term/ajax-search']) . '",
75
+                    url: "' . Url::to(['/term/ajax-search']).'",
76 76
                     type: "POST",
77 77
                     dataType: "json",
78 78
                     data: {
Please login to merge, or discard this patch.
backend/views/post/_form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     ]) ?>
21 21
 
22 22
     <?= $form->field($model, 'slug', [
23
-        'template' => '<span class="input-group-addon">' . $model->getAttributeLabel('slug') . '</span>{input}',
23
+        'template' => '<span class="input-group-addon">'.$model->getAttributeLabel('slug').'</span>{input}',
24 24
         'options' => [
25 25
             'class' => 'input-group form-group input-group-sm',
26 26
         ],
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             'compressorRoute' => 'editor/compressor',
46 46
             'settings' => [
47 47
                 'menubar' => false,
48
-                'skin_url' => Url::base(true) . '/editor/skins/writesdown',
48
+                'skin_url' => Url::base(true).'/editor/skins/writesdown',
49 49
                 'toolbar_items_size' => 'medium',
50 50
                 'toolbar' => 'undo redo | styleselect | bold italic | alignleft aligncenter '
51 51
                     . 'alignright alignjustify | bullist numlist outdent indent | link image | code fullscreen',
Please login to merge, or discard this patch.
backend/views/post/index.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             ) ?>
42 42
 
43 43
             <?= ButtonDropdown::widget([
44
-                'label' => Html::tag('i', '', ['class' => 'fa fa-user']) . ' Author',
44
+                'label' => Html::tag('i', '', ['class' => 'fa fa-user']).' Author',
45 45
                 'dropdown' => [
46 46
                     'items' => [
47 47
                         [
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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, [
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
 </div>
139 139
 <?php $this->registerJs('jQuery(".bulk-button").click(function(e){
140 140
     e.preventDefault();
141
-    if(confirm("' . Yii::t("app", "Are you sure to do this?") . '")){
141
+    if(confirm("' . Yii::t("app", "Are you sure to do this?").'")){
142 142
         var ids     = $("#post-grid-view").yiiGridView("getSelectedRows"); // returns an array of pkeys, and #grid is your grid element id
143 143
         var action  = $(this).parents(".form-group").find(".bulk-action").val();
144 144
         $.ajax({
145
-            url: "' . Url::to(["bulk-action"]) . '",
145
+            url: "' . Url::to(["bulk-action"]).'",
146 146
             data: { ids: ids, action: action, _csrf: yii.getCsrfToken() },
147 147
             type:"POST",
148 148
             success: function(data){
Please login to merge, or discard this patch.