Passed
Push — master ( 492cc7...e5a5fc )
by Michael
45s queued 11s
created
admin/admin_type_manager.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 use Xmf\Request;
14 14
 
15
-require_once __DIR__ . '/admin_header.php';
15
+require_once __DIR__.'/admin_header.php';
16 16
 xoops_cp_header();
17 17
 echo '<br>';
18 18
 require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             }
86 86
         }
87 87
         if (count($type_del) > 0) {
88
-            $type_list = $typeHandler->getList(new \Criteria('type_id', '(' . implode(', ', $type_del) . ')', 'IN'));
88
+            $type_list = $typeHandler->getList(new \Criteria('type_id', '('.implode(', ', $type_del).')', 'IN'));
89 89
             xoops_confirm(['op' => 'delete', 'type_del' => serialize($type_del)], xoops_getenv('PHP_SELF'), sprintf(_AM_NEWBB_TODEL_TYPE, implode(', ', array_values($type_list))), '', false);
90 90
         } else {
91 91
             redirect_header(xoops_getenv('PHP_SELF'), 2, _MD_NEWBB_DBUPDATED);
@@ -115,14 +115,14 @@  discard block
 block discarded – undo
115 115
         $adminObject->addItemButton(_AM_NEWBB_TYPE_TEMPLATE_APPLY, 'admin_type_manager.php?op=apply', $icon = 'add');
116 116
         $adminObject->addItemButton(_AM_NEWBB_TYPE_FORUM, 'admin_type_manager.php?op=forum', $icon = 'add');
117 117
         $adminObject->displayButton('left');
118
-        echo '<legend style="font-weight: bold; color: #900;">' . _AM_NEWBB_TYPE_ORDER_DESC . '</legend>';
119
-        echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>";
120
-        echo "<form name='template' method='post' action='" . xoops_getenv('PHP_SELF') . "'>";
118
+        echo '<legend style="font-weight: bold; color: #900;">'._AM_NEWBB_TYPE_ORDER_DESC.'</legend>';
119
+        echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>";
120
+        echo "<form name='template' method='post' action='".xoops_getenv('PHP_SELF')."'>";
121 121
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
122 122
         echo "<tr align='center'>";
123
-        echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_ORDER . '</th>';
124
-        echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_NAME . '</th>';
125
-        echo "<th class='bg3'>" . _AM_NEWBB_TYPE_DESCRIPTION . '</th>';
123
+        echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_ORDER.'</th>';
124
+        echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_NAME.'</th>';
125
+        echo "<th class='bg3'>"._AM_NEWBB_TYPE_DESCRIPTION.'</th>';
126 126
         echo '</tr>';
127 127
 
128 128
         if ($templates = $cacheHelper->read('type_template')) {
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
                 }
134 134
                 $typeObject = $typesObject[$key];
135 135
                 echo "<tr class='even' align='left'>";
136
-                echo "<td><input type='text' name='type_order[{$key}]' value='" . $order . "' size='10' /></td>";
137
-                echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>';
138
-                echo '<td>' . $typeObject->getVar('type_description') . '</td>';
136
+                echo "<td><input type='text' name='type_order[{$key}]' value='".$order."' size='10' /></td>";
137
+                echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>';
138
+                echo '<td>'.$typeObject->getVar('type_description').'</td>';
139 139
                 echo '</tr>';
140 140
                 unset($typesObject[$key]);
141 141
             }
@@ -144,15 +144,15 @@  discard block
 block discarded – undo
144 144
         foreach ($typesObject as $key => $typeObject) {
145 145
             echo "<tr class='odd' align='left'>";
146 146
             echo "<td><input type='text' name='type_order[{$key}]' value='0' size='10' /></td>";
147
-            echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>';
148
-            echo '<td>' . $typeObject->getVar('type_description') . '</td>';
147
+            echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>';
148
+            echo '<td>'.$typeObject->getVar('type_description').'</td>';
149 149
             echo '</tr>';
150 150
         }
151 151
 
152 152
         echo "<tr><td colspan='3' style='text-align:center;'>";
153 153
         echo "<input type='hidden' name='op' value='save_template' />";
154
-        echo "<input type='submit' name='submit' value='" . _SUBMIT . "' /> ";
155
-        echo "<input type='reset' value='" . _CANCEL . "' />";
154
+        echo "<input type='submit' name='submit' value='"._SUBMIT."' /> ";
155
+        echo "<input type='reset' value='"._CANCEL."' />";
156 156
         echo '</td></tr></table>';
157 157
         echo '</form>';
158 158
         echo '</td></tr></table>';
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
     case 'save_template':
162 162
         $templates = array_flip(array_filter(Request::getArray('type_order', [], 'POST')));
163 163
         $cacheHelper->write('type_template', $templates);
164
-        redirect_header(xoops_getenv('PHP_SELF') . '?op=template', 2, _MD_NEWBB_DBUPDATED);
164
+        redirect_header(xoops_getenv('PHP_SELF').'?op=template', 2, _MD_NEWBB_DBUPDATED);
165 165
         break;
166 166
 
167 167
     case 'apply':
168 168
         if (!$templates = $cacheHelper->read('type_template')) {
169
-            redirect_header(xoops_getenv('PHP_SELF') . '?op=template', 2, _AM_NEWBB_TYPE_TEMPLATE_ERR);
169
+            redirect_header(xoops_getenv('PHP_SELF').'?op=template', 2, _AM_NEWBB_TYPE_TEMPLATE_ERR);
170 170
         }
171 171
 
172 172
         //        $categoryHandler  = Newbb\Helper::getInstance()->getHandler('Category');
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
         //        $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
177 177
         $forums = $forumHandler->getTree(array_keys($categories), 0, 'all');
178 178
         foreach (array_keys($forums) as $c) {
179
-            $fm_options[-1 * $c] = '[' . $categories[$c] . ']';
179
+            $fm_options[-1 * $c] = '['.$categories[$c].']';
180 180
             foreach (array_keys($forums[$c]) as $f) {
181
-                $fm_options[$f] = $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'];
181
+                $fm_options[$f] = $forums[$c][$f]['prefix'].$forums[$c][$f]['forum_name'];
182 182
             }
183 183
         }
184 184
         unset($forums, $categories);
@@ -199,15 +199,15 @@  discard block
 block discarded – undo
199 199
         $adminObject->addItemButton(_AM_NEWBB_TYPE_FORUM, 'admin_type_manager.php?op=forum', $icon = 'add');
200 200
         $adminObject->displayButton('left');
201 201
 
202
-        echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>";
202
+        echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>";
203 203
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
204 204
         echo "<tr align='center'>";
205
-        echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_NAME . '</th>';
206
-        echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_ORDER . '</th>';
207
-        echo "<th class='bg3'>" . _AM_NEWBB_TYPE_DESCRIPTION . '</th>';
205
+        echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_NAME.'</th>';
206
+        echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_ORDER.'</th>';
207
+        echo "<th class='bg3'>"._AM_NEWBB_TYPE_DESCRIPTION.'</th>';
208 208
         echo '</tr>';
209 209
 
210
-        $typesObject = $typeHandler->getAll(new \Criteria('type_id', '(' . implode(', ', array_values($templates)) . ')', 'IN'));
210
+        $typesObject = $typeHandler->getAll(new \Criteria('type_id', '('.implode(', ', array_values($templates)).')', 'IN'));
211 211
         arsort($templates);
212 212
         foreach ($templates as $order => $key) {
213 213
             if (!isset($typesObject[$key])) {
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
             }
216 216
             $typeObject = $typesObject[$key];
217 217
             echo "<tr class='even' align='left'>";
218
-            echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>';
219
-            echo '<td>' . $order . '</td>';
220
-            echo '<td>' . $typeObject->getVar('type_description') . '</td>';
218
+            echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>';
219
+            echo '<td>'.$order.'</td>';
220
+            echo '<td>'.$typeObject->getVar('type_description').'</td>';
221 221
             echo '</tr>';
222 222
             unset($typesObject[$key]);
223 223
         }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
     case 'save_apply':
231 231
         if (!$templates = $cacheHelper->read('type_template')) {
232
-            redirect_header(xoops_getenv('PHP_SELF') . '?op=template', 2, _AM_NEWBB_TYPE_TEMPLATE);
232
+            redirect_header(xoops_getenv('PHP_SELF').'?op=template', 2, _AM_NEWBB_TYPE_TEMPLATE);
233 233
         }
234 234
         foreach (Request::getArray('forums', [], 'POST') as $forum) {
235 235
             if ($forum < 1) {
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
         }
256 256
 
257 257
         foreach (array_keys($forums) as $c) {
258
-            $fm_options[-1 * $c] = '[' . $categories[$c] . ']';
258
+            $fm_options[-1 * $c] = '['.$categories[$c].']';
259 259
             foreach (array_keys($forums[$c]) as $f) {
260
-                $fm_options[$f] = $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'];
260
+                $fm_options[$f] = $forums[$c][$f]['prefix'].$forums[$c][$f]['forum_name'];
261 261
             }
262 262
         }
263 263
         unset($forums, $categories);
@@ -282,12 +282,12 @@  discard block
 block discarded – undo
282 282
 
283 283
     case 'edit_forum':
284 284
         if (!Request::getInt('forum', 0, 'POST') || Request::getInt('forum', 0, 'POST') < 1) {
285
-            redirect_header(xoops_getenv('PHP_SELF') . '?op=forum', 2, _AM_NEWBB_TYPE_FORUM_ERR);
285
+            redirect_header(xoops_getenv('PHP_SELF').'?op=forum', 2, _AM_NEWBB_TYPE_FORUM_ERR);
286 286
         }
287 287
 
288 288
         //        $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
289 289
         if (!$forumObject = $forumHandler->get(Request::getInt('forum', 0, 'POST'))) {
290
-            redirect_header(xoops_getenv('PHP_SELF') . '?op=forum', 2, _AM_NEWBB_TYPE_FORUM_ERR);
290
+            redirect_header(xoops_getenv('PHP_SELF').'?op=forum', 2, _AM_NEWBB_TYPE_FORUM_ERR);
291 291
         }
292 292
 
293 293
         $typesObject = $typeHandler->getAll();
@@ -299,14 +299,14 @@  discard block
 block discarded – undo
299 299
         $adminObject->addItemButton(_AM_NEWBB_TYPE_TEMPLATE, 'admin_type_manager.php?op=template', $icon = 'add');
300 300
         $adminObject->addItemButton(_AM_NEWBB_TYPE_FORUM, 'admin_type_manager.php?op=forum', $icon = 'add');
301 301
         $adminObject->displayButton('left');
302
-        echo '<legend style="font-weight: bold; color: #900;">' . _AM_NEWBB_TYPE_ORDER_DESC . '</legend>';
303
-        echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>";
304
-        echo "<form name='template' method='post' action='" . xoops_getenv('PHP_SELF') . "'>";
302
+        echo '<legend style="font-weight: bold; color: #900;">'._AM_NEWBB_TYPE_ORDER_DESC.'</legend>';
303
+        echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>";
304
+        echo "<form name='template' method='post' action='".xoops_getenv('PHP_SELF')."'>";
305 305
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
306 306
         echo "<tr align='center'>";
307
-        echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_ORDER . '</th>';
308
-        echo "<th class='bg3' width='20%'>" . _AM_NEWBB_TYPE_NAME . '</th>';
309
-        echo "<th class='bg3'>" . _AM_NEWBB_TYPE_DESCRIPTION . '</th>';
307
+        echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_ORDER.'</th>';
308
+        echo "<th class='bg3' width='20%'>"._AM_NEWBB_TYPE_NAME.'</th>';
309
+        echo "<th class='bg3'>"._AM_NEWBB_TYPE_DESCRIPTION.'</th>';
310 310
         echo '</tr>';
311 311
 
312 312
         $types       = $typeHandler->getByForum(Request::getInt('forum', 0, 'POST'));
@@ -321,9 +321,9 @@  discard block
 block discarded – undo
321 321
             }
322 322
             $typeObject = $typesObject[$type['type_id']];
323 323
             echo "<tr class='even' align='left'>";
324
-            echo "<td><input type='text' name='type_order[" . $type['type_id'] . "]' value='" . $type['type_order'] . "' size='10' /></td>";
325
-            echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>';
326
-            echo '<td>' . $typeObject->getVar('type_description') . '</td>';
324
+            echo "<td><input type='text' name='type_order[".$type['type_id']."]' value='".$type['type_order']."' size='10' /></td>";
325
+            echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>';
326
+            echo '<td>'.$typeObject->getVar('type_description').'</td>';
327 327
             echo '</tr>';
328 328
             unset($typesObject[$type['type_id']]);
329 329
         }
@@ -331,17 +331,17 @@  discard block
 block discarded – undo
331 331
         foreach ($typesObject as $key => $typeObject) {
332 332
             echo "<tr class='odd' align='left'>";
333 333
             echo "<td><input type='text' name='type_order[{$key}]' value='0' size='10' /></td>";
334
-            echo "<td><em style='color:" . $typeObject->getVar('type_color') . ";'>" . $typeObject->getVar('type_name') . '</em></td>';
335
-            echo '<td>' . $typeObject->getVar('type_description') . '</td>';
334
+            echo "<td><em style='color:".$typeObject->getVar('type_color').";'>".$typeObject->getVar('type_name').'</em></td>';
335
+            echo '<td>'.$typeObject->getVar('type_description').'</td>';
336 336
             echo '</tr>';
337 337
         }
338 338
 
339 339
         echo "<tr><td colspan='3' style='text-align:center;'>";
340
-        echo '<legend style="font-weight: bold; color: #900;">' . _AM_NEWBB_TYPE_EDITFORUM_DESC . '</legend>';
341
-        echo "<input type='hidden' name='forum' value='" . Request::getInt('forum', 0, 'POST') . "' />";
340
+        echo '<legend style="font-weight: bold; color: #900;">'._AM_NEWBB_TYPE_EDITFORUM_DESC.'</legend>';
341
+        echo "<input type='hidden' name='forum' value='".Request::getInt('forum', 0, 'POST')."' />";
342 342
         echo "<input type='hidden' name='op' value='save_forum' />";
343
-        echo "<input type='submit' name='submit' value='" . _SUBMIT . "' /> ";
344
-        echo "<input type='reset' value='" . _CANCEL . "' />";
343
+        echo "<input type='submit' name='submit' value='"._SUBMIT."' /> ";
344
+        echo "<input type='reset' value='"._CANCEL."' />";
345 345
         echo '</td></tr></table>';
346 346
         echo '</form>';
347 347
         echo '</td></tr></table>';
@@ -349,10 +349,10 @@  discard block
 block discarded – undo
349 349
 
350 350
     case 'save_forum':
351 351
         if (!Request::getInt('forum', 0, 'POST') || Request::getInt('forum', 0, 'POST') < 1) {
352
-            redirect_header(xoops_getenv('PHP_SELF') . '?op=forum', 2, _AM_NEWBB_TYPE_FORUM);
352
+            redirect_header(xoops_getenv('PHP_SELF').'?op=forum', 2, _AM_NEWBB_TYPE_FORUM);
353 353
         }
354 354
         $typeHandler->updateByForum(Request::getInt('forum', 0, 'POST'), Request::getArray('type_order', null, 'POST'));
355
-        redirect_header(xoops_getenv('PHP_SELF') . '?op=forum', 2, _MD_NEWBB_DBUPDATED);
355
+        redirect_header(xoops_getenv('PHP_SELF').'?op=forum', 2, _MD_NEWBB_DBUPDATED);
356 356
         break;
357 357
 
358 358
     case 'add':
@@ -372,16 +372,16 @@  discard block
 block discarded – undo
372 372
             $adminObject->displayButton('left');
373 373
         }
374 374
         echo _AM_NEWBB_TYPE_HELP;
375
-        echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>";
376
-        echo "<form name='list' method='post' action='" . xoops_getenv('PHP_SELF') . "'>";
375
+        echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>";
376
+        echo "<form name='list' method='post' action='".xoops_getenv('PHP_SELF')."'>";
377 377
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
378 378
         echo "<tr align='center'>";
379 379
         if ('add' !== $op) {
380
-            echo "<th class='bg3' width='5%'>" . _DELETE . '</th>';
380
+            echo "<th class='bg3' width='5%'>"._DELETE.'</th>';
381 381
         }
382
-        echo "<th align='left' class='bg3' width='20%'>" . _AM_NEWBB_TYPE_NAME . '</th>';
383
-        echo "<th class='bg3' width='15%'>" . _AM_NEWBB_TYPE_COLOR . '</th>';
384
-        echo "<th align='left' class='bg3'>" . _AM_NEWBB_TYPE_DESCRIPTION . '</th>';
382
+        echo "<th align='left' class='bg3' width='20%'>"._AM_NEWBB_TYPE_NAME.'</th>';
383
+        echo "<th class='bg3' width='15%'>"._AM_NEWBB_TYPE_COLOR.'</th>';
384
+        echo "<th align='left' class='bg3'>"._AM_NEWBB_TYPE_DESCRIPTION.'</th>';
385 385
         echo '</tr>';
386 386
 
387 387
 //        $isColorpicker = require_once $GLOBALS['xoops']->path('class/xoopsform/formcolorpicker.php');
@@ -391,14 +391,14 @@  discard block
 block discarded – undo
391 391
             foreach ($typesObject as $key => $typeObject) {
392 392
                 echo "<tr class='odd' align='left'>";
393 393
                 echo "<td><input type='checkbox' name='type_del[{$key}]' /></td>";
394
-                echo "<td><input type='text' name='type_name[{$key}]' value='" . $typeObject->getVar('type_name') . "' size='10' /></td>";
394
+                echo "<td><input type='text' name='type_name[{$key}]' value='".$typeObject->getVar('type_name')."' size='10' /></td>";
395 395
                 if ($isColorpicker) {
396 396
                     $form_colorpicker = new \XoopsFormColorPicker('', "type_color[{$key}]", $typeObject->getVar('type_color'));
397
-                    echo '<td>' . $form_colorpicker->render() . '</td>';
397
+                    echo '<td>'.$form_colorpicker->render().'</td>';
398 398
                 } else {
399
-                    echo "<td><input type='text' name='type_color[{$key}]' value='" . $typeObject->getVar('type_color') . "' size='10' /></td>";
399
+                    echo "<td><input type='text' name='type_color[{$key}]' value='".$typeObject->getVar('type_color')."' size='10' /></td>";
400 400
                 }
401
-                echo "<td><input type='text' name='type_description[{$key}]' value='" . $typeObject->getVar('type_description') . "' size='30' /></td>";
401
+                echo "<td><input type='text' name='type_description[{$key}]' value='".$typeObject->getVar('type_description')."' size='30' /></td>";
402 402
                 echo '</tr>';
403 403
             }
404 404
             echo "<tr><td colspan='4' style='text-align:center;'>";
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                 echo "<td><input type='text' name='type_name[{$i}]' value='' size='10' /></td>";
412 412
                 if ($isColorpicker) {
413 413
                     $form_colorpicker = new \XoopsFormColorPicker('', "type_color[{$i}]", '');
414
-                    echo '<td>' . $form_colorpicker->render() . '</td>';
414
+                    echo '<td>'.$form_colorpicker->render().'</td>';
415 415
                 } else {
416 416
                     echo "<td><input type='text' name='type_color[{$i}]' value='' size='10' /></td>";
417 417
                 }
@@ -422,16 +422,16 @@  discard block
 block discarded – undo
422 422
             echo "<input type='hidden' name='isnew' value='1' />";
423 423
         }
424 424
         echo "<input type='hidden' name='op' value='save_type' />";
425
-        echo "<input type='submit' name='submit' value='" . _SUBMIT . "' /> ";
426
-        echo "<input type='reset' value='" . _CANCEL . "' />";
425
+        echo "<input type='submit' name='submit' value='"._SUBMIT."' /> ";
426
+        echo "<input type='reset' value='"._CANCEL."' />";
427 427
         echo '</td></tr></table>';
428 428
         echo '</form>';
429 429
         echo '</td></tr></table>';
430 430
         echo '<fieldset>';
431
-        echo '<legend>&nbsp;' . _MI_NEWBB_ADMENU_TYPE . '&nbsp;</legend>';
431
+        echo '<legend>&nbsp;'._MI_NEWBB_ADMENU_TYPE.'&nbsp;</legend>';
432 432
         echo _AM_NEWBB_HELP_TYPE_TAB;
433 433
         echo '</fieldset>';
434 434
         break;
435 435
 }
436 436
 
437
-require_once __DIR__ . '/admin_footer.php';
437
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/menu.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -41,82 +41,82 @@
 block discarded – undo
41 41
 $adminmenu[] = [
42 42
     'title' => _MI_NEWBB_ADMENU_INDEX,
43 43
     'link'  => 'admin/index.php',
44
-    'icon'  => $pathIcon32 . 'home.png'
44
+    'icon'  => $pathIcon32.'home.png'
45 45
 ];
46 46
 
47 47
 $adminmenu[] = [
48 48
     'title' => _MI_NEWBB_ADMENU_CATEGORY,
49 49
     'link'  => 'admin/admin_cat_manager.php',
50
-    'icon'  => $pathIcon32 . 'category.png'
50
+    'icon'  => $pathIcon32.'category.png'
51 51
 ];
52 52
 
53 53
 $adminmenu[] = [
54 54
     'title' => _MI_NEWBB_ADMENU_FORUM,
55 55
     'link'  => 'admin/admin_forum_manager.php',
56
-    'icon'  => $pathIcon32 . 'forums.png'
56
+    'icon'  => $pathIcon32.'forums.png'
57 57
 ];
58 58
 
59 59
 $adminmenu[] = [
60 60
     'title' => _MI_NEWBB_ADMENU_PERMISSION,
61 61
     'link'  => 'admin/admin_permissions.php',
62
-    'icon'  => $pathIcon32 . 'permissions.png'
62
+    'icon'  => $pathIcon32.'permissions.png'
63 63
 ];
64 64
 
65 65
 $adminmenu[] = [
66 66
     'title' => _MI_NEWBB_ADMENU_ORDER,
67 67
     'link'  => 'admin/admin_forum_reorder.php',
68
-    'icon'  => $pathIcon32 . 'compfile.png'
68
+    'icon'  => $pathIcon32.'compfile.png'
69 69
 ];
70 70
 
71 71
 $adminmenu[] = [
72 72
     'title' => _MI_NEWBB_ADMENU_PRUNE,
73 73
     'link'  => 'admin/admin_forum_prune.php',
74
-    'icon'  => $pathIcon32 . 'update.png'
74
+    'icon'  => $pathIcon32.'update.png'
75 75
 ];
76 76
 
77 77
 $adminmenu[] = [
78 78
     'title' => _MI_NEWBB_ADMENU_REPORT,
79 79
     'link'  => 'admin/admin_report.php',
80
-    'icon'  => $pathIcon32 . 'content.png'
80
+    'icon'  => $pathIcon32.'content.png'
81 81
 ];
82 82
 
83 83
 $adminmenu[] = [
84 84
     'title' => _MI_NEWBB_ADMENU_DIGEST,
85 85
     'link'  => 'admin/admin_digest.php',
86
-    'icon'  => $pathIcon32 . 'digest.png'
86
+    'icon'  => $pathIcon32.'digest.png'
87 87
 ];
88 88
 
89 89
 $adminmenu[] = [
90 90
     'title' => _MI_NEWBB_ADMENU_VOTE,
91 91
     'link'  => 'admin/admin_votedata.php',
92
-    'icon'  => $pathIcon32 . 'button_ok.png'
92
+    'icon'  => $pathIcon32.'button_ok.png'
93 93
 ];
94 94
 
95 95
 $adminmenu[] = [
96 96
     'title' => _MI_NEWBB_ADMENU_TYPE,
97 97
     'link'  => 'admin/admin_type_manager.php',
98
-    'icon'  => $pathIcon32 . 'type.png'
98
+    'icon'  => $pathIcon32.'type.png'
99 99
 ];
100 100
 
101 101
 $adminmenu[] = [
102 102
     'title' => _MI_NEWBB_ADMENU_GROUPMOD,
103 103
     'link'  => 'admin/admin_groupmod.php',
104
-    'icon'  => $pathIcon32 . 'groupmod.png'
104
+    'icon'  => $pathIcon32.'groupmod.png'
105 105
 ];
106 106
 
107 107
 $adminmenu[] = [
108 108
     'title' => _MI_NEWBB_ADMENU_SYNC,
109 109
     'link'  => 'admin/admin_synchronization.php',
110
-    'icon'  => $pathIcon32 . 'synchronized.png'
110
+    'icon'  => $pathIcon32.'synchronized.png'
111 111
 ];
112 112
 
113 113
 $adminmenu[] = [
114 114
     'title' => _MI_NEWBB_ADMENU_MIGRATE,
115 115
     'link'  => 'admin/migrate.php',
116
-    'icon'  => $pathIcon32 . 'database_go.png'
116
+    'icon'  => $pathIcon32.'database_go.png'
117 117
 ];
118 118
 $adminmenu[] = [
119 119
     'title' => _MI_NEWBB_ADMENU_ABOUT,
120 120
     'link'  => 'admin/about.php',
121
-    'icon'  => $pathIcon32 . 'about.png'
121
+    'icon'  => $pathIcon32.'about.png'
122 122
 ];
Please login to merge, or discard this patch.
class/Common/Configurator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         $moduleDirName = basename(dirname(dirname(__DIR__)));
46 46
         $capsDirName   = strtoupper($moduleDirName);
47 47
 
48
-        require_once  dirname(dirname(__DIR__)) . '/include/config.php';
48
+        require_once  dirname(dirname(__DIR__)).'/include/config.php';
49 49
         $config = getConfig();
50 50
 
51 51
         $this->name            = $config->name;
Please login to merge, or discard this patch.
class/Common/VersionChecks.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     public static function checkVerXoops(\XoopsModule $module = null, $requiredVer = null)
30 30
     {
31 31
         $moduleDirName = basename(dirname(dirname(__DIR__)));
32
-        $moduleDirNameUpper   = strtoupper($moduleDirName);
32
+        $moduleDirNameUpper = strtoupper($moduleDirName);
33 33
         if (null === $module) {
34 34
             $module = \XoopsModule::getByDirname($moduleDirName);
35 35
         }
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
         //check for minimum XOOPS version
39 39
         $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string
40 40
         if (null === $requiredVer) {
41
-            $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string
41
+            $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string
42 42
         }
43 43
         $success = true;
44 44
 
45 45
         if (version_compare($currentVer, $requiredVer, '<')) {
46 46
             $success = false;
47
-            $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer));
47
+            $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer));
48 48
         }
49 49
 
50 50
         return $success;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public static function checkVerPhp(\XoopsModule $module)
62 62
     {
63 63
         $moduleDirName = basename(dirname(dirname(__DIR__)));
64
-        $moduleDirNameUpper   = strtoupper($moduleDirName);
64
+        $moduleDirNameUpper = strtoupper($moduleDirName);
65 65
         xoops_loadLanguage('admin', $module->dirname());
66 66
         // check for minimum PHP version
67 67
         $success = true;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $reqVer  = $module->getInfo('min_php');
70 70
         if (false !== $reqVer && '' !== $reqVer) {
71 71
             if (version_compare($verNum, $reqVer, '<')) {
72
-                $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum));
72
+                $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum));
73 73
                 $success = false;
74 74
             }
75 75
         }
Please login to merge, or discard this patch.
class/Common/Migrate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
      * @throws \InvalidArgumentException
31 31
      */
32 32
     public function __construct()
33
-    {   require_once  dirname(dirname(__DIR__)) . '/include/config.php';
33
+    {   require_once  dirname(dirname(__DIR__)).'/include/config.php';
34 34
         $config = getConfig();
35
-        $this->renameTables            = $config->renameTables;
35
+        $this->renameTables = $config->renameTables;
36 36
 
37 37
         $moduleDirName = basename(dirname(dirname(__DIR__)));
38 38
         parent::__construct($moduleDirName);
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 $this->synchronizeTable($tableName);
90 90
                 $updateTable = $GLOBALS['xoopsDB']->prefix($tableName);
91 91
                 $joinTable   = $GLOBALS['xoopsDB']->prefix($srcTableName);
92
-                $sql         = "UPDATE `$updateTable` t1 INNER JOIN `$joinTable` t2 ON t1.post_id = t2.post_id \n" . "SET t1.dohtml = t2.dohtml,  t1.dosmiley = t2.dosmiley, t1.doxcode = t2.doxcode\n" . '  , t1.doimage = t2.doimage, t1.dobr = t2.dobr';
92
+                $sql         = "UPDATE `$updateTable` t1 INNER JOIN `$joinTable` t2 ON t1.post_id = t2.post_id \n"."SET t1.dohtml = t2.dohtml,  t1.dosmiley = t2.dosmiley, t1.doxcode = t2.doxcode\n".'  , t1.doimage = t2.doimage, t1.dobr = t2.dobr';
93 93
                 $this->tableHandler->addToQueue($sql);
94 94
             }
95 95
         }
Please login to merge, or discard this patch.
class/Readtopic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
 use XoopsModules\Newbb;
34 34
 
35
-require_once __DIR__ . '/Read.php';
35
+require_once __DIR__.'/Read.php';
36 36
 
37 37
 /**
38 38
  * A handler for read/unread handling
Please login to merge, or discard this patch.
class/ReadForum.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
 use XoopsModules\Newbb;
34 34
 
35
-require_once __DIR__ . '/Read.php';
35
+require_once __DIR__.'/Read.php';
36 36
 
37 37
 /**
38 38
  * A handler for read/unread handling
Please login to merge, or discard this patch.
include/functions.config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 use XoopsModules\Newbb;
15 15
 
16
-defined('NEWBB_FUNCTIONS_INI') || require __DIR__ . '/functions.ini.php';
16
+defined('NEWBB_FUNCTIONS_INI') || require __DIR__.'/functions.ini.php';
17 17
 define('NEWBB_FUNCTIONS_CONFIG_LOADED', true);
18 18
 
19 19
 if (!defined('NEWBB_FUNCTIONS_CONFIG')) {
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         }
38 38
 
39 39
         $configs = is_object($helper) ? $helper->getConfig() : [];
40
-        $plugins = require __DIR__   . '/plugin.php';
40
+        $plugins = require __DIR__.'/plugin.php';
41 41
         if (is_array($configs) && is_array($plugins)) {
42 42
             $configs = array_merge($configs, $plugins);
43 43
         }
Please login to merge, or discard this patch.
class/StatsHandler.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
14 14
 
15
-defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php';
15
+defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php';
16 16
 
17 17
 define('NEWBB_STATS_TYPE_TOPIC', 1);
18 18
 define('NEWBB_STATS_TYPE_POST', 2);
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function update($id, $type, $increment = 1)
73 73
     {
74
-        $id        = (int)$id;
75
-        $increment = (int)$increment;
74
+        $id        = (int) $id;
75
+        $increment = (int) $increment;
76 76
 
77 77
         if (empty($increment) || false === ($type = array_search($type, $this->param['type']))) {
78 78
             return false;
79 79
         }
80 80
 
81
-        $sql    = "    UPDATE {$this->table}"
81
+        $sql = "    UPDATE {$this->table}"
82 82
                   . '    SET stats_value = CASE '
83 83
                   . "                    WHEN time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format)  THEN stats_value + '{$increment}' "
84 84
                   . "                    ELSE '{$increment}' "
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $result = $this->db->queryF($sql);
91 91
         $rows   = $this->db->getAffectedRows();
92 92
         if (0 == $rows) {
93
-            $sql    = "    INSERT INTO {$this->table}"
93
+            $sql = "    INSERT INTO {$this->table}"
94 94
                       . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
95 95
                       . '    VALUES '
96 96
                       . "        ('0', '{$increment}', '{$type}', '"
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         foreach ($periods as $period) {
148 148
             $_periods[] = array_search($period, $this->param['period']);
149 149
         }
150
-        $sql    = '    SELECT stats_id, stats_value, stats_type, stats_period '
150
+        $sql = '    SELECT stats_id, stats_value, stats_type, stats_period '
151 151
                   . "    FROM {$this->table} "
152 152
                   . '    WHERE '
153 153
                   . "        ( time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format) ) "
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
                                         . implode(', ', array_map('intval', $ids))
157 157
                                         . ')')
158 158
                   . '        '
159
-                  . (empty($_types) ? '' : 'AND stats_type IN (' . implode(', ', $_types) . ')')
159
+                  . (empty($_types) ? '' : 'AND stats_type IN ('.implode(', ', $_types).')')
160 160
                   . '        '
161
-                  . (empty($_periods) ? '' : 'AND stats_period IN (' . implode(', ', $_periods) . ')');
161
+                  . (empty($_periods) ? '' : 'AND stats_period IN ('.implode(', ', $_periods).')');
162 162
         $result = $this->db->query($sql);
163 163
 
164 164
         while (false !== ($row = $this->db->fetchArray($result))) {
165
-            $ret[(string)$row['stats_id']][$this->param['type'][$row['stats_type']]][$this->param['period'][$row['stats_period']]] = $row['stats_value'];
165
+            $ret[(string) $row['stats_id']][$this->param['type'][$row['stats_type']]][$this->param['period'][$row['stats_period']]] = $row['stats_value'];
166 166
         }
167 167
 
168 168
         return $ret;
@@ -170,36 +170,36 @@  discard block
 block discarded – undo
170 170
 
171 171
     public function reset()
172 172
     {
173
-        $this->db->queryF('TRUNCATE TABLE ' . $this->table);
173
+        $this->db->queryF('TRUNCATE TABLE '.$this->table);
174 174
         $now        = time();
175 175
         $time_start = [
176 176
             'day'   => '%Y%j',
177 177
             'week'  => '%Y%u',
178 178
             'month' => '%Y%m'
179 179
         ];
180
-        $counts     = [];
180
+        $counts = [];
181 181
 
182
-        $sql = '    SELECT forum_id' . '    FROM ' . $this->db->prefix('newbb_forums');
182
+        $sql = '    SELECT forum_id'.'    FROM '.$this->db->prefix('newbb_forums');
183 183
         $ret = $this->db->query($sql);
184 184
         while (false !== (list($forum_id) = $this->db->fetchRow($ret))) {
185
-            $sql    = '    SELECT COUNT(*), SUM(topic_views)' . '    FROM ' . $this->db->prefix('newbb_topics') . "    WHERE approved=1 AND forum_id = {$forum_id}";
185
+            $sql    = '    SELECT COUNT(*), SUM(topic_views)'.'    FROM '.$this->db->prefix('newbb_topics')."    WHERE approved=1 AND forum_id = {$forum_id}";
186 186
             $result = $this->db->query($sql);
187 187
             list($topics, $views) = $this->db->fetchRow($result);
188 188
             $this->update($forum_id, 'topic', $topics);
189 189
             $this->update($forum_id, 'view', $views);
190 190
 
191
-            $sql    = '    SELECT COUNT(*)' . '    FROM ' . $this->db->prefix('newbb_topics') . "    WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}";
191
+            $sql    = '    SELECT COUNT(*)'.'    FROM '.$this->db->prefix('newbb_topics')."    WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}";
192 192
             $result = $this->db->query($sql);
193 193
             list($digests) = $this->db->fetchRow($result);
194 194
             $this->update($forum_id, 'digest', $digests);
195 195
 
196
-            $sql    = '    SELECT COUNT(*)' . '    FROM ' . $this->db->prefix('newbb_posts') . "    WHERE approved=1 AND forum_id = {$forum_id}";
196
+            $sql    = '    SELECT COUNT(*)'.'    FROM '.$this->db->prefix('newbb_posts')."    WHERE approved=1 AND forum_id = {$forum_id}";
197 197
             $result = $this->db->query($sql);
198 198
             list($posts) = $this->db->fetchRow($result);
199 199
             $this->update($forum_id, 'post', $posts);
200 200
 
201 201
             foreach ($time_start as $period => $format) {
202
-                $sql    = '    SELECT COUNT(*), SUM(topic_views)' . '    FROM ' . $this->db->prefix('newbb_topics') . "    WHERE approved=1 AND forum_id = {$forum_id}" . "        AND FROM_UNIXTIME(topic_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
202
+                $sql    = '    SELECT COUNT(*), SUM(topic_views)'.'    FROM '.$this->db->prefix('newbb_topics')."    WHERE approved=1 AND forum_id = {$forum_id}"."        AND FROM_UNIXTIME(topic_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
203 203
                 $result = $this->db->query($sql);
204 204
                 list($topics, $views) = $this->db->fetchRow($result);
205 205
                 $views = empty($views) ? 0 : $views; // null check
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 @$counts['topic'][$period] += $topics;
223 223
                 @$counts['view'][$period] += $views;
224 224
 
225
-                $sql    = '    SELECT COUNT(*)' . '    FROM ' . $this->db->prefix('newbb_topics') . "    WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}" . "        AND FROM_UNIXTIME(digest_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
225
+                $sql    = '    SELECT COUNT(*)'.'    FROM '.$this->db->prefix('newbb_topics')."    WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}"."        AND FROM_UNIXTIME(digest_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
226 226
                 $result = $this->db->query($sql);
227 227
                 list($digests) = $this->db->fetchRow($result);
228 228
                 $this->db->queryF("    INSERT INTO {$this->table}"
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                                   . "', NOW(), '{$format}')");
236 236
                 @$counts['digest'][$period] += $digests;
237 237
 
238
-                $sql    = '    SELECT COUNT(*)' . '    FROM ' . $this->db->prefix('newbb_posts') . "    WHERE approved=1 AND forum_id = {$forum_id}" . "        AND FROM_UNIXTIME(post_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
238
+                $sql    = '    SELECT COUNT(*)'.'    FROM '.$this->db->prefix('newbb_posts')."    WHERE approved=1 AND forum_id = {$forum_id}"."        AND FROM_UNIXTIME(post_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
239 239
                 $result = $this->db->query($sql);
240 240
                 list($posts) = $this->db->fetchRow($result);
241 241
                 $this->db->queryF("    INSERT INTO {$this->table}"
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             }
251 251
         }
252 252
 
253
-        $this->db->queryF("    DELETE FROM {$this->table}" . "    WHERE stats_id = '0' AND stats_period <> " . array_search('total', $this->param['period'], true));
253
+        $this->db->queryF("    DELETE FROM {$this->table}"."    WHERE stats_id = '0' AND stats_period <> ".array_search('total', $this->param['period'], true));
254 254
         foreach ($time_start as $period => $format) {
255 255
             foreach (array_keys($counts) as $type) {
256 256
                 $this->db->queryF("    INSERT INTO {$this->table}"
Please login to merge, or discard this patch.