@@ -9,7 +9,7 @@ |
||
9 | 9 | |
10 | 10 | function b_faqs_random_diduno_show() |
11 | 11 | { |
12 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
12 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
13 | 13 | |
14 | 14 | $block = []; |
15 | 15 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | function b_faqs_most_viewed_show($options) |
13 | 13 | { |
14 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
14 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
15 | 15 | |
16 | 16 | $block = []; |
17 | 17 | if ($options[0] == 0) { |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | function b_faqs_most_viewed_edit($options) |
49 | 49 | { |
50 | 50 | global $xoopsDB, $xoopsModule, $xoopsUser; |
51 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
51 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
52 | 52 | |
53 | 53 | $form = sf_createCategorySelect($options[0]); |
54 | 54 | |
55 | - $form .= ' <br>' . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[1] . "'> " . _MB_SF_FAQS . ''; |
|
56 | - $form .= ' <br>' . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[2] . "'> " . _MB_SF_LENGTH . ''; |
|
55 | + $form .= ' <br>'._MB_SF_DISP." <input type='text' name='options[]' value='".$options[1]."'> "._MB_SF_FAQS.''; |
|
56 | + $form .= ' <br>'._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[2]."'> "._MB_SF_LENGTH.''; |
|
57 | 57 | |
58 | 58 | return $form; |
59 | 59 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | function b_faqs_context_show($options) |
13 | 13 | { |
14 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
14 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
15 | 15 | |
16 | 16 | $block = []; |
17 | 17 | |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | */ |
49 | 49 | function b_faqs_context_edit($options) |
50 | 50 | { |
51 | - $form = '' . _MB_SF_DISP . ' '; |
|
52 | - $form .= "<input type='text' name='options[]' value='" . $options[0] . "'> " . _MB_SF_FAQS . ''; |
|
51 | + $form = ''._MB_SF_DISP.' '; |
|
52 | + $form .= "<input type='text' name='options[]' value='".$options[0]."'> "._MB_SF_FAQS.''; |
|
53 | 53 | |
54 | 54 | return $form; |
55 | 55 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | |
10 | 10 | function b_faqs_random_faq_show() |
11 | 11 | { |
12 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
12 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
13 | 13 | |
14 | 14 | $block = []; |
15 | 15 |
@@ -6,16 +6,16 @@ discard block |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -require_once __DIR__ . '/header.php'; |
|
9 | +require_once __DIR__.'/header.php'; |
|
10 | 10 | |
11 | 11 | global $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
12 | 12 | |
13 | 13 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl'; |
14 | 14 | |
15 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
16 | -require_once __DIR__ . '/footer.php'; |
|
15 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
16 | +require_once __DIR__.'/footer.php'; |
|
17 | 17 | |
18 | -$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
18 | +$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
19 | 19 | |
20 | 20 | // Creating the category object for the selected category |
21 | 21 | $categoryObj = new sfCategory($categoryid); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $categoryHandler = sf_gethandler('category'); |
35 | 35 | |
36 | 36 | // At which record shall we start |
37 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
37 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
38 | 38 | |
39 | 39 | // Creating the faq handler object |
40 | 40 | $faqHandler = sf_gethandler('faq'); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $last_qnaObj = $faqHandler->getLastPublishedByCat([_SF_STATUS_OPENED]); |
59 | 59 | if (isset($last_qnaObj[$categoryid])) { |
60 | 60 | $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid')); |
61 | - $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . '</a>'); |
|
61 | + $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50).'</a>'); |
|
62 | 62 | } |
63 | 63 | // Populating the smarty variables with informations related to the selected category |
64 | 64 | $category = $categoryObj->toArray(null, true); |
@@ -77,16 +77,16 @@ discard block |
||
77 | 77 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
78 | 78 | if (isset($last_qnaObj[$subcat_id])) { |
79 | 79 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
80 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>'); |
|
80 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>'); |
|
81 | 81 | } |
82 | 82 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
83 | 83 | $subcats[$subcat_id] = $subcat->toArray(null, true); |
84 | - $catQnasWithSub += $subcats[$subcat_id]['total']; |
|
84 | + $catQnasWithSub += $subcats[$subcat_id]['total']; |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | $xoopsTpl->assign('subcats', $subcats); |
88 | 88 | } |
89 | -$category['total'] = $catQnasWithSub + $totalQnas[$categoryid]; |
|
89 | +$category['total'] = $catQnasWithSub+$totalQnas[$categoryid]; |
|
90 | 90 | if ($faqsObj) { |
91 | 91 | $userids = []; |
92 | 92 | foreach ($faqsObj as $key => $thisfaq) { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | $memberHandler = xoops_getHandler('member'); |
98 | - $users = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
98 | + $users = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
99 | 99 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
100 | 100 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
101 | 101 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | } |
109 | 109 | // Language constants |
110 | -$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . '</a>'); |
|
110 | +$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION.'</a>'); |
|
111 | 111 | $xoopsTpl->assign('modulename', $xoopsModule->dirname()); |
112 | 112 | |
113 | 113 | $xoopsTpl->assign('displaylastfaqs', true); |
@@ -124,19 +124,19 @@ discard block |
||
124 | 124 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
125 | 125 | |
126 | 126 | // The Navigation Bar |
127 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
128 | -$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
127 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
128 | +$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
129 | 129 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
130 | - $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'; |
|
130 | + $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'; |
|
131 | 131 | } else { |
132 | - $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
132 | + $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | $xoopsTpl->assign('category', $category); |
136 | 136 | |
137 | 137 | // Page Title Hack by marcan |
138 | 138 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
139 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
139 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
140 | 140 | // End Page Title Hack by marcan |
141 | 141 | |
142 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
142 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
@@ -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(); |
@@ -227,149 +227,149 @@ |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | switch ($op) { |
230 | - case 'mod': |
|
231 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
232 | - $destList = isset($_POST['destList']) ? $_POST['destList'] : ''; |
|
233 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
234 | - xoops_cp_header(); |
|
235 | - |
|
236 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
237 | - editcat(true, $categoryid); |
|
238 | - break; |
|
230 | + case 'mod': |
|
231 | + $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
232 | + $destList = isset($_POST['destList']) ? $_POST['destList'] : ''; |
|
233 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
234 | + xoops_cp_header(); |
|
239 | 235 | |
240 | - case 'addcategory': |
|
241 | - global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid; |
|
236 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
237 | + editcat(true, $categoryid); |
|
238 | + break; |
|
242 | 239 | |
243 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
240 | + case 'addcategory': |
|
241 | + global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid; |
|
244 | 242 | |
245 | - if ($categoryid != 0) { |
|
246 | - $categoryObj = new sfCategory($categoryid); |
|
247 | - } else { |
|
248 | - $categoryObj = $categoryHandler->create(); |
|
249 | - } |
|
243 | + $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
250 | 244 | |
251 | - //if (isset($_POST['allmods'])) $allmods = $_POST['allmods']; |
|
252 | - //if (isset($_POST['moderators'])) $moderators = $_POST['moderators']; |
|
245 | + if ($categoryid != 0) { |
|
246 | + $categoryObj = new sfCategory($categoryid); |
|
247 | + } else { |
|
248 | + $categoryObj = $categoryHandler->create(); |
|
249 | + } |
|
253 | 250 | |
254 | - $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0); |
|
255 | - $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0; |
|
256 | - $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1); |
|
251 | + //if (isset($_POST['allmods'])) $allmods = $_POST['allmods']; |
|
252 | + //if (isset($_POST['moderators'])) $moderators = $_POST['moderators']; |
|
257 | 253 | |
258 | - // Groups and permissions |
|
259 | - if (isset($_POST['groups_read'])) { |
|
260 | - $categoryObj->setGroups_read($_POST['groups_read']); |
|
261 | - } else { |
|
262 | - $categoryObj->setGroups_read(); |
|
263 | - } |
|
264 | - // $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array(); |
|
265 | - // $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array(); |
|
266 | - |
|
267 | - $categoryObj->setVar('name', $_POST['name']); |
|
268 | - |
|
269 | - $categoryObj->setVar('description', $_POST['description']); |
|
270 | - if ($categoryObj->isNew()) { |
|
271 | - $redirect_msg = _AM_SF_CATCREATED; |
|
272 | - $redirect_to = 'category.php?op=mod'; |
|
273 | - } else { |
|
274 | - $redirect_msg = _AM_SF_COLMODIFIED; |
|
275 | - $redirect_to = 'category.php'; |
|
276 | - } |
|
254 | + $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0); |
|
255 | + $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0; |
|
256 | + $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1); |
|
277 | 257 | |
278 | - if (!$categoryObj->store()) { |
|
279 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors())); |
|
280 | - } |
|
281 | - // TODO : put this function in the category class |
|
282 | - sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
|
283 | - //sf_saveCategory_Permissions($groups_admin, $categoriesObj->categoryid(), 'category_admin'); |
|
258 | + // Groups and permissions |
|
259 | + if (isset($_POST['groups_read'])) { |
|
260 | + $categoryObj->setGroups_read($_POST['groups_read']); |
|
261 | + } else { |
|
262 | + $categoryObj->setGroups_read(); |
|
263 | + } |
|
264 | + // $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array(); |
|
265 | + // $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array(); |
|
266 | + |
|
267 | + $categoryObj->setVar('name', $_POST['name']); |
|
268 | + |
|
269 | + $categoryObj->setVar('description', $_POST['description']); |
|
270 | + if ($categoryObj->isNew()) { |
|
271 | + $redirect_msg = _AM_SF_CATCREATED; |
|
272 | + $redirect_to = 'category.php?op=mod'; |
|
273 | + } else { |
|
274 | + $redirect_msg = _AM_SF_COLMODIFIED; |
|
275 | + $redirect_to = 'category.php'; |
|
276 | + } |
|
284 | 277 | |
285 | - if ($applyall) { |
|
278 | + if (!$categoryObj->store()) { |
|
279 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors())); |
|
280 | + } |
|
286 | 281 | // TODO : put this function in the category class |
287 | - sf_overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid()); |
|
288 | - } |
|
282 | + sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
|
283 | + //sf_saveCategory_Permissions($groups_admin, $categoriesObj->categoryid(), 'category_admin'); |
|
289 | 284 | |
290 | - redirect_header($redirect_to, 2, $redirect_msg); |
|
291 | - break; |
|
285 | + if ($applyall) { |
|
286 | + // TODO : put this function in the category class |
|
287 | + sf_overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid()); |
|
288 | + } |
|
292 | 289 | |
293 | - case 'del': |
|
294 | - global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; |
|
290 | + redirect_header($redirect_to, 2, $redirect_msg); |
|
291 | + break; |
|
295 | 292 | |
296 | - $module_id = $xoopsModule->getVar('mid'); |
|
297 | - $gpermHandler = xoops_getHandler('groupperm'); |
|
293 | + case 'del': |
|
294 | + global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; |
|
298 | 295 | |
299 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
300 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid; |
|
296 | + $module_id = $xoopsModule->getVar('mid'); |
|
297 | + $gpermHandler = xoops_getHandler('groupperm'); |
|
301 | 298 | |
302 | - $categoryObj = new sfCategory($categoryid); |
|
299 | + $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
300 | + $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid; |
|
303 | 301 | |
304 | - $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
|
305 | - $name = isset($_POST['name']) ? $_POST['name'] : ''; |
|
302 | + $categoryObj = new sfCategory($categoryid); |
|
306 | 303 | |
307 | - if ($confirm) { |
|
308 | - if (!$categoryHandler->delete($categoryObj)) { |
|
309 | - redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR); |
|
304 | + $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; |
|
305 | + $name = isset($_POST['name']) ? $_POST['name'] : ''; |
|
306 | + |
|
307 | + if ($confirm) { |
|
308 | + if (!$categoryHandler->delete($categoryObj)) { |
|
309 | + redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR); |
|
310 | + } |
|
311 | + redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name)); |
|
312 | + } else { |
|
313 | + // no confirm: show deletion condition |
|
314 | + $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
315 | + xoops_cp_header(); |
|
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); |
|
322 | + xoops_cp_footer(); |
|
310 | 323 | } |
311 | - redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name)); |
|
312 | - } else { |
|
313 | - // no confirm: show deletion condition |
|
314 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
324 | + exit(); |
|
325 | + break; |
|
326 | + |
|
327 | + case 'cancel': |
|
328 | + redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, '')); |
|
329 | + break; |
|
330 | + case 'default': |
|
331 | + default: |
|
332 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
315 | 333 | xoops_cp_header(); |
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); |
|
322 | - xoops_cp_footer(); |
|
323 | - } |
|
324 | - exit(); |
|
325 | - break; |
|
326 | - |
|
327 | - case 'cancel': |
|
328 | - redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, '')); |
|
329 | - break; |
|
330 | - case 'default': |
|
331 | - default: |
|
332 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
333 | - xoops_cp_header(); |
|
334 | - |
|
335 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
336 | - echo "<br>\n"; |
|
337 | 334 | |
338 | - // Creating the objects for top categories |
|
339 | - $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0); |
|
340 | - |
|
341 | - sf_collapsableBar('toptable', 'toptableicon'); |
|
342 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
343 | - echo "<div id='toptable'>"; |
|
344 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
345 | - |
|
346 | - echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
|
347 | - echo '<tr>'; |
|
348 | - echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
349 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
350 | - echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
351 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
352 | - echo '</tr>'; |
|
353 | - $totalCategories = $categoryHandler->getCategoriesCount(0); |
|
354 | - if (count($categoriesObj) > 0) { |
|
355 | - foreach ($categoriesObj as $key => $thiscat) { |
|
356 | - displayCategory($thiscat); |
|
357 | - } |
|
358 | - } else { |
|
335 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
336 | + echo "<br>\n"; |
|
337 | + |
|
338 | + // Creating the objects for top categories |
|
339 | + $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0); |
|
340 | + |
|
341 | + sf_collapsableBar('toptable', 'toptableicon'); |
|
342 | + echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
343 | + echo "<div id='toptable'>"; |
|
344 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
345 | + |
|
346 | + echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
|
359 | 347 | echo '<tr>'; |
360 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
348 | + echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
349 | + echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
350 | + echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
351 | + echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
361 | 352 | echo '</tr>'; |
362 | - $categoryid = '0'; |
|
363 | - } |
|
364 | - echo "</table>\n"; |
|
365 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
366 | - $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory'); |
|
367 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
368 | - echo '</div>'; |
|
353 | + $totalCategories = $categoryHandler->getCategoriesCount(0); |
|
354 | + if (count($categoriesObj) > 0) { |
|
355 | + foreach ($categoriesObj as $key => $thiscat) { |
|
356 | + displayCategory($thiscat); |
|
357 | + } |
|
358 | + } else { |
|
359 | + echo '<tr>'; |
|
360 | + echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
361 | + echo '</tr>'; |
|
362 | + $categoryid = '0'; |
|
363 | + } |
|
364 | + echo "</table>\n"; |
|
365 | + require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
366 | + $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory'); |
|
367 | + echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
368 | + echo '</div>'; |
|
369 | 369 | |
370 | - editcat(false); |
|
370 | + editcat(false); |
|
371 | 371 | |
372 | - break; |
|
372 | + break; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | require_once __DIR__ . '/admin_footer.php'; |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -require_once __DIR__ . '/admin_header.php'; |
|
9 | +require_once __DIR__.'/admin_header.php'; |
|
10 | 10 | |
11 | 11 | // Creating the category handler object |
12 | 12 | $categoryHandler = sf_gethandler('category'); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | // Where do we start? |
24 | -$startcategory = isset($_GET['startcategory']) ? (int)$_GET['startcategory'] : 0; |
|
24 | +$startcategory = isset($_GET['startcategory']) ? (int) $_GET['startcategory'] : 0; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @param XoopsObject $categoryObj |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | $description = $categoryObj->description(); |
34 | 34 | if (!XOOPS_USE_MULTIBYTES) { |
35 | 35 | if (strlen($description) >= 100) { |
36 | - $description = substr($description, 0, 100 - 1) . '...'; |
|
36 | + $description = substr($description, 0, 100-1).'...'; |
|
37 | 37 | } |
38 | 38 | } |
39 | - $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITCOL . "' alt='" . _AM_SF_EDITCOL . "'></a>"; |
|
40 | - $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETECOL . "' alt='" . _AM_SF_DELETECOL . "'></a>"; |
|
39 | + $modify = "<a href='category.php?op=mod&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITCOL."' alt='"._AM_SF_EDITCOL."'></a>"; |
|
40 | + $delete = "<a href='category.php?op=del&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETECOL."' alt='"._AM_SF_DELETECOL."'></a>"; |
|
41 | 41 | |
42 | 42 | $spaces = ''; |
43 | 43 | for ($j = 0; $j < $level; ++$j) { |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''> " |
59 | 59 | . $categoryObj->name() |
60 | 60 | . '</a></td>'; |
61 | - echo "<td class='even' align='left'>" . $description . '</td>'; |
|
62 | - echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>'; |
|
61 | + echo "<td class='even' align='left'>".$description.'</td>'; |
|
62 | + echo "<td class='even' align='center'>".$categoryObj->weight().'</td>'; |
|
63 | 63 | echo "<td class='even' align='center'> $modify $delete </td>"; |
64 | 64 | echo '</tr>'; |
65 | 65 | $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | { |
81 | 81 | //$moderators = array(); // just to define the variable |
82 | 82 | //$allmods = array(); |
83 | - $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
|
83 | + $startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0; |
|
84 | 84 | global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $_GET; |
85 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
85 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
86 | 86 | |
87 | 87 | // Creating the faq handler object |
88 | 88 | $faqHandler = sf_gethandler('faq'); |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | redirect_header('category.php', 1, _AM_SF_NOCOLTOEDIT); |
105 | 105 | } |
106 | 106 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
107 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_EDITCOL . '</h3>'; |
|
107 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_EDITCOL.'</h3>'; |
|
108 | 108 | echo "<div id='bottomtable'>"; |
109 | 109 | } else { |
110 | 110 | $categoryObj = $categoryHandler->create(); |
111 | 111 | echo "<br>\n"; |
112 | 112 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
113 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORY_CREATE . '</h3>'; |
|
113 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_CATEGORY_CREATE.'</h3>'; |
|
114 | 114 | echo "<div id='bottomtable'>"; |
115 | 115 | } |
116 | 116 | // Start category form |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | $sform->addElement($groups_read_checkbox); |
157 | 157 | // Apply permissions on all faqs |
158 | - $addapplyall_radio = new XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
158 | + $addapplyall_radio = new XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
159 | 159 | $sform->addElement($addapplyall_radio); |
160 | 160 | // MODERATORS |
161 | 161 | //$moderators_tray = new XoopsFormElementTray(_AM_SF_MODERATORS_DEF, ''); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | echo '</div>'; |
221 | 221 | |
222 | 222 | if ($categoryid) { |
223 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php'; |
|
223 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php'; |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | unset($hidden); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | switch ($op) { |
230 | 230 | case 'mod': |
231 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
231 | + $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
232 | 232 | $destList = isset($_POST['destList']) ? $_POST['destList'] : ''; |
233 | 233 | $adminObject = \Xmf\Module\Admin::getInstance(); |
234 | 234 | xoops_cp_header(); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | case 'addcategory': |
241 | 241 | global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid; |
242 | 242 | |
243 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
243 | + $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0; |
|
244 | 244 | |
245 | 245 | if ($categoryid != 0) { |
246 | 246 | $categoryObj = new sfCategory($categoryid); |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | //if (isset($_POST['allmods'])) $allmods = $_POST['allmods']; |
252 | 252 | //if (isset($_POST['moderators'])) $moderators = $_POST['moderators']; |
253 | 253 | |
254 | - $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0); |
|
255 | - $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0; |
|
256 | - $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1); |
|
254 | + $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int) $_POST['parentid'] : 0); |
|
255 | + $applyall = isset($_POST['applyall']) ? (int) $_POST['applyall'] : 0; |
|
256 | + $categoryObj->setVar('weight', isset($_POST['weight']) ? (int) $_POST['weight'] : 1); |
|
257 | 257 | |
258 | 258 | // Groups and permissions |
259 | 259 | if (isset($_POST['groups_read'])) { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | } |
277 | 277 | |
278 | 278 | if (!$categoryObj->store()) { |
279 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors())); |
|
279 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR.sf_formatErrors($categoryObj->getErrors())); |
|
280 | 280 | } |
281 | 281 | // TODO : put this function in the category class |
282 | 282 | sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
@@ -296,8 +296,8 @@ discard block |
||
296 | 296 | $module_id = $xoopsModule->getVar('mid'); |
297 | 297 | $gpermHandler = xoops_getHandler('groupperm'); |
298 | 298 | |
299 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
300 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid; |
|
299 | + $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0; |
|
300 | + $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : $categoryid; |
|
301 | 301 | |
302 | 302 | $categoryObj = new sfCategory($categoryid); |
303 | 303 | |
@@ -311,14 +311,14 @@ discard block |
||
311 | 311 | redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name)); |
312 | 312 | } else { |
313 | 313 | // no confirm: show deletion condition |
314 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
314 | + $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
315 | 315 | xoops_cp_header(); |
316 | 316 | xoops_confirm([ |
317 | 317 | 'op' => 'del', |
318 | 318 | 'categoryid' => $categoryObj->categoryid(), |
319 | 319 | 'confirm' => 1, |
320 | 320 | 'name' => $categoryObj->name() |
321 | - ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
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(); |
@@ -339,16 +339,16 @@ discard block |
||
339 | 339 | $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0); |
340 | 340 | |
341 | 341 | sf_collapsableBar('toptable', 'toptableicon'); |
342 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
342 | + echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_CATEGORIES_TITLE.'</h3>'; |
|
343 | 343 | echo "<div id='toptable'>"; |
344 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
344 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_CATEGORIES_DSC.'</span>'; |
|
345 | 345 | |
346 | 346 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
347 | 347 | echo '<tr>'; |
348 | - echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
349 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
350 | - echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
351 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
348 | + echo "<th width='35%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
349 | + echo "<th class='bg3' align='left'><b>"._AM_SF_DESCRIP.'</b></td>'; |
|
350 | + echo "<th class='bg3' width='65' align='center'><b>"._AM_SF_WEIGHT.'</b></td>'; |
|
351 | + echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
352 | 352 | echo '</tr>'; |
353 | 353 | $totalCategories = $categoryHandler->getCategoriesCount(0); |
354 | 354 | if (count($categoriesObj) > 0) { |
@@ -357,14 +357,14 @@ discard block |
||
357 | 357 | } |
358 | 358 | } else { |
359 | 359 | echo '<tr>'; |
360 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
360 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOCAT.'</td>'; |
|
361 | 361 | echo '</tr>'; |
362 | 362 | $categoryid = '0'; |
363 | 363 | } |
364 | 364 | echo "</table>\n"; |
365 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
365 | + require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
366 | 366 | $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory'); |
367 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
367 | + echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
368 | 368 | echo '</div>'; |
369 | 369 | |
370 | 370 | editcat(false); |
@@ -372,4 +372,4 @@ discard block |
||
372 | 372 | break; |
373 | 373 | } |
374 | 374 | |
375 | -require_once __DIR__ . '/admin_footer.php'; |
|
375 | +require_once __DIR__.'/admin_footer.php'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * |
12 | 12 | */ |
13 | 13 | |
14 | -require_once __DIR__ . '/admin_header.php'; |
|
14 | +require_once __DIR__.'/admin_header.php'; |
|
15 | 15 | |
16 | 16 | $importFromModuleName = 'XoopsFAQ'; |
17 | 17 | $scriptname = 'xoopsfaq.php'; |
@@ -24,33 +24,33 @@ discard block |
||
24 | 24 | |
25 | 25 | if ($op === 'start') { |
26 | 26 | xoops_cp_header(); |
27 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
27 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
28 | 28 | |
29 | - $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('xoopsfaq_categories')); |
|
29 | + $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('xoopsfaq_categories')); |
|
30 | 30 | list($totalCat) = $xoopsDB->fetchRow($result); |
31 | 31 | |
32 | 32 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
33 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>'; |
|
33 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>'; |
|
34 | 34 | echo "<div id='bottomtable'>"; |
35 | 35 | |
36 | 36 | if ($totalCat == 0) { |
37 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_NO_CATEGORY . '</span>'; |
|
37 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_NO_CATEGORY.'</span>'; |
|
38 | 38 | } else { |
39 | - require_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
|
39 | + require_once XOOPS_ROOT_PATH.'/class/xoopstree.php'; |
|
40 | 40 | |
41 | - $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('xoopsfaq_contents')); |
|
41 | + $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('xoopsfaq_contents')); |
|
42 | 42 | list($totalFAQ) = $xoopsDB->fetchRow($result); |
43 | 43 | |
44 | 44 | if ($totalFAQ == 0) { |
45 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat) . '</span>'; |
|
45 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat).'</span>'; |
|
46 | 46 | } else { |
47 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . sprintf(_AM_SF_IMPORT_MODULE_FOUND, $importFromModuleName, $totalCat, $totalFAQ) . '</span>'; |
|
47 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.sprintf(_AM_SF_IMPORT_MODULE_FOUND, $importFromModuleName, $totalCat, $totalFAQ).'</span>'; |
|
48 | 48 | |
49 | - $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL . '/modules/smartfaq/admin/' . $scriptname); |
|
49 | + $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL.'/modules/smartfaq/admin/'.$scriptname); |
|
50 | 50 | |
51 | 51 | // Categories to be imported |
52 | 52 | $cat_cbox = new XoopsFormCheckBox(sprintf(_AM_SF_IMPORT_CATEGORIES, $importFromModuleName), 'import_category', -1); |
53 | - $result = $xoopsDB->queryF('SELECT c.category_id, c.category_title, count(q.contents_id) FROM ' . $xoopsDB->prefix('xoopsfaq_categories') . ' AS c, ' . $xoopsDB->prefix('xoopsfaq_contents') . ' AS q WHERE c.category_id=q.category_id GROUP BY c.category_id ORDER BY category_order'); |
|
53 | + $result = $xoopsDB->queryF('SELECT c.category_id, c.category_title, count(q.contents_id) FROM '.$xoopsDB->prefix('xoopsfaq_categories').' AS c, '.$xoopsDB->prefix('xoopsfaq_contents').' AS q WHERE c.category_id=q.category_id GROUP BY c.category_id ORDER BY category_order'); |
|
54 | 54 | |
55 | 55 | while (list($cid, $cat_title, $count) = $xoopsDB->fetchRow($result)) { |
56 | 56 | $cat_cbox->addOption($cid, "$cat_title ($count)<br\>"); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ob_end_clean(); |
66 | 66 | |
67 | 67 | // Auto-Approve |
68 | - $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '')); |
|
68 | + $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'')); |
|
69 | 69 | |
70 | 70 | // Submitted and answered by |
71 | 71 | $memberHandler = xoops_getHandler('member'); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $form->addElement($user_select); |
79 | 79 | |
80 | 80 | // Q&As can be commented? |
81 | - $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '')); |
|
81 | + $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'')); |
|
82 | 82 | |
83 | 83 | $group_list = $memberHandler->getGroupList(); |
84 | 84 | $groups_selected = []; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($op === 'go') { |
105 | - require_once __DIR__ . '/admin_header.php'; |
|
105 | + require_once __DIR__.'/admin_header.php'; |
|
106 | 106 | |
107 | 107 | $import_category = (isset($_POST['import_category']) ? $_POST['import_category'] : null); |
108 | 108 | if (!$import_category) { |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | xoops_cp_header(); |
113 | 113 | |
114 | 114 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
115 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>'; |
|
115 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>'; |
|
116 | 116 | echo "<div id='bottomtable'>"; |
117 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_RESULT . '</span>'; |
|
117 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_RESULT.'</span>'; |
|
118 | 118 | |
119 | 119 | $cnt_imported_cat = 0; |
120 | 120 | $cnt_imported_faq = 0; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | echo "Can Comment: $cancomment<br>"; |
143 | 143 | echo "Auto aprove: $autoaprove<br>";*/ |
144 | 144 | |
145 | - $resultCat = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('xoopsfaq_categories') . " where category_id in ($import_category_list) order by category_order"); |
|
145 | + $resultCat = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('xoopsfaq_categories')." where category_id in ($import_category_list) order by category_order"); |
|
146 | 146 | |
147 | 147 | while ($arrCat = $xoopsDB->fetchArray($resultCat)) { |
148 | 148 | extract($arrCat, EXTR_PREFIX_ALL, 'xcat'); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $categoryObj->setVar('name', $xcat_category_title); |
157 | 157 | |
158 | 158 | if (!$categoryObj->store(false)) { |
159 | - echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name) . '<br>'; |
|
159 | + echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name).'<br>'; |
|
160 | 160 | continue; |
161 | 161 | } |
162 | 162 | |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | |
165 | 165 | ++$cnt_imported_cat; |
166 | 166 | |
167 | - echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $xcat_category_title) . "<br\>"; |
|
167 | + echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $xcat_category_title)."<br\>"; |
|
168 | 168 | |
169 | - $resultFAQ = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('xoopsfaq_contents') . " where category_id=$xcat_category_id order by contents_order"); |
|
169 | + $resultFAQ = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('xoopsfaq_contents')." where category_id=$xcat_category_id order by contents_order"); |
|
170 | 170 | while ($arrFAQ = $xoopsDB->fetchArray($resultFAQ)) { |
171 | 171 | extract($arrFAQ, EXTR_PREFIX_ALL, 'xfaq'); |
172 | 172 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $faqObj->setVar('cancomment', $cancomment); |
195 | 195 | |
196 | 196 | if (!$faqObj->store(false)) { |
197 | - echo sprintf(' ' . _AM_SF_IMPORT_FAQ_ERROR, $xfaq_contents_title) . '<br>'; |
|
197 | + echo sprintf(' '._AM_SF_IMPORT_FAQ_ERROR, $xfaq_contents_title).'<br>'; |
|
198 | 198 | continue; |
199 | 199 | } else { |
200 | 200 | $answerObj->setVar('faqid', $faqObj->faqid()); |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | $answerObj->setVar('status', _SF_AN_STATUS_APPROVED); |
204 | 204 | |
205 | 205 | if (!$answerObj->store()) { |
206 | - echo sprintf(' ' . _AM_SF_IMPORT_FAQ_ERROR) . '<br>'; |
|
206 | + echo sprintf(' '._AM_SF_IMPORT_FAQ_ERROR).'<br>'; |
|
207 | 207 | continue; |
208 | 208 | } else { |
209 | - echo ' ' . sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)) . '<br>'; |
|
209 | + echo ' '.sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)).'<br>'; |
|
210 | 210 | ++$cnt_imported_faq; |
211 | 211 | } |
212 | 212 | } |
@@ -216,8 +216,8 @@ discard block |
||
216 | 216 | } |
217 | 217 | |
218 | 218 | echo 'Done.<br>'; |
219 | - echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat) . '<br>'; |
|
220 | - echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq) . '<br>'; |
|
219 | + echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat).'<br>'; |
|
220 | + echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq).'<br>'; |
|
221 | 221 | |
222 | 222 | exit(); |
223 | 223 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * |
11 | 11 | */ |
12 | 12 | |
13 | -require_once __DIR__ . '/admin_header.php'; |
|
13 | +require_once __DIR__.'/admin_header.php'; |
|
14 | 14 | |
15 | 15 | $importFromModuleName = 'WF-FAQ'; |
16 | 16 | $scriptname = 'wffaq.php'; |
@@ -22,33 +22,33 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | if ($op === 'start') { |
25 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
25 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
26 | 26 | xoops_cp_header(); |
27 | - $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('faqcategories')); |
|
27 | + $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('faqcategories')); |
|
28 | 28 | list($totalCat) = $xoopsDB->fetchRow($result); |
29 | 29 | |
30 | 30 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
31 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>'; |
|
31 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>'; |
|
32 | 32 | echo "<div id='bottomtable'>"; |
33 | 33 | |
34 | 34 | if ($totalCat == 0) { |
35 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_NO_CATEGORY . '</span>'; |
|
35 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_NO_CATEGORY.'</span>'; |
|
36 | 36 | } else { |
37 | - require_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
|
37 | + require_once XOOPS_ROOT_PATH.'/class/xoopstree.php'; |
|
38 | 38 | |
39 | - $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('faqtopics')); |
|
39 | + $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('faqtopics')); |
|
40 | 40 | list($totalFAQ) = $xoopsDB->fetchRow($result); |
41 | 41 | |
42 | 42 | if ($totalFAQ == 0) { |
43 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat) . '</span>'; |
|
43 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat).'</span>'; |
|
44 | 44 | } else { |
45 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . sprintf(_AM_SF_IMPORT_MODULE_FOUND, $importFromModuleName, $totalCat, $totalFAQ) . '</span>'; |
|
45 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.sprintf(_AM_SF_IMPORT_MODULE_FOUND, $importFromModuleName, $totalCat, $totalFAQ).'</span>'; |
|
46 | 46 | |
47 | - $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL . '/modules/smartfaq/admin/' . $scriptname); |
|
47 | + $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL.'/modules/smartfaq/admin/'.$scriptname); |
|
48 | 48 | |
49 | 49 | // Categories to be imported |
50 | 50 | $cat_cbox = new XoopsFormCheckBox(sprintf(_AM_SF_IMPORT_CATEGORIES, $importFromModuleName), 'import_category', -1); |
51 | - $result = $xoopsDB->queryF('SELECT c.catID, c.name, count(t.topicID) FROM ' . $xoopsDB->prefix('faqcategories') . ' AS c, ' . $xoopsDB->prefix('faqtopics') . ' AS t WHERE c.catID=t.catID GROUP BY t.catID ORDER BY c.weight'); |
|
51 | + $result = $xoopsDB->queryF('SELECT c.catID, c.name, count(t.topicID) FROM '.$xoopsDB->prefix('faqcategories').' AS c, '.$xoopsDB->prefix('faqtopics').' AS t WHERE c.catID=t.catID GROUP BY t.catID ORDER BY c.weight'); |
|
52 | 52 | while (list($cid, $cat_title, $count) = $xoopsDB->fetchRow($result)) { |
53 | 53 | $cat_cbox->addOption($cid, "$cat_title ($count)<br\>"); |
54 | 54 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ob_end_clean(); |
63 | 63 | |
64 | 64 | // Auto-Approve |
65 | - $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '')); |
|
65 | + $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'')); |
|
66 | 66 | |
67 | 67 | // Submitted and answered by |
68 | 68 | $memberHandler = xoops_getHandler('member'); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $form->addElement($user_select); |
76 | 76 | |
77 | 77 | // Q&As can be commented? |
78 | - $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '')); |
|
78 | + $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'')); |
|
79 | 79 | $group_list = $memberHandler->getGroupList(); |
80 | 80 | $groups_selected = []; |
81 | 81 | $groups_checkbox = new XoopsFormCheckBox(_AM_SF_IMPORT_PERMISSIONS, 'groups_read'); |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | redirect_header($scriptname, 2, _AM_SF_NOCATSELECTED); |
105 | 105 | } |
106 | 106 | |
107 | - require_once __DIR__ . '/admin_header.php'; |
|
107 | + require_once __DIR__.'/admin_header.php'; |
|
108 | 108 | xoops_cp_header(); |
109 | 109 | |
110 | 110 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
111 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>'; |
|
111 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>'; |
|
112 | 112 | echo "<div id='bottomtable'>"; |
113 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_RESULT . '</span>'; |
|
113 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_RESULT.'</span>'; |
|
114 | 114 | |
115 | 115 | $cnt_imported_cat = 0; |
116 | 116 | $cnt_imported_faq = 0; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | echo "Can Comment: $cancomment<br>"; |
139 | 139 | echo "Auto aprove: $autoaprove<br>";*/ |
140 | 140 | |
141 | - $resultCat = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('faqcategories') . " where catID in ($import_category_list) order by weight"); |
|
141 | + $resultCat = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('faqcategories')." where catID in ($import_category_list) order by weight"); |
|
142 | 142 | |
143 | 143 | while ($arrCat = $xoopsDB->fetchArray($resultCat)) { |
144 | 144 | extract($arrCat, EXTR_PREFIX_ALL, 'wfc'); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $categoryObj->setVar('description', $wfc_description); |
154 | 154 | |
155 | 155 | if (!$categoryObj->store(false)) { |
156 | - echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name) . '<br>'; |
|
156 | + echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name).'<br>'; |
|
157 | 157 | continue; |
158 | 158 | } |
159 | 159 | |
@@ -161,9 +161,9 @@ discard block |
||
161 | 161 | |
162 | 162 | ++$cnt_imported_cat; |
163 | 163 | |
164 | - echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $wfc_name) . "<br\>"; |
|
164 | + echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $wfc_name)."<br\>"; |
|
165 | 165 | |
166 | - $resultFAQ = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('faqtopics') . " where catID=$wfc_catID order by weight"); |
|
166 | + $resultFAQ = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('faqtopics')." where catID=$wfc_catID order by weight"); |
|
167 | 167 | while ($arrFAQ = $xoopsDB->fetchArray($resultFAQ)) { |
168 | 168 | extract($arrFAQ, EXTR_PREFIX_ALL, 'wft'); |
169 | 169 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $faqObj->setVar('exacturl', 0); |
196 | 196 | |
197 | 197 | if (!$faqObj->store(false)) { |
198 | - echo sprintf(' ' . _AM_SF_IMPORT_FAQ_ERROR, $wft_question) . '<br>'; |
|
198 | + echo sprintf(' '._AM_SF_IMPORT_FAQ_ERROR, $wft_question).'<br>'; |
|
199 | 199 | continue; |
200 | 200 | } else { |
201 | 201 | $answerObj->setVar('faqid', $faqObj->faqid()); |
@@ -204,10 +204,10 @@ discard block |
||
204 | 204 | $answerObj->setVar('status', _SF_AN_STATUS_APPROVED); |
205 | 205 | |
206 | 206 | if (!$answerObj->store()) { |
207 | - echo sprintf(' ' . _AM_SF_IMPORT_FAQ_ERROR) . '<br>'; |
|
207 | + echo sprintf(' '._AM_SF_IMPORT_FAQ_ERROR).'<br>'; |
|
208 | 208 | continue; |
209 | 209 | } else { |
210 | - echo ' ' . sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)) . '<br>'; |
|
210 | + echo ' '.sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)).'<br>'; |
|
211 | 211 | ++$cnt_imported_faq; |
212 | 212 | } |
213 | 213 | } |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | echo 'Done.<br>'; |
220 | - echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat) . '<br>'; |
|
221 | - echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq) . '<br>'; |
|
220 | + echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat).'<br>'; |
|
221 | + echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq).'<br>'; |
|
222 | 222 | |
223 | 223 | exit(); |
224 | 224 | } |
@@ -5,13 +5,13 @@ discard block |
||
5 | 5 | * Author: The SmartFactory <www.smartfactory.ca> |
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | -require_once __DIR__ . '/header.php'; |
|
8 | +require_once __DIR__.'/header.php'; |
|
9 | 9 | |
10 | 10 | // At which record shall we start for the Categories |
11 | -$catstart = isset($_GET['catstart']) ? (int)$_GET['catstart'] : 0; |
|
11 | +$catstart = isset($_GET['catstart']) ? (int) $_GET['catstart'] : 0; |
|
12 | 12 | |
13 | 13 | // At which record shall we start for the FAQ |
14 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
14 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
15 | 15 | |
16 | 16 | // Creating the category handler object |
17 | 17 | $categoryHandler = sf_gethandler('category'); |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | |
37 | 37 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl'; |
38 | 38 | |
39 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
40 | -require_once __DIR__ . '/footer.php'; |
|
39 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
40 | +require_once __DIR__.'/footer.php'; |
|
41 | 41 | |
42 | 42 | // Creating the categories objects |
43 | 43 | $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['catperpage'], $catstart); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // Get the last smartfaq in each category |
61 | 61 | $last_qnaObj = $faqHandler->getLastPublishedByCat(); |
62 | 62 | } |
63 | -$lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize']; |
|
63 | +$lastfaqsize = (int) $xoopsModuleConfig['lastfaqsize']; |
|
64 | 64 | $categories = []; |
65 | 65 | foreach ($categoriesObj as $cat_id => $category) { |
66 | 66 | $total = 0; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
71 | 71 | if (isset($last_qnaObj[$subcat_id])) { |
72 | 72 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
73 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
73 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
74 | 74 | } |
75 | 75 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
76 | 76 | if ($xoopsModuleConfig['displaysubcatonindex']) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | if ($total > 0) { |
89 | 89 | if (isset($last_qnaObj[$cat_id])) { |
90 | 90 | $category->setVar('last_faqid', $last_qnaObj[$cat_id]->getVar('faqid')); |
91 | - $category->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$cat_id]->getVar('faqid') . "'>" . $last_qnaObj[$cat_id]->question($lastfaqsize) . '</a>'); |
|
91 | + $category->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$cat_id]->getVar('faqid')."'>".$last_qnaObj[$cat_id]->question($lastfaqsize).'</a>'); |
|
92 | 92 | } |
93 | 93 | $category->setVar('faqcount', $total); |
94 | 94 | if (!isset($categories[$cat_id])) { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | $memberHandler = xoops_getHandler('member'); |
129 | - $users = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
129 | + $users = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
130 | 130 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
131 | 131 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
132 | 132 | |
@@ -152,14 +152,14 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | // Language constants |
155 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
155 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
156 | 156 | $xoopsTpl->assign('whereInSection', $moduleName); |
157 | 157 | $xoopsTpl->assign('displaysubcatonindex', $xoopsModuleConfig['displaysubcatonindex']); |
158 | 158 | $xoopsTpl->assign('displaylastfaqs', $xoopsModuleConfig['displaylastfaqs']); |
159 | 159 | $xoopsTpl->assign('display_categoryname', true); |
160 | 160 | $xoopsTpl->assign('displayFull', $xoopsModuleConfig['displaytype'] === 'full'); |
161 | 161 | |
162 | -$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD . ' ' . $moduleName); |
|
162 | +$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD.' '.$moduleName); |
|
163 | 163 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['indexwelcomemsg'], 1)); |
164 | 164 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_SMARTFAQS); |
165 | 165 | $xoopsTpl->assign('lang_home', _MD_SF_HOME); |
@@ -178,20 +178,20 @@ discard block |
||
178 | 178 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
179 | 179 | |
180 | 180 | // Category Navigation Bar |
181 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
181 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
182 | 182 | $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', ''); |
183 | 183 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
184 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
184 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
185 | 185 | } else { |
186 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
186 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | // FAQ Navigation Bar |
190 | 190 | $pagenav = new XoopsPageNav($totalFaqs, $xoopsModuleConfig['indexperpage'], $start, 'start', ''); |
191 | 191 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
192 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
192 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
193 | 193 | } else { |
194 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
194 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | // Page Title Hack by marcan |
@@ -199,4 +199,4 @@ discard block |
||
199 | 199 | $xoopsTpl->assign('xoops_pagetitle', $module_name); |
200 | 200 | // End Page Title Hack by marcan |
201 | 201 | |
202 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
202 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |