@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { |
29 | 29 | exit('Access Denied'); |
30 | 30 | } |
31 | -require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php'; |
|
32 | -include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blocksadmin.php'; |
|
31 | +require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
|
32 | +include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blocksadmin.php'; |
|
33 | 33 | |
34 | 34 | $op = 'list'; |
35 | 35 | if (isset($HTTP_POST_VARS)) { |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | || 'clone' === $HTTP_GET_VARS['op'] |
44 | 44 | || 'previewpopup' === $HTTP_GET_VARS['op']) { |
45 | 45 | $op = $HTTP_GET_VARS['op']; |
46 | - $bid = isset($HTTP_GET_VARS['bid']) ? (int)$HTTP_GET_VARS['bid'] : 0; |
|
46 | + $bid = isset($HTTP_GET_VARS['bid']) ? (int) $HTTP_GET_VARS['bid'] : 0; |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | 50 | if (isset($previewblock)) { |
51 | 51 | xoops_cp_header(); |
52 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
52 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
53 | 53 | $xoopsTpl = new \XoopsTpl(); |
54 | - $xoopsTpl->caching= 0; |
|
54 | + $xoopsTpl->caching = 0; |
|
55 | 55 | if (isset($bid)) { |
56 | 56 | $block['bid'] = $bid; |
57 | 57 | $block['form_title'] = _AM_EDITBLOCK; |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | . $myblock->getContent('S', $bctype) |
84 | 84 | . '</td></tr></table></body></html>'; |
85 | 85 | |
86 | - $dummyfile = '_dummyfile_' . time() . '.html'; |
|
87 | - $fp = fopen(XOOPS_CACHE_PATH . '/' . $dummyfile, 'w'); |
|
86 | + $dummyfile = '_dummyfile_'.time().'.html'; |
|
87 | + $fp = fopen(XOOPS_CACHE_PATH.'/'.$dummyfile, 'w'); |
|
88 | 88 | fwrite($fp, $dummyhtml); |
89 | 89 | fclose($fp); |
90 | 90 | $block['edit_form'] = false; |
@@ -95,24 +95,24 @@ discard block |
||
95 | 95 | $block['visible'] = $bvisible; |
96 | 96 | $block['title'] = $myblock->getVar('title', 'E'); |
97 | 97 | $block['content'] = $myblock->getVar('content', 'E'); |
98 | - $block['modules'] =& $bmodule; |
|
98 | + $block['modules'] = & $bmodule; |
|
99 | 99 | $block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type'); |
100 | 100 | $block['is_custom'] = true; |
101 | - $block['cachetime'] = (int)$bcachetime; |
|
102 | - echo '<a href="admin.php?fct=blocksadmin">' . _AM_BADMIN . '</a> <span style="font-weight:bold;">»»</span> ' . $block['form_title'] . '<br><br>'; |
|
103 | - include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blockform.php'; |
|
101 | + $block['cachetime'] = (int) $bcachetime; |
|
102 | + echo '<a href="admin.php?fct=blocksadmin">'._AM_BADMIN.'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br><br>'; |
|
103 | + include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php'; |
|
104 | 104 | $form->display(); |
105 | 105 | xoops_cp_footer(); |
106 | 106 | echo '<script type="text/javascript"> |
107 | 107 | <!--// |
108 | - preview_window = openWithSelfMain("' . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file=' . $dummyfile . '", "popup", 250, 200); |
|
108 | + preview_window = openWithSelfMain("' . XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file='.$dummyfile.'", "popup", 250, 200); |
|
109 | 109 | //--> |
110 | 110 | </script>'; |
111 | 111 | exit(); |
112 | 112 | } |
113 | 113 | |
114 | 114 | if ('previewpopup' === $op) { |
115 | - $file = str_replace('..', '', XOOPS_CACHE_PATH . '/' . trim($HTTP_GET_VARS['file'])); |
|
115 | + $file = str_replace('..', '', XOOPS_CACHE_PATH.'/'.trim($HTTP_GET_VARS['file'])); |
|
116 | 116 | if (file_exists($file)) { |
117 | 117 | include $file; |
118 | 118 | @unlink($file); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | if ('update' === $op) { |
153 | - $bcachetime = isset($bcachetime) ? (int)$bcachetime : 0; |
|
153 | + $bcachetime = isset($bcachetime) ? (int) $bcachetime : 0; |
|
154 | 154 | $options = isset($options) ? $options : []; |
155 | 155 | $bcontent = isset($bcontent) ? $bcontent : ''; |
156 | 156 | $bctype = isset($bctype) ? $bctype : ''; |
@@ -251,27 +251,27 @@ discard block |
||
251 | 251 | $sql = sprintf('DELETE FROM %s WHERE block_id = %u', $db->prefix('block_module_link'), $bid); |
252 | 252 | $db->query($sql); |
253 | 253 | foreach ($bmodule as $bmid) { |
254 | - $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int)$bmid); |
|
254 | + $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int) $bmid); |
|
255 | 255 | $db->query($sql); |
256 | 256 | } |
257 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
257 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
258 | 258 | $xoopsTpl = new \XoopsTpl(); |
259 | - $xoopsTpl->caching= 2; |
|
259 | + $xoopsTpl->caching = 2; |
|
260 | 260 | if ('' != $myblock->getVar('template')) { |
261 | - if ($xoopsTpl->is_cached('db:' . $myblock->getVar('template'))) { |
|
262 | - if (!$xoopsTpl->clear_cache('db:' . $myblock->getVar('template'))) { |
|
263 | - $msg = 'Unable to clear cache for block ID' . $bid; |
|
261 | + if ($xoopsTpl->is_cached('db:'.$myblock->getVar('template'))) { |
|
262 | + if (!$xoopsTpl->clear_cache('db:'.$myblock->getVar('template'))) { |
|
263 | + $msg = 'Unable to clear cache for block ID'.$bid; |
|
264 | 264 | } |
265 | 265 | } |
266 | 266 | } else { |
267 | - if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block' . $bid)) { |
|
268 | - if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block' . $bid)) { |
|
269 | - $msg = 'Unable to clear cache for block ID' . $bid; |
|
267 | + if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block'.$bid)) { |
|
268 | + if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block'.$bid)) { |
|
269 | + $msg = 'Unable to clear cache for block ID'.$bid; |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | } |
273 | 273 | } else { |
274 | - $msg = 'Failed update of block. ID:' . $bid; |
|
274 | + $msg = 'Failed update of block. ID:'.$bid; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | return $msg; // GIJ + |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | $categoryID = isset($categoryID) ? $categoryID : 0; |
10 | -$type = isset($type) ? (int)$type : 3; |
|
10 | +$type = isset($type) ? (int) $type : 3; |
|
11 | 11 | $term = isset($term) ? $type : ''; |
12 | 12 | |
13 | 13 | $sform = new \XoopsThemeForm(_MD_WB_SEARCHFORM, 'searchform', 'search.php'); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $searchcat = new \XoopsFormSelect(_MD_WB_CATEGORY, 'categoryID', $categoryID); |
22 | 22 | $searchcat->addOption('0', _MD_WB_ALLOFTHEM); |
23 | 23 | |
24 | - $resultcat = $xoopsDB->queryF('SELECT categoryID, name FROM ' . $xoopsDB->prefix('wbcategories') . ' ORDER BY categoryID'); |
|
24 | + $resultcat = $xoopsDB->queryF('SELECT categoryID, name FROM '.$xoopsDB->prefix('wbcategories').' ORDER BY categoryID'); |
|
25 | 25 | |
26 | 26 | while (list($categoryID, $name) = $xoopsDB->fetchRow($resultcat)) { |
27 | 27 | $searchcat->addOption('categoryID', "$categoryID : $name"); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
13 | 13 | |
14 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
14 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
15 | 15 | define('NEWBB_FUNCTIONS_RENDER_LOADED', true); |
16 | 16 | |
17 | 17 | if (!defined('NEWBB_FUNCTIONS_RENDER')): |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | // decode xcode |
57 | 57 | if (0 != $image) { |
58 | 58 | // image allowed |
59 | - $text =& $myts->xoopsCodeDecode($text); |
|
59 | + $text = & $myts->xoopsCodeDecode($text); |
|
60 | 60 | } else { |
61 | 61 | // image not allowed |
62 | - $text =& $myts->xoopsCodeDecode($text, 0); |
|
62 | + $text = & $myts->xoopsCodeDecode($text, 0); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | if (0 != $br) { |
66 | - $text =& $myts->nl2Br($text); |
|
66 | + $text = & $myts->nl2Br($text); |
|
67 | 67 | } |
68 | - $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
68 | + $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
69 | 69 | |
70 | 70 | return $text; |
71 | 71 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}'>"; |
97 | 97 | if (empty($asImage)) { |
98 | - $button = "<a href='{$link}' title='{$alt}' {$extra}>" . sf_displayImage($button, $alt, true) . '</a>'; |
|
98 | + $button = "<a href='{$link}' title='{$alt}' {$extra}>".sf_displayImage($button, $alt, true).'</a>'; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return $button; |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | |
27 | 27 | Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
28 | 28 | |
29 | -echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . $faqs_title . '</h3>'; |
|
29 | +echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".$faqs_title.'</h3>'; |
|
30 | 30 | echo "<div id='toptable'>"; |
31 | -echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $faqs_info . '</span>'; |
|
31 | +echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$faqs_info.'</span>'; |
|
32 | 32 | |
33 | 33 | // Get the total number of published FAQs |
34 | 34 | $totalfaqs = $faqHandler->getFaqsCount($sel_cat, [Constants::SF_STATUS_PUBLISHED, Constants::SF_STATUS_NEW_ANSWER]); |
@@ -39,22 +39,22 @@ discard block |
||
39 | 39 | $allCats = $categoryHandler->getObjects(null, true); |
40 | 40 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
41 | 41 | echo '<tr>'; |
42 | -echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>'; |
|
43 | -echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
44 | -echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>'; |
|
42 | +echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>'; |
|
43 | +echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
44 | +echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>'; |
|
45 | 45 | |
46 | -echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>'; |
|
47 | -echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>'; |
|
46 | +echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>'; |
|
47 | +echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>'; |
|
48 | 48 | |
49 | -echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>'; |
|
50 | -echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
49 | +echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>'; |
|
50 | +echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
51 | 51 | echo '</tr>'; |
52 | 52 | if ($totalfaqs > 0) { |
53 | 53 | global $pathIcon16, $smartModuleConfig; |
54 | 54 | foreach ($faqsObj as $iValue) { |
55 | 55 | $categoryObj = $allCats[$iValue->categoryid()]; |
56 | - $modify = "<a href='faq.php?op=mod&faqid=" . $iValue->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_EDITART . "'></a>"; |
|
57 | - $delete = "<a href='faq.php?op=del&faqid=" . $iValue->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
56 | + $modify = "<a href='faq.php?op=mod&faqid=".$iValue->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_EDITART."'></a>"; |
|
57 | + $delete = "<a href='faq.php?op=del&faqid=".$iValue->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
58 | 58 | |
59 | 59 | //adding name of the Question Submitter |
60 | 60 | $requester = Smartfaq\Utility::getLinkedUnameFromId($iValue->uid(), $smartModuleConfig['userealname']); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $criteria->add(new \Criteria('faqid', $iValue->faqid())); |
68 | 68 | $criteria->add(new \Criteria('status', true)); |
69 | 69 | |
70 | - $answerObjects =& $answerHandler->getObjects($criteria, true); |
|
70 | + $answerObjects = & $answerHandler->getObjects($criteria, true); |
|
71 | 71 | |
72 | 72 | foreach (array_keys($answerObjects) as $j) { |
73 | 73 | $answerObj = $answerObjects[$j]; |
@@ -82,26 +82,26 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | echo '<tr>'; |
85 | - echo "<td class='head' align='center'>" . $iValue->faqid() . '</td>'; |
|
86 | - echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>'; |
|
87 | - echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $iValue->faqid() . "'>" . $iValue->question(100) . '</a></td>'; |
|
85 | + echo "<td class='head' align='center'>".$iValue->faqid().'</td>'; |
|
86 | + echo "<td class='even' align='left'>".$categoryObj->name().'</td>'; |
|
87 | + echo "<td class='even' align='left'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$iValue->faqid()."'>".$iValue->question(100).'</a></td>'; |
|
88 | 88 | |
89 | - echo "<td class='even' align='center'>" . $requester . '</td>'; |
|
90 | - echo "<td class='even' align='center'>" . $answerSubmitter . '</td>'; |
|
89 | + echo "<td class='even' align='center'>".$requester.'</td>'; |
|
90 | + echo "<td class='even' align='center'>".$answerSubmitter.'</td>'; |
|
91 | 91 | |
92 | - echo "<td class='even' align='center'>" . $iValue->datesub('s') . '</td>'; |
|
92 | + echo "<td class='even' align='center'>".$iValue->datesub('s').'</td>'; |
|
93 | 93 | echo "<td class='even' align='center'> $modify $delete </td>"; |
94 | 94 | echo '</tr>'; |
95 | 95 | } |
96 | 96 | } else { |
97 | 97 | $faqid = -1; |
98 | 98 | echo '<tr>'; |
99 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQS . '</td>'; |
|
99 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQS.'</td>'; |
|
100 | 100 | echo '</tr>'; |
101 | 101 | } |
102 | 102 | echo "</table>\n"; |
103 | 103 | echo "<br>\n"; |
104 | 104 | |
105 | 105 | $pagenav = new \XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq', $pagenav_extra_args); |
106 | -echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
106 | +echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
107 | 107 | echo '</div>'; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | function smartfaq_com_update($faq_id, $total_num) |
12 | 12 | { |
13 | 13 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
14 | - $sql = 'UPDATE ' . $db->prefix('smartfaq_faq') . ' SET comments = ' . $total_num . ' WHERE faqid = ' . $faq_id; |
|
14 | + $sql = 'UPDATE '.$db->prefix('smartfaq_faq').' SET comments = '.$total_num.' WHERE faqid = '.$faq_id; |
|
15 | 15 | $db->query($sql); |
16 | 16 | } |
17 | 17 |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | |
21 | 21 | use XoopsModules\Smartfaq; |
22 | 22 | |
23 | -include __DIR__ . '/../preloads/autoloader.php'; |
|
23 | +include __DIR__.'/../preloads/autoloader.php'; |
|
24 | 24 | |
25 | 25 | $moduleDirName = basename(dirname(__DIR__)); |
26 | -$moduleDirNameUpper = strtoupper($moduleDirName); //$capsDirName |
|
26 | +$moduleDirNameUpper = strtoupper($moduleDirName); //$capsDirName |
|
27 | 27 | |
28 | 28 | |
29 | 29 | /** @var \XoopsDatabase $db */ |
@@ -40,20 +40,20 @@ discard block |
||
40 | 40 | //$categoryHandler = new Smartfaq\CategoryHandler($db); |
41 | 41 | //$downloadHandler = new Smartfaq\DownloadHandler($db); |
42 | 42 | |
43 | -if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
|
44 | - define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
|
45 | - define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
46 | - define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
47 | - define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/'); |
|
48 | - define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/'); |
|
49 | - define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images'); |
|
50 | - define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/'); |
|
51 | - define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
|
52 | - define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
|
53 | - define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
|
54 | - define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
55 | - define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
56 | - define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
|
43 | +if (!defined($moduleDirNameUpper.'_CONSTANTS_DEFINED')) { |
|
44 | + define($moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__))); |
|
45 | + define($moduleDirNameUpper.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
46 | + define($moduleDirNameUpper.'_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
47 | + define($moduleDirNameUpper.'_URL', XOOPS_URL.'/modules/'.$moduleDirName.'/'); |
|
48 | + define($moduleDirNameUpper.'_IMAGE_URL', constant($moduleDirNameUpper.'_URL').'/assets/images/'); |
|
49 | + define($moduleDirNameUpper.'_IMAGE_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/assets/images'); |
|
50 | + define($moduleDirNameUpper.'_ADMIN_URL', constant($moduleDirNameUpper.'_URL').'/admin/'); |
|
51 | + define($moduleDirNameUpper.'_ADMIN_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/admin/'); |
|
52 | + define($moduleDirNameUpper.'_ADMIN', constant($moduleDirNameUpper.'_URL').'/admin/index.php'); |
|
53 | + define($moduleDirNameUpper.'_AUTHOR_LOGOIMG', constant($moduleDirNameUpper.'_URL').'/assets/images/logoModule.png'); |
|
54 | + define($moduleDirNameUpper.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
55 | + define($moduleDirNameUpper.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
56 | + define($moduleDirNameUpper.'_CONSTANTS_DEFINED', 1); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | |
@@ -63,15 +63,15 @@ discard block |
||
63 | 63 | //$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
64 | 64 | |
65 | 65 | $icons = [ |
66 | - 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
|
67 | - 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
|
68 | - 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
|
69 | - 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
|
70 | - 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
|
71 | - 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
|
72 | - 'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
|
73 | - '0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
|
74 | - '1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
|
66 | + 'edit' => "<img src='".$pathIcon16."/edit.png' alt="._EDIT."' align='middle'>", |
|
67 | + 'delete' => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>", |
|
68 | + 'clone' => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>", |
|
69 | + 'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>", |
|
70 | + 'print' => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>", |
|
71 | + 'pdf' => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>", |
|
72 | + 'add' => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>", |
|
73 | + '0' => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>", |
|
74 | + '1' => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>", |
|
75 | 75 | ]; |
76 | 76 | |
77 | 77 | $debug = false; |
@@ -84,12 +84,12 @@ discard block |
||
84 | 84 | $GLOBALS['xoopsTpl'] = new \XoopsTpl(); |
85 | 85 | } |
86 | 86 | |
87 | -$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
|
87 | +$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL.'/modules/'.$moduleDirName); |
|
88 | 88 | // Local icons path |
89 | 89 | if (is_object($helper->getModule())) { |
90 | 90 | $pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
91 | 91 | $pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
92 | 92 | |
93 | - $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
|
93 | + $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL.'/modules/'.$moduleDirName.'/'.$pathModIcon16); |
|
94 | 94 | $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
95 | 95 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -include __DIR__ . '/../../mainfile.php'; |
|
9 | +include __DIR__.'/../../mainfile.php'; |
|
10 | 10 | |
11 | 11 | //require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
12 | 12 | //require_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php'; |
@@ -9,16 +9,16 @@ discard block |
||
9 | 9 | use XoopsModules\Smartfaq; |
10 | 10 | use XoopsModules\Smartfaq\Constants; |
11 | 11 | |
12 | -require_once __DIR__ . '/header.php'; |
|
12 | +require_once __DIR__.'/header.php'; |
|
13 | 13 | |
14 | 14 | global $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
15 | 15 | |
16 | 16 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl'; |
17 | 17 | |
18 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
19 | -require_once __DIR__ . '/footer.php'; |
|
18 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
19 | +require_once __DIR__.'/footer.php'; |
|
20 | 20 | |
21 | -$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
21 | +$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
22 | 22 | |
23 | 23 | // Creating the category object for the selected category |
24 | 24 | $categoryObj = new Smartfaq\Category($categoryid); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $categoryHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Category'); |
39 | 39 | |
40 | 40 | // At which record shall we start |
41 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
41 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
42 | 42 | |
43 | 43 | // Creating the faq handler object |
44 | 44 | /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */ |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $last_qnaObj = $faqHandler->getLastPublishedByCat([Constants::SF_STATUS_OPENED]); |
64 | 64 | if (isset($last_qnaObj[$categoryid])) { |
65 | 65 | $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid')); |
66 | - $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . '</a>'); |
|
66 | + $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50).'</a>'); |
|
67 | 67 | } |
68 | 68 | // Populating the smarty variables with informations related to the selected category |
69 | 69 | $category = $categoryObj->toArray(null, true); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $category['categoryPath'] = $categoryObj->getCategoryPath(false, true); |
72 | 72 | |
73 | 73 | // Creating the sub-categories objects that belong to the selected category |
74 | -$subcatsObj =& $categoryHandler->getCategories(0, 0, $categoryid); |
|
74 | +$subcatsObj = & $categoryHandler->getCategories(0, 0, $categoryid); |
|
75 | 75 | $total_subcats = count($subcatsObj); |
76 | 76 | $catQnasWithSub = 0; |
77 | 77 | if (0 != $total_subcats) { |
@@ -82,16 +82,16 @@ discard block |
||
82 | 82 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
83 | 83 | if (isset($last_qnaObj[$subcat_id])) { |
84 | 84 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
85 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>'); |
|
85 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>'); |
|
86 | 86 | } |
87 | 87 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
88 | 88 | $subcats[$subcat_id] = $subcat->toArray(null, true); |
89 | - $catQnasWithSub += $subcats[$subcat_id]['total']; |
|
89 | + $catQnasWithSub += $subcats[$subcat_id]['total']; |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | $xoopsTpl->assign('subcats', $subcats); |
93 | 93 | } |
94 | -$category['total'] = $catQnasWithSub + $totalQnas[$categoryid]; |
|
94 | +$category['total'] = $catQnasWithSub+$totalQnas[$categoryid]; |
|
95 | 95 | if ($faqsObj) { |
96 | 96 | $userids = []; |
97 | 97 | foreach ($faqsObj as $key => $thisfaq) { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | $memberHandler = xoops_getHandler('member'); |
103 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
103 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
104 | 104 | foreach ($faqsObj as $iValue) { |
105 | 105 | $faq = $iValue->toArray(null, $allcategories); |
106 | 106 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | } |
114 | 114 | // Language constants |
115 | -$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . '</a>'); |
|
115 | +$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION.'</a>'); |
|
116 | 116 | $xoopsTpl->assign('modulename', $xoopsModule->dirname()); |
117 | 117 | |
118 | 118 | $xoopsTpl->assign('displaylastfaqs', true); |
@@ -129,19 +129,19 @@ discard block |
||
129 | 129 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
130 | 130 | |
131 | 131 | // The Navigation Bar |
132 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
133 | -$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
132 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
133 | +$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
134 | 134 | if (1 == $xoopsModuleConfig['useimagenavpage']) { |
135 | - $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'; |
|
135 | + $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'; |
|
136 | 136 | } else { |
137 | - $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
137 | + $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $xoopsTpl->assign('category', $category); |
141 | 141 | |
142 | 142 | // Page Title Hack by marcan |
143 | 143 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
144 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
144 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
145 | 145 | // End Page Title Hack by marcan |
146 | 146 | |
147 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
147 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $faqHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Faq'); |
39 | 39 | |
40 | 40 | // creating the FAQ objects that belong to the selected category |
41 | - $faqsObj = $faqHandler->getFaqs($limit, 0, Constants::SF_STATUS_OPENED, $categoryid, $sort); |
|
41 | + $faqsObj = $faqHandler->getFaqs($limit, 0, Constants::SF_STATUS_OPENED, $categoryid, $sort); |
|
42 | 42 | |
43 | 43 | if ($faqsObj) { |
44 | 44 | foreach ($faqsObj as $iValue) { |
@@ -72,40 +72,40 @@ discard block |
||
72 | 72 | |
73 | 73 | $form = Smartfaq\Utility::createCategorySelect($options[0]); |
74 | 74 | |
75 | - $form .= ' <br>' . _MB_SF_ORDER . " <select name='options[]'>"; |
|
75 | + $form .= ' <br>'._MB_SF_ORDER." <select name='options[]'>"; |
|
76 | 76 | |
77 | 77 | $form .= "<option value='datesub'"; |
78 | 78 | if ('datesub' === $options[1]) { |
79 | 79 | $form .= ' selected'; |
80 | 80 | } |
81 | - $form .= '>' . _MB_SF_DATE . "</option>\n"; |
|
81 | + $form .= '>'._MB_SF_DATE."</option>\n"; |
|
82 | 82 | |
83 | 83 | $form .= "<option value='counter'"; |
84 | 84 | if ('counter' === $options[1]) { |
85 | 85 | $form .= ' selected'; |
86 | 86 | } |
87 | - $form .= '>' . _MB_SF_HITS . "</option>\n"; |
|
87 | + $form .= '>'._MB_SF_HITS."</option>\n"; |
|
88 | 88 | |
89 | 89 | $form .= "<option value='weight'"; |
90 | 90 | if ('weight' === $options[1]) { |
91 | 91 | $form .= ' selected'; |
92 | 92 | } |
93 | - $form .= '>' . _MB_SF_WEIGHT . "</option>\n"; |
|
93 | + $form .= '>'._MB_SF_WEIGHT."</option>\n"; |
|
94 | 94 | |
95 | 95 | $form .= "</select>\n"; |
96 | 96 | |
97 | - $form .= ' ' . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[2] . "'> " . _MB_SF_QUESTIONS . ''; |
|
98 | - $form .= ' <br>' . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[3] . "'> " . _MB_SF_LENGTH . ''; |
|
97 | + $form .= ' '._MB_SF_DISP." <input type='text' name='options[]' value='".$options[2]."'> "._MB_SF_QUESTIONS.''; |
|
98 | + $form .= ' <br>'._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[3]."'> "._MB_SF_LENGTH.''; |
|
99 | 99 | |
100 | - $form .= '<br>' . _MB_SF_SHOW_DATE . " <input type='radio' id='options[]' name='options[]' value='1'"; |
|
100 | + $form .= '<br>'._MB_SF_SHOW_DATE." <input type='radio' id='options[]' name='options[]' value='1'"; |
|
101 | 101 | if (1 == $options[4]) { |
102 | 102 | $form .= ' checked'; |
103 | 103 | } |
104 | - $form .= '> ' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'"; |
|
104 | + $form .= '> '._YES."<input type='radio' id='options[]' name='options[]' value='0'"; |
|
105 | 105 | if (0 == $options[4]) { |
106 | 106 | $form .= ' checked'; |
107 | 107 | } |
108 | - $form .= '> ' . _NO . ''; |
|
108 | + $form .= '> '._NO.''; |
|
109 | 109 | |
110 | 110 | return $form; |
111 | 111 | } |