@@ -70,18 +70,18 @@ |
||
70 | 70 | $myblock->setVar('title', $myts->stripSlashesGPC($btitle)); |
71 | 71 | $myblock->setVar('content', $myts->stripSlashesGPC($bcontent)); |
72 | 72 | $dummyhtml = '<html><head><meta http-equiv="content-type" content="text/html; charset=' |
73 | - . _CHARSET |
|
74 | - . '"><meta http-equiv="content-language" content="' |
|
75 | - . _LANGCODE |
|
76 | - . '"><title>' |
|
77 | - . $xoopsConfig['sitename'] |
|
78 | - . '</title><link rel="stylesheet" type="text/css" media="all" href="' |
|
79 | - . getcss($xoopsConfig['theme_set']) |
|
80 | - . '"></head><body><table><tr><th>' |
|
81 | - . $myblock->getVar('title') |
|
82 | - . '</th></tr><tr><td>' |
|
83 | - . $myblock->getContent('S', $bctype) |
|
84 | - . '</td></tr></table></body></html>'; |
|
73 | + . _CHARSET |
|
74 | + . '"><meta http-equiv="content-language" content="' |
|
75 | + . _LANGCODE |
|
76 | + . '"><title>' |
|
77 | + . $xoopsConfig['sitename'] |
|
78 | + . '</title><link rel="stylesheet" type="text/css" media="all" href="' |
|
79 | + . getcss($xoopsConfig['theme_set']) |
|
80 | + . '"></head><body><table><tr><th>' |
|
81 | + . $myblock->getVar('title') |
|
82 | + . '</th></tr><tr><td>' |
|
83 | + . $myblock->getContent('S', $bctype) |
|
84 | + . '</td></tr></table></body></html>'; |
|
85 | 85 | |
86 | 86 | $dummyfile = '_dummyfile_' . time() . '.html'; |
87 | 87 | $fp = fopen(XOOPS_CACHE_PATH . '/' . $dummyfile, 'w'); |
@@ -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 + |
@@ -6,5 +6,5 @@ |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -include __DIR__ . '/../../mainfile.php'; |
|
10 | -require_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
9 | +include __DIR__.'/../../mainfile.php'; |
|
10 | +require_once XOOPS_ROOT_PATH.'/include/comment_new.php'; |
@@ -274,7 +274,7 @@ |
||
274 | 274 | define('_AM_SF_STATUS_EXP', "Status<span style='font-size: xx-small; font-weight: normal; display: block;'>Select the status of the Q&A.</span>"); |
275 | 275 | define('_AM_SF_SUBMISSIONSMNGMT', 'Submitted Q&A'); |
276 | 276 | define('_AM_SF_SPECIFIC_URL_SELECT', 'Specific URL...'); |
277 | -define('_AM_SF_SPECIFIC_URL', "Specific URL</span><span style='font-size: xx-small; font-weight: normal; display: block;'>If you have set the 'Contextually link to<br>this module' to <i>" . _AM_SF_SPECIFIC_URL_SELECT . "</i>, please<br>specify the URL.<br>\n<b>Example :</b> modules/newbb</span>"); |
|
277 | +define('_AM_SF_SPECIFIC_URL', "Specific URL</span><span style='font-size: xx-small; font-weight: normal; display: block;'>If you have set the 'Contextually link to<br>this module' to <i>"._AM_SF_SPECIFIC_URL_SELECT."</i>, please<br>specify the URL.<br>\n<b>Example :</b> modules/newbb</span>"); |
|
278 | 278 | define('_AM_SF_SUBMISSION_MODERATE', "Moderate this Q&A's submission"); |
279 | 279 | define('_AM_SF_SUBMITTED', 'Submitted'); |
280 | 280 | define('_AM_SF_SUBMITTED_EXP', '<b>Submitted Q&A</b> : Q&A that have been submitted by users. Once approved, they will be displayed in the Q&A section.'); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | define('_AM_SF_CONTEXTMODULELINK', 'Contextually linked to this module'); |
79 | 79 | define( |
80 | 80 | '_AM_SF_CONTEXTMODULELINK_FAQ', |
81 | - "Contextually linked to this module<span style='font-size: xx-small; font-weight: normal; display: block;'>Select the module to which this Q&A will be<br>linked. If the Contextual FAQ block is visible<br>on that module, the 'How do I' statement of<br>this Q&A will be displayed.</span>" |
|
81 | + "Contextually linked to this module<span style='font-size: xx-small; font-weight: normal; display: block;'>Select the module to which this Q&A will be<br>linked. If the Contextual FAQ block is visible<br>on that module, the 'How do I' statement of<br>this Q&A will be displayed.</span>" |
|
82 | 82 | ); |
83 | 83 | define('_AM_SF_CONTEXTOPTIONS', 'Contextual options'); |
84 | 84 | define('_AM_SF_CONTEXTPAGE', 'Contextually linked to this URL'); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | define('_AM_SF_ERROR_FAQ_NOT_SAVED', 'An error occured. The Q&A was not saved in the database.'); |
122 | 122 | define( |
123 | 123 | '_AM_SF_EXACTURL', |
124 | - "Exact URL?<span style='font-size: xx-small; font-weight: normal; display: block;'>If set to 'Yes', the Q&A will only display in the'Specific URL set above'. If set to 'No', the Q&A will be displayed in all pages that match a part of the root of the specific URL. ie; modules/newbb/*.php</span>" |
|
124 | + "Exact URL?<span style='font-size: xx-small; font-weight: normal; display: block;'>If set to 'Yes', the Q&A will only display in the'Specific URL set above'. If set to 'No', the Q&A will be displayed in all pages that match a part of the root of the specific URL. ie; modules/newbb/*.php</span>" |
|
125 | 125 | ); |
126 | 126 | define('_AM_SF_FAQ_EDIT', 'Edit this Q&A'); |
127 | 127 | define('_AM_SF_FAQ_NEW_ANSWER_PUBLISHED', 'The original answer was replaced by this answer.'); |
@@ -385,7 +385,7 @@ |
||
385 | 385 | |
386 | 386 | //Help |
387 | 387 | define('_MI_SF_DIRNAME', basename(dirname(dirname(__DIR__)))); |
388 | -define('_MI_SF_HELP_HEADER', __DIR__ . '/help/helpheader.tpl'); |
|
388 | +define('_MI_SF_HELP_HEADER', __DIR__.'/help/helpheader.tpl'); |
|
389 | 389 | define('_MI_SF_BACK_2_ADMIN', 'Back to Administration of '); |
390 | 390 | define('_MI_SF_OVERVIEW', 'Overview'); |
391 | 391 |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | define('_MI_SF_REQUESTINTROMSGDSC', 'Introduction message to be displayed in the Request a Q&A page of the module.'); |
116 | 116 | define( |
117 | 117 | '_MI_SF_REQUESTINTROMSGDEF', |
118 | - 'You did not find the answer to the question you were looking for? No problem! Simply fill the following form in order to request the answer for a new question. The site administrator will review your request and publish this new question in the Open Questions section for someone to answer it!' |
|
118 | + 'You did not find the answer to the question you were looking for? No problem! Simply fill the following form in order to request the answer for a new question. The site administrator will review your request and publish this new question in the Open Questions section for someone to answer it!' |
|
119 | 119 | ); |
120 | 120 | |
121 | 121 | define('_MI_SF_OPENINTROMSG', 'Open Questions section introduction message:'); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | define('_MI_SF_HELP_PATH_SELECT', "Path of SmartFAQ's help files"); |
129 | 129 | define( |
130 | 130 | '_MI_SF_HELP_PATH_SELECT_DSC', |
131 | - "SELECT FROM where you would LIKE TO access SmartFAQ's help files. If you downloaded the 'SmartFAQ's Help Package' AND uploaded it IN 'modules/smartfaq/doc/', you can SELECT 'Inside the module'. Alternatively, you can access the module's help file directly from docs.xoops.org by chosing this in the selector. You can also select 'Custom Path' and specify yourself the path of the help files in the next config option 'Custom path of SmartFAQ's help files'" |
|
131 | + "SELECT FROM where you would LIKE TO access SmartFAQ's help files. If you downloaded the 'SmartFAQ's Help Package' AND uploaded it IN 'modules/smartfaq/doc/', you can SELECT 'Inside the module'. Alternatively, you can access the module's help file directly from docs.xoops.org by chosing this in the selector. You can also select 'Custom Path' and specify yourself the path of the help files in the next config option 'Custom path of SmartFAQ's help files'" |
|
132 | 132 | ); |
133 | 133 | |
134 | 134 | define('_MI_SF_HELP_PATH_CUSTOM', "Custom path of SmartFAQ's help files"); |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | define('_MI_SF_DIR_ATTACHMENT', 'Attachments physical path.'); |
352 | 352 | define( |
353 | 353 | '_MI_SF_DIR_ATTACHMENT_DESC', |
354 | - "Physical path only needs to be set from your xoops root and not before, for example you may have attachments uploaded to www.yoururl.com/uploads/newbb the path entered would then be '/uploads/newbb' never include a trailing slash '/' the thumbnails path becomes '/uploads/newbb/thumbs'" |
|
354 | + "Physical path only needs to be set from your xoops root and not before, for example you may have attachments uploaded to www.yoururl.com/uploads/newbb the path entered would then be '/uploads/newbb' never include a trailing slash '/' the thumbnails path becomes '/uploads/newbb/thumbs'" |
|
355 | 355 | ); |
356 | 356 | define('_MI_SF_PATH_MAGICK', 'Path for ImageMagick'); |
357 | 357 | define('_MI_SF_PATH_MAGICK_DESC', "Usually it is '/usr/bin/X11'. Leave it BLANK if you do not have ImageMagicK installed or for autodetecting."); |
@@ -6,5 +6,5 @@ |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -include __DIR__ . '/../../mainfile.php'; |
|
10 | -require_once XOOPS_ROOT_PATH . '/include/comment_delete.php'; |
|
9 | +include __DIR__.'/../../mainfile.php'; |
|
10 | +require_once XOOPS_ROOT_PATH.'/include/comment_delete.php'; |
@@ -116,13 +116,13 @@ |
||
116 | 116 | // Language constants |
117 | 117 | $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
118 | 118 | $xoopsTpl->assign([ |
119 | - 'lang_on' => _MD_SF_ON, |
|
120 | - 'lang_postedby' => _MD_SF_POSTEDBY, |
|
121 | - 'lang_total' => $totalQnasOnPage, |
|
122 | - 'lang_faq' => _MD_SF_FAQ, |
|
123 | - 'lang_datesub' => _MD_SF_DATESUB, |
|
124 | - 'lang_hits' => _MD_SF_HITS |
|
125 | - ]); |
|
119 | + 'lang_on' => _MD_SF_ON, |
|
120 | + 'lang_postedby' => _MD_SF_POSTEDBY, |
|
121 | + 'lang_total' => $totalQnasOnPage, |
|
122 | + 'lang_faq' => _MD_SF_FAQ, |
|
123 | + 'lang_datesub' => _MD_SF_DATESUB, |
|
124 | + 'lang_hits' => _MD_SF_HITS |
|
125 | + ]); |
|
126 | 126 | |
127 | 127 | $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
128 | 128 | $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename'])); |
@@ -9,15 +9,15 @@ 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 | // At which record shall we start for the Categories |
17 | -$catstart = isset($_GET['catstart']) ? (int)$_GET['catstart'] : 0; |
|
17 | +$catstart = isset($_GET['catstart']) ? (int) $_GET['catstart'] : 0; |
|
18 | 18 | |
19 | 19 | // At which record shall we start for the FAQs |
20 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
20 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
21 | 21 | |
22 | 22 | // Creating the category handler object |
23 | 23 | $categoryHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Category'); |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | |
47 | 47 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl'; |
48 | 48 | |
49 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
50 | -require_once __DIR__ . '/footer.php'; |
|
49 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
50 | +require_once __DIR__.'/footer.php'; |
|
51 | 51 | |
52 | 52 | //get all categories for future reference |
53 | 53 | $allcategories = $categoryHandler->getObjects(null, true); |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
70 | 70 | if (isset($last_qnaObj[$subcat_id])) { |
71 | 71 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
72 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>'); |
|
72 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>'); |
|
73 | 73 | } |
74 | 74 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
75 | 75 | $categories[$cat_id]['subcats'][$subcat_id] = $subcat->toArray(null, true); |
76 | - $total += $totalQnas[$subcat_id]; |
|
76 | + $total += $totalQnas[$subcat_id]; |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | $memberHandler = xoops_getHandler('member'); |
108 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
108 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
109 | 109 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
110 | 110 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
111 | 111 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | } |
120 | 120 | // Language constants |
121 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
121 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
122 | 122 | $xoopsTpl->assign([ |
123 | 123 | 'lang_on' => _MD_SF_ON, |
124 | 124 | 'lang_postedby' => _MD_SF_POSTEDBY, |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | 'lang_hits' => _MD_SF_HITS |
129 | 129 | ]); |
130 | 130 | |
131 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
131 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
132 | 132 | $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename'])); |
133 | 133 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['openquestionintromsg'], 1)); |
134 | 134 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_QUESTIONS); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION); |
137 | 137 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
138 | 138 | $xoopsTpl->assign('sectionname', $moduleName); |
139 | -$xoopsTpl->assign('whereInSection', "<a href='index.php'>" . $moduleName . '</a> > ' . _MD_SF_OPEN_SECTION); |
|
139 | +$xoopsTpl->assign('whereInSection', "<a href='index.php'>".$moduleName.'</a> > '._MD_SF_OPEN_SECTION); |
|
140 | 140 | |
141 | 141 | $xoopsTpl->assign('displayFull', false); |
142 | 142 | $xoopsTpl->assign('displaylastfaqs', $xoopsModuleConfig['displaylastfaqs']); |
@@ -152,25 +152,25 @@ discard block |
||
152 | 152 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
153 | 153 | |
154 | 154 | // Category Navigation Bar |
155 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
155 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
156 | 156 | $pagenav = new \XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', ''); |
157 | 157 | if (1 == $xoopsModuleConfig['useimagenavpage']) { |
158 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
158 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
159 | 159 | } else { |
160 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
160 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | // FAQ Navigation Bar |
164 | 164 | $pagenav = new \XoopsPageNav($totalFaqs, $xoopsModuleConfig['indexperpage'], $start, 'start', ''); |
165 | 165 | if (1 == $xoopsModuleConfig['useimagenavpage']) { |
166 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
166 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
167 | 167 | } else { |
168 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
168 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | // Page Title Hack by marcan |
172 | 172 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
173 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category->getVar('name')); |
|
173 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category->getVar('name')); |
|
174 | 174 | // End Page Title Hack by marcan |
175 | 175 | |
176 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
176 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
@@ -15,12 +15,12 @@ |
||
15 | 15 | $xoopsTpl->assign('isAdmin', $isAdmin); |
16 | 16 | |
17 | 17 | $xoopsTpl->assign([ |
18 | - 'lang_on' => _MD_SF_ON, |
|
19 | - 'lang_postedby' => _MD_SF_POSTEDBY, |
|
20 | - 'lang_faq' => _MD_SF_QUESTION, |
|
21 | - 'lang_datesub' => _MD_SF_DATESUB, |
|
22 | - 'lang_hits' => _MD_SF_HITS |
|
23 | - ]); |
|
18 | + 'lang_on' => _MD_SF_ON, |
|
19 | + 'lang_postedby' => _MD_SF_POSTEDBY, |
|
20 | + 'lang_faq' => _MD_SF_QUESTION, |
|
21 | + 'lang_datesub' => _MD_SF_DATESUB, |
|
22 | + 'lang_hits' => _MD_SF_HITS |
|
23 | + ]); |
|
24 | 24 | $xoopsTpl->assign('sectionname', $myts->displayTarea($xoopsModule->getVar('name'))); |
25 | 25 | |
26 | 26 | $xoopsTpl->assign('modulename', $xoopsModule->dirname()); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $uid = $xoopsUser ? $xoopsUser->getVar('uid') : 0; |
14 | 14 | $isAdmin = (Smartfaq\Utility::userIsAdmin() || Smartfaq\Utility::getModerator()); |
15 | 15 | |
16 | -$xoopsTpl->assign('sf_adminpage', "<a href='" . XOOPS_URL . "/modules/smartfaq/admin/index.php'>" . _MD_SF_ADMIN_PAGE . '</a>'); |
|
16 | +$xoopsTpl->assign('sf_adminpage', "<a href='".XOOPS_URL."/modules/smartfaq/admin/index.php'>"._MD_SF_ADMIN_PAGE.'</a>'); |
|
17 | 17 | $xoopsTpl->assign('isAdmin', $isAdmin); |
18 | 18 | |
19 | 19 | $xoopsTpl->assign([ |
@@ -36,4 +36,4 @@ discard block |
||
36 | 36 | |
37 | 37 | $xoopsTpl->assign('ref_smartfaq', 'SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)'); |
38 | 38 | |
39 | -$xoopsTpl->assign('xoops_module_header', "<link rel='stylesheet' type='text/css' href='" . XOOPS_URL . "/modules/smartfaq/assets/css/smartfaq.css'>"); |
|
39 | +$xoopsTpl->assign('xoops_module_header', "<link rel='stylesheet' type='text/css' href='".XOOPS_URL."/modules/smartfaq/assets/css/smartfaq.css'>"); |
@@ -46,18 +46,18 @@ discard block |
||
46 | 46 | |
47 | 47 | echo '<tr>'; |
48 | 48 | echo "<td class='even' align='lefet'>" |
49 | - . $spaces |
|
50 | - . "<a href='" |
|
51 | - . XOOPS_URL |
|
52 | - . '/modules/' |
|
53 | - . $xoopsModule->dirname() |
|
54 | - . '/category.php?categoryid=' |
|
55 | - . $categoryObj->categoryid() |
|
56 | - . "'><img src='" |
|
57 | - . XOOPS_URL |
|
58 | - . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''> " |
|
59 | - . $categoryObj->name() |
|
60 | - . '</a></td>'; |
|
49 | + . $spaces |
|
50 | + . "<a href='" |
|
51 | + . XOOPS_URL |
|
52 | + . '/modules/' |
|
53 | + . $xoopsModule->dirname() |
|
54 | + . '/category.php?categoryid=' |
|
55 | + . $categoryObj->categoryid() |
|
56 | + . "'><img src='" |
|
57 | + . XOOPS_URL |
|
58 | + . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''> " |
|
59 | + . $categoryObj->name() |
|
60 | + . '</a></td>'; |
|
61 | 61 | echo "<td class='even' align='left'>" . $description . '</td>'; |
62 | 62 | echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>'; |
63 | 63 | echo "<td class='even' align='center'> $modify $delete </td>"; |
@@ -314,11 +314,11 @@ discard block |
||
314 | 314 | $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
315 | 315 | xoops_cp_header(); |
316 | 316 | xoops_confirm([ |
317 | - 'op' => 'del', |
|
318 | - 'categoryid' => $categoryObj->categoryid(), |
|
319 | - 'confirm' => 1, |
|
320 | - 'name' => $categoryObj->name() |
|
321 | - ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
317 | + 'op' => 'del', |
|
318 | + 'categoryid' => $categoryObj->categoryid(), |
|
319 | + 'confirm' => 1, |
|
320 | + 'name' => $categoryObj->name() |
|
321 | + ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
322 | 322 | xoops_cp_footer(); |
323 | 323 | } |
324 | 324 | exit(); |
@@ -231,149 +231,149 @@ |
||
231 | 231 | } |
232 | 232 | |
233 | 233 | switch ($op) { |
234 | - case 'mod': |
|
235 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
236 | - $destList = isset($_POST['destList']) ? $_POST['destList'] : ''; |
|
237 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
238 | - xoops_cp_header(); |
|
234 | + case 'mod': |
|
235 | + $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
236 | + $destList = isset($_POST['destList']) ? $_POST['destList'] : ''; |
|
237 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
238 | + xoops_cp_header(); |
|
239 | 239 | |
240 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
241 | - editcat(true, $categoryid); |
|
242 | - break; |
|
240 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
241 | + editcat(true, $categoryid); |
|
242 | + break; |
|
243 | 243 | |
244 | - case 'addcategory': |
|
245 | - global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid; |
|
244 | + case 'addcategory': |
|
245 | + global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid; |
|
246 | 246 | |
247 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
247 | + $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
248 | 248 | |
249 | - if (0 != $categoryid) { |
|
250 | - $categoryObj = new Smartfaq\Category($categoryid); |
|
251 | - } else { |
|
252 | - $categoryObj = $categoryHandler->create(); |
|
253 | - } |
|
249 | + if (0 != $categoryid) { |
|
250 | + $categoryObj = new Smartfaq\Category($categoryid); |
|
251 | + } else { |
|
252 | + $categoryObj = $categoryHandler->create(); |
|
253 | + } |
|
254 | 254 | |
255 | - //if (isset($_POST['allmods'])) $allmods = $_POST['allmods']; |
|
256 | - //if (isset($_POST['moderators'])) $moderators = $_POST['moderators']; |
|
255 | + //if (isset($_POST['allmods'])) $allmods = $_POST['allmods']; |
|
256 | + //if (isset($_POST['moderators'])) $moderators = $_POST['moderators']; |
|
257 | 257 | |
258 | - $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0); |
|
259 | - $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0; |
|
260 | - $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1); |
|
258 | + $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0); |
|
259 | + $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0; |
|
260 | + $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1); |
|
261 | 261 | |
262 | - // Groups and permissions |
|
263 | - if (isset($_POST['groups_read'])) { |
|
264 | - $categoryObj->setGroups_read($_POST['groups_read']); |
|
265 | - } else { |
|
266 | - $categoryObj->setGroups_read(); |
|
267 | - } |
|
268 | - // $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array(); |
|
269 | - // $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array(); |
|
270 | - |
|
271 | - $categoryObj->setVar('name', $_POST['name']); |
|
272 | - |
|
273 | - $categoryObj->setVar('description', $_POST['description']); |
|
274 | - if ($categoryObj->isNew()) { |
|
275 | - $redirect_msg = _AM_SF_CATCREATED; |
|
276 | - $redirect_to = 'category.php?op=mod'; |
|
277 | - } else { |
|
278 | - $redirect_msg = _AM_SF_COLMODIFIED; |
|
279 | - $redirect_to = 'category.php'; |
|
280 | - } |
|
281 | - |
|
282 | - if (!$categoryObj->store()) { |
|
283 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . Smartfaq\Utility::formatErrors($categoryObj->getErrors())); |
|
284 | - } |
|
285 | - // TODO : put this function in the category class |
|
286 | - Smartfaq\Utility::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
|
287 | - //Smartfaq\Utility::saveCategoryPermissions($groups_admin, $categoriesObj->categoryid(), 'category_admin'); |
|
262 | + // Groups and permissions |
|
263 | + if (isset($_POST['groups_read'])) { |
|
264 | + $categoryObj->setGroups_read($_POST['groups_read']); |
|
265 | + } else { |
|
266 | + $categoryObj->setGroups_read(); |
|
267 | + } |
|
268 | + // $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array(); |
|
269 | + // $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array(); |
|
270 | + |
|
271 | + $categoryObj->setVar('name', $_POST['name']); |
|
272 | + |
|
273 | + $categoryObj->setVar('description', $_POST['description']); |
|
274 | + if ($categoryObj->isNew()) { |
|
275 | + $redirect_msg = _AM_SF_CATCREATED; |
|
276 | + $redirect_to = 'category.php?op=mod'; |
|
277 | + } else { |
|
278 | + $redirect_msg = _AM_SF_COLMODIFIED; |
|
279 | + $redirect_to = 'category.php'; |
|
280 | + } |
|
288 | 281 | |
289 | - if ($applyall) { |
|
282 | + if (!$categoryObj->store()) { |
|
283 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . Smartfaq\Utility::formatErrors($categoryObj->getErrors())); |
|
284 | + } |
|
290 | 285 | // TODO : put this function in the category class |
291 | - Smartfaq\Utility::overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid()); |
|
292 | - } |
|
286 | + Smartfaq\Utility::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
|
287 | + //Smartfaq\Utility::saveCategoryPermissions($groups_admin, $categoriesObj->categoryid(), 'category_admin'); |
|
293 | 288 | |
294 | - redirect_header($redirect_to, 2, $redirect_msg); |
|
295 | - break; |
|
289 | + if ($applyall) { |
|
290 | + // TODO : put this function in the category class |
|
291 | + Smartfaq\Utility::overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid()); |
|
292 | + } |
|
296 | 293 | |
297 | - case 'del': |
|
298 | - global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; |
|
294 | + redirect_header($redirect_to, 2, $redirect_msg); |
|
295 | + break; |
|
299 | 296 | |
300 | - $module_id = $xoopsModule->getVar('mid'); |
|
301 | - $gpermHandler = xoops_getHandler('groupperm'); |
|
297 | + case 'del': |
|
298 | + global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; |
|
302 | 299 | |
303 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
304 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid; |
|
300 | + $module_id = $xoopsModule->getVar('mid'); |
|
301 | + $gpermHandler = xoops_getHandler('groupperm'); |
|
305 | 302 | |
306 | - $categoryObj = new Smartfaq\Category($categoryid); |
|
303 | + $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
304 | + $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid; |
|
307 | 305 | |
308 | - $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
|
309 | - $name = isset($_POST['name']) ? $_POST['name'] : ''; |
|
306 | + $categoryObj = new Smartfaq\Category($categoryid); |
|
310 | 307 | |
311 | - if ($confirm) { |
|
312 | - if (!$categoryHandler->delete($categoryObj)) { |
|
313 | - redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR); |
|
308 | + $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
|
309 | + $name = isset($_POST['name']) ? $_POST['name'] : ''; |
|
310 | + |
|
311 | + if ($confirm) { |
|
312 | + if (!$categoryHandler->delete($categoryObj)) { |
|
313 | + redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR); |
|
314 | + } |
|
315 | + redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name)); |
|
316 | + } else { |
|
317 | + // no confirm: show deletion condition |
|
318 | + $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
319 | + xoops_cp_header(); |
|
320 | + xoops_confirm([ |
|
321 | + 'op' => 'del', |
|
322 | + 'categoryid' => $categoryObj->categoryid(), |
|
323 | + 'confirm' => 1, |
|
324 | + 'name' => $categoryObj->name() |
|
325 | + ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
326 | + xoops_cp_footer(); |
|
314 | 327 | } |
315 | - redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name)); |
|
316 | - } else { |
|
317 | - // no confirm: show deletion condition |
|
318 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
328 | + exit(); |
|
329 | + break; |
|
330 | + |
|
331 | + case 'cancel': |
|
332 | + redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, '')); |
|
333 | + break; |
|
334 | + case 'default': |
|
335 | + default: |
|
336 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
319 | 337 | xoops_cp_header(); |
320 | - xoops_confirm([ |
|
321 | - 'op' => 'del', |
|
322 | - 'categoryid' => $categoryObj->categoryid(), |
|
323 | - 'confirm' => 1, |
|
324 | - 'name' => $categoryObj->name() |
|
325 | - ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
326 | - xoops_cp_footer(); |
|
327 | - } |
|
328 | - exit(); |
|
329 | - break; |
|
330 | - |
|
331 | - case 'cancel': |
|
332 | - redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, '')); |
|
333 | - break; |
|
334 | - case 'default': |
|
335 | - default: |
|
336 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
337 | - xoops_cp_header(); |
|
338 | - |
|
339 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
340 | - echo "<br>\n"; |
|
341 | 338 | |
342 | - // Creating the objects for top categories |
|
343 | - $categoriesObj =& $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0); |
|
344 | - |
|
345 | - Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
|
346 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
347 | - echo "<div id='toptable'>"; |
|
348 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
349 | - |
|
350 | - echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
|
351 | - echo '<tr>'; |
|
352 | - echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
353 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
354 | - echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
355 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
356 | - echo '</tr>'; |
|
357 | - $totalCategories = $categoryHandler->getCategoriesCount(0); |
|
358 | - if (count($categoriesObj) > 0) { |
|
359 | - foreach ($categoriesObj as $key => $thiscat) { |
|
360 | - displayCategory($thiscat); |
|
361 | - } |
|
362 | - } else { |
|
339 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
340 | + echo "<br>\n"; |
|
341 | + |
|
342 | + // Creating the objects for top categories |
|
343 | + $categoriesObj =& $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0); |
|
344 | + |
|
345 | + Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
|
346 | + echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
347 | + echo "<div id='toptable'>"; |
|
348 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
349 | + |
|
350 | + echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
|
363 | 351 | echo '<tr>'; |
364 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
352 | + echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
353 | + echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
354 | + echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
355 | + echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
365 | 356 | echo '</tr>'; |
366 | - $categoryid = '0'; |
|
367 | - } |
|
368 | - echo "</table>\n"; |
|
369 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
370 | - $pagenav = new \XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory'); |
|
371 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
372 | - echo '</div>'; |
|
357 | + $totalCategories = $categoryHandler->getCategoriesCount(0); |
|
358 | + if (count($categoriesObj) > 0) { |
|
359 | + foreach ($categoriesObj as $key => $thiscat) { |
|
360 | + displayCategory($thiscat); |
|
361 | + } |
|
362 | + } else { |
|
363 | + echo '<tr>'; |
|
364 | + echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
365 | + echo '</tr>'; |
|
366 | + $categoryid = '0'; |
|
367 | + } |
|
368 | + echo "</table>\n"; |
|
369 | + require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
370 | + $pagenav = new \XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory'); |
|
371 | + echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
372 | + echo '</div>'; |
|
373 | 373 | |
374 | - editcat(false); |
|
374 | + editcat(false); |
|
375 | 375 | |
376 | - break; |
|
376 | + break; |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | require_once __DIR__ . '/admin_footer.php'; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | use XoopsModules\Smartfaq; |
10 | 10 | |
11 | -require_once __DIR__ . '/admin_header.php'; |
|
11 | +require_once __DIR__.'/admin_header.php'; |
|
12 | 12 | |
13 | 13 | // Creating the category handler object |
14 | 14 | /** @var \XoopsModules\Smartfaq\CategoryHandler $categoryHandler */ |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | // Where do we start? |
27 | -$startcategory = isset($_GET['startcategory']) ? (int)$_GET['startcategory'] : 0; |
|
27 | +$startcategory = isset($_GET['startcategory']) ? (int) $_GET['startcategory'] : 0; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @param XoopsObject $categoryObj |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | $description = $categoryObj->description(); |
37 | 37 | if (!XOOPS_USE_MULTIBYTES) { |
38 | 38 | if (strlen($description) >= 100) { |
39 | - $description = substr($description, 0, 100 - 1) . '...'; |
|
39 | + $description = substr($description, 0, 100-1).'...'; |
|
40 | 40 | } |
41 | 41 | } |
42 | - $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITCOL . "' alt='" . _AM_SF_EDITCOL . "'></a>"; |
|
43 | - $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETECOL . "' alt='" . _AM_SF_DELETECOL . "'></a>"; |
|
42 | + $modify = "<a href='category.php?op=mod&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITCOL."' alt='"._AM_SF_EDITCOL."'></a>"; |
|
43 | + $delete = "<a href='category.php?op=del&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETECOL."' alt='"._AM_SF_DELETECOL."'></a>"; |
|
44 | 44 | |
45 | 45 | $spaces = ''; |
46 | 46 | for ($j = 0; $j < $level; ++$j) { |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''> " |
62 | 62 | . $categoryObj->name() |
63 | 63 | . '</a></td>'; |
64 | - echo "<td class='even' align='left'>" . $description . '</td>'; |
|
65 | - echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>'; |
|
64 | + echo "<td class='even' align='left'>".$description.'</td>'; |
|
65 | + echo "<td class='even' align='center'>".$categoryObj->weight().'</td>'; |
|
66 | 66 | echo "<td class='even' align='center'> $modify $delete </td>"; |
67 | 67 | echo '</tr>'; |
68 | - $subCategoriesObj =& $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
|
68 | + $subCategoriesObj = & $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
|
69 | 69 | if (count($subCategoriesObj) > 0) { |
70 | 70 | ++$level; |
71 | 71 | foreach ($subCategoriesObj as $key => $thiscat) { |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | { |
84 | 84 | //$moderators = array(); // just to define the variable |
85 | 85 | //$allmods = array(); |
86 | - $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
|
86 | + $startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0; |
|
87 | 87 | global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $_GET; |
88 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
88 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
89 | 89 | |
90 | 90 | // Creating the faq handler object |
91 | 91 | /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */ |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | redirect_header('category.php', 1, _AM_SF_NOCOLTOEDIT); |
109 | 109 | } |
110 | 110 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
111 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_EDITCOL . '</h3>'; |
|
111 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_EDITCOL.'</h3>'; |
|
112 | 112 | echo "<div id='bottomtable'>"; |
113 | 113 | } else { |
114 | 114 | $categoryObj = $categoryHandler->create(); |
115 | 115 | echo "<br>\n"; |
116 | 116 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
117 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORY_CREATE . '</h3>'; |
|
117 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_CATEGORY_CREATE.'</h3>'; |
|
118 | 118 | echo "<div id='bottomtable'>"; |
119 | 119 | } |
120 | 120 | // Start category form |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | $sform->addElement($groups_read_checkbox); |
161 | 161 | // Apply permissions on all faqs |
162 | - $addapplyall_radio = new \XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
162 | + $addapplyall_radio = new \XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
163 | 163 | $sform->addElement($addapplyall_radio); |
164 | 164 | // MODERATORS |
165 | 165 | //$moderators_tray = new \XoopsFormElementTray(_AM_SF_MODERATORS_DEF, ''); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | echo '</div>'; |
225 | 225 | |
226 | 226 | if ($categoryid) { |
227 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php'; |
|
227 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php'; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | unset($hidden); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | switch ($op) { |
234 | 234 | case 'mod': |
235 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
235 | + $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
236 | 236 | $destList = isset($_POST['destList']) ? $_POST['destList'] : ''; |
237 | 237 | $adminObject = \Xmf\Module\Admin::getInstance(); |
238 | 238 | xoops_cp_header(); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | case 'addcategory': |
245 | 245 | global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid; |
246 | 246 | |
247 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
247 | + $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0; |
|
248 | 248 | |
249 | 249 | if (0 != $categoryid) { |
250 | 250 | $categoryObj = new Smartfaq\Category($categoryid); |
@@ -255,9 +255,9 @@ discard block |
||
255 | 255 | //if (isset($_POST['allmods'])) $allmods = $_POST['allmods']; |
256 | 256 | //if (isset($_POST['moderators'])) $moderators = $_POST['moderators']; |
257 | 257 | |
258 | - $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0); |
|
259 | - $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0; |
|
260 | - $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1); |
|
258 | + $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int) $_POST['parentid'] : 0); |
|
259 | + $applyall = isset($_POST['applyall']) ? (int) $_POST['applyall'] : 0; |
|
260 | + $categoryObj->setVar('weight', isset($_POST['weight']) ? (int) $_POST['weight'] : 1); |
|
261 | 261 | |
262 | 262 | // Groups and permissions |
263 | 263 | if (isset($_POST['groups_read'])) { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | } |
281 | 281 | |
282 | 282 | if (!$categoryObj->store()) { |
283 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . Smartfaq\Utility::formatErrors($categoryObj->getErrors())); |
|
283 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR.Smartfaq\Utility::formatErrors($categoryObj->getErrors())); |
|
284 | 284 | } |
285 | 285 | // TODO : put this function in the category class |
286 | 286 | Smartfaq\Utility::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
@@ -300,8 +300,8 @@ discard block |
||
300 | 300 | $module_id = $xoopsModule->getVar('mid'); |
301 | 301 | $gpermHandler = xoops_getHandler('groupperm'); |
302 | 302 | |
303 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
304 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid; |
|
303 | + $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0; |
|
304 | + $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : $categoryid; |
|
305 | 305 | |
306 | 306 | $categoryObj = new Smartfaq\Category($categoryid); |
307 | 307 | |
@@ -315,14 +315,14 @@ discard block |
||
315 | 315 | redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name)); |
316 | 316 | } else { |
317 | 317 | // no confirm: show deletion condition |
318 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
318 | + $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
319 | 319 | xoops_cp_header(); |
320 | 320 | xoops_confirm([ |
321 | 321 | 'op' => 'del', |
322 | 322 | 'categoryid' => $categoryObj->categoryid(), |
323 | 323 | 'confirm' => 1, |
324 | 324 | 'name' => $categoryObj->name() |
325 | - ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
325 | + ], 'category.php', _AM_SF_DELETECOL." '".$categoryObj->name()."'. <br> <br>"._AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
326 | 326 | xoops_cp_footer(); |
327 | 327 | } |
328 | 328 | exit(); |
@@ -340,19 +340,19 @@ discard block |
||
340 | 340 | echo "<br>\n"; |
341 | 341 | |
342 | 342 | // Creating the objects for top categories |
343 | - $categoriesObj =& $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0); |
|
343 | + $categoriesObj = & $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0); |
|
344 | 344 | |
345 | 345 | Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
346 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
346 | + echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_CATEGORIES_TITLE.'</h3>'; |
|
347 | 347 | echo "<div id='toptable'>"; |
348 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
348 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_CATEGORIES_DSC.'</span>'; |
|
349 | 349 | |
350 | 350 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
351 | 351 | echo '<tr>'; |
352 | - echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
353 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
354 | - echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
355 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
352 | + echo "<th width='35%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
353 | + echo "<th class='bg3' align='left'><b>"._AM_SF_DESCRIP.'</b></td>'; |
|
354 | + echo "<th class='bg3' width='65' align='center'><b>"._AM_SF_WEIGHT.'</b></td>'; |
|
355 | + echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
356 | 356 | echo '</tr>'; |
357 | 357 | $totalCategories = $categoryHandler->getCategoriesCount(0); |
358 | 358 | if (count($categoriesObj) > 0) { |
@@ -361,14 +361,14 @@ discard block |
||
361 | 361 | } |
362 | 362 | } else { |
363 | 363 | echo '<tr>'; |
364 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
364 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOCAT.'</td>'; |
|
365 | 365 | echo '</tr>'; |
366 | 366 | $categoryid = '0'; |
367 | 367 | } |
368 | 368 | echo "</table>\n"; |
369 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
369 | + require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
370 | 370 | $pagenav = new \XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory'); |
371 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
371 | + echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
372 | 372 | echo '</div>'; |
373 | 373 | |
374 | 374 | editcat(false); |
@@ -376,4 +376,4 @@ discard block |
||
376 | 376 | break; |
377 | 377 | } |
378 | 378 | |
379 | -require_once __DIR__ . '/admin_footer.php'; |
|
379 | +require_once __DIR__.'/admin_footer.php'; |
@@ -35,22 +35,22 @@ |
||
35 | 35 | |
36 | 36 | if ('category' === $category) { |
37 | 37 | // Assume we have a valid category id |
38 | - $sql = 'SELECT name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' WHERE categoryid = ' . $item_id; |
|
38 | + $sql = 'SELECT name FROM '.$xoopsDB->prefix('smartfaq_categories').' WHERE categoryid = '.$item_id; |
|
39 | 39 | $result = $xoopsDB->queryF($sql); // TODO: error check |
40 | 40 | $result_array = $xoopsDB->fetchArray($result); |
41 | 41 | $item['name'] = $result_array['name']; |
42 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/category.php?categoryid=' . $item_id; |
|
42 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/category.php?categoryid='.$item_id; |
|
43 | 43 | |
44 | 44 | return $item; |
45 | 45 | } |
46 | 46 | |
47 | 47 | if ('faq' === $category) { |
48 | 48 | // Assume we have a valid story id |
49 | - $sql = 'SELECT question FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE faqid = ' . $item_id; |
|
49 | + $sql = 'SELECT question FROM '.$xoopsDB->prefix('smartfaq_faq').' WHERE faqid = '.$item_id; |
|
50 | 50 | $result = $xoopsDB->queryF($sql); // TODO: error check |
51 | 51 | $result_array = $xoopsDB->fetchArray($result); |
52 | 52 | $item['name'] = $result_array['question']; |
53 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/faq.php?faqid=' . $item_id; |
|
53 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/faq.php?faqid='.$item_id; |
|
54 | 54 | |
55 | 55 | return $item; |
56 | 56 | } |