Passed
Push — master ( 0d9957...3a195a )
by Mihail
04:49
created
Apps/View/Admin/default/user/user_clear.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
             ['text' => $model->getUser()->id],
35 35
             ['text' => $model->getUser()->email],
36 36
             ['text' => $model->getUser()->login],
37
-            ['text' => $model->getUser()->profile->nick ?? 'id' . $model->getUser()->id],
37
+            ['text' => $model->getUser()->profile->nick ?? 'id'.$model->getUser()->id],
38 38
             ['text' => Date::convertToDatetime($model->getUser()->created_at, Date::FORMAT_TO_HOUR)],
39 39
         ])->display() ?>
40 40
 </div>
Please login to merge, or discard this patch.
Apps/View/Admin/default/content/content_update.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
             $langMenu->menu([
52 52
                 'text' => Str::upperCase($lang),
53 53
                 'tab' => function() use ($form, $lang) {
54
-                    return $form->fieldset()->text('title.' . $lang, null, __('Fill the title of the content for current language locale')) .
55
-                        '<strong>' . __('Content text') . '</strong><br />' .
56
-                        $form->field()->textarea('text.' . $lang, ['class' => 'form-control wysiwyg', 'rows' => 7]);
54
+                    return $form->fieldset()->text('title.'.$lang, null, __('Fill the title of the content for current language locale')).
55
+                        '<strong>'.__('Content text').'</strong><br />'.
56
+                        $form->field()->textarea('text.'.$lang, ['class' => 'form-control wysiwyg', 'rows' => 7]);
57 57
                 },
58 58
                 'tabActive' => $lang === \App::$Request->getLanguage()
59 59
             ]);
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
             $langMenu->menu([
73 73
                 'text' => Str::upperCase($lang),
74 74
                 'tab' => function() use ($form, $lang) {
75
-                    return $form->fieldset()->text('metaTitle.' . $lang, null, __('Set meta title for content page (displayed in browser head). Recommended length: 50-70 chars')).
76
-                        $form->fieldset()->text('metaKeywords.' . $lang, ['class' => 'tag-selectize'], __('Set meta keywords for this content (for search engine crawlers) separated by comma')).
77
-                        $form->fieldset()->text('metaTitle.' . $lang, null, __('Set meta description for this content (for search engine crawlers). Recommended length: 200-250 chars'));
75
+                    return $form->fieldset()->text('metaTitle.'.$lang, null, __('Set meta title for content page (displayed in browser head). Recommended length: 50-70 chars')).
76
+                        $form->fieldset()->text('metaKeywords.'.$lang, ['class' => 'tag-selectize'], __('Set meta keywords for this content (for search engine crawlers) separated by comma')).
77
+                        $form->fieldset()->text('metaTitle.'.$lang, null, __('Set meta description for this content (for search engine crawlers). Recommended length: 200-250 chars'));
78 78
                 },
79 79
                 'tabActive' => $lang === \App::$Request->getLanguage()
80 80
             ]);
@@ -92,16 +92,16 @@  discard block
 block discarded – undo
92 92
             <div class="dropzone dropzone-previews" id="ffcms-dropzone"></div>
93 93
         </div>
94 94
         <div class="col-md-4">
95
-        ' . $form->fieldset()->select('poster', ['options' => [__('Not selected...')]], __("Select image from gallery as a poster for this content")) . '
95
+        ' . $form->fieldset()->select('poster', ['options' => [__('Not selected...')]], __("Select image from gallery as a poster for this content")).'
96 96
         </div>
97 97
     </div><br/><br/>';
98 98
     }])
99 99
     ->menu(['text' => __('Other'), 'tab' => function() use ($form, $model) {
100
-        return $form->fieldset()->boolean('display', null, __('Can users view this content or only available for administrators?')) .
101
-            $form->fieldset()->boolean('important', null, __('Make this material important and stack it on top of all news?')) .
102
-            $form->fieldset()->text('createdAt', ['class' => 'form-control datepick'], __('Set the date of creation or leave empty for current date')) .
103
-            $form->fieldset()->select('authorId', ['options' => $model->getUserIdName(), 'optionsKey' => true, 'class' => 'selectize-option'], __('Enter author user_id or leave empty to set current user as author')) .
104
-            $form->fieldset()->text('source', null, __('Set source URL if this content is copied from another website')) .
100
+        return $form->fieldset()->boolean('display', null, __('Can users view this content or only available for administrators?')).
101
+            $form->fieldset()->boolean('important', null, __('Make this material important and stack it on top of all news?')).
102
+            $form->fieldset()->text('createdAt', ['class' => 'form-control datepick'], __('Set the date of creation or leave empty for current date')).
103
+            $form->fieldset()->select('authorId', ['options' => $model->getUserIdName(), 'optionsKey' => true, 'class' => 'selectize-option'], __('Enter author user_id or leave empty to set current user as author')).
104
+            $form->fieldset()->text('source', null, __('Set source URL if this content is copied from another website')).
105 105
             $form->fieldset()->text('addRating', null, __('Add or reduce this content rating. Example: 5 gives +5 to total rating, -5 gives -5 to total'));
106 106
     }]);
107 107
 
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
                 ['text' => $comment->id],
129 129
                 ['text' => Text::snippet(\App::$Security->strip_tags($comment->message), 100)],
130 130
                 ['text' => $comment->getAnswerCount()],
131
-                ['text' => Url::a(['user/update', [$comment->user_id]], ($comment->user->profile->nick ?? 'id' . $comment->user->id)), 'html' => true],
131
+                ['text' => Url::a(['user/update', [$comment->user_id]], ($comment->user->profile->nick ?? 'id'.$comment->user->id)), 'html' => true],
132 132
                 ['text' => $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm'])
133 133
                     ->add('<i class="fa fa-pencil"></i>', ['comments/read', [$comment->id]], ['html' => true, 'class' => 'btn btn-primary', 'target' => '_blank'])
134 134
                     ->add('<i class="fa fa-trash-o"></i>', ['comments/delete', ['comment', $comment->id]], ['html' => true, 'class' => 'btn btn-danger', 'target' => '_blank'])
135
-                    ->display(),'properties' => ['class' => 'text-center'], 'html' => true
135
+                    ->display(), 'properties' => ['class' => 'text-center'], 'html' => true
136 136
                 ]
137 137
             ]);
138 138
         }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     var DropzoneFiles = [];
239 239
     $('#ffcms-dropzone').dropzone({
240 240
         url: script_url + '/api/content/galleryupload/<?= $model->galleryFreeId ?>?lang=' + script_lang,
241
-        dictDefaultMessage: '<?= __('Drop files here to upload in gallery') . '<br />' . __('(or click here)') ?>',
241
+        dictDefaultMessage: '<?= __('Drop files here to upload in gallery').'<br />'.__('(or click here)') ?>',
242 242
         acceptedFiles: ".jpeg,.jpg,.png,.gif,.webp",
243 243
         addRemoveLinks: true,
244 244
         removedfile: function (file) { // file remove click, lets try to remove file from server & make visual changes
Please login to merge, or discard this patch.
Apps/View/Admin/default/content/category_list.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 <h1><?= __('Category list') ?></h1>
26 26
 <div class="row">
27 27
     <div class="col-md-12">
28
-        <?= Url::a(['content/categoryupdate'], '<i class="fa fa-plus"></i> ' . __('Add category'), ['class' => 'btn btn-primary', 'html' => true]) ?>
28
+        <?= Url::a(['content/categoryupdate'], '<i class="fa fa-plus"></i> '.__('Add category'), ['class' => 'btn btn-primary', 'html' => true]) ?>
29 29
     </div>
30 30
 </div>
31 31
 <div class="table-responsive">
@@ -56,17 +56,17 @@  discard block
 block discarded – undo
56 56
             <tr>
57 57
                 <td>
58 58
                     <div class="row">
59
-                        <div class="d-none d-md-block col-md-<?= $offset ?> col-xs-<?= $offset+2 ?> " style="border-bottom: 2px solid #8a8a8a;height: 1px;padding-top: 10px;"></div>
60
-                        <div class="col-md-<?= $set ?> col-xs-<?= $set-2 ?>">
59
+                        <div class="d-none d-md-block col-md-<?= $offset ?> col-xs-<?= $offset + 2 ?> " style="border-bottom: 2px solid #8a8a8a;height: 1px;padding-top: 10px;"></div>
60
+                        <div class="col-md-<?= $set ?> col-xs-<?= $set - 2 ?>">
61 61
                             <?= $row->getLocaled('title') ?>
62 62
                             <sup>id: <?= $row->id ?></sup>
63
-                            <a href="<?= \App::$Alias->scriptUrl . '/content/list/' . $row->path ?>" target="_blank" class="badge badge-secondary">/<?= $row->path ?></a>
63
+                            <a href="<?= \App::$Alias->scriptUrl.'/content/list/'.$row->path ?>" target="_blank" class="badge badge-secondary">/<?= $row->path ?></a>
64 64
                         </div>
65 65
                     </div>
66 66
                 </td>
67 67
                 <td class="text-center">
68 68
                     <?php $btn = $this->bootstrap()->btngroup(['class' => 'btn-group btn-group-sm', 'dropdown' => ['class' => 'btn-group btn-group-sm'], 'role' => 'group'], 4)
69
-                        ->add('<i class="fa fa-eye"></i>', [\App::$Alias->scriptUrl . '/content/list/' . $row->path], ['html' => true, 'target' => '_blank'])
69
+                        ->add('<i class="fa fa-eye"></i>', [\App::$Alias->scriptUrl.'/content/list/'.$row->path], ['html' => true, 'target' => '_blank'])
70 70
                         ->add('<i class="fa fa-plus"></i>', ['content/categoryupdate', null, ['parent' => $row->id]], ['class' => 'btn btn-success', 'data-toggle' => 'tooltip', 'title' => __('Add subcategory'), 'html' => true])
71 71
                         ->add('<i class="fa fa-cog"></i>', ['content/categoryupdate', [$row->id]], ['class' => 'btn btn-primary', 'data-toggle' => 'tooltip', 'title' => __('Category configurations'), 'html' => true]);
72 72
                     if ($row->id > 1) {
Please login to merge, or discard this patch.
Apps/Model/Admin/User/FormUserClear.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function make()
72 72
     {
73
-        if ((bool)$this->comments) {
73
+        if ((bool) $this->comments) {
74 74
             CommentPost::where('user_id', $this->_user->id)->delete();
75 75
             CommentAnswer::where('user_id', $this->_user->id)->delete();
76 76
         }
77 77
 
78
-        if ((bool)$this->content) {
78
+        if ((bool) $this->content) {
79 79
             $contents = Content::where('author_id', $this->_user->id);
80 80
             $ids = $contents->pluck('id')->toArray();
81 81
             if ($ids && count($ids) > 0) {
@@ -85,12 +85,12 @@  discard block
 block discarded – undo
85 85
             }
86 86
         }
87 87
 
88
-        if ((bool)$this->feedback) {
88
+        if ((bool) $this->feedback) {
89 89
             FeedbackPost::where('user_id', $this->_user->id)
90 90
                 ->update(['readed' => true, 'closed' => true]);
91 91
         }
92 92
 
93
-        if ((bool)$this->wall) {
93
+        if ((bool) $this->wall) {
94 94
             WallPost::where('sender_id', $this->_user->id)->delete();
95 95
             WallAnswer::where('user_id', $this->_user->id)->delete();
96 96
         }
Please login to merge, or discard this patch.
Apps/Model/Admin/User/FormUserDelete.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         foreach ($this->users as $user) {
80 80
             $uid = $user->id;
81 81
             // delete whole website info for this user
82
-            if ((bool)$this->delete) {
82
+            if ((bool) $this->delete) {
83 83
                 $model = new FormUserClear($user);
84 84
                 $model->comments = true;
85 85
                 $model->content = true;
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
             }
90 90
 
91 91
             // delete avatars
92
-            File::remove('/upload/user/avatar/big/' . $uid . '.jpg');
93
-            File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');
94
-            File::remove('/upload/user/avatar/small/' . $uid . '.jpg');
95
-            File::remove('/upload/user/avatar/original/' . $uid . '.jpg');
92
+            File::remove('/upload/user/avatar/big/'.$uid.'.jpg');
93
+            File::remove('/upload/user/avatar/medium/'.$uid.'.jpg');
94
+            File::remove('/upload/user/avatar/small/'.$uid.'.jpg');
95
+            File::remove('/upload/user/avatar/original/'.$uid.'.jpg');
96 96
             // delete user profile and auth data
97 97
             $user->profile()->delete();
98 98
             // delete user provider data
Please login to merge, or discard this patch.
Apps/Model/Admin/Content/FormContentUpdate.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         if (!$this->_content->id) {
67 67
             $this->_new = true;
68 68
             if (!$this->galleryFreeId) {
69
-                $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32));
69
+                $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32));
70 70
             }
71 71
 
72 72
             if (!$this->authorId) {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                 $this->categoryId = 1;
78 78
             }
79 79
             if (!$this->path) {
80
-                $this->path = Integer::random(8) . '-' . date('d-m-Y');
80
+                $this->path = Integer::random(8).'-'.date('d-m-Y');
81 81
             }
82 82
 
83 83
             if ($this->cloneId > 0) {
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
     public function rules(): array
116 116
     {
117 117
         $res = [
118
-            ['title.' . App::$Request->getLanguage(), 'required'],
119
-            ['text.' . App::$Request->getLanguage(), 'required'],
118
+            ['title.'.App::$Request->getLanguage(), 'required'],
119
+            ['text.'.App::$Request->getLanguage(), 'required'],
120 120
             ['text', 'used'],
121 121
             ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'],
122 122
             [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title', 'important'], 'required'],
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
         ];
130 130
 
131 131
         foreach (App::$Properties->get('languages') as $lang) {
132
-            $res[] = ['title.' . $lang, 'length_max', 120, null, true, true];
133
-            $res[] = ['keywords.' . $lang, 'length_max', 150];
134
-            $res[] = ['description.' . $lang, 'length_max', 250];
132
+            $res[] = ['title.'.$lang, 'length_max', 120, null, true, true];
133
+            $res[] = ['keywords.'.$lang, 'length_max', 150];
134
+            $res[] = ['description.'.$lang, 'length_max', 250];
135 135
         }
136 136
 
137 137
         return $res;
@@ -187,10 +187,10 @@  discard block
 block discarded – undo
187 187
         $this->_content->meta_keywords = $this->metaKeywords;
188 188
         $this->_content->meta_description = $this->metaDescription;
189 189
         $this->_content->source = $this->source;
190
-        $this->_content->important = (int)$this->important;
190
+        $this->_content->important = (int) $this->important;
191 191
         // check if rating is changed
192
-        if ((int)$this->addRating !== 0) {
193
-            $this->_content->rating += (int)$this->addRating;
192
+        if ((int) $this->addRating !== 0) {
193
+            $this->_content->rating += (int) $this->addRating;
194 194
         }
195 195
 
196 196
         // check if date is updated
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         }
200 200
 
201 201
         // save poster data
202
-        $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster;
202
+        $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster;
203 203
         if (File::exist($posterPath)) {
204 204
             $this->_content->poster = $this->poster;
205 205
         }
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 
235 235
         // move files
236 236
         if ($tmpGalleryId !== $this->_content->id) {
237
-            Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id);
237
+            Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id);
238 238
         }
239 239
     }
240 240
 
@@ -273,9 +273,9 @@  discard block
 block discarded – undo
273 273
     public function getUserIdName(): ?array
274 274
     {
275 275
         $users = [];
276
-        User::with('profile')->get()->each(function ($user) use (&$users) {
276
+        User::with('profile')->get()->each(function($user) use (&$users) {
277 277
             /** @var User $user */
278
-            $users[$user->id] = ($user->profile->nick ?? 'id' . $user->id) . ' (' . $user->email . ')';
278
+            $users[$user->id] = ($user->profile->nick ?? 'id'.$user->id).' ('.$user->email.')';
279 279
         });
280 280
 
281 281
         return $users;
Please login to merge, or discard this patch.
Apps/Controller/Admin/Content/ActionUpdate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             ->withTrashed()
32 32
             ->findOrNew($id);
33 33
         $isNew = $record->id === null;
34
-        $cloneId = (int)$this->request->query->get('from', 0);
34
+        $cloneId = (int) $this->request->query->get('from', 0);
35 35
 
36 36
         // init model
37 37
         $model = new FormContentUpdate($record, $cloneId);
Please login to merge, or discard this patch.
Private/Migrations/Updates/update_cms_310-2017-07-29-11-00-00.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     public function up()
18 18
     {
19 19
         // set nullable varchar type for token column
20
-        $this->getSchema()->table('users', function($table){
20
+        $this->getSchema()->table('users', function($table) {
21 21
             $table->string('approve_token', 128)->nullable()->default(null)->change();
22 22
         });
23 23
         // set approve_token = null where it like '0' str or ''
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             });
32 32
         }
33 33
         if (!$this->getSchema()->hasColumn('comment_answers', 'app_relation_id')) {
34
-            $this->getSchema()->table('comment_answers', function ($table){
34
+            $this->getSchema()->table('comment_answers', function($table) {
35 35
                 $table->integer('app_relation_id')->unsigned()->default(0)->after('app_name');
36 36
             });
37 37
         }
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 
42 42
         // @todo: add algo to find app_name & app_id for oldest comments
43 43
         if ($this->getSchema()->hasColumn('comment_posts', 'pathway')) {
44
-            $this->getSchema()->table('comment_posts', function ($table){
44
+            $this->getSchema()->table('comment_posts', function($table) {
45 45
                 $table->dropColumn('pathway');
46 46
             });
47 47
         }
48 48
         // remove comment_hash column from content
49 49
         if ($this->getSchema()->hasColumn('contents', 'comment_hash')) {
50
-            $this->getSchema()->table('contents', function ($table){
50
+            $this->getSchema()->table('contents', function($table) {
51 51
                 $table->dropColumn('comment_hash');
52 52
             });
53 53
         }
Please login to merge, or discard this patch.
Apps/View/Front/default/_layouts/default.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     <?php if (\App::$Debug): ?>
31 31
         <?= \App::$Debug->renderHead() ?>
32 32
     <?php endif; ?>
33
-    <?php if (!isset($fullgrid)){ $fullgrid = false; } ?>
33
+    <?php if (!isset($fullgrid)) { $fullgrid = false; } ?>
34 34
 </head>
35 35
 <body class="bg-light">
36 36
 
@@ -45,23 +45,23 @@  discard block
 block discarded – undo
45 45
 if (\App::$Properties->get('multiLanguage') && count(\App::$Properties->get('languages')) > 1) {
46 46
     foreach (\App::$Properties->get('languages') as $lang) {
47 47
         $navbar->menu('left', [
48
-            'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" alt="' . $lang . '">',
49
-            'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(),
48
+            'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'">',
49
+            'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(),
50 50
             'html' => true
51 51
         ]);
52 52
     }
53 53
 }
54 54
 if (\App::$User->isAuth()) {
55 55
     $userId = \App::$User->identity()->getId();
56
-    $navbar->menu('right', ['text' => __('Account') . ' <span class="badge" id="summary-count-block">0</span>', 'dropdown' => [
56
+    $navbar->menu('right', ['text' => __('Account').' <span class="badge" id="summary-count-block">0</span>', 'dropdown' => [
57 57
         ['text' => __('My profile'), 'link' => ['profile/show', [$userId]]],
58
-        ['text' => __('Messages') . ' <span class="badge" id="pm-count-block">0</span>', 'link' => ['profile/messages'], 'class' => 'dropdown-item', 'html' => true],
58
+        ['text' => __('Messages').' <span class="badge" id="pm-count-block">0</span>', 'link' => ['profile/messages'], 'class' => 'dropdown-item', 'html' => true],
59 59
         ['text' => __('Feed'), 'link' => ['profile/feed'], 'class' => 'dropdown-item'],
60
-        ['text' => __('Notifications') . ' <span class="badge" id="notify-count-block">0</span>', 'link' => ['profile/notifications'], 'class' => 'dropdown-item', 'html' => true],
60
+        ['text' => __('Notifications').' <span class="badge" id="notify-count-block">0</span>', 'link' => ['profile/notifications'], 'class' => 'dropdown-item', 'html' => true],
61 61
         ['text' => __('Settings'), 'link' => ['profile/settings'], 'class' => 'dropdown-item'],
62 62
     ], 'properties' => ['html' => true]]);
63 63
     if (\App::$User->identity()->role->can('Admin/Main/Index')) {
64
-        $navbar->menu('right', ['text' => __('Admin'), 'link' => \App::$Alias->scriptUrl . '/admin']);
64
+        $navbar->menu('right', ['text' => __('Admin'), 'link' => \App::$Alias->scriptUrl.'/admin']);
65 65
     }
66 66
     $navbar->menu('right', ['text' => __('Logout'), 'link' => ['user/logout']]);
67 67
 } else {
Please login to merge, or discard this patch.