@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | |
24 | 24 | // a complete rewrite by irmtfan to enhance: 1- RTL 2- Multilanguage (EMLH and Xlanguage) |
25 | 25 | error_reporting(0); |
26 | -require_once __DIR__ . '/header.php'; |
|
26 | +require_once __DIR__.'/header.php'; |
|
27 | 27 | |
28 | 28 | $attach_id = Request::getString('attachid', '', 'GET'); |
29 | 29 | $forum = Request::getInt('forum', 0, 'GET'); |
30 | 30 | $topic_id = Request::getInt('topic_id', 0, 'GET'); |
31 | 31 | $post_id = Request::getInt('post_id', 0, 'GET'); |
32 | 32 | |
33 | -if (!is_file(XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php')) { |
|
34 | - redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?topic_id=' . $topic_id, 3, 'TCPDF for Xoops not installed'); |
|
33 | +if (!is_file(XOOPS_ROOT_PATH.'/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php')) { |
|
34 | + redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?topic_id='.$topic_id, 3, 'TCPDF for Xoops not installed'); |
|
35 | 35 | } else { |
36 | - require_once XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php'; |
|
36 | + require_once XOOPS_ROOT_PATH.'/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | if (empty($post_id)) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $pf_title = ''; |
64 | 64 | if ($parent_forums) { |
65 | 65 | foreach ($parent_forums as $p_f) { |
66 | - $pf_title .= $p_f['forum_name'] . ' - '; |
|
66 | + $pf_title .= $p_f['forum_name'].' - '; |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | if (!$forumHandler->getPermission($viewtopic_forum)) { |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | $pdf_data['author'] = $myts->undoHtmlSpecialChars($post_data['author']); |
84 | 84 | $pdf_data['title'] = $myts->undoHtmlSpecialChars($post_data['subject']); |
85 | 85 | $content = ''; |
86 | -$content .= '<b>' . $pdf_data['title'] . '</b><br><br>'; |
|
87 | -$content .= _MD_NEWBB_AUTHORC . ' ' . $pdf_data['author'] . '<br>'; |
|
88 | -$content .= _MD_NEWBB_POSTEDON . ' ' . formatTimestamp($post_data['date']) . '<br><br><br>'; |
|
89 | -$content .= $myts->undoHtmlSpecialChars($post_data['text']) . '<br>'; |
|
86 | +$content .= '<b>'.$pdf_data['title'].'</b><br><br>'; |
|
87 | +$content .= _MD_NEWBB_AUTHORC.' '.$pdf_data['author'].'<br>'; |
|
88 | +$content .= _MD_NEWBB_POSTEDON.' '.formatTimestamp($post_data['date']).'<br><br><br>'; |
|
89 | +$content .= $myts->undoHtmlSpecialChars($post_data['text']).'<br>'; |
|
90 | 90 | //$content .= $post_edit . '<br>'; //reserve for future versions to display edit records |
91 | 91 | $pdf_data['content'] = str_replace('[pagebreak]', '<br>', $content); |
92 | 92 | $pdf_data['topic_title'] = $forumtopic->getVar('topic_title'); |
93 | -$pdf_data['forum_title'] = $pf_title . $viewtopic_forum->getVar('forum_name'); |
|
93 | +$pdf_data['forum_title'] = $pf_title.$viewtopic_forum->getVar('forum_name'); |
|
94 | 94 | $pdf_data['cat_title'] = $viewtopic_cat->getVar('cat_title'); |
95 | -$pdf_data['subject'] = _MD_NEWBB_PDF_SUBJECT . ': ' . $pdf_data['topic_title']; |
|
96 | -$pdf_data['keywords'] = XOOPS_URL . ', ' . 'XOOPS Project, ' . $pdf_data['topic_title']; |
|
97 | -$pdf_data['HeadFirstLine'] = $GLOBALS['xoopsConfig']['sitename'] . ' - ' . $GLOBALS['xoopsConfig']['slogan']; |
|
98 | -$pdf_data['HeadSecondLine'] = _MD_NEWBB_FORUMHOME . ' - ' . $pdf_data['cat_title'] . ' - ' . $pdf_data['forum_title'] . ' - ' . $pdf_data['topic_title']; |
|
95 | +$pdf_data['subject'] = _MD_NEWBB_PDF_SUBJECT.': '.$pdf_data['topic_title']; |
|
96 | +$pdf_data['keywords'] = XOOPS_URL.', '.'XOOPS Project, '.$pdf_data['topic_title']; |
|
97 | +$pdf_data['HeadFirstLine'] = $GLOBALS['xoopsConfig']['sitename'].' - '.$GLOBALS['xoopsConfig']['slogan']; |
|
98 | +$pdf_data['HeadSecondLine'] = _MD_NEWBB_FORUMHOME.' - '.$pdf_data['cat_title'].' - '.$pdf_data['forum_title'].' - '.$pdf_data['topic_title']; |
|
99 | 99 | // START irmtfan to implement EMLH by GIJ |
100 | 100 | if (function_exists('easiestml')) { |
101 | 101 | $pdf_data = easiestml($pdf_data); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | // set document information |
138 | 138 | $pdf->SetCreator(PDF_CREATOR); |
139 | 139 | $pdf->SetAuthor(PDF_AUTHOR); |
140 | -$pdf->SetTitle($pdf_data['forum_title'] . ' - ' . $pdf_data['subject']); |
|
140 | +$pdf->SetTitle($pdf_data['forum_title'].' - '.$pdf_data['subject']); |
|
141 | 141 | $pdf->SetSubject($pdf_data['subject']); |
142 | 142 | $pdf->SetKeywords($pdf_data['keywords']); |
143 | 143 | |
@@ -160,4 +160,4 @@ discard block |
||
160 | 160 | //$pdf->SetFont(PDF_FONT_NAME_MAIN, PDF_FONT_STYLE_MAIN, PDF_FONT_SIZE_MAIN); |
161 | 161 | $pdf->SetFont('dejavusans', '', 12); |
162 | 162 | $pdf->writeHTML($pdf_data['content'], true, 0); |
163 | -$pdf->Output($pdf_data['topic_title'] . '_' . $post_id . '.pdf', 'I'); |
|
163 | +$pdf->Output($pdf_data['topic_title'].'_'.$post_id.'.pdf', 'I'); |
@@ -42,17 +42,17 @@ discard block |
||
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 |
||
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 |
||
82 | 82 | // array_push($parentIds, $option['id']); |
83 | 83 | $parentIds[] = $option['id']; |
84 | 84 | } |
85 | - $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
85 | + $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | } |
@@ -32,7 +32,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
292 | 292 | } |
293 | 293 | $form->display(); |
294 | 294 | echo '<fieldset>'; |
295 | - echo '<legend> ' . _MI_NEWBB_ADMENU_PERMISSION . ' </legend>'; |
|
295 | + echo '<legend> '._MI_NEWBB_ADMENU_PERMISSION.' </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 |
||
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 | } |
@@ -23,10 +23,10 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -30,16 +30,16 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -13,7 +13,7 @@ discard block |
||
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 |
||
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 |
||
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; |
@@ -13,7 +13,7 @@ discard block |
||
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 |
||
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; |
@@ -34,8 +34,8 @@ discard block |
||
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 |
||
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 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
13 | 13 | |
14 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
14 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
15 | 15 | define('NEWBB_FUNCTIONS_TOPIC_LOADED', true); |
16 | 16 | |
17 | 17 | if (!defined('NEWBB_FUNCTIONS_TOPIC')) { |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | if (empty($prefixName)) { |
43 | 43 | return $topicTitle; |
44 | 44 | } |
45 | - $topicPrefix = $prefixColor ? '<em style="font-style: normal; color: ' . $prefixColor . ';">[' . $prefixName . ']</em> ' : '[' . $prefixName . '] '; |
|
45 | + $topicPrefix = $prefixColor ? '<em style="font-style: normal; color: '.$prefixColor.';">['.$prefixName.']</em> ' : '['.$prefixName.'] '; |
|
46 | 46 | |
47 | - return $topicPrefix . $topicTitle; |
|
47 | + return $topicPrefix.$topicTitle; |
|
48 | 48 | } |
49 | 49 | } |