Passed
Branch master (565d4a)
by Michael
15:11 queued 01:11
created
class/GroupFormCheckBox.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
     public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
43 43
     {
44 44
         if ($option['id'] > 0) {
45
-            $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
45
+            $tree .= $prefix.'<input type="checkbox" name="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" onclick="';
46 46
             foreach ($parentIds as $pid) {
47 47
                 if ($pid <= 0) {
48 48
                     continue;
49 49
                 }
50
-                $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
51
-                $tree       .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}";
50
+                $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']';
51
+                $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if (ele.checked !== true) {ele.checked = this.checked;}";
52 52
             }
53 53
             foreach ($option['allchild'] as $cid) {
54
-                $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
55
-                $tree      .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}";
54
+                $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']';
55
+                $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if (this.checked !== true) {ele.checked = false;}";
56 56
             }
57 57
             $tree .= '" value="1"';
58 58
             if (in_array($option['id'], $this->_value)) {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                      . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5)
75 75
                      . "\" /><br>\n";
76 76
         } else {
77
-            $tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n";
77
+            $tree .= $prefix.$option['name'].'<input type="hidden" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id']."]\" /><br>\n";
78 78
         }
79 79
         if (isset($option['children'])) {
80 80
             foreach ($option['children'] as $child) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                     //                  array_push($parentIds, $option['id']);
83 83
                     $parentIds[] = $option['id'];
84 84
                 }
85
-                $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . '&nbsp;-', $parentIds);
85
+                $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.'&nbsp;-', $parentIds);
86 86
             }
87 87
         }
88 88
     }
Please login to merge, or discard this patch.
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -22,68 +22,68 @@
 block discarded – undo
22 22
  */
23 23
 class GroupFormCheckBox extends \XoopsGroupFormCheckBox
24 24
 {
25
-    /**
26
-     * @param      $caption
27
-     * @param      $name
28
-     * @param      $groupId
29
-     * @param null $values
30
-     */
31
-    public function __construct($caption, $name, $groupId, $values = null)
32
-    {
33
-        parent::__construct($caption, $name, $groupId, $values);
34
-    }
25
+	/**
26
+	 * @param      $caption
27
+	 * @param      $name
28
+	 * @param      $groupId
29
+	 * @param null $values
30
+	 */
31
+	public function __construct($caption, $name, $groupId, $values = null)
32
+	{
33
+		parent::__construct($caption, $name, $groupId, $values);
34
+	}
35 35
 
36
-    /**
37
-     * @param string $tree
38
-     * @param array  $option
39
-     * @param string $prefix
40
-     * @param array  $parentIds
41
-     */
42
-    public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
43
-    {
44
-        if ($option['id'] > 0) {
45
-            $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
46
-            foreach ($parentIds as $pid) {
47
-                if ($pid <= 0) {
48
-                    continue;
49
-                }
50
-                $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
51
-                $tree       .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}";
52
-            }
53
-            foreach ($option['allchild'] as $cid) {
54
-                $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
55
-                $tree      .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}";
56
-            }
57
-            $tree .= '" value="1"';
58
-            if (in_array($option['id'], $this->_value)) {
59
-                $tree .= ' checked';
60
-            }
61
-            $tree .= ' />'
62
-                     . $option['name']
63
-                     . '<input type="hidden" name="'
64
-                     . $this->getName()
65
-                     . '[parents]['
66
-                     . $option['id']
67
-                     . ']" value="'
68
-                     . implode(':', $parentIds)
69
-                     . '" /><input type="hidden" name="'
70
-                     . $this->getName()
71
-                     . '[itemname]['
72
-                     . $option['id']
73
-                     . ']" value="'
74
-                     . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5)
75
-                     . "\" /><br>\n";
76
-        } else {
77
-            $tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n";
78
-        }
79
-        if (isset($option['children'])) {
80
-            foreach ($option['children'] as $child) {
81
-                if ($option['id'] > 0) {
82
-                    //                  array_push($parentIds, $option['id']);
83
-                    $parentIds[] = $option['id'];
84
-                }
85
-                $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . '&nbsp;-', $parentIds);
86
-            }
87
-        }
88
-    }
36
+	/**
37
+	 * @param string $tree
38
+	 * @param array  $option
39
+	 * @param string $prefix
40
+	 * @param array  $parentIds
41
+	 */
42
+	public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
43
+	{
44
+		if ($option['id'] > 0) {
45
+			$tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
46
+			foreach ($parentIds as $pid) {
47
+				if ($pid <= 0) {
48
+					continue;
49
+				}
50
+				$parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
51
+				$tree       .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}";
52
+			}
53
+			foreach ($option['allchild'] as $cid) {
54
+				$child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
55
+				$tree      .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}";
56
+			}
57
+			$tree .= '" value="1"';
58
+			if (in_array($option['id'], $this->_value)) {
59
+				$tree .= ' checked';
60
+			}
61
+			$tree .= ' />'
62
+					 . $option['name']
63
+					 . '<input type="hidden" name="'
64
+					 . $this->getName()
65
+					 . '[parents]['
66
+					 . $option['id']
67
+					 . ']" value="'
68
+					 . implode(':', $parentIds)
69
+					 . '" /><input type="hidden" name="'
70
+					 . $this->getName()
71
+					 . '[itemname]['
72
+					 . $option['id']
73
+					 . ']" value="'
74
+					 . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5)
75
+					 . "\" /><br>\n";
76
+		} else {
77
+			$tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n";
78
+		}
79
+		if (isset($option['children'])) {
80
+			foreach ($option['children'] as $child) {
81
+				if ($option['id'] > 0) {
82
+					//                  array_push($parentIds, $option['id']);
83
+					$parentIds[] = $option['id'];
84
+				}
85
+				$this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . '&nbsp;-', $parentIds);
86
+			}
87
+		}
88
+	}
89 89
 }
Please login to merge, or discard this patch.
include/form.post.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
     if (empty($postParentObject)) {
67 67
         $postParentObject = $postHandler->get($pid);
68 68
     }
69
-    $form_title = _MD_NEWBB_REPLY . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}&amp;post_id={$pid}\" rel=\"external\">" . $postParentObject->getVar('subject') . '</a>';
69
+    $form_title = _MD_NEWBB_REPLY.': <a href="'.XOOPS_URL."/modules/newbb/viewtopic.php?topic_id={$topic_id}&amp;post_id={$pid}\" rel=\"external\">".$postParentObject->getVar('subject').'</a>';
70 70
 } else {
71
-    $form_title = _EDIT . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">" . $postObject->getVar('subject') . '</a>';
71
+    $form_title = _EDIT.': <a href="'.XOOPS_URL."/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">".$postObject->getVar('subject').'</a>';
72 72
     $editby     = true;
73 73
 }
74 74
 $xoopsTpl->assign('form_title', $form_title);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
 //$filname = XOOPS_URL.$_SERVER['REQUEST_URI'];
103 103
 
104
-$forum_form = new \XoopsThemeForm(htmlspecialchars(@$form_title, ENT_QUOTES | ENT_HTML5), 'form_post', XOOPS_URL . '/modules/newbb/post.php', 'post', true);
104
+$forum_form = new \XoopsThemeForm(htmlspecialchars(@$form_title, ENT_QUOTES | ENT_HTML5), 'form_post', XOOPS_URL.'/modules/newbb/post.php', 'post', true);
105 105
 $forum_form->setExtra('enctype="multipart/form-data"');
106 106
 
107 107
 if ($editby) {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 $icons_radio   = new \XoopsFormRadio(_MD_NEWBB_MESSAGEICON, 'icon', $icon);
144 144
 $subject_icons = \XoopsLists::getSubjectsList();
145 145
 foreach ($subject_icons as $iconfile) {
146
-    $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />');
146
+    $icons_radio->addOption($iconfile, '<img src="'.XOOPS_URL.'/images/subject/'.$iconfile.'" alt="" />');
147 147
 }
148 148
 $forum_form->addElement($icons_radio);
149 149
 
@@ -251,18 +251,18 @@  discard block
 block discarded – undo
251 251
     $upload_tray = new \XoopsFormElementTray(_MD_NEWBB_ATTACHMENT);
252 252
     $upload_tray->addElement(new \XoopsFormFile('', 'userfile', $forumObject->getVar('attach_maxkb') * 1024));
253 253
     $upload_tray->addElement(new \XoopsFormButton('', 'contents_upload', _MD_NEWBB_UPLOAD, 'submit'));
254
-    $upload_tray->addElement(new \XoopsFormLabel('<br><br>' . _MD_NEWBB_MAX_FILESIZE . ':', $forumObject->getVar('attach_maxkb') . 'Kb; '));
254
+    $upload_tray->addElement(new \XoopsFormLabel('<br><br>'._MD_NEWBB_MAX_FILESIZE.':', $forumObject->getVar('attach_maxkb').'Kb; '));
255 255
     $extensions = trim(str_replace('|', ' ', $forumObject->getVar('attach_ext')));
256 256
     $extensions = (empty($extensions) || '*' === $extensions) ? _ALL : $extensions;
257
-    $upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS . ':', $extensions));
258
-    $upload_tray->addElement(new \XoopsFormLabel('<br>' . sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width'])));
257
+    $upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS.':', $extensions));
258
+    $upload_tray->addElement(new \XoopsFormLabel('<br>'.sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width'])));
259 259
     $forum_form->addElement($upload_tray);
260 260
 }
261 261
 
262 262
 if (!empty($attachments) && is_array($attachments) && count($attachments)) {
263 263
     $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_THIS_FILE_WAS_ATTACHED_TO_THIS_POST, 'delete_attach[]');
264 264
     foreach ($attachments as $key => $attachment) {
265
-        $attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['nameDisplay'] . '</a><br>';
265
+        $attach = ' '._DELETE.' <a href='.XOOPS_URL.'/'.$GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attachment['name_saved'].' rel="external">'.$attachment['nameDisplay'].'</a><br>';
266 266
         $delete_attach_checkbox->addOption($key, $attach);
267 267
     }
268 268
     $forum_form->addElement($delete_attach_checkbox);
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_REMOVE, 'delete_tmp[]');
274 274
     $url_prefix             = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH);
275 275
     foreach ($attachments_tmp as $key => $attachment) {
276
-        $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>';
276
+        $attach = ' <a href="'.$url_prefix.'/'.$attachment[0].'" rel="external">'.$attachment[1].'</a><br>';
277 277
         $delete_attach_checkbox->addOption($key, $attach);
278 278
     }
279 279
     $forum_form->addElement($delete_attach_checkbox);
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             }
297 297
             $karma_select = new \XoopsFormSelect('', 'post_karma', $post_karma);
298 298
             $karma_select->addOptionArray($karma_array);
299
-            $radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA . $karma_select->render());
299
+            $radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA.$karma_select->render());
300 300
         }
301 301
     }
302 302
     $radiobox->addOption('require_null', _MD_NEWBB_REQUIRE_NULL);
@@ -327,11 +327,11 @@  discard block
 block discarded – undo
327 327
 
328 328
 $cancel_button = new \XoopsFormButton('', 'cancel', _CANCEL, 'button');
329 329
 if (!empty($topic_id)) {
330
-    $extra = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . (int)$topic_id;
330
+    $extra = XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.(int)$topic_id;
331 331
 } else {
332
-    $extra = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $forumObject->getVar('forum_id');
332
+    $extra = XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$forumObject->getVar('forum_id');
333 333
 }
334
-$cancel_button->setExtra("onclick='location=\"" . $extra . "\"'");
334
+$cancel_button->setExtra("onclick='location=\"".$extra."\"'");
335 335
 $cancel_button->setExtra("tabindex='6'");
336 336
 
337 337
 if (!empty($isreply) && !empty($hidden)) {
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 
346 346
 $preview_button = new \XoopsFormButton('', 'btn_preview', _PREVIEW, 'button');
347 347
 $preview_button->setExtra("tabindex='5'");
348
-$preview_button->setExtra('onclick="window.document.forms.' . $forum_form->getName() . '.contents_preview.value=1; window.document.forms.' . $forum_form->getName() . '.submit() ;"');
348
+$preview_button->setExtra('onclick="window.document.forms.'.$forum_form->getName().'.contents_preview.value=1; window.document.forms.'.$forum_form->getName().'.submit() ;"');
349 349
 $forum_form->addElement(new \XoopsFormHidden('contents_preview', 0));
350 350
 
351 351
 $button_tray->addElement($preview_button);
Please login to merge, or discard this patch.
Indentation   +163 added lines, -163 removed lines patch added patch discarded remove patch
@@ -30,69 +30,69 @@  discard block
 block discarded – undo
30 30
 
31 31
 //check banning
32 32
 $moderated_id    = (is_object($GLOBALS['xoopsUser'])
33
-                    && $GLOBALS['xoopsUser']->uid() > 0) ? $GLOBALS['xoopsUser']->uid() : 0;
33
+					&& $GLOBALS['xoopsUser']->uid() > 0) ? $GLOBALS['xoopsUser']->uid() : 0;
34 34
 $moderated_ip    = Request::getString('REMOTE_ADDR', '', 'SERVER');
35 35
 $moderated_forum = $forumObject->getVar('forum_id');
36 36
 /** @var Newbb\ModerateHandler $moderateHandler */
37 37
 $moderateHandler = Newbb\Helper::getInstance()->getHandler('Moderate');
38 38
 if (!$moderateHandler->verifyUser($moderated_id, '', $moderated_forum)) {
39
-    $criteria = new \CriteriaCompo();
40
-    $criteria->add(new \Criteria('uid', $moderated_id, '='));
41
-    $criteria->setSort('mod_end');
42
-    $criteria->setOrder('DESC');
43
-    $mod  = $moderateHandler->getObjects($criteria, false, false);
44
-    $tage = ($mod[0]['mod_end'] - $mod[0]['mod_start']) / 60 / 60 / 24;
45
-    $msg  = $myts->displayTarea(sprintf(_MD_NEWBB_SUSPEND_TEXT, newbbGetUnameFromId($moderated_id), (int)$tage, $mod[0]['mod_desc'], formatTimestamp($mod[0]['mod_end'])), 1);
46
-    xoops_error($msg, _MD_NEWBB_SUSPEND_NOACCESS);
47
-    require_once $GLOBALS['xoops']->path('footer.php');
48
-    exit();
39
+	$criteria = new \CriteriaCompo();
40
+	$criteria->add(new \Criteria('uid', $moderated_id, '='));
41
+	$criteria->setSort('mod_end');
42
+	$criteria->setOrder('DESC');
43
+	$mod  = $moderateHandler->getObjects($criteria, false, false);
44
+	$tage = ($mod[0]['mod_end'] - $mod[0]['mod_start']) / 60 / 60 / 24;
45
+	$msg  = $myts->displayTarea(sprintf(_MD_NEWBB_SUSPEND_TEXT, newbbGetUnameFromId($moderated_id), (int)$tage, $mod[0]['mod_desc'], formatTimestamp($mod[0]['mod_end'])), 1);
46
+	xoops_error($msg, _MD_NEWBB_SUSPEND_NOACCESS);
47
+	require_once $GLOBALS['xoops']->path('footer.php');
48
+	exit();
49 49
 }
50 50
 
51 51
 $xoopsTpl->assign('category', ['id' => $forumObject->getVar('cat_id'), 'title' => $categoryObject->getVar('cat_title')]);
52 52
 $xoopsTpl->assign('parentforum', $forumHandler->getParents($forumObject));
53 53
 $xoopsTpl->assign([
54
-                      'forum_id'   => $forumObject->getVar('forum_id'),
55
-                      'forum_name' => $forumObject->getVar('forum_name')
56
-                  ]);
54
+					  'forum_id'   => $forumObject->getVar('forum_id'),
55
+					  'forum_name' => $forumObject->getVar('forum_name')
56
+				  ]);
57 57
 
58 58
 if (!is_object($topicObject)) {
59
-    $topicObject = $topicHandler->create();
59
+	$topicObject = $topicHandler->create();
60 60
 }
61 61
 
62 62
 $editby = false;
63 63
 if ($topicObject->isNew()) {
64
-    $form_title = _MD_NEWBB_POSTNEW;
64
+	$form_title = _MD_NEWBB_POSTNEW;
65 65
 } elseif ($postObject->isNew()) {
66
-    if (empty($postParentObject)) {
67
-        $postParentObject = $postHandler->get($pid);
68
-    }
69
-    $form_title = _MD_NEWBB_REPLY . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}&amp;post_id={$pid}\" rel=\"external\">" . $postParentObject->getVar('subject') . '</a>';
66
+	if (empty($postParentObject)) {
67
+		$postParentObject = $postHandler->get($pid);
68
+	}
69
+	$form_title = _MD_NEWBB_REPLY . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}&amp;post_id={$pid}\" rel=\"external\">" . $postParentObject->getVar('subject') . '</a>';
70 70
 } else {
71
-    $form_title = _EDIT . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">" . $postObject->getVar('subject') . '</a>';
72
-    $editby     = true;
71
+	$form_title = _EDIT . ': <a href="' . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id={$post_id}\" rel=\"external\">" . $postObject->getVar('subject') . '</a>';
72
+	$editby     = true;
73 73
 }
74 74
 $xoopsTpl->assign('form_title', $form_title);
75 75
 
76 76
 foreach ([
77
-             'start',
78
-             'topic_id',
79
-             'post_id',
80
-             'pid',
81
-             'isreply',
82
-             'isedit',
83
-             'contents_preview'
84
-         ] as $getint) {
85
-    ${$getint} = Request::getInt($getint, (!empty(${$getint}) ? ${$getint} : 0), 'GET'); // isset($_GET[$getint]) ? (int)($_GET[$getint]) : ((!empty(${$getint})) ? ${$getint} : 0);
77
+			 'start',
78
+			 'topic_id',
79
+			 'post_id',
80
+			 'pid',
81
+			 'isreply',
82
+			 'isedit',
83
+			 'contents_preview'
84
+		 ] as $getint) {
85
+	${$getint} = Request::getInt($getint, (!empty(${$getint}) ? ${$getint} : 0), 'GET'); // isset($_GET[$getint]) ? (int)($_GET[$getint]) : ((!empty(${$getint})) ? ${$getint} : 0);
86 86
 }
87 87
 foreach ([
88
-             'order',
89
-             'viewmode',
90
-             'hidden',
91
-             'newbb_form',
92
-             'icon',
93
-             'op'
94
-         ] as $getstr) {
95
-    ${$getstr} = Request::getString($getstr, (!empty(${$getstr}) ? ${$getstr} : ''), 'GET'); //isset($_GET[$getstr]) ? $_GET[$getstr] : ((!empty(${$getstr})) ? ${$getstr} : '');
88
+			 'order',
89
+			 'viewmode',
90
+			 'hidden',
91
+			 'newbb_form',
92
+			 'icon',
93
+			 'op'
94
+		 ] as $getstr) {
95
+	${$getstr} = Request::getString($getstr, (!empty(${$getstr}) ? ${$getstr} : ''), 'GET'); //isset($_GET[$getstr]) ? $_GET[$getstr] : ((!empty(${$getstr})) ? ${$getstr} : '');
96 96
 }
97 97
 
98 98
 /** @var Newbb\TopicHandler $topicHandler */
@@ -105,30 +105,30 @@  discard block
 block discarded – undo
105 105
 $forum_form->setExtra('enctype="multipart/form-data"');
106 106
 
107 107
 if ($editby) {
108
-    $forum_form->addElement(new \XoopsFormText(_MD_NEWBB_EDITEDMSG, 'editwhy', 60, 100, ''));
108
+	$forum_form->addElement(new \XoopsFormText(_MD_NEWBB_EDITEDMSG, 'editwhy', 60, 100, ''));
109 109
 }
110 110
 
111 111
 $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
112 112
 if (newbbIsAdmin($forumObject)
113
-    || ($topicHandler->getPermission($forumObject, $topic_status, 'type')
114
-        && (0 == $topic_id
115
-            || $uid == $topicHandler->get(@$topic_id, 'topic_poster')))) {
116
-    $type_id = $topicHandler->get(@$topic_id, 'type_id');
117
-    /** @var Newbb\TypeHandler $typeHandler */
118
-    $typeHandler = Newbb\Helper::getInstance()->getHandler('Type');
119
-    $types       = $typeHandler->getByForum($forumObject->getVar('forum_id'));
120
-    if (!empty($types)) {
121
-        $type_element = new \XoopsFormSelect(_MD_NEWBB_TYPE, 'type_id', $type_id);
122
-        //$type_element = new \XoopsFormRadio(_MD_NEWBB_TYPE, 'type_id', $type_id);
123
-        $type_element->addOption(0, _NONE);
124
-        foreach ($types as $key => $type) {
125
-            //$value = empty($type["type_color"]) ? $type["type_name"] : "<em style=\"font-style: normal; color: " . $type["type_color"] . ";\">" . $type["type_name"] . "</em>";
126
-            $type_element->addOption($key, $type['type_name']);
127
-        }
128
-        $forum_form->addElement($type_element);
129
-    } else {
130
-        $forum_form->addElement(new \XoopsFormHidden('type_id', 0));
131
-    }
113
+	|| ($topicHandler->getPermission($forumObject, $topic_status, 'type')
114
+		&& (0 == $topic_id
115
+			|| $uid == $topicHandler->get(@$topic_id, 'topic_poster')))) {
116
+	$type_id = $topicHandler->get(@$topic_id, 'type_id');
117
+	/** @var Newbb\TypeHandler $typeHandler */
118
+	$typeHandler = Newbb\Helper::getInstance()->getHandler('Type');
119
+	$types       = $typeHandler->getByForum($forumObject->getVar('forum_id'));
120
+	if (!empty($types)) {
121
+		$type_element = new \XoopsFormSelect(_MD_NEWBB_TYPE, 'type_id', $type_id);
122
+		//$type_element = new \XoopsFormRadio(_MD_NEWBB_TYPE, 'type_id', $type_id);
123
+		$type_element->addOption(0, _NONE);
124
+		foreach ($types as $key => $type) {
125
+			//$value = empty($type["type_color"]) ? $type["type_name"] : "<em style=\"font-style: normal; color: " . $type["type_color"] . ";\">" . $type["type_name"] . "</em>";
126
+			$type_element->addOption($key, $type['type_name']);
127
+		}
128
+		$forum_form->addElement($type_element);
129
+	} else {
130
+		$forum_form->addElement(new \XoopsFormHidden('type_id', 0));
131
+	}
132 132
 }
133 133
 
134 134
 $subject_form = new \XoopsFormText(_MD_NEWBB_SUBJECTC, 'subject', 60, 100, $subject);
@@ -136,32 +136,32 @@  discard block
 block discarded – undo
136 136
 $forum_form->addElement($subject_form, true);
137 137
 
138 138
 if (!is_object($GLOBALS['xoopsUser'])) {
139
-    $required = !empty($GLOBALS['xoopsModuleConfig']['require_name']);
140
-    $forum_form->addElement(new \XoopsFormText(_MD_NEWBB_NAMEMAIL, 'poster_name', 60, 255, (!empty($isedit) && !empty($poster_name)) ? $poster_name : ''), $required);
139
+	$required = !empty($GLOBALS['xoopsModuleConfig']['require_name']);
140
+	$forum_form->addElement(new \XoopsFormText(_MD_NEWBB_NAMEMAIL, 'poster_name', 60, 255, (!empty($isedit) && !empty($poster_name)) ? $poster_name : ''), $required);
141 141
 }
142 142
 
143 143
 $icons_radio   = new \XoopsFormRadio(_MD_NEWBB_MESSAGEICON, 'icon', $icon);
144 144
 $subject_icons = \XoopsLists::getSubjectsList();
145 145
 foreach ($subject_icons as $iconfile) {
146
-    $icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />');
146
+	$icons_radio->addOption($iconfile, '<img src="' . XOOPS_URL . '/images/subject/' . $iconfile . '" alt="" />');
147 147
 }
148 148
 $forum_form->addElement($icons_radio);
149 149
 
150 150
 $nohtml = !$topicHandler->getPermission($forumObject, $topic_status, 'html');
151 151
 
152 152
 if (Request::getString('editor', '', 'POST')) {
153
-    $editor = trim(Request::getString('editor', '', 'POST'));
154
-    newbbSetCookie('editor', $editor);
153
+	$editor = trim(Request::getString('editor', '', 'POST'));
154
+	newbbSetCookie('editor', $editor);
155 155
 } elseif (!$editor = newbbGetCookie('editor')) {
156
-    if (empty($editor)) {
157
-        $editor = @ $GLOBALS['xoopsModuleConfig']['editor_default'];
158
-    }
156
+	if (empty($editor)) {
157
+		$editor = @ $GLOBALS['xoopsModuleConfig']['editor_default'];
158
+	}
159 159
 }
160 160
 if (count(@$GLOBALS['xoopsModuleConfig']['editor_allowed']) > 0) {
161
-    if (!in_array($editor, $GLOBALS['xoopsModuleConfig']['editor_allowed'])) {
162
-        $editor = $GLOBALS['xoopsModuleConfig']['editor_allowed'][0];
163
-        newbbSetCookie('editor', $editor);
164
-    }
161
+	if (!in_array($editor, $GLOBALS['xoopsModuleConfig']['editor_allowed'])) {
162
+		$editor = $GLOBALS['xoopsModuleConfig']['editor_allowed'][0];
163
+		newbbSetCookie('editor', $editor);
164
+	}
165 165
 }
166 166
 
167 167
 $forum_form->addElement(new \XoopsFormSelectEditor($forum_form, 'editor', $editor, $nohtml, @$GLOBALS['xoopsModuleConfig']['editor_allowed'][0]));
@@ -178,31 +178,31 @@  discard block
 block discarded – undo
178 178
 $forum_form->addElement($_editor, true);
179 179
 
180 180
 if (!empty($GLOBALS['xoopsModuleConfig']['do_tag']) && (empty($postObject) || $postObject->isTopic())) {
181
-    $topic_tags = '';
182
-    if (Request::getString('topic_tags', '', 'POST')) {
183
-        $topic_tags = $myts->htmlSpecialChars(Request::getString('topic_tags', '', 'POST'));
184
-    } elseif (!empty($topic_id)) {
185
-        $topic_tags = $topicHandler->get($topic_id, 'topic_tags');
186
-    }
187
-    if (xoops_load('formtag', 'tag') && class_exists('TagFormTag')) {
188
-        $forum_form->addElement(new TagFormTag('topic_tags', 60, 255, $topic_tags));
189
-    }
181
+	$topic_tags = '';
182
+	if (Request::getString('topic_tags', '', 'POST')) {
183
+		$topic_tags = $myts->htmlSpecialChars(Request::getString('topic_tags', '', 'POST'));
184
+	} elseif (!empty($topic_id)) {
185
+		$topic_tags = $topicHandler->get($topic_id, 'topic_tags');
186
+	}
187
+	if (xoops_load('formtag', 'tag') && class_exists('TagFormTag')) {
188
+		$forum_form->addElement(new TagFormTag('topic_tags', 60, 255, $topic_tags));
189
+	}
190 190
 }
191 191
 
192 192
 $options_tray = new \XoopsFormElementTray(_MD_NEWBB_OPTIONS, '<br>');
193 193
 if (is_object($GLOBALS['xoopsUser']) && 1 == $GLOBALS['xoopsModuleConfig']['allow_user_anonymous']) {
194
-    $noname          = (!empty($isedit) && is_object($postObject) && 0 == $postObject->getVar('uid')) ? 1 : 0;
195
-    $noname_checkbox = new \XoopsFormCheckBox('', 'noname', $noname);
196
-    $noname_checkbox->addOption(1, _MD_NEWBB_POSTANONLY);
197
-    $options_tray->addElement($noname_checkbox);
194
+	$noname          = (!empty($isedit) && is_object($postObject) && 0 == $postObject->getVar('uid')) ? 1 : 0;
195
+	$noname_checkbox = new \XoopsFormCheckBox('', 'noname', $noname);
196
+	$noname_checkbox->addOption(1, _MD_NEWBB_POSTANONLY);
197
+	$options_tray->addElement($noname_checkbox);
198 198
 }
199 199
 
200 200
 if (!$nohtml) {
201
-    $html_checkbox = new \XoopsFormCheckBox('', 'dohtml', $dohtml);
202
-    $html_checkbox->addOption(1, _MD_NEWBB_DOHTML);
203
-    $options_tray->addElement($html_checkbox);
201
+	$html_checkbox = new \XoopsFormCheckBox('', 'dohtml', $dohtml);
202
+	$html_checkbox->addOption(1, _MD_NEWBB_DOHTML);
203
+	$options_tray->addElement($html_checkbox);
204 204
 } else {
205
-    $forum_form->addElement(new \XoopsFormHidden('dohtml', 0));
205
+	$forum_form->addElement(new \XoopsFormHidden('dohtml', 0));
206 206
 }
207 207
 
208 208
 $smiley_checkbox = new \XoopsFormCheckBox('', 'dosmiley', $dosmiley);
@@ -214,99 +214,99 @@  discard block
 block discarded – undo
214 214
 $options_tray->addElement($xcode_checkbox);
215 215
 
216 216
 if (!$nohtml) {
217
-    $br_checkbox = new \XoopsFormCheckBox('', 'dobr', $dobr);
218
-    $br_checkbox->addOption(1, _MD_NEWBB_DOBR);
219
-    $options_tray->addElement($br_checkbox);
217
+	$br_checkbox = new \XoopsFormCheckBox('', 'dobr', $dobr);
218
+	$br_checkbox->addOption(1, _MD_NEWBB_DOBR);
219
+	$options_tray->addElement($br_checkbox);
220 220
 } else {
221
-    $forum_form->addElement(new \XoopsFormHidden('dobr', 1));
221
+	$forum_form->addElement(new \XoopsFormHidden('dobr', 1));
222 222
 }
223 223
 
224 224
 if (is_object($GLOBALS['xoopsUser']) && $topicHandler->getPermission($forumObject, $topic_status, 'signature')) {
225
-    $attachsig_checkbox = new \XoopsFormCheckBox('', 'attachsig', $attachsig);
226
-    $attachsig_checkbox->addOption(1, _MD_NEWBB_ATTACHSIG);
227
-    $options_tray->addElement($attachsig_checkbox);
225
+	$attachsig_checkbox = new \XoopsFormCheckBox('', 'attachsig', $attachsig);
226
+	$attachsig_checkbox->addOption(1, _MD_NEWBB_ATTACHSIG);
227
+	$options_tray->addElement($attachsig_checkbox);
228 228
 }
229 229
 $notify = 0;
230 230
 if (is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsModuleConfig']['notification_enabled']) {
231
-    if (!empty($notify)) {
232
-        // If 'notify' set, use that value (e.g. preview or upload)
233
-        //$notify = 1;
234
-    } else {
235
-        // Otherwise, check previous subscribed status...
236
-        /** @var \XoopsNotificationHandler $notificationHandler */
237
-        $notificationHandler = xoops_getHandler('notification');
238
-        if (!empty($topic_id)
239
-            && $notificationHandler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $GLOBALS['xoopsUser']->getVar('uid'))) {
240
-            $notify = 1;
241
-        }
242
-    }
243
-
244
-    $notify_checkbox = new \XoopsFormCheckBox('', 'notify', $notify);
245
-    $notify_checkbox->addOption(1, _MD_NEWBB_NEWPOSTNOTIFY);
246
-    $options_tray->addElement($notify_checkbox);
231
+	if (!empty($notify)) {
232
+		// If 'notify' set, use that value (e.g. preview or upload)
233
+		//$notify = 1;
234
+	} else {
235
+		// Otherwise, check previous subscribed status...
236
+		/** @var \XoopsNotificationHandler $notificationHandler */
237
+		$notificationHandler = xoops_getHandler('notification');
238
+		if (!empty($topic_id)
239
+			&& $notificationHandler->isSubscribed('thread', $topic_id, 'new_post', $xoopsModule->getVar('mid'), $GLOBALS['xoopsUser']->getVar('uid'))) {
240
+			$notify = 1;
241
+		}
242
+	}
243
+
244
+	$notify_checkbox = new \XoopsFormCheckBox('', 'notify', $notify);
245
+	$notify_checkbox->addOption(1, _MD_NEWBB_NEWPOSTNOTIFY);
246
+	$options_tray->addElement($notify_checkbox);
247 247
 }
248 248
 $forum_form->addElement($options_tray);
249 249
 
250 250
 if ($topicHandler->getPermission($forumObject, $topic_status, 'attach')) {
251
-    $upload_tray = new \XoopsFormElementTray(_MD_NEWBB_ATTACHMENT);
252
-    $upload_tray->addElement(new \XoopsFormFile('', 'userfile', $forumObject->getVar('attach_maxkb') * 1024));
253
-    $upload_tray->addElement(new \XoopsFormButton('', 'contents_upload', _MD_NEWBB_UPLOAD, 'submit'));
254
-    $upload_tray->addElement(new \XoopsFormLabel('<br><br>' . _MD_NEWBB_MAX_FILESIZE . ':', $forumObject->getVar('attach_maxkb') . 'Kb; '));
255
-    $extensions = trim(str_replace('|', ' ', $forumObject->getVar('attach_ext')));
256
-    $extensions = (empty($extensions) || '*' === $extensions) ? _ALL : $extensions;
257
-    $upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS . ':', $extensions));
258
-    $upload_tray->addElement(new \XoopsFormLabel('<br>' . sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width'])));
259
-    $forum_form->addElement($upload_tray);
251
+	$upload_tray = new \XoopsFormElementTray(_MD_NEWBB_ATTACHMENT);
252
+	$upload_tray->addElement(new \XoopsFormFile('', 'userfile', $forumObject->getVar('attach_maxkb') * 1024));
253
+	$upload_tray->addElement(new \XoopsFormButton('', 'contents_upload', _MD_NEWBB_UPLOAD, 'submit'));
254
+	$upload_tray->addElement(new \XoopsFormLabel('<br><br>' . _MD_NEWBB_MAX_FILESIZE . ':', $forumObject->getVar('attach_maxkb') . 'Kb; '));
255
+	$extensions = trim(str_replace('|', ' ', $forumObject->getVar('attach_ext')));
256
+	$extensions = (empty($extensions) || '*' === $extensions) ? _ALL : $extensions;
257
+	$upload_tray->addElement(new \XoopsFormLabel(_MD_NEWBB_ALLOWED_EXTENSIONS . ':', $extensions));
258
+	$upload_tray->addElement(new \XoopsFormLabel('<br>' . sprintf(_MD_NEWBB_MAXPIC, $GLOBALS['xoopsModuleConfig']['max_img_height'], $GLOBALS['xoopsModuleConfig']['max_img_width'])));
259
+	$forum_form->addElement($upload_tray);
260 260
 }
261 261
 
262 262
 if (!empty($attachments) && is_array($attachments) && count($attachments)) {
263
-    $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_THIS_FILE_WAS_ATTACHED_TO_THIS_POST, 'delete_attach[]');
264
-    foreach ($attachments as $key => $attachment) {
265
-        $attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['nameDisplay'] . '</a><br>';
266
-        $delete_attach_checkbox->addOption($key, $attach);
267
-    }
268
-    $forum_form->addElement($delete_attach_checkbox);
269
-    unset($delete_attach_checkbox);
263
+	$delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_THIS_FILE_WAS_ATTACHED_TO_THIS_POST, 'delete_attach[]');
264
+	foreach ($attachments as $key => $attachment) {
265
+		$attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['nameDisplay'] . '</a><br>';
266
+		$delete_attach_checkbox->addOption($key, $attach);
267
+	}
268
+	$forum_form->addElement($delete_attach_checkbox);
269
+	unset($delete_attach_checkbox);
270 270
 }
271 271
 
272 272
 if (!empty($attachments_tmp) && is_array($attachments_tmp) && count($attachments_tmp)) {
273
-    $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_REMOVE, 'delete_tmp[]');
274
-    $url_prefix             = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH);
275
-    foreach ($attachments_tmp as $key => $attachment) {
276
-        $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>';
277
-        $delete_attach_checkbox->addOption($key, $attach);
278
-    }
279
-    $forum_form->addElement($delete_attach_checkbox);
280
-    unset($delete_attach_checkbox);
281
-    $attachments_tmp = base64_encode(serialize($attachments_tmp));
282
-    $forum_form->addElement(new \XoopsFormHidden('attachments_tmp', $attachments_tmp));
273
+	$delete_attach_checkbox = new \XoopsFormCheckBox(_MD_NEWBB_REMOVE, 'delete_tmp[]');
274
+	$url_prefix             = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH);
275
+	foreach ($attachments_tmp as $key => $attachment) {
276
+		$attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>';
277
+		$delete_attach_checkbox->addOption($key, $attach);
278
+	}
279
+	$forum_form->addElement($delete_attach_checkbox);
280
+	unset($delete_attach_checkbox);
281
+	$attachments_tmp = base64_encode(serialize($attachments_tmp));
282
+	$forum_form->addElement(new \XoopsFormHidden('attachments_tmp', $attachments_tmp));
283 283
 }
284 284
 $radiobox = null;
285 285
 if ($GLOBALS['xoopsModuleConfig']['enable_karma'] || $GLOBALS['xoopsModuleConfig']['allow_require_reply']) {
286
-    $view_require = $require_reply ? 'require_reply' : ($post_karma ? 'require_karma' : 'require_null');
287
-    $radiobox     = new \XoopsFormRadio(_MD_NEWBB_VIEW_REQUIRE, 'view_require', $view_require);
288
-    if ($GLOBALS['xoopsModuleConfig']['allow_require_reply']) {
289
-        $radiobox->addOption('require_reply', _MD_NEWBB_REQUIRE_REPLY);
290
-    }
291
-    if ($GLOBALS['xoopsModuleConfig']['enable_karma']) {
292
-        $karmas = array_map('trim', explode(',', $GLOBALS['xoopsModuleConfig']['karma_options']));
293
-        if (count($karmas) > 1) {
294
-            foreach ($karmas as $karma) {
295
-                $karma_array[(string)$karma] = (int)$karma;
296
-            }
297
-            $karma_select = new \XoopsFormSelect('', 'post_karma', $post_karma);
298
-            $karma_select->addOptionArray($karma_array);
299
-            $radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA . $karma_select->render());
300
-        }
301
-    }
302
-    $radiobox->addOption('require_null', _MD_NEWBB_REQUIRE_NULL);
286
+	$view_require = $require_reply ? 'require_reply' : ($post_karma ? 'require_karma' : 'require_null');
287
+	$radiobox     = new \XoopsFormRadio(_MD_NEWBB_VIEW_REQUIRE, 'view_require', $view_require);
288
+	if ($GLOBALS['xoopsModuleConfig']['allow_require_reply']) {
289
+		$radiobox->addOption('require_reply', _MD_NEWBB_REQUIRE_REPLY);
290
+	}
291
+	if ($GLOBALS['xoopsModuleConfig']['enable_karma']) {
292
+		$karmas = array_map('trim', explode(',', $GLOBALS['xoopsModuleConfig']['karma_options']));
293
+		if (count($karmas) > 1) {
294
+			foreach ($karmas as $karma) {
295
+				$karma_array[(string)$karma] = (int)$karma;
296
+			}
297
+			$karma_select = new \XoopsFormSelect('', 'post_karma', $post_karma);
298
+			$karma_select->addOptionArray($karma_array);
299
+			$radiobox->addOption('require_karma', _MD_NEWBB_REQUIRE_KARMA . $karma_select->render());
300
+		}
301
+	}
302
+	$radiobox->addOption('require_null', _MD_NEWBB_REQUIRE_NULL);
303 303
 }
304 304
 if (null !== $radiobox) {
305
-    $forum_form->addElement($radiobox);
305
+	$forum_form->addElement($radiobox);
306 306
 }
307 307
 
308 308
 if (empty($uid)) {
309
-    $forum_form->addElement(new \XoopsFormCaptcha());
309
+	$forum_form->addElement(new \XoopsFormCaptcha());
310 310
 }
311 311
 
312 312
 $forum_form->addElement(new \XoopsFormHidden('pid', @$pid));
@@ -327,20 +327,20 @@  discard block
 block discarded – undo
327 327
 
328 328
 $cancel_button = new \XoopsFormButton('', 'cancel', _CANCEL, 'button');
329 329
 if (!empty($topic_id)) {
330
-    $extra = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . (int)$topic_id;
330
+	$extra = XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . (int)$topic_id;
331 331
 } else {
332
-    $extra = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $forumObject->getVar('forum_id');
332
+	$extra = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $forumObject->getVar('forum_id');
333 333
 }
334 334
 $cancel_button->setExtra("onclick='location=\"" . $extra . "\"'");
335 335
 $cancel_button->setExtra("tabindex='6'");
336 336
 
337 337
 if (!empty($isreply) && !empty($hidden)) {
338
-    $forum_form->addElement(new \XoopsFormHidden('hidden', $hidden));
338
+	$forum_form->addElement(new \XoopsFormHidden('hidden', $hidden));
339 339
 
340
-    $quote_button = new \XoopsFormButton('', 'quote', _MD_NEWBB_QUOTE, 'button');
341
-    $quote_button->setExtra("onclick='xoopsGetElementById(\"message\").value=xoopsGetElementById(\"message\").value+ xoopsGetElementById(\"hidden\").value;xoopsGetElementById(\"hidden\").value=\"\";'");
342
-    $quote_button->setExtra("tabindex='4'");
343
-    $button_tray->addElement($quote_button);
340
+	$quote_button = new \XoopsFormButton('', 'quote', _MD_NEWBB_QUOTE, 'button');
341
+	$quote_button->setExtra("onclick='xoopsGetElementById(\"message\").value=xoopsGetElementById(\"message\").value+ xoopsGetElementById(\"hidden\").value;xoopsGetElementById(\"hidden\").value=\"\";'");
342
+	$quote_button->setExtra("tabindex='4'");
343
+	$button_tray->addElement($quote_button);
344 344
 }
345 345
 
346 346
 $preview_button = new \XoopsFormButton('', 'btn_preview', _PREVIEW, 'button');
Please login to merge, or discard this patch.
admin/admin_permissions.php 2 patches
Spacing   +21 added lines, -21 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');
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     case 'template':
64 64
         xoops_cp_header();
65 65
         $adminObject->displayNavigation(basename(__FILE__));
66
-        echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
66
+        echo "<legend style='font-weight: bold; color: #900;'>"._AM_NEWBB_PERM_ACTION.'</legend>';
67 67
         $opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_TEMPLAT, 'actionform', 'admin_permissions.php', 'get');
68 68
         $op_select = new \XoopsFormSelect('', 'action');
69 69
         $op_select->setExtra('onchange="document.forms.actionform.submit()"');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $perm_template = $newbbpermHandler->getTemplate();
83 83
         foreach (array_keys($glist) as $i) {
84 84
             $selected   = !empty($perm_template[$i]) ? array_keys($perm_template[$i]) : [];
85
-            $ret_ele    = '<tr align="left" valign="top"><td class="head">' . $glist[$i] . '</td>';
85
+            $ret_ele    = '<tr align="left" valign="top"><td class="head">'.$glist[$i].'</td>';
86 86
             $ret_ele    .= '<td class="even">';
87 87
             $ret_ele    .= '<table class="outer"><tr><td class="odd"><table><tr>';
88 88
             $ii         = 0;
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
                 if (0 == $ii % 5) {
93 93
                     $ret_ele .= '</tr><tr>';
94 94
                 }
95
-                $checked      = in_array('forum_' . $perm, $selected) ? ' checked' : '';
96
-                $option_id    = $perm . '_' . $i;
95
+                $checked      = in_array('forum_'.$perm, $selected) ? ' checked' : '';
96
+                $option_id    = $perm.'_'.$i;
97 97
                 $option_ids[] = $option_id;
98
-                $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>';
98
+                $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>';
99 99
             }
100 100
             $ret_ele    .= '</tr></table></td><td class="even">';
101
-            $ret_ele    .= _ALL . ' <input id="checkall[' . $i . ']" type="checkbox" value="" onclick="var optionids = new Array(' . implode(', ', $option_ids) . '); xoopsCheckAllElements(optionids, \'checkall[' . $i . ']\')" />';
101
+            $ret_ele    .= _ALL.' <input id="checkall['.$i.']" type="checkbox" value="" onclick="var optionids = new Array('.implode(', ', $option_ids).'); xoopsCheckAllElements(optionids, \'checkall['.$i.']\')" />';
102 102
             $ret_ele    .= '</td></tr></table>';
103 103
             $ret_ele    .= '</td></tr>';
104 104
             $elements[] = $ret_ele;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $tray->addElement(new \XoopsFormHidden('action', 'template_save'));
108 108
         $tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
109 109
         $tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
110
-        $ret = '<br><strong>' . _AM_NEWBB_PERM_TEMPLATE . '</strong><br>' . _AM_NEWBB_PERM_TEMPLATE_DESC . '<br>';
110
+        $ret = '<br><strong>'._AM_NEWBB_PERM_TEMPLATE.'</strong><br>'._AM_NEWBB_PERM_TEMPLATE_DESC.'<br>';
111 111
         $ret .= "<form name='template' id='template' method='post'>\n<table width='100%' class='outer' cellspacing='1'>\n";
112 112
         $ret .= implode("\n", $elements);
113 113
         $ret .= '<tr align="left" valign="top"><td class="head"></td><td class="even" style="text-align:center;">';
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $ret .= '</td></tr>';
116 116
         $ret .= '</table></form>';
117 117
         echo $ret;
118
-        require_once __DIR__ . '/admin_footer.php';
118
+        require_once __DIR__.'/admin_footer.php';
119 119
         break;
120 120
 
121 121
     case 'template_save':
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         }
137 137
         xoops_cp_header();
138 138
         $adminObject->displayNavigation(basename(__FILE__));
139
-        echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
139
+        echo "<legend style='font-weight: bold; color: #900;'>"._AM_NEWBB_PERM_ACTION.'</legend>';
140 140
         $opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_APPLY, 'actionform', 'admin_permissions.php', 'get');
141 141
         $op_select = new \XoopsFormSelect('', 'action');
142 142
         $op_select->setExtra('onchange="document.forms.actionform.submit()"');
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
         $forums       = $forumHandler->getTree(array_keys($categories), 0, 'all');
160 160
         foreach (array_keys($forums) as $c) {
161 161
             $fm_options[-1 * $c - 1000] = ' ';
162
-            $fm_options[-1 * $c]        = '[' . $categories[$c] . ']';
162
+            $fm_options[-1 * $c]        = '['.$categories[$c].']';
163 163
             foreach (array_keys($forums[$c]) as $f) {
164
-                $fm_options[$f] = $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'];
164
+                $fm_options[$f] = $forums[$c][$f]['prefix'].$forums[$c][$f]['forum_name'];
165 165
             }
166 166
         }
167 167
         unset($forums, $categories);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         $tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
177 177
         $fmform->addElement($tray);
178 178
         $fmform->display();
179
-        require_once __DIR__ . '/admin_footer.php';
179
+        require_once __DIR__.'/admin_footer.php';
180 180
         break;
181 181
 
182 182
     case 'apply_save':
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         }
215 215
 
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, 'actionform', 'admin_permissions.php', 'get');
219 219
         $op_select = new \XoopsFormSelect('', 'action');
220 220
         $op_select->setExtra('onchange="document.forms.actionform.submit()"');
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
             ]
238 238
         ];
239 239
         foreach ($perms as $perm) {
240
-            $op_options[$perm] = constant('_AM_NEWBB_CAN_' . strtoupper($perm));
240
+            $op_options[$perm] = constant('_AM_NEWBB_CAN_'.strtoupper($perm));
241 241
             $fm_options[$perm] = [
242
-                'title'     => constant('_AM_NEWBB_CAN_' . strtoupper($perm)),
243
-                'item'      => 'forum_' . $perm,
242
+                'title'     => constant('_AM_NEWBB_CAN_'.strtoupper($perm)),
243
+                'item'      => 'forum_'.$perm,
244 244
                 'desc'      => '',
245 245
                 'anonymous' => true
246 246
             ];
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
             if (count($forums) > 0) {
282 282
                 foreach (array_keys($forums) as $c) {
283 283
                     $key_c = -1 * $c;
284
-                    $form->addItem($key_c, '<strong>[' . $categories[$c] . ']</strong>');
284
+                    $form->addItem($key_c, '<strong>['.$categories[$c].']</strong>');
285 285
                     foreach (array_keys($forums[$c]) as $f) {
286 286
                         $pid = $forums[$c][$f]['parent_forum'] ?: $key_c;
287
-                        $form->addItem($f, $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'], $pid);
287
+                        $form->addItem($f, $forums[$c][$f]['prefix'].$forums[$c][$f]['forum_name'], $pid);
288 288
                     }
289 289
                 }
290 290
             }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         }
293 293
         $form->display();
294 294
         echo '<fieldset>';
295
-        echo '<legend>&nbsp;' . _MI_NEWBB_ADMENU_PERMISSION . '&nbsp;</legend>';
295
+        echo '<legend>&nbsp;'._MI_NEWBB_ADMENU_PERMISSION.'&nbsp;</legend>';
296 296
         echo _AM_NEWBB_HELP_PERMISSION_TAB;
297 297
         echo '</fieldset>';
298 298
         // Since we can not control the permission update, a trick is used here
@@ -301,6 +301,6 @@  discard block
 block discarded – undo
301 301
         $permissionHandler->createPermData();
302 302
         $cacheHelper = Newbb\Utility::cleanCache();
303 303
         //$cacheHelper->delete('permission');
304
-        require_once __DIR__ . '/admin_footer.php';
304
+        require_once __DIR__.'/admin_footer.php';
305 305
         break;
306 306
 }
Please login to merge, or discard this patch.
Indentation   +225 added lines, -225 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 require_once __DIR__ . '/admin_header.php';
36 36
 require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
37 37
 if (!class_exists('XoopsGroupPermForm')) {
38
-    require_once $GLOBALS['xoops']->path('class/xoopsform/grouppermform.php');
38
+	require_once $GLOBALS['xoops']->path('class/xoopsform/grouppermform.php');
39 39
 }
40 40
 
41 41
 /**
@@ -60,247 +60,247 @@  discard block
 block discarded – undo
60 60
 $perms            = $newbbpermHandler->getValidForumPerms();
61 61
 
62 62
 switch ($action) {
63
-    case 'template':
64
-        xoops_cp_header();
65
-        $adminObject->displayNavigation(basename(__FILE__));
66
-        echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
67
-        $opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_TEMPLAT, 'actionform', 'admin_permissions.php', 'get');
68
-        $op_select = new \XoopsFormSelect('', 'action');
69
-        $op_select->setExtra('onchange="document.forms.actionform.submit()"');
70
-        $op_select->addOptionArray([
71
-                                       'no'       => _SELECT,
72
-                                       'template' => _AM_NEWBB_PERM_TEMPLATE,
73
-                                       'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP,
74
-                                       'default'  => _AM_NEWBB_PERM_SETBYGROUP
75
-                                   ]);
76
-        $opform->addElement($op_select);
77
-        $opform->display();
63
+	case 'template':
64
+		xoops_cp_header();
65
+		$adminObject->displayNavigation(basename(__FILE__));
66
+		echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
67
+		$opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_TEMPLAT, 'actionform', 'admin_permissions.php', 'get');
68
+		$op_select = new \XoopsFormSelect('', 'action');
69
+		$op_select->setExtra('onchange="document.forms.actionform.submit()"');
70
+		$op_select->addOptionArray([
71
+									   'no'       => _SELECT,
72
+									   'template' => _AM_NEWBB_PERM_TEMPLATE,
73
+									   'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP,
74
+									   'default'  => _AM_NEWBB_PERM_SETBYGROUP
75
+								   ]);
76
+		$opform->addElement($op_select);
77
+		$opform->display();
78 78
 
79
-        $memberHandler = xoops_getHandler('member');
80
-        $glist         = $memberHandler->getGroupList();
81
-        $elements      = [];
82
-        $perm_template = $newbbpermHandler->getTemplate();
83
-        foreach (array_keys($glist) as $i) {
84
-            $selected   = !empty($perm_template[$i]) ? array_keys($perm_template[$i]) : [];
85
-            $ret_ele    = '<tr align="left" valign="top"><td class="head">' . $glist[$i] . '</td>';
86
-            $ret_ele    .= '<td class="even">';
87
-            $ret_ele    .= '<table class="outer"><tr><td class="odd"><table><tr>';
88
-            $ii         = 0;
89
-            $option_ids = [];
90
-            foreach ($perms as $perm) {
91
-                ++$ii;
92
-                if (0 == $ii % 5) {
93
-                    $ret_ele .= '</tr><tr>';
94
-                }
95
-                $checked      = in_array('forum_' . $perm, $selected) ? ' checked' : '';
96
-                $option_id    = $perm . '_' . $i;
97
-                $option_ids[] = $option_id;
98
-                $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>';
99
-            }
100
-            $ret_ele    .= '</tr></table></td><td class="even">';
101
-            $ret_ele    .= _ALL . ' <input id="checkall[' . $i . ']" type="checkbox" value="" onclick="var optionids = new Array(' . implode(', ', $option_ids) . '); xoopsCheckAllElements(optionids, \'checkall[' . $i . ']\')" />';
102
-            $ret_ele    .= '</td></tr></table>';
103
-            $ret_ele    .= '</td></tr>';
104
-            $elements[] = $ret_ele;
105
-        }
106
-        $tray = new \XoopsFormElementTray('');
107
-        $tray->addElement(new \XoopsFormHidden('action', 'template_save'));
108
-        $tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
109
-        $tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
110
-        $ret = '<br><strong>' . _AM_NEWBB_PERM_TEMPLATE . '</strong><br>' . _AM_NEWBB_PERM_TEMPLATE_DESC . '<br>';
111
-        $ret .= "<form name='template' id='template' method='post'>\n<table width='100%' class='outer' cellspacing='1'>\n";
112
-        $ret .= implode("\n", $elements);
113
-        $ret .= '<tr align="left" valign="top"><td class="head"></td><td class="even" style="text-align:center;">';
114
-        $ret .= $tray->render();
115
-        $ret .= '</td></tr>';
116
-        $ret .= '</table></form>';
117
-        echo $ret;
118
-        require_once __DIR__ . '/admin_footer.php';
119
-        break;
79
+		$memberHandler = xoops_getHandler('member');
80
+		$glist         = $memberHandler->getGroupList();
81
+		$elements      = [];
82
+		$perm_template = $newbbpermHandler->getTemplate();
83
+		foreach (array_keys($glist) as $i) {
84
+			$selected   = !empty($perm_template[$i]) ? array_keys($perm_template[$i]) : [];
85
+			$ret_ele    = '<tr align="left" valign="top"><td class="head">' . $glist[$i] . '</td>';
86
+			$ret_ele    .= '<td class="even">';
87
+			$ret_ele    .= '<table class="outer"><tr><td class="odd"><table><tr>';
88
+			$ii         = 0;
89
+			$option_ids = [];
90
+			foreach ($perms as $perm) {
91
+				++$ii;
92
+				if (0 == $ii % 5) {
93
+					$ret_ele .= '</tr><tr>';
94
+				}
95
+				$checked      = in_array('forum_' . $perm, $selected) ? ' checked' : '';
96
+				$option_id    = $perm . '_' . $i;
97
+				$option_ids[] = $option_id;
98
+				$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>';
99
+			}
100
+			$ret_ele    .= '</tr></table></td><td class="even">';
101
+			$ret_ele    .= _ALL . ' <input id="checkall[' . $i . ']" type="checkbox" value="" onclick="var optionids = new Array(' . implode(', ', $option_ids) . '); xoopsCheckAllElements(optionids, \'checkall[' . $i . ']\')" />';
102
+			$ret_ele    .= '</td></tr></table>';
103
+			$ret_ele    .= '</td></tr>';
104
+			$elements[] = $ret_ele;
105
+		}
106
+		$tray = new \XoopsFormElementTray('');
107
+		$tray->addElement(new \XoopsFormHidden('action', 'template_save'));
108
+		$tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
109
+		$tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
110
+		$ret = '<br><strong>' . _AM_NEWBB_PERM_TEMPLATE . '</strong><br>' . _AM_NEWBB_PERM_TEMPLATE_DESC . '<br>';
111
+		$ret .= "<form name='template' id='template' method='post'>\n<table width='100%' class='outer' cellspacing='1'>\n";
112
+		$ret .= implode("\n", $elements);
113
+		$ret .= '<tr align="left" valign="top"><td class="head"></td><td class="even" style="text-align:center;">';
114
+		$ret .= $tray->render();
115
+		$ret .= '</td></tr>';
116
+		$ret .= '</table></form>';
117
+		echo $ret;
118
+		require_once __DIR__ . '/admin_footer.php';
119
+		break;
120 120
 
121
-    case 'template_save':
122
-        //        $res = $newbbpermHandler->setTemplate($_POST['perms'], $groupid = 0);
123
-        $res = $newbbpermHandler->setTemplate(Request::getArray('perms', '', 'POST'), $groupid = 0);
124
-        if ($res) {
125
-            redirect_header('admin_permissions.php', 2, _AM_NEWBB_PERM_TEMPLATE_CREATED);
126
-        } else {
127
-            redirect_header('admin_permissions.php?action=template', 2, _AM_NEWBB_PERM_TEMPLATE_ERROR);
128
-        }
129
-        break;
130
-    //        exit();
121
+	case 'template_save':
122
+		//        $res = $newbbpermHandler->setTemplate($_POST['perms'], $groupid = 0);
123
+		$res = $newbbpermHandler->setTemplate(Request::getArray('perms', '', 'POST'), $groupid = 0);
124
+		if ($res) {
125
+			redirect_header('admin_permissions.php', 2, _AM_NEWBB_PERM_TEMPLATE_CREATED);
126
+		} else {
127
+			redirect_header('admin_permissions.php?action=template', 2, _AM_NEWBB_PERM_TEMPLATE_ERROR);
128
+		}
129
+		break;
130
+	//        exit();
131 131
 
132
-    case 'apply':
133
-        $perm_template = $newbbpermHandler->getTemplate();
134
-        if (null === $perm_template) {
135
-            redirect_header('admin_permissions.php?action=template', 2, _AM_NEWBB_PERM_TEMPLATE);
136
-        }
137
-        xoops_cp_header();
138
-        $adminObject->displayNavigation(basename(__FILE__));
139
-        echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
140
-        $opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_APPLY, 'actionform', 'admin_permissions.php', 'get');
141
-        $op_select = new \XoopsFormSelect('', 'action');
142
-        $op_select->setExtra('onchange="document.forms.actionform.submit()"');
143
-        $op_select->addOptionArray([
144
-                                       'no'       => _SELECT,
145
-                                       'template' => _AM_NEWBB_PERM_TEMPLATE,
146
-                                       'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP
147
-                                   ]);
148
-        $opform->addElement($op_select);
149
-        $opform->display();
132
+	case 'apply':
133
+		$perm_template = $newbbpermHandler->getTemplate();
134
+		if (null === $perm_template) {
135
+			redirect_header('admin_permissions.php?action=template', 2, _AM_NEWBB_PERM_TEMPLATE);
136
+		}
137
+		xoops_cp_header();
138
+		$adminObject->displayNavigation(basename(__FILE__));
139
+		echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
140
+		$opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP_APPLY, 'actionform', 'admin_permissions.php', 'get');
141
+		$op_select = new \XoopsFormSelect('', 'action');
142
+		$op_select->setExtra('onchange="document.forms.actionform.submit()"');
143
+		$op_select->addOptionArray([
144
+									   'no'       => _SELECT,
145
+									   'template' => _AM_NEWBB_PERM_TEMPLATE,
146
+									   'apply'    => _AM_NEWBB_PERM_TEMPLATEAPP
147
+								   ]);
148
+		$opform->addElement($op_select);
149
+		$opform->display();
150 150
 
151
-        /** @var Newbb\CategoryHandler $categoryHandler */
152
-        $categoryHandler  = Newbb\Helper::getInstance()->getHandler('Category');
153
-        $criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1));
154
-        $criteriaCategory->setSort('cat_order');
155
-        $categories = $categoryHandler->getList($criteriaCategory);
151
+		/** @var Newbb\CategoryHandler $categoryHandler */
152
+		$categoryHandler  = Newbb\Helper::getInstance()->getHandler('Category');
153
+		$criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1));
154
+		$criteriaCategory->setSort('cat_order');
155
+		$categories = $categoryHandler->getList($criteriaCategory);
156 156
 
157
-        /** @var Newbb\ForumHandler $forumHandler */
158
-        $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
159
-        $forums       = $forumHandler->getTree(array_keys($categories), 0, 'all');
160
-        foreach (array_keys($forums) as $c) {
161
-            $fm_options[-1 * $c - 1000] = ' ';
162
-            $fm_options[-1 * $c]        = '[' . $categories[$c] . ']';
163
-            foreach (array_keys($forums[$c]) as $f) {
164
-                $fm_options[$f] = $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'];
165
-            }
166
-        }
167
-        unset($forums, $categories);
157
+		/** @var Newbb\ForumHandler $forumHandler */
158
+		$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
159
+		$forums       = $forumHandler->getTree(array_keys($categories), 0, 'all');
160
+		foreach (array_keys($forums) as $c) {
161
+			$fm_options[-1 * $c - 1000] = ' ';
162
+			$fm_options[-1 * $c]        = '[' . $categories[$c] . ']';
163
+			foreach (array_keys($forums[$c]) as $f) {
164
+				$fm_options[$f] = $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'];
165
+			}
166
+		}
167
+		unset($forums, $categories);
168 168
 
169
-        $fmform    = new \XoopsThemeForm(_AM_NEWBB_PERM_TEMPLATEAPP, 'fmform', 'admin_permissions.php', 'post', true);
170
-        $fm_select = new \XoopsFormSelect(_AM_NEWBB_PERM_FORUMS, 'forums', null, 10, true);
171
-        $fm_select->addOptionArray($fm_options);
172
-        $fmform->addElement($fm_select);
173
-        $tray = new \XoopsFormElementTray('');
174
-        $tray->addElement(new \XoopsFormHidden('action', 'apply_save'));
175
-        $tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
176
-        $tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
177
-        $fmform->addElement($tray);
178
-        $fmform->display();
179
-        require_once __DIR__ . '/admin_footer.php';
180
-        break;
169
+		$fmform    = new \XoopsThemeForm(_AM_NEWBB_PERM_TEMPLATEAPP, 'fmform', 'admin_permissions.php', 'post', true);
170
+		$fm_select = new \XoopsFormSelect(_AM_NEWBB_PERM_FORUMS, 'forums', null, 10, true);
171
+		$fm_select->addOptionArray($fm_options);
172
+		$fmform->addElement($fm_select);
173
+		$tray = new \XoopsFormElementTray('');
174
+		$tray->addElement(new \XoopsFormHidden('action', 'apply_save'));
175
+		$tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
176
+		$tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
177
+		$fmform->addElement($tray);
178
+		$fmform->display();
179
+		require_once __DIR__ . '/admin_footer.php';
180
+		break;
181 181
 
182
-    case 'apply_save':
183
-        if (!Request::getArray('forums', '', 'POST')) {
184
-            break;
185
-        }
186
-        foreach (Request::getArray('forums', '', 'POST') as $forum) {
187
-            if ($forum < 1) {
188
-                continue;
189
-            }
190
-            $newbbpermHandler->applyTemplate($forum, $module_id);
191
-        }
192
-        $cacheHelper = Newbb\Utility::cleanCache();
193
-        //$cacheHelper->delete('permission');
194
-        redirect_header('admin_permissions.php', 2, _AM_NEWBB_PERM_TEMPLATE_APPLIED);
195
-        break;
182
+	case 'apply_save':
183
+		if (!Request::getArray('forums', '', 'POST')) {
184
+			break;
185
+		}
186
+		foreach (Request::getArray('forums', '', 'POST') as $forum) {
187
+			if ($forum < 1) {
188
+				continue;
189
+			}
190
+			$newbbpermHandler->applyTemplate($forum, $module_id);
191
+		}
192
+		$cacheHelper = Newbb\Utility::cleanCache();
193
+		//$cacheHelper->delete('permission');
194
+		redirect_header('admin_permissions.php', 2, _AM_NEWBB_PERM_TEMPLATE_APPLIED);
195
+		break;
196 196
 
197
-    default:
198
-        xoops_cp_header();
197
+	default:
198
+		xoops_cp_header();
199 199
 
200
-        $categoryHandler  = Newbb\Helper::getInstance()->getHandler('Category');
201
-        $criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1));
202
-        $criteriaCategory->setSort('cat_order');
203
-        $categories = $categoryHandler->getList($criteriaCategory);
200
+		$categoryHandler  = Newbb\Helper::getInstance()->getHandler('Category');
201
+		$criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1));
202
+		$criteriaCategory->setSort('cat_order');
203
+		$categories = $categoryHandler->getList($criteriaCategory);
204 204
 
205
-        if (0 === count($categories)) {
206
-            redirect_header('admin_cat_manager.php', 2, _AM_NEWBB_CREATENEWCATEGORY);
207
-        }
205
+		if (0 === count($categories)) {
206
+			redirect_header('admin_cat_manager.php', 2, _AM_NEWBB_CREATENEWCATEGORY);
207
+		}
208 208
 
209
-        $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
210
-        $forums       = $forumHandler->getTree(array_keys($categories), 0, 'all');
209
+		$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
210
+		$forums       = $forumHandler->getTree(array_keys($categories), 0, 'all');
211 211
 
212
-        if (0 === count($forums)) {
213
-            redirect_header('admin_forum_manager.php', 2, _AM_NEWBB_CREATENEWFORUM);
214
-        }
212
+		if (0 === count($forums)) {
213
+			redirect_header('admin_forum_manager.php', 2, _AM_NEWBB_CREATENEWFORUM);
214
+		}
215 215
 
216
-        $adminObject->displayNavigation(basename(__FILE__));
217
-        echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
218
-        $opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP, 'actionform', 'admin_permissions.php', 'get');
219
-        $op_select = new \XoopsFormSelect('', 'action');
220
-        $op_select->setExtra('onchange="document.forms.actionform.submit()"');
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
-                                   ]);
227
-        $opform->addElement($op_select);
228
-        $opform->display();
216
+		$adminObject->displayNavigation(basename(__FILE__));
217
+		echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . '</legend>';
218
+		$opform    = new \XoopsSimpleForm(_AM_NEWBB_PERM_ACTION_HELP, 'actionform', 'admin_permissions.php', 'get');
219
+		$op_select = new \XoopsFormSelect('', 'action');
220
+		$op_select->setExtra('onchange="document.forms.actionform.submit()"');
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
+								   ]);
227
+		$opform->addElement($op_select);
228
+		$opform->display();
229 229
 
230
-        $op_options = ['category' => _AM_NEWBB_CAT_ACCESS];
231
-        $fm_options = [
232
-            'category' => [
233
-                'title'     => _AM_NEWBB_CAT_ACCESS,
234
-                'item'      => 'category_access',
235
-                'desc'      => '',
236
-                'anonymous' => true
237
-            ]
238
-        ];
239
-        foreach ($perms as $perm) {
240
-            $op_options[$perm] = constant('_AM_NEWBB_CAN_' . strtoupper($perm));
241
-            $fm_options[$perm] = [
242
-                'title'     => constant('_AM_NEWBB_CAN_' . strtoupper($perm)),
243
-                'item'      => 'forum_' . $perm,
244
-                'desc'      => '',
245
-                'anonymous' => true
246
-            ];
247
-        }
230
+		$op_options = ['category' => _AM_NEWBB_CAT_ACCESS];
231
+		$fm_options = [
232
+			'category' => [
233
+				'title'     => _AM_NEWBB_CAT_ACCESS,
234
+				'item'      => 'category_access',
235
+				'desc'      => '',
236
+				'anonymous' => true
237
+			]
238
+		];
239
+		foreach ($perms as $perm) {
240
+			$op_options[$perm] = constant('_AM_NEWBB_CAN_' . strtoupper($perm));
241
+			$fm_options[$perm] = [
242
+				'title'     => constant('_AM_NEWBB_CAN_' . strtoupper($perm)),
243
+				'item'      => 'forum_' . $perm,
244
+				'desc'      => '',
245
+				'anonymous' => true
246
+			];
247
+		}
248 248
 
249
-        $op_keys = array_keys($op_options);
250
-        $op      = strtolower(Request::getCmd('op', Request::getCmd('op', '', 'COOKIE'), 'GET'));
251
-        if (empty($op)) {
252
-            $op = $op_keys[0];
253
-            setcookie('op', isset($op_keys[1]) ? $op_keys[1] : '');
254
-        } elseif (false !== ($key = array_search($op, $op_keys))) {
255
-            setcookie('op', isset($op_keys[$key + 1]) ? $op_keys[$key + 1] : '');
256
-        }
249
+		$op_keys = array_keys($op_options);
250
+		$op      = strtolower(Request::getCmd('op', Request::getCmd('op', '', 'COOKIE'), 'GET'));
251
+		if (empty($op)) {
252
+			$op = $op_keys[0];
253
+			setcookie('op', isset($op_keys[1]) ? $op_keys[1] : '');
254
+		} elseif (false !== ($key = array_search($op, $op_keys))) {
255
+			setcookie('op', isset($op_keys[$key + 1]) ? $op_keys[$key + 1] : '');
256
+		}
257 257
 
258
-        $opform    = new \XoopsSimpleForm('', 'opform', 'admin_permissions.php', 'get');
259
-        $op_select = new \XoopsFormSelect('', 'op', $op);
260
-        $op_select->setExtra('onchange="document.forms.opform.submit()"');
261
-        $op_select->addOptionArray($op_options);
262
-        $opform->addElement($op_select);
263
-        $opform->display();
258
+		$opform    = new \XoopsSimpleForm('', 'opform', 'admin_permissions.php', 'get');
259
+		$op_select = new \XoopsFormSelect('', 'op', $op);
260
+		$op_select->setExtra('onchange="document.forms.opform.submit()"');
261
+		$op_select->addOptionArray($op_options);
262
+		$opform->addElement($op_select);
263
+		$opform->display();
264 264
 
265
-        $perm_desc = '';
265
+		$perm_desc = '';
266 266
 
267
-        $form = new Newbb\GroupPermForm($fm_options[$op]['title'], $module_id, $fm_options[$op]['item'], $fm_options[$op]['desc'], 'admin/admin_permissions.php', $fm_options[$op]['anonymous']);
267
+		$form = new Newbb\GroupPermForm($fm_options[$op]['title'], $module_id, $fm_options[$op]['item'], $fm_options[$op]['desc'], 'admin/admin_permissions.php', $fm_options[$op]['anonymous']);
268 268
 
269
-        $categoryHandler  = Newbb\Helper::getInstance()->getHandler('Category');
270
-        $criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1));
271
-        $criteriaCategory->setSort('cat_order');
272
-        $categories = $categoryHandler->getList($criteriaCategory);
273
-        if ('category' === $op) {
274
-            foreach (array_keys($categories) as $key) {
275
-                $form->addItem($key, $categories[$key]);
276
-            }
277
-            unset($categories);
278
-        } else {
279
-            $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
280
-            $forums       = $forumHandler->getTree(array_keys($categories), 0, 'all');
281
-            if (count($forums) > 0) {
282
-                foreach (array_keys($forums) as $c) {
283
-                    $key_c = -1 * $c;
284
-                    $form->addItem($key_c, '<strong>[' . $categories[$c] . ']</strong>');
285
-                    foreach (array_keys($forums[$c]) as $f) {
286
-                        $pid = $forums[$c][$f]['parent_forum'] ?: $key_c;
287
-                        $form->addItem($f, $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'], $pid);
288
-                    }
289
-                }
290
-            }
291
-            unset($forums, $categories);
292
-        }
293
-        $form->display();
294
-        echo '<fieldset>';
295
-        echo '<legend>&nbsp;' . _MI_NEWBB_ADMENU_PERMISSION . '&nbsp;</legend>';
296
-        echo _AM_NEWBB_HELP_PERMISSION_TAB;
297
-        echo '</fieldset>';
298
-        // Since we can not control the permission update, a trick is used here
299
-        /** var Newbb\PermissionHandler $permissionHandler */
300
-        $permissionHandler = Newbb\Helper::getInstance()->getHandler('Permission');
301
-        $permissionHandler->createPermData();
302
-        $cacheHelper = Newbb\Utility::cleanCache();
303
-        //$cacheHelper->delete('permission');
304
-        require_once __DIR__ . '/admin_footer.php';
305
-        break;
269
+		$categoryHandler  = Newbb\Helper::getInstance()->getHandler('Category');
270
+		$criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1));
271
+		$criteriaCategory->setSort('cat_order');
272
+		$categories = $categoryHandler->getList($criteriaCategory);
273
+		if ('category' === $op) {
274
+			foreach (array_keys($categories) as $key) {
275
+				$form->addItem($key, $categories[$key]);
276
+			}
277
+			unset($categories);
278
+		} else {
279
+			$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
280
+			$forums       = $forumHandler->getTree(array_keys($categories), 0, 'all');
281
+			if (count($forums) > 0) {
282
+				foreach (array_keys($forums) as $c) {
283
+					$key_c = -1 * $c;
284
+					$form->addItem($key_c, '<strong>[' . $categories[$c] . ']</strong>');
285
+					foreach (array_keys($forums[$c]) as $f) {
286
+						$pid = $forums[$c][$f]['parent_forum'] ?: $key_c;
287
+						$form->addItem($f, $forums[$c][$f]['prefix'] . $forums[$c][$f]['forum_name'], $pid);
288
+					}
289
+				}
290
+			}
291
+			unset($forums, $categories);
292
+		}
293
+		$form->display();
294
+		echo '<fieldset>';
295
+		echo '<legend>&nbsp;' . _MI_NEWBB_ADMENU_PERMISSION . '&nbsp;</legend>';
296
+		echo _AM_NEWBB_HELP_PERMISSION_TAB;
297
+		echo '</fieldset>';
298
+		// Since we can not control the permission update, a trick is used here
299
+		/** var Newbb\PermissionHandler $permissionHandler */
300
+		$permissionHandler = Newbb\Helper::getInstance()->getHandler('Permission');
301
+		$permissionHandler->createPermData();
302
+		$cacheHelper = Newbb\Utility::cleanCache();
303
+		//$cacheHelper->delete('permission');
304
+		require_once __DIR__ . '/admin_footer.php';
305
+		break;
306 306
 }
Please login to merge, or discard this patch.
include/common.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -50,19 +50,19 @@  discard block
 block discarded – undo
50 50
 //define('NEWBB_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash
51 51
 
52 52
 if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) {
53
-    define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__)));
54
-    define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
55
-    define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
56
-    define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/');
57
-    define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
58
-    define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
59
-    define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
60
-    define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
61
-    define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
62
-    define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
63
-    define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
64
-    define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
65
-    define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
53
+	define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__)));
54
+	define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
55
+	define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
56
+	define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/');
57
+	define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
58
+	define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
59
+	define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
60
+	define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
61
+	define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
62
+	define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
63
+	define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
64
+	define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
65
+	define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
66 66
 }
67 67
 
68 68
 
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
 //$pathModIcon32 = $helper->getModule()->getInfo('modicons32');
134 134
 
135 135
 $icons = [
136
-    'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
137
-    'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
138
-    'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
139
-    'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
140
-    'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
141
-    'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
142
-    'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
143
-    '0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
144
-    '1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
136
+	'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
137
+	'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
138
+	'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
139
+	'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
140
+	'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
141
+	'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
142
+	'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
143
+	'0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
144
+	'1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
145 145
 ];
146 146
 
147 147
 $debug = false;
@@ -150,16 +150,16 @@  discard block
 block discarded – undo
150 150
 $myts = \MyTextSanitizer::getInstance();
151 151
 
152 152
 if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) {
153
-    require_once $GLOBALS['xoops']->path('class/template.php');
154
-    $GLOBALS['xoopsTpl'] = new \XoopsTpl();
153
+	require_once $GLOBALS['xoops']->path('class/template.php');
154
+	$GLOBALS['xoopsTpl'] = new \XoopsTpl();
155 155
 }
156 156
 
157 157
 $GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName);
158 158
 // Local icons path
159 159
 if (is_object($helper->getModule())) {
160
-    $pathModIcon16 = $helper->getModule()->getInfo('modicons16');
161
-    $pathModIcon32 = $helper->getModule()->getInfo('modicons32');
160
+	$pathModIcon16 = $helper->getModule()->getInfo('modicons16');
161
+	$pathModIcon32 = $helper->getModule()->getInfo('modicons32');
162 162
 
163
-    $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16);
164
-    $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32);
163
+	$GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16);
164
+	$GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32);
165 165
 }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
 use XoopsModules\Newbb;
24 24
 
25 25
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
26
-require_once dirname(__DIR__) . '/preloads/autoloader.php';
26
+require_once dirname(__DIR__).'/preloads/autoloader.php';
27 27
 
28 28
 $moduleDirName = basename(dirname(__DIR__));
29
-$moduleDirNameUpper   = strtoupper($moduleDirName); //$capsDirName
29
+$moduleDirNameUpper = strtoupper($moduleDirName); //$capsDirName
30 30
 
31 31
 /** @var \XoopsDatabase $db */
32 32
 /** @var Newbb\Helper $helper */
@@ -49,20 +49,20 @@  discard block
 block discarded – undo
49 49
 //define('NEWBB_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash
50 50
 //define('NEWBB_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash
51 51
 
52
-if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) {
53
-    define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__)));
54
-    define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
55
-    define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
56
-    define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/');
57
-    define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
58
-    define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
59
-    define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
60
-    define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
61
-    define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
62
-    define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
63
-    define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
64
-    define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
65
-    define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
52
+if (!defined($moduleDirNameUpper.'_CONSTANTS_DEFINED')) {
53
+    define($moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__)));
54
+    define($moduleDirNameUpper.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/');
55
+    define($moduleDirNameUpper.'_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/');
56
+    define($moduleDirNameUpper.'_URL', XOOPS_URL.'/modules/'.$moduleDirName.'/');
57
+    define($moduleDirNameUpper.'_IMAGE_URL', constant($moduleDirNameUpper.'_URL').'/assets/images/');
58
+    define($moduleDirNameUpper.'_IMAGE_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/assets/images');
59
+    define($moduleDirNameUpper.'_ADMIN_URL', constant($moduleDirNameUpper.'_URL').'/admin/');
60
+    define($moduleDirNameUpper.'_ADMIN_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/admin/');
61
+    define($moduleDirNameUpper.'_ADMIN', constant($moduleDirNameUpper.'_URL').'/admin/index.php');
62
+    define($moduleDirNameUpper.'_AUTHOR_LOGOIMG', constant($moduleDirNameUpper.'_URL').'/assets/images/logoModule.png');
63
+    define($moduleDirNameUpper.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash
64
+    define($moduleDirNameUpper.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash
65
+    define($moduleDirNameUpper.'_CONSTANTS_DEFINED', 1);
66 66
 }
67 67
 
68 68
 
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
 //$pathModIcon32 = $helper->getModule()->getInfo('modicons32');
134 134
 
135 135
 $icons = [
136
-    'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
137
-    'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
138
-    'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
139
-    'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
140
-    'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
141
-    'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
142
-    'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
143
-    '0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
144
-    '1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
136
+    'edit'    => "<img src='".$pathIcon16."/edit.png'  alt="._EDIT."' align='middle'>",
137
+    'delete'  => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>",
138
+    'clone'   => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>",
139
+    'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>",
140
+    'print'   => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>",
141
+    'pdf'     => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>",
142
+    'add'     => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>",
143
+    '0'       => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>",
144
+    '1'       => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>",
145 145
 ];
146 146
 
147 147
 $debug = false;
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
     $GLOBALS['xoopsTpl'] = new \XoopsTpl();
155 155
 }
156 156
 
157
-$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName);
157
+$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL.'/modules/'.$moduleDirName);
158 158
 // Local icons path
159 159
 if (is_object($helper->getModule())) {
160 160
     $pathModIcon16 = $helper->getModule()->getInfo('modicons16');
161 161
     $pathModIcon32 = $helper->getModule()->getInfo('modicons32');
162 162
 
163
-    $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16);
163
+    $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL.'/modules/'.$moduleDirName.'/'.$pathModIcon16);
164 164
     $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32);
165 165
 }
Please login to merge, or discard this patch.
include/oninstall.php 2 patches
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -30,20 +30,20 @@  discard block
 block discarded – undo
30 30
  */
31 31
 function xoops_module_pre_install_newbb(\XoopsModule $module)
32 32
 {
33
-    require_once dirname(__DIR__) . '/preloads/autoloader.php';
34
-    /** @var Newbb\Utility $utility */
35
-    $utility      = new \XoopsModules\Newbb\Utility();
36
-    $xoopsSuccess = $utility::checkVerXoops($module);
37
-    $phpSuccess   = $utility::checkVerPhp($module);
33
+	require_once dirname(__DIR__) . '/preloads/autoloader.php';
34
+	/** @var Newbb\Utility $utility */
35
+	$utility      = new \XoopsModules\Newbb\Utility();
36
+	$xoopsSuccess = $utility::checkVerXoops($module);
37
+	$phpSuccess   = $utility::checkVerPhp($module);
38 38
 
39
-    if (false !== $xoopsSuccess && false !== $phpSuccess) {
40
-        $moduleTables =& $module->getInfo('tables');
41
-        foreach ($moduleTables as $table) {
42
-            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
43
-        }
44
-    }
39
+	if (false !== $xoopsSuccess && false !== $phpSuccess) {
40
+		$moduleTables =& $module->getInfo('tables');
41
+		foreach ($moduleTables as $table) {
42
+			$GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
43
+		}
44
+	}
45 45
 
46
-    return $xoopsSuccess && $phpSuccess;
46
+	return $xoopsSuccess && $phpSuccess;
47 47
 }
48 48
 
49 49
 /**
@@ -55,50 +55,50 @@  discard block
 block discarded – undo
55 55
  */
56 56
 function xoops_module_install_newbb(\XoopsModule $module)
57 57
 {
58
-    require_once  dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
59
-    require_once  dirname(__DIR__) . '/include/config.php';
58
+	require_once  dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
59
+	require_once  dirname(__DIR__) . '/include/config.php';
60 60
 
61
-    $moduleDirName = basename(dirname(__DIR__));
61
+	$moduleDirName = basename(dirname(__DIR__));
62 62
 
63
-    /** @var Newbb\Helper $helper */
64
-    $helper = Newbb\Helper::getInstance();
65
-    $utility      = new Newbb\Utility();
66
-    $configurator = new Newbb\Common\Configurator();
67
-    // Load language files
68
-    $helper->loadLanguage('admin');
69
-    $helper->loadLanguage('modinfo');
63
+	/** @var Newbb\Helper $helper */
64
+	$helper = Newbb\Helper::getInstance();
65
+	$utility      = new Newbb\Utility();
66
+	$configurator = new Newbb\Common\Configurator();
67
+	// Load language files
68
+	$helper->loadLanguage('admin');
69
+	$helper->loadLanguage('modinfo');
70 70
 
71
-    // default Permission Settings ----------------------
72
-    global $xoopsModule, $xoopsDB;
73
-    $moduleId     = $xoopsModule->getVar('mid');
74
-    $moduleId2    = $helper->getModule()->mid();
75
-    $grouppermHandler = xoops_getHandler('groupperm');
76
-    // access rights ------------------------------------------
77
-    $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
78
-    $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
79
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
80
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
81
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
71
+	// default Permission Settings ----------------------
72
+	global $xoopsModule, $xoopsDB;
73
+	$moduleId     = $xoopsModule->getVar('mid');
74
+	$moduleId2    = $helper->getModule()->mid();
75
+	$grouppermHandler = xoops_getHandler('groupperm');
76
+	// access rights ------------------------------------------
77
+	$grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
78
+	$grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
79
+	$grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
80
+	$grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
81
+	$grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
82 82
 
83
-    //  ---  CREATE FOLDERS ---------------
84
-    if (count($configurator->uploadFolders) > 0) {
85
-        //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
86
-        foreach (array_keys($configurator->uploadFolders) as $i) {
87
-            $utility::createFolder($configurator->uploadFolders[$i]);
88
-        }
89
-    }
83
+	//  ---  CREATE FOLDERS ---------------
84
+	if (count($configurator->uploadFolders) > 0) {
85
+		//    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
86
+		foreach (array_keys($configurator->uploadFolders) as $i) {
87
+			$utility::createFolder($configurator->uploadFolders[$i]);
88
+		}
89
+	}
90 90
 
91
-    //  ---  COPY blank.png FILES ---------------
92
-    if (count($configurator->copyBlankFiles) > 0) {
93
-        $file =  dirname(__DIR__) . '/assets/images/blank.png';
94
-        foreach (array_keys($configurator->copyBlankFiles) as $i) {
95
-            $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
96
-            $utility::copyFile($file, $dest);
97
-        }
98
-    }
99
-    //delete .html entries from the tpl table
100
-    $sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'";
101
-    $xoopsDB->queryF($sql);
91
+	//  ---  COPY blank.png FILES ---------------
92
+	if (count($configurator->copyBlankFiles) > 0) {
93
+		$file =  dirname(__DIR__) . '/assets/images/blank.png';
94
+		foreach (array_keys($configurator->copyBlankFiles) as $i) {
95
+			$dest = $configurator->copyBlankFiles[$i] . '/blank.png';
96
+			$utility::copyFile($file, $dest);
97
+		}
98
+	}
99
+	//delete .html entries from the tpl table
100
+	$sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'";
101
+	$xoopsDB->queryF($sql);
102 102
 
103
-    return true;
103
+	return true;
104 104
 }
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
  */
31 31
 function xoops_module_pre_install_newbb(\XoopsModule $module)
32 32
 {
33
-    require_once dirname(__DIR__) . '/preloads/autoloader.php';
33
+    require_once dirname(__DIR__).'/preloads/autoloader.php';
34 34
     /** @var Newbb\Utility $utility */
35 35
     $utility      = new \XoopsModules\Newbb\Utility();
36 36
     $xoopsSuccess = $utility::checkVerXoops($module);
37 37
     $phpSuccess   = $utility::checkVerPhp($module);
38 38
 
39 39
     if (false !== $xoopsSuccess && false !== $phpSuccess) {
40
-        $moduleTables =& $module->getInfo('tables');
40
+        $moduleTables = & $module->getInfo('tables');
41 41
         foreach ($moduleTables as $table) {
42
-            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
42
+            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';');
43 43
         }
44 44
     }
45 45
 
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
  */
56 56
 function xoops_module_install_newbb(\XoopsModule $module)
57 57
 {
58
-    require_once  dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
59
-    require_once  dirname(__DIR__) . '/include/config.php';
58
+    require_once  dirname(dirname(dirname(__DIR__))).'/mainfile.php';
59
+    require_once  dirname(__DIR__).'/include/config.php';
60 60
 
61 61
     $moduleDirName = basename(dirname(__DIR__));
62 62
 
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
     $moduleId2    = $helper->getModule()->mid();
75 75
     $grouppermHandler = xoops_getHandler('groupperm');
76 76
     // access rights ------------------------------------------
77
-    $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
78
-    $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
79
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
80
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
81
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
77
+    $grouppermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
78
+    $grouppermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
79
+    $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
80
+    $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId);
81
+    $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
82 82
 
83 83
     //  ---  CREATE FOLDERS ---------------
84 84
     if (count($configurator->uploadFolders) > 0) {
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
 
91 91
     //  ---  COPY blank.png FILES ---------------
92 92
     if (count($configurator->copyBlankFiles) > 0) {
93
-        $file =  dirname(__DIR__) . '/assets/images/blank.png';
93
+        $file = dirname(__DIR__).'/assets/images/blank.png';
94 94
         foreach (array_keys($configurator->copyBlankFiles) as $i) {
95
-            $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
95
+            $dest = $configurator->copyBlankFiles[$i].'/blank.png';
96 96
             $utility::copyFile($file, $dest);
97 97
         }
98 98
     }
99 99
     //delete .html entries from the tpl table
100
-    $sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'";
100
+    $sql = 'DELETE FROM '.$xoopsDB->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'";
101 101
     $xoopsDB->queryF($sql);
102 102
 
103 103
     return true;
Please login to merge, or discard this patch.
include/functions.render.php 2 patches
Indentation   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -17,146 +17,146 @@
 block discarded – undo
17 17
 define('NEWBB_FUNCTIONS_RENDER_LOADED', true);
18 18
 
19 19
 if (!defined('NEWBB_FUNCTIONS_RENDER')) {
20
-    define('NEWBB_FUNCTIONS_RENDER', 1);
20
+	define('NEWBB_FUNCTIONS_RENDER', 1);
21 21
 
22
-    /*
22
+	/*
23 23
      * Sorry, we have to use the stupid solution unless there is an option in MyTextSanitizer:: htmlspecialchars();
24 24
      */
25
-    /**
26
-     * @param $text
27
-     * @return mixed
28
-     */
29
-    function newbbHtmlspecialchars(&$text)
30
-    {
31
-        return preg_replace(['/&amp;/i', '/&nbsp;/i'], ['&', '&amp;nbsp;'], htmlspecialchars($text, ENT_QUOTES | ENT_HTML5));
32
-    }
33
-
34
-    /**
35
-     * @param        $text
36
-     * @param  int   $html
37
-     * @param  int   $smiley
38
-     * @param  int   $xcode
39
-     * @param  int   $image
40
-     * @param  int   $br
41
-     * @return mixed
42
-     */
43
-    function &newbbDisplayTarea(&$text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
44
-    {
45
-        global $myts;
46
-
47
-        if (1 !== $html) {
48
-            // html not allowed
49
-            $text = newbbHtmlspecialchars($text);
50
-        }
51
-        $text = $myts->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
52
-        $text = $myts->makeClickable($text);
53
-        if (0 !== $smiley) {
54
-            // process smiley
55
-            $text = $myts->smiley($text);
56
-        }
57
-        if (0 !== $xcode) {
58
-            // decode xcode
59
-            if (0 !== $image) {
60
-                // image allowed
61
-                $text = $myts->xoopsCodeDecode($text);
62
-            } else {
63
-                // image not allowed
64
-                $text = $myts->xoopsCodeDecode($text, 0);
65
-            }
66
-        }
67
-        if (0 !== $br) {
68
-            $text = $myts->nl2Br($text);
69
-        }
70
-        $text = $myts->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
71
-
72
-        return $text;
73
-    }
74
-
75
-    /**
76
-     * @param $document
77
-     * @return string
78
-     */
79
-    function newbbHtml2text($document)
80
-    {
81
-        $text = strip_tags($document);
82
-
83
-        return $text;
84
-    }
85
-
86
-    /**
87
-     * Display forrum button
88
-     *
89
-     * @param          $link
90
-     * @param          $button
91
-     * @param  string  $alt     alt message
92
-     * @param  boolean $asImage true for image mode; false for text mode
93
-     * @param  string  $extra   extra attribute for the button
94
-     * @return mixed
95
-     * @internal param string $image image/button name, without extension
96
-     */
97
-    function newbbGetButton($link, $button, $alt = '', $asImage = true, $extra = "class='forum_button'")
98
-    {
99
-        $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}' />";
100
-        if (empty($asImage)) {
101
-            $button = "<a href='{$link}' title='{$alt}' {$extra}>" . newbbDisplayImage($button, $alt, true) . '</a>';
102
-        }
103
-
104
-        return $button;
105
-    }
106
-
107
-    /**
108
-     * Display forrum images
109
-     *
110
-     * @param  string  $image   image name, without extension
111
-     * @param  string  $alt     alt message
112
-     * @param  boolean $display true for return image anchor; faulse for assign to $xoopsTpl
113
-     * @param  string  $extra   extra attribute for the image
114
-     * @return mixed
115
-     */
116
-    function newbbDisplayImage($image, $alt = '', $display = true, $extra = "class='forum_icon'")
117
-    {
118
-        $iconHandler = newbbGetIconHandler();
119
-        // START hacked by irmtfan
120
-        // to show text links instead of buttons - func_num_args()==2 => only when $image, $alt is set and optional $display not set
121
-
122
-        if (2 == func_num_args()) {
123
-            // overall setting
124
-            if (!empty($GLOBALS['xoopsModuleConfig']['display_text_links'])) {
125
-                $display = false;
126
-            }
127
-            // if set for each link => overwrite $display
128
-            if (isset($GLOBALS['xoopsModuleConfig']['display_text_each_link'][$image])) {
129
-                $display = empty($GLOBALS['xoopsModuleConfig']['display_text_each_link'][$image]);
130
-            }
131
-        }
132
-        // END hacked by irmtfan
133
-        if (empty($display)) {
134
-            return $iconHandler->assignImage($image, $alt, $extra);
135
-        } else {
136
-            return $iconHandler->getImage($image, $alt, $extra);
137
-        }
138
-    }
139
-
140
-    /**
141
-     * @return Newbb\IconHandler
142
-     */
143
-    function newbbGetIconHandler()
144
-    {
145
-        global $xoTheme;
146
-        static $iconHandler;
147
-
148
-        if (isset($iconHandler)) {
149
-            return $iconHandler;
150
-        }
25
+	/**
26
+	 * @param $text
27
+	 * @return mixed
28
+	 */
29
+	function newbbHtmlspecialchars(&$text)
30
+	{
31
+		return preg_replace(['/&amp;/i', '/&nbsp;/i'], ['&', '&amp;nbsp;'], htmlspecialchars($text, ENT_QUOTES | ENT_HTML5));
32
+	}
33
+
34
+	/**
35
+	 * @param        $text
36
+	 * @param  int   $html
37
+	 * @param  int   $smiley
38
+	 * @param  int   $xcode
39
+	 * @param  int   $image
40
+	 * @param  int   $br
41
+	 * @return mixed
42
+	 */
43
+	function &newbbDisplayTarea(&$text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
44
+	{
45
+		global $myts;
46
+
47
+		if (1 !== $html) {
48
+			// html not allowed
49
+			$text = newbbHtmlspecialchars($text);
50
+		}
51
+		$text = $myts->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
52
+		$text = $myts->makeClickable($text);
53
+		if (0 !== $smiley) {
54
+			// process smiley
55
+			$text = $myts->smiley($text);
56
+		}
57
+		if (0 !== $xcode) {
58
+			// decode xcode
59
+			if (0 !== $image) {
60
+				// image allowed
61
+				$text = $myts->xoopsCodeDecode($text);
62
+			} else {
63
+				// image not allowed
64
+				$text = $myts->xoopsCodeDecode($text, 0);
65
+			}
66
+		}
67
+		if (0 !== $br) {
68
+			$text = $myts->nl2Br($text);
69
+		}
70
+		$text = $myts->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
71
+
72
+		return $text;
73
+	}
74
+
75
+	/**
76
+	 * @param $document
77
+	 * @return string
78
+	 */
79
+	function newbbHtml2text($document)
80
+	{
81
+		$text = strip_tags($document);
82
+
83
+		return $text;
84
+	}
85
+
86
+	/**
87
+	 * Display forrum button
88
+	 *
89
+	 * @param          $link
90
+	 * @param          $button
91
+	 * @param  string  $alt     alt message
92
+	 * @param  boolean $asImage true for image mode; false for text mode
93
+	 * @param  string  $extra   extra attribute for the button
94
+	 * @return mixed
95
+	 * @internal param string $image image/button name, without extension
96
+	 */
97
+	function newbbGetButton($link, $button, $alt = '', $asImage = true, $extra = "class='forum_button'")
98
+	{
99
+		$button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}' />";
100
+		if (empty($asImage)) {
101
+			$button = "<a href='{$link}' title='{$alt}' {$extra}>" . newbbDisplayImage($button, $alt, true) . '</a>';
102
+		}
103
+
104
+		return $button;
105
+	}
106
+
107
+	/**
108
+	 * Display forrum images
109
+	 *
110
+	 * @param  string  $image   image name, without extension
111
+	 * @param  string  $alt     alt message
112
+	 * @param  boolean $display true for return image anchor; faulse for assign to $xoopsTpl
113
+	 * @param  string  $extra   extra attribute for the image
114
+	 * @return mixed
115
+	 */
116
+	function newbbDisplayImage($image, $alt = '', $display = true, $extra = "class='forum_icon'")
117
+	{
118
+		$iconHandler = newbbGetIconHandler();
119
+		// START hacked by irmtfan
120
+		// to show text links instead of buttons - func_num_args()==2 => only when $image, $alt is set and optional $display not set
121
+
122
+		if (2 == func_num_args()) {
123
+			// overall setting
124
+			if (!empty($GLOBALS['xoopsModuleConfig']['display_text_links'])) {
125
+				$display = false;
126
+			}
127
+			// if set for each link => overwrite $display
128
+			if (isset($GLOBALS['xoopsModuleConfig']['display_text_each_link'][$image])) {
129
+				$display = empty($GLOBALS['xoopsModuleConfig']['display_text_each_link'][$image]);
130
+			}
131
+		}
132
+		// END hacked by irmtfan
133
+		if (empty($display)) {
134
+			return $iconHandler->assignImage($image, $alt, $extra);
135
+		} else {
136
+			return $iconHandler->getImage($image, $alt, $extra);
137
+		}
138
+	}
139
+
140
+	/**
141
+	 * @return Newbb\IconHandler
142
+	 */
143
+	function newbbGetIconHandler()
144
+	{
145
+		global $xoTheme;
146
+		static $iconHandler;
147
+
148
+		if (isset($iconHandler)) {
149
+			return $iconHandler;
150
+		}
151 151
 
152 152
 //        if (!class_exists('IconHandler')) {
153 153
 //            require_once dirname(__DIR__) . '/class/icon.php';
154 154
 //        }
155 155
 
156
-        $iconHandler           = Newbb\IconHandler::getInstance();
157
-        $iconHandler->template = $xoTheme->template;
158
-        $iconHandler->init($GLOBALS['xoopsConfig']['language']);
156
+		$iconHandler           = Newbb\IconHandler::getInstance();
157
+		$iconHandler->template = $xoTheme->template;
158
+		$iconHandler->init($GLOBALS['xoopsConfig']['language']);
159 159
 
160
-        return $iconHandler;
161
-    }
160
+		return $iconHandler;
161
+	}
162 162
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
15 15
 
16
-defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__   . '/functions.ini.php';
16
+defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php';
17 17
 define('NEWBB_FUNCTIONS_RENDER_LOADED', true);
18 18
 
19 19
 if (!defined('NEWBB_FUNCTIONS_RENDER')) {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         if (0 !== $br) {
68 68
             $text = $myts->nl2Br($text);
69 69
         }
70
-        $text = $myts->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
70
+        $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18)
71 71
 
72 72
         return $text;
73 73
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}' />";
100 100
         if (empty($asImage)) {
101
-            $button = "<a href='{$link}' title='{$alt}' {$extra}>" . newbbDisplayImage($button, $alt, true) . '</a>';
101
+            $button = "<a href='{$link}' title='{$alt}' {$extra}>".newbbDisplayImage($button, $alt, true).'</a>';
102 102
         }
103 103
 
104 104
         return $button;
Please login to merge, or discard this patch.
include/functions.welcome.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -17,34 +17,34 @@
 block discarded – undo
17 17
 define('NEWBB_FUNCTIONS_WELCOME_LOADED', true);
18 18
 
19 19
 if (!defined('NEWBB_FUNCTIONS_WELCOME')) {
20
-    define('NEWBB_FUNCTIONS_WELCOME', true);
21
-
22
-    /**
23
-     * @return bool
24
-     */
25
-    function newbbWelcome()
26
-    {
27
-        global $forumObject;
28
-        $ret = '';
29
-
30
-        $forumId = @$GLOBALS['xoopsModuleConfig']['welcome_forum'];
31
-        if (!$forumId) {
32
-            return false;
33
-        }
34
-        /** @var Newbb\ForumHandler $forumHandler */
35
-        $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
36
-        $forumObject  = $forumHandler->get($forumId);
37
-        if (!$forumObject || !$forumHandler->getPermission($forumObject)) {
38
-            unset($forumObject);
39
-
40
-            return false;
41
-        }
42
-
43
-        require_once __DIR__   . '/functions.welcome.inc.php';
44
-        unset($forumObject);
45
-
46
-        return $ret;
47
-    }
48
-
49
-    newbbWelcome();
20
+	define('NEWBB_FUNCTIONS_WELCOME', true);
21
+
22
+	/**
23
+	 * @return bool
24
+	 */
25
+	function newbbWelcome()
26
+	{
27
+		global $forumObject;
28
+		$ret = '';
29
+
30
+		$forumId = @$GLOBALS['xoopsModuleConfig']['welcome_forum'];
31
+		if (!$forumId) {
32
+			return false;
33
+		}
34
+		/** @var Newbb\ForumHandler $forumHandler */
35
+		$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
36
+		$forumObject  = $forumHandler->get($forumId);
37
+		if (!$forumObject || !$forumHandler->getPermission($forumObject)) {
38
+			unset($forumObject);
39
+
40
+			return false;
41
+		}
42
+
43
+		require_once __DIR__   . '/functions.welcome.inc.php';
44
+		unset($forumObject);
45
+
46
+		return $ret;
47
+	}
48
+
49
+	newbbWelcome();
50 50
 }
Please login to merge, or discard this 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
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
15 15
 
16
-defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php';
16
+defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php';
17 17
 define('NEWBB_FUNCTIONS_WELCOME_LOADED', true);
18 18
 
19 19
 if (!defined('NEWBB_FUNCTIONS_WELCOME')) {
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             return false;
41 41
         }
42 42
 
43
-        require_once __DIR__   . '/functions.welcome.inc.php';
43
+        require_once __DIR__.'/functions.welcome.inc.php';
44 44
         unset($forumObject);
45 45
 
46 46
         return $ret;
Please login to merge, or discard this patch.
include/onuninstall.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 
20 20
 function xoops_module_pre_uninstall_newbb(\XoopsModule $module)
21 21
 {
22
-    // Do some synchronization
23
-    return true;
22
+	// Do some synchronization
23
+	return true;
24 24
 }
25 25
 
26 26
 /**
@@ -32,36 +32,36 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function xoops_module_uninstall_newbb(\XoopsModule $module)
34 34
 {
35
-    //    return true;
35
+	//    return true;
36 36
 
37
-    $moduleDirName  = basename(dirname(__DIR__));
38
-    $moduleDirNameUpper   = strtoupper($moduleDirName);
39
-    /** @var \XoopsModules\Newbb\Helper $helper */
40
-    $helper = \XoopsModules\Newbb\Helper::getInstance();
37
+	$moduleDirName  = basename(dirname(__DIR__));
38
+	$moduleDirNameUpper   = strtoupper($moduleDirName);
39
+	/** @var \XoopsModules\Newbb\Helper $helper */
40
+	$helper = \XoopsModules\Newbb\Helper::getInstance();
41 41
 
42
-    /** @var Newbb\Utility $utility */
43
-    $utility = new \XoopsModules\Newbb\Utility();
42
+	/** @var Newbb\Utility $utility */
43
+	$utility = new \XoopsModules\Newbb\Utility();
44 44
 
45
-    $success = true;
46
-    $helper->loadLanguage('admin');
45
+	$success = true;
46
+	$helper->loadLanguage('admin');
47 47
 
48
-    //------------------------------------------------------------------
49
-    // Remove uploads folder (and all subfolders) if they exist
50
-    //------------------------------------------------------------------
48
+	//------------------------------------------------------------------
49
+	// Remove uploads folder (and all subfolders) if they exist
50
+	//------------------------------------------------------------------
51 51
 
52
-    $old_directories = [$GLOBALS['xoops']->path("uploads/{$moduleDirName}")];
53
-    foreach ($old_directories as $old_dir) {
54
-        $dirInfo = new \SplFileInfo($old_dir);
55
-        if ($dirInfo->isDir()) {
56
-            // The directory exists so delete it
57
-            if (false === $utility::rrmdir($old_dir)) {
58
-                $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir));
59
-                $success = false;
60
-            }
61
-        }
62
-        unset($dirInfo);
63
-    }
64
-    /*
52
+	$old_directories = [$GLOBALS['xoops']->path("uploads/{$moduleDirName}")];
53
+	foreach ($old_directories as $old_dir) {
54
+		$dirInfo = new \SplFileInfo($old_dir);
55
+		if ($dirInfo->isDir()) {
56
+			// The directory exists so delete it
57
+			if (false === $utility::rrmdir($old_dir)) {
58
+				$module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir));
59
+				$success = false;
60
+			}
61
+		}
62
+		unset($dirInfo);
63
+	}
64
+	/*
65 65
     //------------ START ----------------
66 66
     //------------------------------------------------------------------
67 67
     // Remove xsitemap.xml from XOOPS root folder if it exists
@@ -75,6 +75,6 @@  discard block
 block discarded – undo
75 75
 //    return $success && $delOk; // use this if you're using this routine
76 76
 */
77 77
 
78
-    return $success;
79
-    //------------ END  ----------------
78
+	return $success;
79
+	//------------ END  ----------------
80 80
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
 {
35 35
     //    return true;
36 36
 
37
-    $moduleDirName  = basename(dirname(__DIR__));
38
-    $moduleDirNameUpper   = strtoupper($moduleDirName);
37
+    $moduleDirName = basename(dirname(__DIR__));
38
+    $moduleDirNameUpper = strtoupper($moduleDirName);
39 39
     /** @var \XoopsModules\Newbb\Helper $helper */
40 40
     $helper = \XoopsModules\Newbb\Helper::getInstance();
41 41
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         if ($dirInfo->isDir()) {
56 56
             // The directory exists so delete it
57 57
             if (false === $utility::rrmdir($old_dir)) {
58
-                $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir));
58
+                $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $old_dir));
59 59
                 $success = false;
60 60
             }
61 61
         }
Please login to merge, or discard this patch.
include/functions.session.php 2 patches
Indentation   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -17,101 +17,101 @@
 block discarded – undo
17 17
 define('NEWBB_FUNCTIONS_SESSION_LOADED', true);
18 18
 
19 19
 if (!defined('NEWBB_FUNCTIONS_SESSION')) {
20
-    define('NEWBB_FUNCTIONS_SESSION', 1);
20
+	define('NEWBB_FUNCTIONS_SESSION', 1);
21 21
 
22
-    /*
22
+	/*
23 23
      * Currently the newbb session/cookie handlers are limited to:
24 24
      * -- one dimension
25 25
      * -- "," and "|" are preserved
26 26
      *
27 27
      */
28
-    /**
29
-     * @param        $name
30
-     * @param string|array $string
31
-     */
32
-    function newbbSetSession($name, $string = '')
33
-    {
34
-        if (is_array($string)) {
35
-            $value = [];
36
-            foreach ($string as $key => $val) {
37
-                $value[] = $key . '|' . $val;
38
-            }
39
-            $string = implode(',', $value);
40
-        }
41
-        $_SESSION['newbb_' . $name] = $string;
42
-    }
28
+	/**
29
+	 * @param        $name
30
+	 * @param string|array $string
31
+	 */
32
+	function newbbSetSession($name, $string = '')
33
+	{
34
+		if (is_array($string)) {
35
+			$value = [];
36
+			foreach ($string as $key => $val) {
37
+				$value[] = $key . '|' . $val;
38
+			}
39
+			$string = implode(',', $value);
40
+		}
41
+		$_SESSION['newbb_' . $name] = $string;
42
+	}
43 43
 
44
-    /**
45
-     * @param             $name
46
-     * @param  bool       $isArray
47
-     * @return array|bool
48
-     */
49
-    function newbbGetSession($name, $isArray = false)
50
-    {
51
-        $value = !empty($_SESSION['newbb_' . $name]) ? $_SESSION['newbb_' . $name] : false;
52
-        if ($isArray) {
53
-            $_value = $value ? explode(',', $value) : [];
54
-            $value  = [];
55
-            if (count($_value) > 0) {
56
-                foreach ($_value as $string) {
57
-                    $key         = substr($string, 0, strpos($string, '|'));
58
-                    $val         = substr($string, strpos($string, '|') + 1);
59
-                    $value[$key] = $val;
60
-                }
61
-            }
62
-            unset($_value);
63
-        }
44
+	/**
45
+	 * @param             $name
46
+	 * @param  bool       $isArray
47
+	 * @return array|bool
48
+	 */
49
+	function newbbGetSession($name, $isArray = false)
50
+	{
51
+		$value = !empty($_SESSION['newbb_' . $name]) ? $_SESSION['newbb_' . $name] : false;
52
+		if ($isArray) {
53
+			$_value = $value ? explode(',', $value) : [];
54
+			$value  = [];
55
+			if (count($_value) > 0) {
56
+				foreach ($_value as $string) {
57
+					$key         = substr($string, 0, strpos($string, '|'));
58
+					$val         = substr($string, strpos($string, '|') + 1);
59
+					$value[$key] = $val;
60
+				}
61
+			}
62
+			unset($_value);
63
+		}
64 64
 
65
-        return $value;
66
-    }
65
+		return $value;
66
+	}
67 67
 
68
-    /**
69
-     * @param        $name
70
-     * @param string|array $string
71
-     * @param int    $expire
72
-     */
73
-    function newbbSetCookie($name, $string = '', $expire = 0)
74
-    {
75
-        global $forumCookie;
76
-        if (is_array($string)) {
77
-            $value = [];
78
-            foreach ($string as $key => $val) {
79
-                $value[] = $key . '|' . $val;
80
-            }
81
-            $string = implode(',', $value);
82
-        }
83
-        setcookie($forumCookie['prefix'] . $name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']);
84
-    }
68
+	/**
69
+	 * @param        $name
70
+	 * @param string|array $string
71
+	 * @param int    $expire
72
+	 */
73
+	function newbbSetCookie($name, $string = '', $expire = 0)
74
+	{
75
+		global $forumCookie;
76
+		if (is_array($string)) {
77
+			$value = [];
78
+			foreach ($string as $key => $val) {
79
+				$value[] = $key . '|' . $val;
80
+			}
81
+			$string = implode(',', $value);
82
+		}
83
+		setcookie($forumCookie['prefix'] . $name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']);
84
+	}
85 85
 
86
-    /**
87
-     * @param             $name
88
-     * @param  bool       $isArray
89
-     * @return array|null
90
-     */
91
-    function newbbGetCookie($name, $isArray = false)
92
-    {
93
-        global $forumCookie;
94
-        //        $value = !empty($_COOKIE[$forumCookie['prefix'] . $name]) ? $_COOKIE[$forumCookie['prefix'] . $name] : null;
95
-        $value = Request::getString($forumCookie['prefix'] . $name, null, 'COOKIE');
86
+	/**
87
+	 * @param             $name
88
+	 * @param  bool       $isArray
89
+	 * @return array|null
90
+	 */
91
+	function newbbGetCookie($name, $isArray = false)
92
+	{
93
+		global $forumCookie;
94
+		//        $value = !empty($_COOKIE[$forumCookie['prefix'] . $name]) ? $_COOKIE[$forumCookie['prefix'] . $name] : null;
95
+		$value = Request::getString($forumCookie['prefix'] . $name, null, 'COOKIE');
96 96
 
97
-        if ($isArray) {
98
-            $_value = $value ? explode(',', $value) : [];
99
-            $value  = [];
100
-            if (count($_value) > 0) {
101
-                foreach ($_value as $string) {
102
-                    $sep = strpos($string, '|');
103
-                    if (false === $sep) {
104
-                        $value[] = $string;
105
-                    } else {
106
-                        $key         = substr($string, 0, $sep);
107
-                        $val         = substr($string, $sep + 1);
108
-                        $value[$key] = $val;
109
-                    }
110
-                }
111
-            }
112
-            unset($_value);
113
-        }
97
+		if ($isArray) {
98
+			$_value = $value ? explode(',', $value) : [];
99
+			$value  = [];
100
+			if (count($_value) > 0) {
101
+				foreach ($_value as $string) {
102
+					$sep = strpos($string, '|');
103
+					if (false === $sep) {
104
+						$value[] = $string;
105
+					} else {
106
+						$key         = substr($string, 0, $sep);
107
+						$val         = substr($string, $sep + 1);
108
+						$value[$key] = $val;
109
+					}
110
+				}
111
+			}
112
+			unset($_value);
113
+		}
114 114
 
115
-        return $value;
116
-    }
115
+		return $value;
116
+	}
117 117
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
15 15
 
16
-defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php';
16
+defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php';
17 17
 define('NEWBB_FUNCTIONS_SESSION_LOADED', true);
18 18
 
19 19
 if (!defined('NEWBB_FUNCTIONS_SESSION')) {
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
         if (is_array($string)) {
35 35
             $value = [];
36 36
             foreach ($string as $key => $val) {
37
-                $value[] = $key . '|' . $val;
37
+                $value[] = $key.'|'.$val;
38 38
             }
39 39
             $string = implode(',', $value);
40 40
         }
41
-        $_SESSION['newbb_' . $name] = $string;
41
+        $_SESSION['newbb_'.$name] = $string;
42 42
     }
43 43
 
44 44
     /**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     function newbbGetSession($name, $isArray = false)
50 50
     {
51
-        $value = !empty($_SESSION['newbb_' . $name]) ? $_SESSION['newbb_' . $name] : false;
51
+        $value = !empty($_SESSION['newbb_'.$name]) ? $_SESSION['newbb_'.$name] : false;
52 52
         if ($isArray) {
53 53
             $_value = $value ? explode(',', $value) : [];
54 54
             $value  = [];
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
         if (is_array($string)) {
77 77
             $value = [];
78 78
             foreach ($string as $key => $val) {
79
-                $value[] = $key . '|' . $val;
79
+                $value[] = $key.'|'.$val;
80 80
             }
81 81
             $string = implode(',', $value);
82 82
         }
83
-        setcookie($forumCookie['prefix'] . $name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']);
83
+        setcookie($forumCookie['prefix'].$name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']);
84 84
     }
85 85
 
86 86
     /**
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     {
93 93
         global $forumCookie;
94 94
         //        $value = !empty($_COOKIE[$forumCookie['prefix'] . $name]) ? $_COOKIE[$forumCookie['prefix'] . $name] : null;
95
-        $value = Request::getString($forumCookie['prefix'] . $name, null, 'COOKIE');
95
+        $value = Request::getString($forumCookie['prefix'].$name, null, 'COOKIE');
96 96
 
97 97
         if ($isArray) {
98 98
             $_value = $value ? explode(',', $value) : [];
Please login to merge, or discard this patch.