@@ -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,7 +9,7 @@ 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 | |
@@ -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::hasModerator()); |
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 */ |
@@ -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) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | //$allmods = array(); |
86 | 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); |
@@ -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'); |
@@ -322,7 +322,7 @@ discard block |
||
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'; |
@@ -284,11 +284,11 @@ |
||
284 | 284 | $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
285 | 285 | xoops_cp_header(); |
286 | 286 | xoops_confirm([ |
287 | - 'op' => 'del', |
|
288 | - 'faqid' => $faqObj->faqid(), |
|
289 | - 'confirm' => 1, |
|
290 | - 'name' => $faqObj->question() |
|
291 | - ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
287 | + 'op' => 'del', |
|
288 | + 'faqid' => $faqObj->faqid(), |
|
289 | + 'confirm' => 1, |
|
290 | + 'name' => $faqObj->question() |
|
291 | + ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
292 | 292 | xoops_cp_footer(); |
293 | 293 | } |
294 | 294 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use XoopsModules\Smartfaq; |
10 | 10 | use XoopsModules\Smartfaq\Constants; |
11 | 11 | |
12 | -require_once __DIR__ . '/admin_header.php'; |
|
12 | +require_once __DIR__.'/admin_header.php'; |
|
13 | 13 | |
14 | 14 | global $xoopsUser; |
15 | 15 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | global $faqHandler, $categoryHandler, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts; |
42 | 42 | |
43 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
43 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
44 | 44 | // If there is a parameter, and the id exists, retrieve data: we're editing a faq |
45 | 45 | if (-1 != $faqid) { |
46 | 46 | // Creating the FAQ object |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | |
73 | 73 | echo "<br>\n"; |
74 | 74 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
75 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . $collapsableBar_title . '</h3>'; |
|
75 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".$collapsableBar_title.'</h3>'; |
|
76 | 76 | echo "<div id='bottomtable'>"; |
77 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>'; |
|
77 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>'; |
|
78 | 78 | } else { |
79 | 79 | // there's no parameter, so we're adding a faq |
80 | 80 | $faqObj = $faqHandler->create(); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $button_caption = _AM_SF_CREATE; |
86 | 86 | |
87 | 87 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
88 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CREATEQUESTION . '</h3>'; |
|
88 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_CREATEQUESTION.'</h3>'; |
|
89 | 89 | echo "<div id='bottomtable'>"; |
90 | 90 | } |
91 | 91 | $sform = new \XoopsThemeForm(_AM_SF_OPEN_QUESTION, 'op', xoops_getenv('PHP_SELF'), 'post', true); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $button_tray->addElement($butt_create); |
160 | 160 | |
161 | 161 | $butt_edit = new \XoopsFormButton('', '', _AM_SF_OPEN_QUESTION_EDIT, 'button'); |
162 | - $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&faqid=" . $faqid . "'\""); |
|
162 | + $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&faqid=".$faqid."'\""); |
|
163 | 163 | $button_tray->addElement($butt_edit); |
164 | 164 | |
165 | 165 | $butt_cancel = new \XoopsFormButton('', '', _AM_SF_CANCEL, 'button'); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | xoops_cp_header(); |
192 | 192 | |
193 | 193 | $adminObject->displayNavigation(basename(__FILE__)); |
194 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
194 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
195 | 195 | |
196 | 196 | editfaq(true, $faqid); |
197 | 197 | break; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | |
253 | 253 | // Storing the FAQ |
254 | 254 | if (!$faqObj->store()) { |
255 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR . Smartfaq\Utility::formatErrors($faqObj->getErrors())); |
|
255 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR.Smartfaq\Utility::formatErrors($faqObj->getErrors())); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | // Send notifications |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | 'faqid' => $faqObj->faqid(), |
294 | 294 | 'confirm' => 1, |
295 | 295 | 'name' => $faqObj->question() |
296 | - ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
296 | + ], 'question.php', _AM_SF_DELETETHISQUESTION." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE); |
|
297 | 297 | xoops_cp_footer(); |
298 | 298 | } |
299 | 299 | |
@@ -306,8 +306,8 @@ discard block |
||
306 | 306 | xoops_cp_header(); |
307 | 307 | $adminObject->displayNavigation(basename(__FILE__)); |
308 | 308 | |
309 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
310 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
309 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
310 | + require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
311 | 311 | |
312 | 312 | global $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $smartModuleConfig; |
313 | 313 | |
@@ -315,9 +315,9 @@ discard block |
||
315 | 315 | |
316 | 316 | Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
317 | 317 | |
318 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_OPENED_TITLE . '</h3>'; |
|
318 | + echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_OPENED_TITLE.'</h3>'; |
|
319 | 319 | echo "<div id='toptable'>"; |
320 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_OPENED_DSC . '</span>'; |
|
320 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_OPENED_DSC.'</span>'; |
|
321 | 321 | |
322 | 322 | // Get the total number of published FAQs |
323 | 323 | $totalfaqs = $faqHandler->getFaqsCount(-1, [Constants::SF_STATUS_OPENED]); |
@@ -327,14 +327,14 @@ discard block |
||
327 | 327 | $allCats = $categoryHandler->getObjects(null, true); |
328 | 328 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
329 | 329 | echo '<tr>'; |
330 | - echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>'; |
|
331 | - echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
332 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>'; |
|
330 | + echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>'; |
|
331 | + echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
332 | + echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>'; |
|
333 | 333 | |
334 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>'; |
|
334 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>'; |
|
335 | 335 | |
336 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>'; |
|
337 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
336 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>'; |
|
337 | + echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
338 | 338 | echo '</tr>'; |
339 | 339 | //var_dump( $faqsObj); |
340 | 340 | if ($totalfaqs > 0) { |
@@ -342,33 +342,33 @@ discard block |
||
342 | 342 | foreach (array_keys($faqsObj) as $i) { |
343 | 343 | $categoryObj = $allCats[$faqsObj[$i]->categoryid()]; |
344 | 344 | |
345 | - $modify = "<a href='question.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_EDITART . "'></a>"; |
|
346 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
345 | + $modify = "<a href='question.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_EDITART."'></a>"; |
|
346 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
347 | 347 | |
348 | 348 | $requester = Smartfaq\Utility::getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
349 | 349 | |
350 | 350 | echo '<tr>'; |
351 | - echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>'; |
|
352 | - echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>'; |
|
353 | - echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/answer.php?faqid=' . $faqsObj[$i]->faqid() . "'>" . $faqsObj[$i]->question(100) . '</a></td>'; |
|
351 | + echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>'; |
|
352 | + echo "<td class='even' align='left'>".$categoryObj->name().'</td>'; |
|
353 | + echo "<td class='even' align='left'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/answer.php?faqid='.$faqsObj[$i]->faqid()."'>".$faqsObj[$i]->question(100).'</a></td>'; |
|
354 | 354 | |
355 | - echo "<td class='even' align='center'>" . $requester . '</td>'; |
|
355 | + echo "<td class='even' align='center'>".$requester.'</td>'; |
|
356 | 356 | |
357 | - echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>'; |
|
357 | + echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>'; |
|
358 | 358 | echo "<td class='even' align='center'> $modify $delete </td>"; |
359 | 359 | echo '</tr>'; |
360 | 360 | } |
361 | 361 | } else { |
362 | 362 | $faqid = -1; |
363 | 363 | echo '<tr>'; |
364 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOQUEUED . '</td>'; |
|
364 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOQUEUED.'</td>'; |
|
365 | 365 | echo '</tr>'; |
366 | 366 | } |
367 | 367 | echo "</table>\n"; |
368 | 368 | echo "<br>\n"; |
369 | 369 | |
370 | 370 | $pagenav = new \XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq'); |
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 | $totalcategories = $categoryHandler->getCategoriesCount(-1); |
@@ -379,4 +379,4 @@ discard block |
||
379 | 379 | break; |
380 | 380 | } |
381 | 381 | |
382 | -require_once __DIR__ . '/admin_footer.php'; |
|
382 | +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 | } |
@@ -114,18 +114,18 @@ |
||
114 | 114 | foreach ($proposed_answers as $proposed_answer) { |
115 | 115 | if (Constants::SF_STATUS_NEW_ANSWER == $faqObj->status()) { |
116 | 116 | $merge = "<a href='faq.php?op=merge&faqid=" |
117 | - . $faqObj->faqid() |
|
118 | - . '&answerid=' |
|
119 | - . $proposed_answer->answerid() |
|
120 | - . "'><img src='" |
|
121 | - . XOOPS_URL |
|
122 | - . '/modules/' |
|
123 | - . $xoopsModule->dirname() |
|
124 | - . "/assets/images/icon/merge.gif' title='" |
|
125 | - . _AM_SF_FAQ_MERGE |
|
126 | - . "' alt='" |
|
127 | - . _AM_SF_FAQ_MERGE |
|
128 | - . "'></a> "; |
|
117 | + . $faqObj->faqid() |
|
118 | + . '&answerid=' |
|
119 | + . $proposed_answer->answerid() |
|
120 | + . "'><img src='" |
|
121 | + . XOOPS_URL |
|
122 | + . '/modules/' |
|
123 | + . $xoopsModule->dirname() |
|
124 | + . "/assets/images/icon/merge.gif' title='" |
|
125 | + . _AM_SF_FAQ_MERGE |
|
126 | + . "' alt='" |
|
127 | + . _AM_SF_FAQ_MERGE |
|
128 | + . "'></a> "; |
|
129 | 129 | $approve = "<a href='answer.php?op=selectanswer&faqid=" . $faqid . '&answerid=' . $proposed_answer->answerid() . "'><img src='" . $pathIcon16 . '/on.png' . "' title='" . _AM_SF_FAQ_APPROVE_NEW_ANSWER . "' alt='" . _AM_SF_APPROVESUB . "'></a>"; |
130 | 130 | } |
131 | 131 | $modify = "<a href='faq.php?op=mod&faqid=" . $faqObj->faqid() . '&answerid=' . $proposed_answer->answerid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_FAQ_REVIEW . "' alt='" . _AM_SF_FAQ_REVIEW . "'></a> "; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use XoopsModules\Smartfaq; |
10 | 10 | use XoopsModules\Smartfaq\Constants; |
11 | 11 | |
12 | -require_once __DIR__ . '/admin_header.php'; |
|
12 | +require_once __DIR__.'/admin_header.php'; |
|
13 | 13 | |
14 | 14 | $op = ''; |
15 | 15 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | global $answerHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts, $pathIcon16, $smartModuleConfig; |
34 | 34 | |
35 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
35 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
36 | 36 | |
37 | 37 | // Creating the FAQ object |
38 | 38 | $faqObj = new Smartfaq\Faq($faqid); |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | $official_answer = $faqObj->answer(); |
70 | 70 | |
71 | 71 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
72 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_SUBMITTED_ANSWER . '</h3>'; |
|
72 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_SUBMITTED_ANSWER.'</h3>'; |
|
73 | 73 | echo "<div id='bottomtable'>"; |
74 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_SUBMITTED_ANSWER_INFO . '</span>'; |
|
74 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_SUBMITTED_ANSWER_INFO.'</span>'; |
|
75 | 75 | |
76 | 76 | $proposed_answers = $answerHandler->getAllAnswers($faqid, Constants::SF_AN_STATUS_PROPOSED); |
77 | 77 | |
@@ -81,31 +81,31 @@ discard block |
||
81 | 81 | |
82 | 82 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer> |
83 | 83 | <tr> |
84 | - <td class='head' width='100px'>" . _AM_SF_CATEGORY . "</td> |
|
85 | - <td class='even'>" . $categoryObj->name() . "</td> |
|
84 | + <td class='head' width='100px'>" . _AM_SF_CATEGORY."</td> |
|
85 | + <td class='even'>" . $categoryObj->name()."</td> |
|
86 | 86 | </tr> |
87 | 87 | <tr> |
88 | - <td class='head' width='100px'>" . _AM_SF_QUESTION . "</td> |
|
89 | - <td class='even'>" . $faqObj->question() . '</td> |
|
88 | + <td class='head' width='100px'>" . _AM_SF_QUESTION."</td> |
|
89 | + <td class='even'>" . $faqObj->question().'</td> |
|
90 | 90 | </tr>'; |
91 | 91 | if ($official_answer) { |
92 | 92 | echo " |
93 | 93 | <tr> |
94 | - <td class='head' width='100px'>" . _AM_SF_ANSWER_OFFICIAL . "</td> |
|
95 | - <td class='even'>" . $official_answer->answer() . '</td> |
|
94 | + <td class='head' width='100px'>" . _AM_SF_ANSWER_OFFICIAL."</td> |
|
95 | + <td class='even'>" . $official_answer->answer().'</td> |
|
96 | 96 | </tr>'; |
97 | 97 | } |
98 | 98 | echo "</table><br>\n"; |
99 | 99 | |
100 | 100 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
101 | 101 | echo '<tr>'; |
102 | - echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>'; |
|
103 | - echo "<th class='bg3' class='bg3' align='center'><b>" . _AM_SF_ANSWER . '</b></td>'; |
|
102 | + echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>'; |
|
103 | + echo "<th class='bg3' class='bg3' align='center'><b>"._AM_SF_ANSWER.'</b></td>'; |
|
104 | 104 | |
105 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>'; |
|
105 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>'; |
|
106 | 106 | |
107 | - echo "<th width='180' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>'; |
|
108 | - echo "<th width='120' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
107 | + echo "<th width='180' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>'; |
|
108 | + echo "<th width='120' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
109 | 109 | echo '</tr>'; |
110 | 110 | |
111 | 111 | $merge = ''; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $approve = ''; |
114 | 114 | foreach ($proposed_answers as $proposed_answer) { |
115 | 115 | if (Constants::SF_STATUS_NEW_ANSWER == $faqObj->status()) { |
116 | - $merge = "<a href='faq.php?op=merge&faqid=" |
|
116 | + $merge = "<a href='faq.php?op=merge&faqid=" |
|
117 | 117 | . $faqObj->faqid() |
118 | 118 | . '&answerid=' |
119 | 119 | . $proposed_answer->answerid() |
@@ -126,19 +126,19 @@ discard block |
||
126 | 126 | . "' alt='" |
127 | 127 | . _AM_SF_FAQ_MERGE |
128 | 128 | . "'></a> "; |
129 | - $approve = "<a href='answer.php?op=selectanswer&faqid=" . $faqid . '&answerid=' . $proposed_answer->answerid() . "'><img src='" . $pathIcon16 . '/on.png' . "' title='" . _AM_SF_FAQ_APPROVE_NEW_ANSWER . "' alt='" . _AM_SF_APPROVESUB . "'></a>"; |
|
129 | + $approve = "<a href='answer.php?op=selectanswer&faqid=".$faqid.'&answerid='.$proposed_answer->answerid()."'><img src='".$pathIcon16.'/on.png'."' title='"._AM_SF_FAQ_APPROVE_NEW_ANSWER."' alt='"._AM_SF_APPROVESUB."'></a>"; |
|
130 | 130 | } |
131 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqObj->faqid() . '&answerid=' . $proposed_answer->answerid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_FAQ_REVIEW . "' alt='" . _AM_SF_FAQ_REVIEW . "'></a> "; |
|
132 | - $delete = "<a href='answer.php?op=del&faqid=" . $faqObj->faqid() . '&answerid=' . $proposed_answer->answerid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETESUBM . "' alt='" . _AM_SF_DELETESUBM . "'></a>"; |
|
131 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqObj->faqid().'&answerid='.$proposed_answer->answerid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_FAQ_REVIEW."' alt='"._AM_SF_FAQ_REVIEW."'></a> "; |
|
132 | + $delete = "<a href='answer.php?op=del&faqid=".$faqObj->faqid().'&answerid='.$proposed_answer->answerid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETESUBM."' alt='"._AM_SF_DELETESUBM."'></a>"; |
|
133 | 133 | echo '<tr>'; |
134 | - echo "<td class='head' align='center'>" . $proposed_answer->answerid() . '</td>'; |
|
135 | - echo "<td class='even' align='left'>" . $proposed_answer->answer() . '</td>'; |
|
134 | + echo "<td class='head' align='center'>".$proposed_answer->answerid().'</td>'; |
|
135 | + echo "<td class='even' align='left'>".$proposed_answer->answer().'</td>'; |
|
136 | 136 | |
137 | 137 | //show name of the answer submitter |
138 | 138 | $submitter = Smartfaq\Utility::getLinkedUnameFromId($proposed_answer->uid(), $smartModuleConfig['userealname']); |
139 | - echo "<td class='even' align='center'>" . $submitter . '</td>'; |
|
139 | + echo "<td class='even' align='center'>".$submitter.'</td>'; |
|
140 | 140 | |
141 | - echo "<td class='even' align='center'>" . $proposed_answer->datesub() . '</td>'; |
|
141 | + echo "<td class='even' align='center'>".$proposed_answer->datesub().'</td>'; |
|
142 | 142 | echo "<td class='even' align='center'> $merge $modify $approve $delete </td>"; |
143 | 143 | echo '</tr>'; |
144 | 144 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | switch ($op) { |
151 | 151 | case 'mod': |
152 | 152 | xoops_cp_header(); |
153 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
153 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
154 | 154 | global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $modify, $myts; |
155 | 155 | $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
156 | 156 | editfaq($faqid); |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $proposed_answers = $answerHandler->getAllAnswers($faqid, Constants::SF_AN_STATUS_PROPOSED); |
258 | 258 | if (count($proposed_answers) > 0) { |
259 | 259 | // This question has other proposed answer |
260 | - $redirect_page = 'answer.php?op=mod&faqid=' . $faqid; |
|
260 | + $redirect_page = 'answer.php?op=mod&faqid='.$faqid; |
|
261 | 261 | $redirect_msg = _AM_SF_ANSWER_REJECTED; |
262 | 262 | } else { |
263 | 263 | // The question has no other proposed answer |
@@ -281,11 +281,11 @@ discard block |
||
281 | 281 | default: |
282 | 282 | xoops_cp_header(); |
283 | 283 | |
284 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
284 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
285 | 285 | global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule; |
286 | 286 | |
287 | 287 | editfaq(); |
288 | 288 | break; |
289 | 289 | } |
290 | 290 | |
291 | -require_once __DIR__ . '/admin_footer.php'; |
|
291 | +require_once __DIR__.'/admin_footer.php'; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | use XoopsModules\Smartfaq; |
15 | 15 | use XoopsModules\Smartfaq\Constants; |
16 | 16 | |
17 | -require_once __DIR__ . '/admin_header.php'; |
|
17 | +require_once __DIR__.'/admin_header.php'; |
|
18 | 18 | |
19 | 19 | $importFromModuleName = 'XoopsFAQ'; |
20 | 20 | $scriptname = 'xoopsfaq.php'; |
@@ -27,33 +27,33 @@ discard block |
||
27 | 27 | |
28 | 28 | if ('start' === $op) { |
29 | 29 | xoops_cp_header(); |
30 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
30 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
31 | 31 | |
32 | - $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('xoopsfaq_categories')); |
|
32 | + $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('xoopsfaq_categories')); |
|
33 | 33 | list($totalCat) = $xoopsDB->fetchRow($result); |
34 | 34 | |
35 | 35 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
36 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>'; |
|
36 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>'; |
|
37 | 37 | echo "<div id='bottomtable'>"; |
38 | 38 | |
39 | 39 | if (0 == $totalCat) { |
40 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_NO_CATEGORY . '</span>'; |
|
40 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_NO_CATEGORY.'</span>'; |
|
41 | 41 | } else { |
42 | - require_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
|
42 | + require_once XOOPS_ROOT_PATH.'/class/xoopstree.php'; |
|
43 | 43 | |
44 | - $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('xoopsfaq_contents')); |
|
44 | + $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('xoopsfaq_contents')); |
|
45 | 45 | list($totalFAQ) = $xoopsDB->fetchRow($result); |
46 | 46 | |
47 | 47 | if (0 == $totalFAQ) { |
48 | - 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>'; |
|
48 | + 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>'; |
|
49 | 49 | } else { |
50 | - 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>'; |
|
50 | + 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>'; |
|
51 | 51 | |
52 | - $form = new \XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL . '/modules/smartfaq/admin/' . $scriptname); |
|
52 | + $form = new \XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL.'/modules/smartfaq/admin/'.$scriptname); |
|
53 | 53 | |
54 | 54 | // Categories to be imported |
55 | 55 | $cat_cbox = new \XoopsFormCheckBox(sprintf(_AM_SF_IMPORT_CATEGORIES, $importFromModuleName), 'import_category', -1); |
56 | - $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'); |
|
56 | + $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'); |
|
57 | 57 | |
58 | 58 | while (list($cid, $cat_title, $count) = $xoopsDB->fetchRow($result)) { |
59 | 59 | $cat_cbox->addOption($cid, "$cat_title ($count)<br\>"); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ob_end_clean(); |
69 | 69 | |
70 | 70 | // Auto-Approve |
71 | - $form->addElement(new \XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '')); |
|
71 | + $form->addElement(new \XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'')); |
|
72 | 72 | |
73 | 73 | // Submitted and answered by |
74 | 74 | $memberHandler = xoops_getHandler('member'); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $form->addElement($user_select); |
82 | 82 | |
83 | 83 | // Q&As can be commented? |
84 | - $form->addElement(new \XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '')); |
|
84 | + $form->addElement(new \XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'')); |
|
85 | 85 | |
86 | 86 | $group_list = $memberHandler->getGroupList(); |
87 | 87 | $groups_selected = []; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | if ('go' === $op) { |
108 | - require_once __DIR__ . '/admin_header.php'; |
|
108 | + require_once __DIR__.'/admin_header.php'; |
|
109 | 109 | |
110 | 110 | $import_category = (isset($_POST['import_category']) ? $_POST['import_category'] : null); |
111 | 111 | if (!$import_category) { |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | xoops_cp_header(); |
116 | 116 | |
117 | 117 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
118 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>'; |
|
118 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>'; |
|
119 | 119 | echo "<div id='bottomtable'>"; |
120 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_RESULT . '</span>'; |
|
120 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_RESULT.'</span>'; |
|
121 | 121 | |
122 | 122 | $cnt_imported_cat = 0; |
123 | 123 | $cnt_imported_faq = 0; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | echo "Can Comment: $cancomment<br>"; |
147 | 147 | echo "Auto aprove: $autoaprove<br>";*/ |
148 | 148 | |
149 | - $resultCat = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('xoopsfaq_categories') . " where category_id in ($import_category_list) order by category_order"); |
|
149 | + $resultCat = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('xoopsfaq_categories')." where category_id in ($import_category_list) order by category_order"); |
|
150 | 150 | |
151 | 151 | while ($arrCat = $xoopsDB->fetchArray($resultCat)) { |
152 | 152 | extract($arrCat, EXTR_PREFIX_ALL, 'xcat'); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $categoryObj->setVar('name', $xcat_category_title); |
161 | 161 | |
162 | 162 | if (!$categoryObj->store(false)) { |
163 | - echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name) . '<br>'; |
|
163 | + echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name).'<br>'; |
|
164 | 164 | continue; |
165 | 165 | } |
166 | 166 | |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | |
169 | 169 | ++$cnt_imported_cat; |
170 | 170 | |
171 | - echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $xcat_category_title) . "<br\>"; |
|
171 | + echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $xcat_category_title)."<br\>"; |
|
172 | 172 | |
173 | - $resultFAQ = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('xoopsfaq_contents') . " where category_id=$xcat_category_id order by contents_order"); |
|
173 | + $resultFAQ = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('xoopsfaq_contents')." where category_id=$xcat_category_id order by contents_order"); |
|
174 | 174 | while ($arrFAQ = $xoopsDB->fetchArray($resultFAQ)) { |
175 | 175 | extract($arrFAQ, EXTR_PREFIX_ALL, 'xfaq'); |
176 | 176 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $faqObj->setVar('cancomment', $cancomment); |
199 | 199 | |
200 | 200 | if (!$faqObj->store(false)) { |
201 | - echo sprintf(' ' . _AM_SF_IMPORT_FAQ_ERROR, $xfaq_contents_title) . '<br>'; |
|
201 | + echo sprintf(' '._AM_SF_IMPORT_FAQ_ERROR, $xfaq_contents_title).'<br>'; |
|
202 | 202 | continue; |
203 | 203 | } else { |
204 | 204 | $answerObj->setVar('faqid', $faqObj->faqid()); |
@@ -207,10 +207,10 @@ discard block |
||
207 | 207 | $answerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED); |
208 | 208 | |
209 | 209 | if (!$answerObj->store()) { |
210 | - echo sprintf(' ' . _AM_SF_IMPORT_FAQ_ERROR) . '<br>'; |
|
210 | + echo sprintf(' '._AM_SF_IMPORT_FAQ_ERROR).'<br>'; |
|
211 | 211 | continue; |
212 | 212 | } else { |
213 | - echo ' ' . sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)) . '<br>'; |
|
213 | + echo ' '.sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)).'<br>'; |
|
214 | 214 | ++$cnt_imported_faq; |
215 | 215 | } |
216 | 216 | } |
@@ -220,8 +220,8 @@ discard block |
||
220 | 220 | } |
221 | 221 | |
222 | 222 | echo 'Done.<br>'; |
223 | - echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat) . '<br>'; |
|
224 | - echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq) . '<br>'; |
|
223 | + echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat).'<br>'; |
|
224 | + echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq).'<br>'; |
|
225 | 225 | |
226 | 226 | exit(); |
227 | 227 | } |