Passed
Push — master ( 4990f6...882d2a )
by Michael
03:01
created
include/functions.user.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -184,18 +184,18 @@
 block discarded – undo
184 184
     $mid = $xoopsModule->getVar('mid');
185 185
 
186 186
     $sql = 'SELECT COUNT(l.groupid) AS count, l.uid FROM '
187
-           . $xoopsMembershipTable
188
-           . ' AS l'
189
-           . ' LEFT JOIN '
190
-           . $xoopsGroupPermTable
191
-           . ' AS p ON p.gperm_groupid=l.groupid'
192
-           . ' WHERE l.uid IN ('
193
-           . implode(', ', array_map('intval', $uid))
194
-           . ')'
195
-           . "    AND p.gperm_modid = '1' AND p.gperm_name = 'module_admin' AND p.gperm_itemid = '"
196
-           . (int)$mid
197
-           . "'"
198
-           . ' GROUP BY l.uid';
187
+            . $xoopsMembershipTable
188
+            . ' AS l'
189
+            . ' LEFT JOIN '
190
+            . $xoopsGroupPermTable
191
+            . ' AS p ON p.gperm_groupid=l.groupid'
192
+            . ' WHERE l.uid IN ('
193
+            . implode(', ', array_map('intval', $uid))
194
+            . ')'
195
+            . "    AND p.gperm_modid = '1' AND p.gperm_name = 'module_admin' AND p.gperm_itemid = '"
196
+            . (int)$mid
197
+            . "'"
198
+            . ' GROUP BY l.uid';
199 199
 
200 200
     if ($result = $GLOBALS['xoopsDB']->query($sql)) {
201 201
         while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@
 block discarded – undo
222 222
         return $forum_moderators;
223 223
     }
224 224
 
225
-    $sql = 'SELECT forum_moderator FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_forums');
225
+    $sql = 'SELECT forum_moderator FROM '.$GLOBALS['xoopsDB']->prefix('newbb_forums');
226 226
     if ($result = $GLOBALS['xoopsDB']->query($sql)) {
227 227
         while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) {
228 228
             if (empty($myrow['forum_moderator'])) {
Please login to merge, or discard this patch.
include/images.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 $forumImage['facebook'] = $forumImage['twitter'] = $forumImage['linkedin'] = $forumImage['googleplus'] = $forumImage['stumbleupon'] = $forumImage['friendfeed'] = $forumImage['digg'] = $forumImage['reddit'] = $forumImage['delicious'] = $forumImage['technorati'] = $forumImage['wong'] = $forumImage['anonym'] = $forumImage['more'] = $forumImage['less'] = 'icon';
49 49
 
50 50
 for ($i = 1; $i <= 5; ++$i) {
51
-    $forumImage['rate' . $i] = 'icon';
51
+    $forumImage['rate'.$i] = 'icon';
52 52
 }
53 53
 
54 54
 $forumImage['p_delete'] = $forumImage['p_reply'] = $forumImage['p_quote'] = $forumImage['p_edit'] = $forumImage['p_report'] =
Please login to merge, or discard this patch.
topicmanager.php 2 patches
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -148,23 +148,23 @@  discard block
 block discarded – undo
148 148
         $restoretopic_id = $topicObject->getVar('topic_id');
149 149
         // irmtfan / missing in URL
150 150
         echo $action[$mode]['msg']
151
-             . "<p><a href='"
152
-             . XOOPS_URL
153
-             . '/modules/'
154
-             . $xoopsModule->getVar('dirname')
155
-             . "/viewtopic.php?topic_id=$restoretopic_id'>"
156
-             . _MD_NEWBB_VIEWTHETOPIC
157
-             . '</a></p>'
158
-             . "<p><a href='"
159
-             . XOOPS_URL
160
-             . '/modules/'
161
-             . $xoopsModule->getVar('dirname')
162
-             . "/viewforum.php?forum=$forum'>"
163
-             . _MD_NEWBB_RETURNTOTHEFORUM
164
-             . '</a></p>'
165
-             . "<p><a href='index.php'>"
166
-             . _MD_NEWBB_RETURNFORUMINDEX
167
-             . '</a></p>';
151
+                . "<p><a href='"
152
+                . XOOPS_URL
153
+                . '/modules/'
154
+                . $xoopsModule->getVar('dirname')
155
+                . "/viewtopic.php?topic_id=$restoretopic_id'>"
156
+                . _MD_NEWBB_VIEWTHETOPIC
157
+                . '</a></p>'
158
+                . "<p><a href='"
159
+                . XOOPS_URL
160
+                . '/modules/'
161
+                . $xoopsModule->getVar('dirname')
162
+                . "/viewforum.php?forum=$forum'>"
163
+                . _MD_NEWBB_RETURNTOTHEFORUM
164
+                . '</a></p>'
165
+                . "<p><a href='index.php'>"
166
+                . _MD_NEWBB_RETURNFORUMINDEX
167
+                . '</a></p>';
168 168
     } elseif ('merge' === $mode) {
169 169
         //        /** @var PostHandler $postHandler */
170 170
         //        $postHandler = Newbb\Helper::getInstance()->getHandler('Post');
@@ -222,28 +222,28 @@  discard block
 block discarded – undo
222 222
             // END irmtfan poll_module and rewrite the method
223 223
         }
224 224
         echo $action[$mode]['msg']
225
-             . // irmtfan full URL
226
-             "<p><a href='"
227
-             . XOOPS_URL
228
-             . '/modules/'
229
-             . $xoopsModule->getVar('dirname')
230
-             . "/viewtopic.php?topic_id=$newtopic'>"
231
-             . _MD_NEWBB_VIEWTHETOPIC
232
-             . '</a></p>'
233
-             . "<p><a href='"
234
-             . XOOPS_URL
235
-             . '/modules/'
236
-             . $xoopsModule->getVar('dirname')
237
-             . "/viewforum.php?forum=$forum'>"
238
-             . _MD_NEWBB_RETURNTOTHEFORUM
239
-             . '</a></p>'
240
-             . "<p><a href='"
241
-             . XOOPS_URL
242
-             . '/modules/'
243
-             . $xoopsModule->getVar('dirname')
244
-             . "/index.php'>"
245
-             . _MD_NEWBB_RETURNFORUMINDEX
246
-             . '</a></p>';
225
+                . // irmtfan full URL
226
+                "<p><a href='"
227
+                . XOOPS_URL
228
+                . '/modules/'
229
+                . $xoopsModule->getVar('dirname')
230
+                . "/viewtopic.php?topic_id=$newtopic'>"
231
+                . _MD_NEWBB_VIEWTHETOPIC
232
+                . '</a></p>'
233
+                . "<p><a href='"
234
+                . XOOPS_URL
235
+                . '/modules/'
236
+                . $xoopsModule->getVar('dirname')
237
+                . "/viewforum.php?forum=$forum'>"
238
+                . _MD_NEWBB_RETURNTOTHEFORUM
239
+                . '</a></p>'
240
+                . "<p><a href='"
241
+                . XOOPS_URL
242
+                . '/modules/'
243
+                . $xoopsModule->getVar('dirname')
244
+                . "/index.php'>"
245
+                . _MD_NEWBB_RETURNFORUMINDEX
246
+                . '</a></p>';
247 247
     } elseif ('move' === $mode) {
248 248
         if ($newforum > 0) {
249 249
             $topic_id    = $topic_id[0];
@@ -261,17 +261,17 @@  discard block
 block discarded – undo
261 261
             $forumHandler->synchronization($newforum);
262 262
             // irmtfan full URL
263 263
             echo $action[$mode]['msg']
264
-                 . "<p><a href='"
265
-                 . XOOPS_URL
266
-                 . '/modules/'
267
-                 . $xoopsModule->getVar('dirname')
268
-                 . "/viewtopic.php?topic_id=$topic_id&amp;forum=$newforum'>"
269
-                 . _MD_NEWBB_GOTONEWFORUM
270
-                 . "</a></p><p><a href='"
271
-                 . XOOPS_URL
272
-                 . "/modules/newbb/index.php'>"
273
-                 . _MD_NEWBB_RETURNFORUMINDEX
274
-                 . '</a></p>';
264
+                    . "<p><a href='"
265
+                    . XOOPS_URL
266
+                    . '/modules/'
267
+                    . $xoopsModule->getVar('dirname')
268
+                    . "/viewtopic.php?topic_id=$topic_id&amp;forum=$newforum'>"
269
+                    . _MD_NEWBB_GOTONEWFORUM
270
+                    . "</a></p><p><a href='"
271
+                    . XOOPS_URL
272
+                    . "/modules/newbb/index.php'>"
273
+                    . _MD_NEWBB_RETURNFORUMINDEX
274
+                    . '</a></p>';
275 275
         } else {
276 276
             // irmtfan - issue with javascript:history.go(-1)
277 277
             redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERRORFORUM);
@@ -312,17 +312,17 @@  discard block
 block discarded – undo
312 312
         }
313 313
         // irmtfan full URL
314 314
         echo $action[$mode]['msg']
315
-             . "<p><a href='"
316
-             . XOOPS_URL
317
-             . '/modules/'
318
-             . $xoopsModule->getVar('dirname')
319
-             . "/viewtopic.php?topic_id=$topic_id&amp;forum=$forum'>"
320
-             . _MD_NEWBB_VIEWTHETOPIC
321
-             . "</a></p><p><a href='"
322
-             . XOOPS_URL
323
-             . "/modules/newbb/viewforum.php?forum=$forum'>"
324
-             . _MD_NEWBB_RETURNFORUMINDEX
325
-             . '</a></p>';
315
+                . "<p><a href='"
316
+                . XOOPS_URL
317
+                . '/modules/'
318
+                . $xoopsModule->getVar('dirname')
319
+                . "/viewtopic.php?topic_id=$topic_id&amp;forum=$forum'>"
320
+                . _MD_NEWBB_VIEWTHETOPIC
321
+                . "</a></p><p><a href='"
322
+                . XOOPS_URL
323
+                . "/modules/newbb/viewforum.php?forum=$forum'>"
324
+                . _MD_NEWBB_RETURNFORUMINDEX
325
+                . '</a></p>';
326 326
     }
327 327
 } else {  // No submit
328 328
     $mode = Request::getString('mode', '', 'GET'); //$_GET['mode'];
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -32,27 +32,27 @@  discard block
 block discarded – undo
32 32
 //  URL: https://xoops.org                                                    //
33 33
 //  Project: Article Project                                                 //
34 34
 //  ------------------------------------------------------------------------ //
35
-require_once __DIR__ . '/header.php';
35
+require_once __DIR__.'/header.php';
36 36
 
37 37
 if (Request::getString('submit', '', 'POST')) {
38 38
     foreach (['forum', 'newforum', 'newtopic'] as $getint) {
39
-        ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]);
39
+        ${$getint} = Request::getInt($getint, 0, 'POST'); // (int)(@$_POST[$getint]);
40 40
     }
41 41
     foreach (['topic_id'] as $getint) {
42
-        ${$getint} = Request::getInt($getint, 0, 'POST');// (int)(@$_POST[$getint]);
42
+        ${$getint} = Request::getInt($getint, 0, 'POST'); // (int)(@$_POST[$getint]);
43 43
     }
44 44
     if (!is_array($topic_id)) {
45 45
         $topic_id = [$topic_id];
46 46
     }
47 47
 } else {
48 48
     foreach (['forum', 'topic_id'] as $getint) {
49
-        ${$getint} = Request::getInt($getint, 0, 'GET');// (int)(@$_GET[$getint]);
49
+        ${$getint} = Request::getInt($getint, 0, 'GET'); // (int)(@$_GET[$getint]);
50 50
     }
51 51
 }
52 52
 
53 53
 if (empty($topic_id)) {
54 54
     $redirect = empty($forum_id) ? 'index.php' : 'viewforum.php?forum={$forum}';
55
-    $redirect = XOOPS_URL . '/modules/newbb/' . $redirect;
55
+    $redirect = XOOPS_URL.'/modules/newbb/'.$redirect;
56 56
     redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC);
57 57
 }
58 58
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     if (is_object($topicObject)) {
68 68
         $forum = $topicObject->getVar('forum_id');
69 69
     } else {
70
-        $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $topic_id;
70
+        $redirect = XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$topic_id;
71 71
         redirect_header($redirect, 2, _MD_NEWBB_FORUMNOEXIST);
72 72
     }
73 73
     unset($topicObject);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 $action['unlock']['sql']   = 'topic_status = 0';
105 105
 $action['unsticky']['sql'] = 'topic_sticky = 0';
106 106
 $action['undigest']['sql'] = 'topic_digest = 0';
107
-$action['digest']['sql']   = 'topic_digest = 1, digest_time = ' . time();
107
+$action['digest']['sql']   = 'topic_digest = 1, digest_time = '.time();
108 108
 
109 109
 // Disable cache
110 110
 $GLOBALS['xoopsConfig']['module_cache'][$xoopsModule->getVar('mid')] = 0;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 require_once $GLOBALS['xoops']->path('header.php');
113 113
 
114 114
 if (Request::getString('submit', '', 'POST')) {
115
-    $mode = Request::getString('mode', '', 'POST');// $_POST['mode'];
115
+    $mode = Request::getString('mode', '', 'POST'); // $_POST['mode'];
116 116
 
117 117
     if ('delete' === $mode) {
118 118
         foreach ($topic_id as $tid) {
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
             //xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $topic_id);
127 127
         }
128 128
         // irmtfan full URL
129
-        echo $action[$mode]['msg'] . "<p><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum=$forum'>" . _MD_NEWBB_RETURNTOTHEFORUM . "</a></p><p><a href='index.php'>" . _MD_NEWBB_RETURNFORUMINDEX . '</a></p>';
129
+        echo $action[$mode]['msg']."<p><a href='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum=$forum'>"._MD_NEWBB_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_NEWBB_RETURNFORUMINDEX.'</a></p>';
130 130
     } elseif ('restore' === $mode) {
131 131
         //$topicHandler = Newbb\Helper::getInstance()->getHandler('Topic');
132 132
         $forums       = [];
133
-        $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '(' . implode(',', $topic_id) . ')', 'IN'));
133
+        $topicsObject = $topicHandler->getAll(new \Criteria('topic_id', '('.implode(',', $topic_id).')', 'IN'));
134 134
         foreach (array_keys($topicsObject) as $id) {
135 135
             $topicObject = $topicsObject[$id];
136 136
             $topicHandler->approve($topicObject);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             $forums[$topicObject->getVar('forum_id')] = 1;
139 139
         }
140 140
         //irmtfan remove - no need to approve posts manually - see class/post.php approve function
141
-        $criteria_forum = new \Criteria('forum_id', '(' . implode(',', array_keys($forums)) . ')', 'IN');
141
+        $criteria_forum = new \Criteria('forum_id', '('.implode(',', array_keys($forums)).')', 'IN');
142 142
         $forumsObject   = $forumHandler->getAll($criteria_forum);
143 143
         foreach (array_keys($forumsObject) as $id) {
144 144
             $forumHandler->synchronization($forumsObject[$id]);
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             /* return false if destination topic is not existing */
179 179
             // irmtfan bug fix: the old topic will be deleted if user input a not exist new topic
180 180
             if (!is_object($newtopicObject)) {
181
-                $redirect = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $tid;
181
+                $redirect = XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$tid;
182 182
                 redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC);
183 183
             }
184 184
             $criteria_topic = new \Criteria('topic_id', $tid);
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
             if ($poll_id > 0 && (0 == $newtopicObject->getVar('poll_id'))) {
203 203
                 $newtopicObject->setVar('topic_haspoll', 1);
204 204
                 $newtopicObject->setVar('poll_id', $poll_id);
205
-                $poll_id = 0;// set to not delete the poll
205
+                $poll_id = 0; // set to not delete the poll
206 206
                 $topicObject->setVar('topic_haspoll', 0); // set to not delete the poll
207
-                $topicObject->setVar('poll_id', 0);// set to not delete the poll
207
+                $topicObject->setVar('poll_id', 0); // set to not delete the poll
208 208
             }
209 209
             //update and sync newtopic after merge
210 210
             //$topicHandler->insert($newtopicObject, true);
@@ -286,16 +286,16 @@  discard block
 block discarded – undo
286 286
                 && !$forumHandler->getPermission($forum_new, 'reply'))        // The forum for the topic to be merged to
287 287
             || (!empty($newforum) && !$forumHandler->getPermission($newforum, 'post')) // The forum to be moved to
288 288
         ) {
289
-            redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&amp;topic_id=$topic_id", 2, _NOPERM);
289
+            redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&amp;topic_id=$topic_id", 2, _NOPERM);
290 290
         }
291 291
 
292 292
         if (!empty($action[$mode]['sql'])) {
293
-            $sql = sprintf('UPDATE `%s` SET ' . $action[$mode]['sql'] . ' WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $topic_id);
293
+            $sql = sprintf('UPDATE `%s` SET '.$action[$mode]['sql'].' WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $topic_id);
294 294
             if (!$r = $GLOBALS['xoopsDB']->query($sql)) {
295
-                redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&amp;topic_id=$topic_id&amp;order=$order&amp;viewmode=$viewmode", 2, _MD_NEWBB_ERROR_BACK . '<br>sql: ' . $sql);
295
+                redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&amp;topic_id=$topic_id&amp;order=$order&amp;viewmode=$viewmode", 2, _MD_NEWBB_ERROR_BACK.'<br>sql: '.$sql);
296 296
             }
297 297
         } else {
298
-            redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?forum=$forum&amp;topic_id=$topic_id", 2, _MD_NEWBB_ERROR_BACK);
298
+            redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?forum=$forum&amp;topic_id=$topic_id", 2, _MD_NEWBB_ERROR_BACK);
299 299
         }
300 300
         if ('digest' === $mode && $GLOBALS['xoopsDB']->getAffectedRows()) {
301 301
             $topicObject = $topicHandler->get($topic_id);
@@ -326,15 +326,15 @@  discard block
 block discarded – undo
326 326
     }
327 327
 } else {  // No submit
328 328
     $mode = Request::getString('mode', '', 'GET'); //$_GET['mode'];
329
-    echo "<form action='" . Request::getString('PHP_SELF', '', 'SERVER') . "' method='post'>";
329
+    echo "<form action='".Request::getString('PHP_SELF', '', 'SERVER')."' method='post'>";
330 330
     echo "<table border='0' cellpadding='1' cellspacing='0' align='center' width='95%'>";
331 331
     echo "<tr><td class='bg2'>";
332 332
     echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>";
333 333
     echo "<tr class='bg3' align='left'>";
334
-    echo "<td colspan='2' align='center'>" . $action[$mode]['desc'] . '</td></tr>';
334
+    echo "<td colspan='2' align='center'>".$action[$mode]['desc'].'</td></tr>';
335 335
 
336 336
     if ('move' === $mode) {
337
-        echo '<tr><td class="bg3">' . _MD_NEWBB_MOVETOPICTO . '</td><td class="bg1">';
337
+        echo '<tr><td class="bg3">'._MD_NEWBB_MOVETOPICTO.'</td><td class="bg1">';
338 338
         $box = '<select name="newforum" size="1">';
339 339
 
340 340
         //        /** @var Newbb\CategoryHandler $categoryHandler */
@@ -345,19 +345,19 @@  discard block
 block discarded – undo
345 345
         if (count($categories) > 0 && count($forums) > 0) {
346 346
             foreach (array_keys($forums) as $key) {
347 347
                 /** @var Newbb\Category[] $categories */
348
-                $box .= "<option value='-1'>[" . $categories[$key]->getVar('cat_title') . ']</option>';
348
+                $box .= "<option value='-1'>[".$categories[$key]->getVar('cat_title').']</option>';
349 349
                 foreach ($forums[$key] as $forumid => $_forum) {
350
-                    $box .= "<option value='" . $forumid . "'>-- " . $_forum['title'] . '</option>';
350
+                    $box .= "<option value='".$forumid."'>-- ".$_forum['title'].'</option>';
351 351
                     if (!isset($_forum['sub'])) {
352 352
                         continue;
353 353
                     }
354 354
                     foreach (array_keys($_forum['sub']) as $fid) {
355
-                        $box .= "<option value='" . $fid . "'>---- " . $_forum['sub'][$fid]['title'] . '</option>';
355
+                        $box .= "<option value='".$fid."'>---- ".$_forum['sub'][$fid]['title'].'</option>';
356 356
                     }
357 357
                 }
358 358
             }
359 359
         } else {
360
-            $box .= "<option value='-1'>" . _MD_NEWBB_NOFORUMINDB . '</option>';
360
+            $box .= "<option value='-1'>"._MD_NEWBB_NOFORUMINDB.'</option>';
361 361
         }
362 362
         unset($forums, $categories);
363 363
 
@@ -365,17 +365,17 @@  discard block
 block discarded – undo
365 365
         echo '</select></td></tr>';
366 366
     }
367 367
     if ('merge' === $mode) {
368
-        echo '<tr><td class="bg3">' . _MD_NEWBB_MERGETOPICTO . '</td><td class="bg1">';
369
-        echo _MD_NEWBB_TOPIC . "&nbsp;ID-$topic_id -> ID: <input name='newtopic' value='' />";
368
+        echo '<tr><td class="bg3">'._MD_NEWBB_MERGETOPICTO.'</td><td class="bg1">';
369
+        echo _MD_NEWBB_TOPIC."&nbsp;ID-$topic_id -> ID: <input name='newtopic' value='' />";
370 370
         echo '</td></tr>';
371 371
     }
372 372
     echo '<tr class="bg3"><td colspan="2" align="center">';
373
-    echo "<input type='hidden' name='mode' value='" . $action[$mode]['name'] . "' />";
374
-    echo "<input type='hidden' name='topic_id' value='" . $topic_id . "' />";
375
-    echo "<input type='hidden' name='forum' value='" . $forum . "' />";
376
-    echo "<input type='submit' name='submit' value='" . $action[$mode]['submit'] . "' />";
373
+    echo "<input type='hidden' name='mode' value='".$action[$mode]['name']."' />";
374
+    echo "<input type='hidden' name='topic_id' value='".$topic_id."' />";
375
+    echo "<input type='hidden' name='forum' value='".$forum."' />";
376
+    echo "<input type='submit' name='submit' value='".$action[$mode]['submit']."' />";
377 377
     echo '</td></tr></form></table></td></tr></table>';
378 378
 }
379 379
 // irmtfan move to footer.php
380
-require_once __DIR__ . '/footer.php';
380
+require_once __DIR__.'/footer.php';
381 381
 include $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.
xoops_version.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @package        module::newbb
10 10
  */
11 11
 
12
-include __DIR__ . '/preloads/autoloader.php';
12
+include __DIR__.'/preloads/autoloader.php';
13 13
 
14 14
 $moduleDirName = basename(__DIR__);
15 15
 $modversion    = [
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
     'sqlfile'             => ['mysql' => 'sql/mysql.sql'],
46 46
     // ------------------- Tables ----------------------------
47 47
     'tables'              => [
48
-        $moduleDirName . '_' . 'archive',
49
-        $moduleDirName . '_' . 'categories',
50
-        $moduleDirName . '_' . 'votedata',
51
-        $moduleDirName . '_' . 'forums',
52
-        $moduleDirName . '_' . 'posts',
53
-        $moduleDirName . '_' . 'posts_text',
54
-        $moduleDirName . '_' . 'topics',
55
-        $moduleDirName . '_' . 'online',
56
-        $moduleDirName . '_' . 'digest',
57
-        $moduleDirName . '_' . 'report',
58
-        $moduleDirName . '_' . 'attachments',
59
-        $moduleDirName . '_' . 'moderates',
60
-        $moduleDirName . '_' . 'reads_forum',
61
-        $moduleDirName . '_' . 'reads_topic',
62
-        $moduleDirName . '_' . 'type',
63
-        $moduleDirName . '_' . 'type_forum',
64
-        $moduleDirName . '_' . 'stats',
65
-        $moduleDirName . '_' . 'user_stats'
48
+        $moduleDirName.'_'.'archive',
49
+        $moduleDirName.'_'.'categories',
50
+        $moduleDirName.'_'.'votedata',
51
+        $moduleDirName.'_'.'forums',
52
+        $moduleDirName.'_'.'posts',
53
+        $moduleDirName.'_'.'posts_text',
54
+        $moduleDirName.'_'.'topics',
55
+        $moduleDirName.'_'.'online',
56
+        $moduleDirName.'_'.'digest',
57
+        $moduleDirName.'_'.'report',
58
+        $moduleDirName.'_'.'attachments',
59
+        $moduleDirName.'_'.'moderates',
60
+        $moduleDirName.'_'.'reads_forum',
61
+        $moduleDirName.'_'.'reads_topic',
62
+        $moduleDirName.'_'.'type',
63
+        $moduleDirName.'_'.'type_forum',
64
+        $moduleDirName.'_'.'stats',
65
+        $moduleDirName.'_'.'user_stats'
66 66
     ],
67 67
     // ------------------- Admin Menu -------------------
68 68
     'system_menu'         => 1,
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
     'description' => '_MI_NEWBB_ANONYMOUS_PRE_DESC',
604 604
     'formtype'    => 'textbox',
605 605
     'valuetype'   => 'text',
606
-    'default'     => $GLOBALS['xoopsConfig']['anonymous'] . '-'
606
+    'default'     => $GLOBALS['xoopsConfig']['anonymous'].'-'
607 607
 ];
608 608
 $modversion['config'][] = [
609 609
     'name'        => 'allow_require_reply',
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
     'item_name'      => 'topic_id',
731 731
     'allow_bookmark' => 1,
732 732
 ];
733
-$modversion['notification']['category'][]  = [
733
+$modversion['notification']['category'][] = [
734 734
     'name'           => 'forum',
735 735
     'title'          => _MI_NEWBB_FORUM_NOTIFY,
736 736
     'description'    => _MI_NEWBB_FORUM_NOTIFYDSC,
@@ -738,13 +738,13 @@  discard block
 block discarded – undo
738 738
     'item_name'      => 'forum',
739 739
     'allow_bookmark' => 1,
740 740
 ];
741
-$modversion['notification']['category'][]  = [
741
+$modversion['notification']['category'][] = [
742 742
     'name'           => 'global',
743 743
     'title'          => _MI_NEWBB_GLOBAL_NOTIFY,
744 744
     'description'    => _MI_NEWBB_GLOBAL_NOTIFYDSC,
745 745
     'subscribe_from' => 'index.php',
746 746
 ];
747
-$modversion['notification']['event'][]     = [
747
+$modversion['notification']['event'][] = [
748 748
     'name'          => 'new_post',
749 749
     'category'      => 'thread',
750 750
     'title'         => _MI_NEWBB_THREAD_NEWPOST_NOTIFY,
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
     'mail_template' => 'thread_newpost_notify',
754 754
     'mail_subject'  => _MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ,
755 755
 ];
756
-$modversion['notification']['event'][]     = [
756
+$modversion['notification']['event'][] = [
757 757
     'name'          => 'new_thread',
758 758
     'category'      => 'forum',
759 759
     'title'         => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFY,
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
     'mail_template' => 'forum_newthread_notify',
763 763
     'mail_subject'  => _MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ,
764 764
 ];
765
-$modversion['notification']['event'][]     = [
765
+$modversion['notification']['event'][] = [
766 766
     'name'          => 'new_forum',
767 767
     'category'      => 'global',
768 768
     'title'         => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY,
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
     'mail_template' => 'global_newforum_notify',
772 772
     'mail_subject'  => _MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ,
773 773
 ];
774
-$modversion['notification']['event'][]     = [
774
+$modversion['notification']['event'][] = [
775 775
     'name'          => 'new_post',
776 776
     'category'      => 'global',
777 777
     'title'         => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFY,
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
     'mail_template' => 'global_newpost_notify',
781 781
     'mail_subject'  => _MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ,
782 782
 ];
783
-$modversion['notification']['event'][]     = [
783
+$modversion['notification']['event'][] = [
784 784
     'name'          => 'new_post',
785 785
     'category'      => 'forum',
786 786
     'title'         => _MI_NEWBB_FORUM_NEWPOST_NOTIFY,
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
     'mail_template' => 'forum_newpost_notify',
790 790
     'mail_subject'  => _MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ,
791 791
 ];
792
-$modversion['notification']['event'][]     = [
792
+$modversion['notification']['event'][] = [
793 793
     'name'          => 'new_fullpost',
794 794
     'category'      => 'global',
795 795
     'admin_only'    => 1,
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
     'mail_template' => 'global_newfullpost_notify',
800 800
     'mail_subject'  => _MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ,
801 801
 ];
802
-$modversion['notification']['event'][]     = [
802
+$modversion['notification']['event'][] = [
803 803
     'name'          => 'digest',
804 804
     'category'      => 'global',
805 805
     'title'         => _MI_NEWBB_GLOBAL_DIGEST_NOTIFY,
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
     'mail_template' => 'global_digest_notify',
809 809
     'mail_subject'  => _MI_NEWBB_GLOBAL_DIGEST_NOTIFYSBJ,
810 810
 ];
811
-$modversion['notification']['event'][]     = [
811
+$modversion['notification']['event'][] = [
812 812
     'name'          => 'new_fullpost',
813 813
     'category'      => 'forum',
814 814
     'admin_only'    => 1,
Please login to merge, or discard this patch.
preloads/core.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,6 +28,6 @@
 block discarded – undo
28 28
      */
29 29
     public static function eventCoreIncludeCommonEnd($args)
30 30
     {
31
-        include __DIR__ . '/autoloader.php';
31
+        include __DIR__.'/autoloader.php';
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
preloads/autoloader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
 /**
4 4
  * @see http://www.php-fig.org/psr/psr-4/examples/
5 5
  */
6
-spl_autoload_register(function ($class) {
6
+spl_autoload_register(function($class) {
7 7
     // project-specific namespace prefix
8
-    $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__)));
8
+    $prefix = 'XoopsModules\\'.ucfirst(basename(dirname(__DIR__)));
9 9
 
10 10
     // base directory for the namespace prefix
11
-    $base_dir = __DIR__ . '/../class/';
11
+    $base_dir = __DIR__.'/../class/';
12 12
 
13 13
     // does the class use the namespace prefix?
14 14
     $len = strlen($prefix);
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     // replace the namespace prefix with the base directory, replace namespace
24 24
     // separators with directory separators in the relative class name, append
25 25
     // with .php
26
-    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
26
+    $file = $base_dir.str_replace('\\', '/', $relative_class).'.php';
27 27
 
28 28
     // if the file exists, require it
29 29
     if (file_exists($file)) {
Please login to merge, or discard this patch.
admin/admin_cat_manager.php 2 patches
Switch Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -115,99 +115,99 @@
 block discarded – undo
115 115
 }
116 116
 
117 117
 switch ($op) {
118
-    case 'mod':
119
-        $categoryObject = ($cat_id > 0) ? $categoryHandler->get($cat_id) : $categoryHandler->create();
120
-        //        if (!$newXoopsModuleGui) {
121
-        //            //loadModuleAdminMenu(1, ( $cat_id > 0) ? _AM_NEWBB_EDITCATEGORY . $categoryObject->getVar('cat_title') : _AM_NEWBB_CREATENEWCATEGORY);
122
-        //            echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_EDITCATEGORY . '</legend>';
123
-        //        } else {
124
-        $adminObject->displayNavigation(basename(__FILE__));
125
-        //        }
126
-        echo '<br>';
127
-        editCategory($categoryObject);
128
-        break;
129
-
130
-    case 'del':
131
-        if (!Request::getBool('confirm', '', 'POST')) {
132
-            xoops_confirm(['op' => 'del', 'cat_id' => Request::getInt('cat_id', 0, 'GET'), 'confirm' => 1], 'admin_cat_manager.php', _AM_NEWBB_WAYSYWTDTTAL);
118
+        case 'mod':
119
+            $categoryObject = ($cat_id > 0) ? $categoryHandler->get($cat_id) : $categoryHandler->create();
120
+            //        if (!$newXoopsModuleGui) {
121
+            //            //loadModuleAdminMenu(1, ( $cat_id > 0) ? _AM_NEWBB_EDITCATEGORY . $categoryObject->getVar('cat_title') : _AM_NEWBB_CREATENEWCATEGORY);
122
+            //            echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_EDITCATEGORY . '</legend>';
123
+            //        } else {
124
+            $adminObject->displayNavigation(basename(__FILE__));
125
+            //        }
126
+            echo '<br>';
127
+            editCategory($categoryObject);
128
+            break;
129
+
130
+        case 'del':
131
+            if (!Request::getBool('confirm', '', 'POST')) {
132
+                xoops_confirm(['op' => 'del', 'cat_id' => Request::getInt('cat_id', 0, 'GET'), 'confirm' => 1], 'admin_cat_manager.php', _AM_NEWBB_WAYSYWTDTTAL);
133
+                break;
134
+            } else {
135
+                $categoryObject = $categoryHandler->create(false);
136
+                $categoryObject->setVar('cat_id', Request::getInt('cat_id', 0, 'POST'));
137
+                $categoryHandler->delete($categoryObject);
138
+
139
+                redirect_header('admin_cat_manager.php', 2, _AM_NEWBB_CATEGORYDELETED);
140
+            }
133 141
             break;
134
-        } else {
135
-            $categoryObject = $categoryHandler->create(false);
136
-            $categoryObject->setVar('cat_id', Request::getInt('cat_id', 0, 'POST'));
137
-            $categoryHandler->delete($categoryObject);
138
-
139
-            redirect_header('admin_cat_manager.php', 2, _AM_NEWBB_CATEGORYDELETED);
140
-        }
141
-        break;
142
-
143
-    case 'save':
144
-        $cacheHelper = new \Xmf\Module\Helper\Cache('newbb');
145
-        $cacheHelper->delete('permission_category');
146
-        if ($cat_id) {
147
-            $categoryObject = $categoryHandler->get($cat_id);
148
-            $message        = _AM_NEWBB_CATEGORYUPDATED;
149
-        } else {
150
-            $categoryObject = $categoryHandler->create();
151
-            $message        = _AM_NEWBB_CATEGORYCREATED;
152
-        }
153
-
154
-        $categoryObject->setVar('cat_title', Request::getString('title', '', 'POST'));
155
-        $categoryObject->setVar('cat_image', Request::getString('cat_image', '', 'POST'));
156
-        $categoryObject->setVar('cat_order', Request::getInt('cat_order', 0, 'POST'));
157
-        $categoryObject->setVar('cat_description', Request::getText('cat_description', '', 'POST'));
158
-        $categoryObject->setVar('cat_url', Request::getString('cat_url', '', 'POST'));
159
-
160
-        $cat_isNew = $categoryObject->isNew();
161
-        if (!$categoryHandler->insert($categoryObject)) {
162
-            $message = _AM_NEWBB_DATABASEERROR;
163
-        }
164
-        if (($cat_id = $categoryObject->getVar('cat_id')) && $cat_isNew) {
165
-            $categoryHandler->applyPermissionTemplate($categoryObject);
166
-        }
167
-        redirect_header('admin_cat_manager.php', 2, $message);
168
-        break;
169
-
170
-    default:
171
-        if (!$categories = $categoryHandler->getByPermission('all')) {
142
+
143
+        case 'save':
144
+            $cacheHelper = new \Xmf\Module\Helper\Cache('newbb');
145
+            $cacheHelper->delete('permission_category');
146
+            if ($cat_id) {
147
+                $categoryObject = $categoryHandler->get($cat_id);
148
+                $message        = _AM_NEWBB_CATEGORYUPDATED;
149
+            } else {
150
+                $categoryObject = $categoryHandler->create();
151
+                $message        = _AM_NEWBB_CATEGORYCREATED;
152
+            }
153
+
154
+            $categoryObject->setVar('cat_title', Request::getString('title', '', 'POST'));
155
+            $categoryObject->setVar('cat_image', Request::getString('cat_image', '', 'POST'));
156
+            $categoryObject->setVar('cat_order', Request::getInt('cat_order', 0, 'POST'));
157
+            $categoryObject->setVar('cat_description', Request::getText('cat_description', '', 'POST'));
158
+            $categoryObject->setVar('cat_url', Request::getString('cat_url', '', 'POST'));
159
+
160
+            $cat_isNew = $categoryObject->isNew();
161
+            if (!$categoryHandler->insert($categoryObject)) {
162
+                $message = _AM_NEWBB_DATABASEERROR;
163
+            }
164
+            if (($cat_id = $categoryObject->getVar('cat_id')) && $cat_isNew) {
165
+                $categoryHandler->applyPermissionTemplate($categoryObject);
166
+            }
167
+            redirect_header('admin_cat_manager.php', 2, $message);
168
+            break;
169
+
170
+        default:
171
+            if (!$categories = $categoryHandler->getByPermission('all')) {
172
+                $adminObject->addItemButton(_AM_NEWBB_CREATENEWCATEGORY, 'admin_cat_manager.php?op=mod', $icon = 'add');
173
+                $adminObject->displayButton('left');
174
+
175
+                echo '<br>';
176
+                newCategory();
177
+                break;
178
+            }
179
+            $adminObject->displayNavigation(basename(__FILE__));
172 180
             $adminObject->addItemButton(_AM_NEWBB_CREATENEWCATEGORY, 'admin_cat_manager.php?op=mod', $icon = 'add');
173 181
             $adminObject->displayButton('left');
174 182
 
175
-            echo '<br>';
176
-            newCategory();
177
-            break;
178
-        }
179
-        $adminObject->displayNavigation(basename(__FILE__));
180
-        $adminObject->addItemButton(_AM_NEWBB_CREATENEWCATEGORY, 'admin_cat_manager.php?op=mod', $icon = 'add');
181
-        $adminObject->displayButton('left');
182
-
183
-        echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>";
184
-        echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
185
-        echo "<tr align='center'>";
186
-        echo "<th align='left' class='bg3'>" . _AM_NEWBB_CATEGORY1 . '</th>';
187
-        echo "<th class='bg3' width='10%'>" . _AM_NEWBB_EDIT . '</th>';
188
-        echo "<th class='bg3' width='10%'>" . _AM_NEWBB_DELETE . '</th>';
189
-        echo '</tr>';
190
-
191
-        foreach ($categories as $key => $onecat) {
192
-            $cat_edit_link  = '<a href="admin_cat_manager.php?op=mod&cat_id=' . $onecat->getVar('cat_id') . '">' . newbbDisplayImage('admin_edit', _EDIT) . '</a>';
193
-            $cat_del_link   = '<a href="admin_cat_manager.php?op=del&cat_id=' . $onecat->getVar('cat_id') . '">' . newbbDisplayImage('admin_delete', _DELETE) . '</a>';
194
-            $cat_title_link = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php?cat=' . $onecat->getVar('cat_id') . '">' . $onecat->getVar('cat_title') . '</a>';
195
-
196
-            echo "<tr class='odd' align='left'>";
197
-            echo '<td>' . $cat_title_link . '</td>';
198
-            echo "<td align='center'>" . $cat_edit_link . '</td>';
199
-            echo "<td align='center'>" . $cat_del_link . '</td>';
183
+            echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>";
184
+            echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
185
+            echo "<tr align='center'>";
186
+            echo "<th align='left' class='bg3'>" . _AM_NEWBB_CATEGORY1 . '</th>';
187
+            echo "<th class='bg3' width='10%'>" . _AM_NEWBB_EDIT . '</th>';
188
+            echo "<th class='bg3' width='10%'>" . _AM_NEWBB_DELETE . '</th>';
200 189
             echo '</tr>';
201
-        }
202
-        echo '</table>';
203
-        echo '</td></tr></table>';
204
-        echo '<fieldset>';
205
-        echo '<legend>&nbsp;' . _MI_NEWBB_ADMENU_CATEGORY . '&nbsp;</legend>';
206
-        echo _AM_NEWBB_HELP_CATEGORY_TAB;
207
-        echo '<br>' . newbbDisplayImage('admin_edit', _EDIT) . '&nbsp;-&nbsp;' . _EDIT;
208
-        echo '<br>' . newbbDisplayImage('admin_delete', _DELETE) . '&nbsp;-&nbsp;' . _DELETE;
209
-        echo '</fieldset>';
210
-        break;
190
+
191
+            foreach ($categories as $key => $onecat) {
192
+                $cat_edit_link  = '<a href="admin_cat_manager.php?op=mod&cat_id=' . $onecat->getVar('cat_id') . '">' . newbbDisplayImage('admin_edit', _EDIT) . '</a>';
193
+                $cat_del_link   = '<a href="admin_cat_manager.php?op=del&cat_id=' . $onecat->getVar('cat_id') . '">' . newbbDisplayImage('admin_delete', _DELETE) . '</a>';
194
+                $cat_title_link = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php?cat=' . $onecat->getVar('cat_id') . '">' . $onecat->getVar('cat_title') . '</a>';
195
+
196
+                echo "<tr class='odd' align='left'>";
197
+                echo '<td>' . $cat_title_link . '</td>';
198
+                echo "<td align='center'>" . $cat_edit_link . '</td>';
199
+                echo "<td align='center'>" . $cat_del_link . '</td>';
200
+                echo '</tr>';
201
+            }
202
+            echo '</table>';
203
+            echo '</td></tr></table>';
204
+            echo '<fieldset>';
205
+            echo '<legend>&nbsp;' . _MI_NEWBB_ADMENU_CATEGORY . '&nbsp;</legend>';
206
+            echo _AM_NEWBB_HELP_CATEGORY_TAB;
207
+            echo '<br>' . newbbDisplayImage('admin_edit', _EDIT) . '&nbsp;-&nbsp;' . _EDIT;
208
+            echo '<br>' . newbbDisplayImage('admin_delete', _DELETE) . '&nbsp;-&nbsp;' . _DELETE;
209
+            echo '</fieldset>';
210
+            break;
211 211
 }
212 212
 
213 213
 $cacheHelper = Newbb\Utility::cleanCache();
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 use Xmf\Request;
33 33
 use XoopsModules\Newbb;
34 34
 
35
-require_once __DIR__ . '/admin_header.php';
36
-require_once __DIR__ . '/../include/functions.render.php';
35
+require_once __DIR__.'/admin_header.php';
36
+require_once __DIR__.'/../include/functions.render.php';
37 37
 
38 38
 xoops_cp_header();
39 39
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
70 70
 
71 71
     if (!$categoryObject->isNew()) {
72
-        $sform = new \XoopsThemeForm(_AM_NEWBB_EDITCATEGORY . ' ' . $categoryObject->getVar('cat_title'), 'op', xoops_getenv('PHP_SELF'));
72
+        $sform = new \XoopsThemeForm(_AM_NEWBB_EDITCATEGORY.' '.$categoryObject->getVar('cat_title'), 'op', xoops_getenv('PHP_SELF'));
73 73
     } else {
74 74
         $sform = new \XoopsThemeForm(_AM_NEWBB_CREATENEWCATEGORY, 'op', xoops_getenv('PHP_SELF'));
75 75
         $categoryObject->setVar('cat_title', '');
@@ -83,17 +83,17 @@  discard block
 block discarded – undo
83 83
     $sform->addElement(new \XoopsFormText(_AM_NEWBB_CATEGORY, 'title', 50, 80, $categoryObject->getVar('cat_title', 'E')), true);
84 84
     $sform->addElement(new \XoopsFormDhtmlTextArea(_AM_NEWBB_CATEGORYDESC, 'cat_description', $categoryObject->getVar('cat_description', 'E'), 10, 60), false);
85 85
 
86
-    $imgdir      = '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/category';
86
+    $imgdir      = '/modules/'.$xoopsModule->getVar('dirname').'/assets/images/category';
87 87
     $cat_image   = $categoryObject->getVar('cat_image');
88 88
     $cat_image   = empty($cat_image) ? 'blank.gif' : $cat_image;
89
-    $graph_array = \XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $imgdir . '/');
89
+    $graph_array = \XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH.$imgdir.'/');
90 90
     array_unshift($graph_array, _NONE);
91 91
     $cat_image_select = new \XoopsFormSelect('', 'cat_image', $categoryObject->getVar('cat_image'));
92 92
     $cat_image_select->addOptionArray($graph_array);
93
-    $cat_image_select->setExtra("onchange=\"showImgSelected('img', 'cat_image', '/" . $imgdir . "/', '', '" . XOOPS_URL . "')\"");
93
+    $cat_image_select->setExtra("onchange=\"showImgSelected('img', 'cat_image', '/".$imgdir."/', '', '".XOOPS_URL."')\"");
94 94
     $cat_image_tray = new \XoopsFormElementTray(_AM_NEWBB_IMAGE, '&nbsp;');
95 95
     $cat_image_tray->addElement($cat_image_select);
96
-    $cat_image_tray->addElement(new \XoopsFormLabel('', "<br><img src='" . XOOPS_URL . $imgdir . '/' . $cat_image . " 'name='img' id='img' alt='' />"));
96
+    $cat_image_tray->addElement(new \XoopsFormLabel('', "<br><img src='".XOOPS_URL.$imgdir.'/'.$cat_image." 'name='img' id='img' alt='' />"));
97 97
     $sform->addElement($cat_image_tray);
98 98
 
99 99
     $sform->addElement(new \XoopsFormText(_AM_NEWBB_SPONSORLINK, 'cat_url', 50, 80, $categoryObject->getVar('cat_url', 'E')), false);
@@ -180,32 +180,32 @@  discard block
 block discarded – undo
180 180
         $adminObject->addItemButton(_AM_NEWBB_CREATENEWCATEGORY, 'admin_cat_manager.php?op=mod', $icon = 'add');
181 181
         $adminObject->displayButton('left');
182 182
 
183
-        echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>";
183
+        echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>";
184 184
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
185 185
         echo "<tr align='center'>";
186
-        echo "<th align='left' class='bg3'>" . _AM_NEWBB_CATEGORY1 . '</th>';
187
-        echo "<th class='bg3' width='10%'>" . _AM_NEWBB_EDIT . '</th>';
188
-        echo "<th class='bg3' width='10%'>" . _AM_NEWBB_DELETE . '</th>';
186
+        echo "<th align='left' class='bg3'>"._AM_NEWBB_CATEGORY1.'</th>';
187
+        echo "<th class='bg3' width='10%'>"._AM_NEWBB_EDIT.'</th>';
188
+        echo "<th class='bg3' width='10%'>"._AM_NEWBB_DELETE.'</th>';
189 189
         echo '</tr>';
190 190
 
191 191
         foreach ($categories as $key => $onecat) {
192
-            $cat_edit_link  = '<a href="admin_cat_manager.php?op=mod&cat_id=' . $onecat->getVar('cat_id') . '">' . newbbDisplayImage('admin_edit', _EDIT) . '</a>';
193
-            $cat_del_link   = '<a href="admin_cat_manager.php?op=del&cat_id=' . $onecat->getVar('cat_id') . '">' . newbbDisplayImage('admin_delete', _DELETE) . '</a>';
194
-            $cat_title_link = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php?cat=' . $onecat->getVar('cat_id') . '">' . $onecat->getVar('cat_title') . '</a>';
192
+            $cat_edit_link  = '<a href="admin_cat_manager.php?op=mod&cat_id='.$onecat->getVar('cat_id').'">'.newbbDisplayImage('admin_edit', _EDIT).'</a>';
193
+            $cat_del_link   = '<a href="admin_cat_manager.php?op=del&cat_id='.$onecat->getVar('cat_id').'">'.newbbDisplayImage('admin_delete', _DELETE).'</a>';
194
+            $cat_title_link = '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/index.php?cat='.$onecat->getVar('cat_id').'">'.$onecat->getVar('cat_title').'</a>';
195 195
 
196 196
             echo "<tr class='odd' align='left'>";
197
-            echo '<td>' . $cat_title_link . '</td>';
198
-            echo "<td align='center'>" . $cat_edit_link . '</td>';
199
-            echo "<td align='center'>" . $cat_del_link . '</td>';
197
+            echo '<td>'.$cat_title_link.'</td>';
198
+            echo "<td align='center'>".$cat_edit_link.'</td>';
199
+            echo "<td align='center'>".$cat_del_link.'</td>';
200 200
             echo '</tr>';
201 201
         }
202 202
         echo '</table>';
203 203
         echo '</td></tr></table>';
204 204
         echo '<fieldset>';
205
-        echo '<legend>&nbsp;' . _MI_NEWBB_ADMENU_CATEGORY . '&nbsp;</legend>';
205
+        echo '<legend>&nbsp;'._MI_NEWBB_ADMENU_CATEGORY.'&nbsp;</legend>';
206 206
         echo _AM_NEWBB_HELP_CATEGORY_TAB;
207
-        echo '<br>' . newbbDisplayImage('admin_edit', _EDIT) . '&nbsp;-&nbsp;' . _EDIT;
208
-        echo '<br>' . newbbDisplayImage('admin_delete', _DELETE) . '&nbsp;-&nbsp;' . _DELETE;
207
+        echo '<br>'.newbbDisplayImage('admin_edit', _EDIT).'&nbsp;-&nbsp;'._EDIT;
208
+        echo '<br>'.newbbDisplayImage('admin_delete', _DELETE).'&nbsp;-&nbsp;'._DELETE;
209 209
         echo '</fieldset>';
210 210
         break;
211 211
 }
@@ -213,4 +213,4 @@  discard block
 block discarded – undo
213 213
 $cacheHelper = Newbb\Utility::cleanCache();
214 214
 //$cacheHelper->delete('permission_category');
215 215
 
216
-require_once __DIR__ . '/admin_footer.php';
216
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/menu.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -41,77 +41,77 @@
 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_ABOUT,
115 115
     'link'  => 'admin/about.php',
116
-    'icon'  => $pathIcon32 . 'about.png'
116
+    'icon'  => $pathIcon32.'about.png'
117 117
 ];
Please login to merge, or discard this patch.
admin/admin_permissions.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -174,20 +174,20 @@  discard block
 block discarded – undo
174 174
                 $tree .= ' checked';
175 175
             }
176 176
             $tree .= ' />'
177
-                     . $option['name']
178
-                     . '<input type="hidden" name="'
179
-                     . $this->getName()
180
-                     . '[parents]['
181
-                     . $option['id']
182
-                     . ']" value="'
183
-                     . implode(':', $parentIds)
184
-                     . '" /><input type="hidden" name="'
185
-                     . $this->getName()
186
-                     . '[itemname]['
187
-                     . $option['id']
188
-                     . ']" value="'
189
-                     . htmlspecialchars($option['name'])
190
-                     . "\" /><br>\n";
177
+                        . $option['name']
178
+                        . '<input type="hidden" name="'
179
+                        . $this->getName()
180
+                        . '[parents]['
181
+                        . $option['id']
182
+                        . ']" value="'
183
+                        . implode(':', $parentIds)
184
+                        . '" /><input type="hidden" name="'
185
+                        . $this->getName()
186
+                        . '[itemname]['
187
+                        . $option['id']
188
+                        . ']" value="'
189
+                        . htmlspecialchars($option['name'])
190
+                        . "\" /><br>\n";
191 191
         } else {
192 192
             $tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n";
193 193
         }
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
         $op_select = new \XoopsFormSelect('', 'action');
220 220
         $op_select->setExtra('onchange="document.forms.actionform.submit()"');
221 221
         $op_select->addOptionArray([
222
-                                       'no'       => _SELECT,
223
-                                       'template' => _AM_NEWBB_PERM_TEMPLATE,
224
-                                       'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP,
225
-                                       'default'  => _AM_NEWBB_PERM_SETBYGROUP
226
-                                   ]);
222
+                                        'no'       => _SELECT,
223
+                                        'template' => _AM_NEWBB_PERM_TEMPLATE,
224
+                                        'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP,
225
+                                        'default'  => _AM_NEWBB_PERM_SETBYGROUP
226
+                                    ]);
227 227
         $opform->addElement($op_select);
228 228
         $opform->display();
229 229
 
@@ -292,10 +292,10 @@  discard block
 block discarded – undo
292 292
         $op_select = new \XoopsFormSelect('', 'action');
293 293
         $op_select->setExtra('onchange="document.forms.actionform.submit()"');
294 294
         $op_select->addOptionArray([
295
-                                       'no'       => _SELECT,
296
-                                       'template' => _AM_NEWBB_PERM_TEMPLATE,
297
-                                       'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP
298
-                                   ]);
295
+                                        'no'       => _SELECT,
296
+                                        'template' => _AM_NEWBB_PERM_TEMPLATE,
297
+                                        'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP
298
+                                    ]);
299 299
         $opform->addElement($op_select);
300 300
         $opform->display();
301 301
 
@@ -370,11 +370,11 @@  discard block
 block discarded – undo
370 370
         $op_select = new \XoopsFormSelect('', 'action');
371 371
         $op_select->setExtra('onchange="document.forms.actionform.submit()"');
372 372
         $op_select->addOptionArray([
373
-                                       'no'       => _SELECT,
374
-                                       'template' => _AM_NEWBB_PERM_TEMPLATE,
375
-                                       'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP,
376
-                                       'default'  => _AM_NEWBB_PERM_SETBYGROUP
377
-                                   ]);
373
+                                        'no'       => _SELECT,
374
+                                        'template' => _AM_NEWBB_PERM_TEMPLATE,
375
+                                        'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP,
376
+                                        'default'  => _AM_NEWBB_PERM_SETBYGROUP
377
+                                    ]);
378 378
         $opform->addElement($op_select);
379 379
         $opform->display();
380 380
 
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 use Xmf\Request;
33 33
 use XoopsModules\Newbb;
34 34
 
35
-require_once __DIR__ . '/admin_header.php';
35
+require_once __DIR__.'/admin_header.php';
36 36
 require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
37 37
 if (!class_exists('XoopsGroupPermForm')) {
38 38
     require_once $GLOBALS['xoops']->path('class/xoopsform/grouppermform.php');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         foreach (array_keys($glist) as $i) {
100 100
             // get selected item id(s) for each group
101 101
             $selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid);
102
-            $ele      = new NewbbXoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
102
+            $ele      = new NewbbXoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected);
103 103
             $ele->setOptionTree($this->_itemTree);
104 104
             $this->addElement($ele);
105 105
             unset($ele);
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
         $tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
109 109
         $tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
110 110
         $this->addElement($tray);
111
-        $ret      = '<br><strong>' . $this->getTitle() . '</strong><br>' . $this->_permDesc . '<br>';
112
-        $ret      .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1' valign='top'>\n";
111
+        $ret      = '<br><strong>'.$this->getTitle().'</strong><br>'.$this->_permDesc.'<br>';
112
+        $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1' valign='top'>\n";
113 113
         $elements = $this->getElements();
114 114
         $hidden   = '';
115 115
         foreach (array_keys($elements) as $i) {
116 116
             if (!is_object($elements[$i])) {
117 117
                 $ret .= $elements[$i];
118 118
             } elseif (!$elements[$i]->isHidden()) {
119
-                $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption();
119
+                $ret .= "<tr valign='top' align='left'><td class='head'>".$elements[$i]->getCaption();
120 120
                 if ('' !== $elements[$i]->getDescription()) {
121
-                    $ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
121
+                    $ret .= '<br><br><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>';
122 122
                 }
123
-                $ret .= "</td>\n<td class='even' style='text-align:center;'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
123
+                $ret .= "</td>\n<td class='even' style='text-align:center;'>\n".$elements[$i]->render()."\n</td></tr>\n";
124 124
             } else {
125 125
                 $hidden .= $elements[$i]->render();
126 126
             }
@@ -157,17 +157,17 @@  discard block
 block discarded – undo
157 157
     public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
158 158
     {
159 159
         if ($option['id'] > 0) {
160
-            $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
160
+            $tree .= $prefix.'<input type="checkbox" name="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" onclick="';
161 161
             foreach ($parentIds as $pid) {
162 162
                 if ($pid <= 0) {
163 163
                     continue;
164 164
                 }
165
-                $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
166
-                $tree       .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}";
165
+                $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']';
166
+                $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if (ele.checked !== true) {ele.checked = this.checked;}";
167 167
             }
168 168
             foreach ($option['allchild'] as $cid) {
169
-                $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
170
-                $tree      .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}";
169
+                $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']';
170
+                $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if (this.checked !== true) {ele.checked = false;}";
171 171
             }
172 172
             $tree .= '" value="1"';
173 173
             if (in_array($option['id'], $this->_value)) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                      . htmlspecialchars($option['name'])
190 190
                      . "\" /><br>\n";
191 191
         } else {
192
-            $tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n";
192
+            $tree .= $prefix.$option['name'].'<input type="hidden" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id']."]\" /><br>\n";
193 193
         }
194 194
         if (isset($option['children'])) {
195 195
             foreach ($option['children'] as $child) {
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                     //                  array_push($parentIds, $option['id']);
198 198
                     $parentIds[] = $option['id'];
199 199
                 }
200
-                $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . '&nbsp;-', $parentIds);
200
+                $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.'&nbsp;-', $parentIds);
201 201
             }
202 202
         }
203 203
     }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     case 'template':
215 215
         xoops_cp_header();
216 216
         $adminObject->displayNavigation(basename(__FILE__));
217
-        echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
217
+        echo "<legend style='font-weight: bold; color: #900;'>"._AM_NEWBB_PERM_ACTION.'</legend>';
218 218
         $opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_TEMPLAT, 'actionform', 'admin_permissions.php', 'get');
219 219
         $op_select = new \XoopsFormSelect('', 'action');
220 220
         $op_select->setExtra('onchange="document.forms.actionform.submit()"');
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         $perm_template = $newbbpermHandler->getTemplate();
234 234
         foreach (array_keys($glist) as $i) {
235 235
             $selected   = !empty($perm_template[$i]) ? array_keys($perm_template[$i]) : [];
236
-            $ret_ele    = '<tr align="left" valign="top"><td class="head">' . $glist[$i] . '</td>';
236
+            $ret_ele    = '<tr align="left" valign="top"><td class="head">'.$glist[$i].'</td>';
237 237
             $ret_ele    .= '<td class="even">';
238 238
             $ret_ele    .= '<table class="outer"><tr><td class="odd"><table><tr>';
239 239
             $ii         = 0;
@@ -243,13 +243,13 @@  discard block
 block discarded – undo
243 243
                 if (0 == $ii % 5) {
244 244
                     $ret_ele .= '</tr><tr>';
245 245
                 }
246
-                $checked      = in_array('forum_' . $perm, $selected) ? ' checked' : '';
247
-                $option_id    = $perm . '_' . $i;
246
+                $checked      = in_array('forum_'.$perm, $selected) ? ' checked' : '';
247
+                $option_id    = $perm.'_'.$i;
248 248
                 $option_ids[] = $option_id;
249
-                $ret_ele      .= '<td><input name="perms[' . $i . '][' . 'forum_' . $perm . ']" id="' . $option_id . '" onclick="" value="1" type="checkbox"' . $checked . '>' . constant('_AM_NEWBB_CAN_' . strtoupper($perm)) . '<br></td>';
249
+                $ret_ele .= '<td><input name="perms['.$i.']['.'forum_'.$perm.']" id="'.$option_id.'" onclick="" value="1" type="checkbox"'.$checked.'>'.constant('_AM_NEWBB_CAN_'.strtoupper($perm)).'<br></td>';
250 250
             }
251 251
             $ret_ele    .= '</tr></table></td><td class="even">';
252
-            $ret_ele    .= _ALL . ' <input id="checkall[' . $i . ']" type="checkbox" value="" onclick="var optionids = new Array(' . implode(', ', $option_ids) . '); xoopsCheckAllElements(optionids, \'checkall[' . $i . ']\')" />';
252
+            $ret_ele    .= _ALL.' <input id="checkall['.$i.']" type="checkbox" value="" onclick="var optionids = new Array('.implode(', ', $option_ids).'); xoopsCheckAllElements(optionids, \'checkall['.$i.']\')" />';
253 253
             $ret_ele    .= '</td></tr></table>';
254 254
             $ret_ele    .= '</td></tr>';
255 255
             $elements[] = $ret_ele;
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         $tray->addElement(new \XoopsFormHidden('action', 'template_save'));
259 259
         $tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
260 260
         $tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
261
-        $ret = '<br><strong>' . _AM_NEWBB_PERM_TEMPLATE . '</strong><br>' . _AM_NEWBB_PERM_TEMPLATE_DESC . '<br>';
261
+        $ret = '<br><strong>'._AM_NEWBB_PERM_TEMPLATE.'</strong><br>'._AM_NEWBB_PERM_TEMPLATE_DESC.'<br>';
262 262
         $ret .= "<form name='template' id='template' method='post'>\n<table width='100%' class='outer' cellspacing='1'>\n";
263 263
         $ret .= implode("\n", $elements);
264 264
         $ret .= '<tr align="left" valign="top"><td class="head"></td><td class="even" style="text-align:center;">';
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         $ret .= '</td></tr>';
267 267
         $ret .= '</table></form>';
268 268
         echo $ret;
269
-        require_once __DIR__ . '/admin_footer.php';
269
+        require_once __DIR__.'/admin_footer.php';
270 270
         break;
271 271
 
272 272
     case 'template_save':
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         }
288 288
         xoops_cp_header();
289 289
         $adminObject->displayNavigation(basename(__FILE__));
290
-        echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
290
+        echo "<legend style='font-weight: bold; color: #900;'>"._AM_NEWBB_PERM_ACTION.'</legend>';
291 291
         $opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_APPLY, 'actionform', 'admin_permissions.php', 'get');
292 292
         $op_select = new \XoopsFormSelect('', 'action');
293 293
         $op_select->setExtra('onchange="document.forms.actionform.submit()"');
@@ -310,9 +310,9 @@  discard block
 block discarded – undo
310 310
         $forums       = $forumHandler->getTree(array_keys($categories), 0, 'all');
311 311
         foreach (array_keys($forums) as $c) {
312 312
             $fm_options[-1 * $c - 1000] = ' ';
313
-            $fm_options[-1 * $c]        = '[' . $categories[$c] . ']';
313
+            $fm_options[-1 * $c]        = '['.$categories[$c].']';
314 314
             foreach (array_keys($forums[$c]) as $f) {
315
-                $fm_options[$f] = $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'];
315
+                $fm_options[$f] = $forums[$c][$f]['prefix'].$forums[$c][$f]['forum_name'];
316 316
             }
317 317
         }
318 318
         unset($forums, $categories);
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
         $tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
328 328
         $fmform->addElement($tray);
329 329
         $fmform->display();
330
-        require_once __DIR__ . '/admin_footer.php';
330
+        require_once __DIR__.'/admin_footer.php';
331 331
         break;
332 332
 
333 333
     case 'apply_save':
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
         }
366 366
 
367 367
         $adminObject->displayNavigation(basename(__FILE__));
368
-        echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
368
+        echo "<legend style='font-weight: bold; color: #900;'>"._AM_NEWBB_PERM_ACTION.'</legend>';
369 369
         $opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP, 'actionform', 'admin_permissions.php', 'get');
370 370
         $op_select = new \XoopsFormSelect('', 'action');
371 371
         $op_select->setExtra('onchange="document.forms.actionform.submit()"');
@@ -388,10 +388,10 @@  discard block
 block discarded – undo
388 388
             ]
389 389
         ];
390 390
         foreach ($perms as $perm) {
391
-            $op_options[$perm] = constant('_AM_NEWBB_CAN_' . strtoupper($perm));
391
+            $op_options[$perm] = constant('_AM_NEWBB_CAN_'.strtoupper($perm));
392 392
             $fm_options[$perm] = [
393
-                'title'     => constant('_AM_NEWBB_CAN_' . strtoupper($perm)),
394
-                'item'      => 'forum_' . $perm,
393
+                'title'     => constant('_AM_NEWBB_CAN_'.strtoupper($perm)),
394
+                'item'      => 'forum_'.$perm,
395 395
                 'desc'      => '',
396 396
                 'anonymous' => true
397 397
             ];
@@ -432,10 +432,10 @@  discard block
 block discarded – undo
432 432
             if (count($forums) > 0) {
433 433
                 foreach (array_keys($forums) as $c) {
434 434
                     $key_c = -1 * $c;
435
-                    $form->addItem($key_c, '<strong>[' . $categories[$c] . ']</strong>');
435
+                    $form->addItem($key_c, '<strong>['.$categories[$c].']</strong>');
436 436
                     foreach (array_keys($forums[$c]) as $f) {
437 437
                         $pid = $forums[$c][$f]['parent_forum'] ?: $key_c;
438
-                        $form->addItem($f, $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'], $pid);
438
+                        $form->addItem($f, $forums[$c][$f]['prefix'].$forums[$c][$f]['forum_name'], $pid);
439 439
                     }
440 440
                 }
441 441
             }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
         }
444 444
         $form->display();
445 445
         echo '<fieldset>';
446
-        echo '<legend>&nbsp;' . _MI_NEWBB_ADMENU_PERMISSION . '&nbsp;</legend>';
446
+        echo '<legend>&nbsp;'._MI_NEWBB_ADMENU_PERMISSION.'&nbsp;</legend>';
447 447
         echo _AM_NEWBB_HELP_PERMISSION_TAB;
448 448
         echo '</fieldset>';
449 449
         // Since we can not control the permission update, a trick is used here
@@ -452,6 +452,6 @@  discard block
 block discarded – undo
452 452
         $permissionHandler->createPermData();
453 453
         $cacheHelper = Newbb\Utility::cleanCache();
454 454
         //$cacheHelper->delete('permission');
455
-        require_once __DIR__ . '/admin_footer.php';
455
+        require_once __DIR__.'/admin_footer.php';
456 456
         break;
457 457
 }
Please login to merge, or discard this patch.