@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** @var Smartfaq\Helper $helper */ |
| 12 | 12 | $helper = Smartfaq\Helper::getInstance(); |
| 13 | 13 | |
| 14 | -require_once __DIR__ . '/header.php'; |
|
| 14 | +require_once __DIR__.'/header.php'; |
|
| 15 | 15 | |
| 16 | 16 | // At which record shall we start for the Categories |
| 17 | 17 | $catstart = \Xmf\Request::getInt('catstart', 0, 'GET'); |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl'; |
| 46 | 46 | |
| 47 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 48 | -require_once __DIR__ . '/footer.php'; |
|
| 47 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 48 | +require_once __DIR__.'/footer.php'; |
|
| 49 | 49 | |
| 50 | 50 | // Creating the categories objects |
| 51 | -$categoriesObj =& $categoryHandler->getCategories($helper->getConfig('catperpage'), $catstart); |
|
| 51 | +$categoriesObj = & $categoryHandler->getCategories($helper->getConfig('catperpage'), $catstart); |
|
| 52 | 52 | // If no categories are found, exit |
| 53 | 53 | $totalCategoriesOnPage = count($categoriesObj); |
| 54 | 54 | if (0 == $totalCategoriesOnPage) { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 79 | 79 | if (isset($last_qnaObj[$subcat_id])) { |
| 80 | 80 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 81 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
| 81 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
| 82 | 82 | } |
| 83 | 83 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
| 84 | 84 | if ($helper->getConfig('displaysubcatonindex')) { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | if ($total > 0) { |
| 97 | 97 | if (isset($last_qnaObj[$cat_id])) { |
| 98 | 98 | $category->setVar('last_faqid', $last_qnaObj[$cat_id]->getVar('faqid')); |
| 99 | - $category->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$cat_id]->getVar('faqid') . "'>" . $last_qnaObj[$cat_id]->question($lastfaqsize) . '</a>'); |
|
| 99 | + $category->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$cat_id]->getVar('faqid')."'>".$last_qnaObj[$cat_id]->question($lastfaqsize).'</a>'); |
|
| 100 | 100 | } |
| 101 | 101 | $category->setVar('faqcount', $total); |
| 102 | 102 | if (!isset($categories[$cat_id])) { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | $memberHandler = xoops_getHandler('member'); |
| 138 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 138 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 139 | 139 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
| 140 | 140 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
| 141 | 141 | |
@@ -161,14 +161,14 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | // Language constants |
| 164 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 164 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 165 | 165 | $xoopsTpl->assign('whereInSection', $moduleName); |
| 166 | 166 | $xoopsTpl->assign('displaysubcatonindex', $helper->getConfig('displaysubcatonindex')); |
| 167 | 167 | $xoopsTpl->assign('displaylastfaqs', $helper->getConfig('displaylastfaqs')); |
| 168 | 168 | $xoopsTpl->assign('display_categoryname', true); |
| 169 | 169 | $xoopsTpl->assign('displayFull', 'full' === $helper->getConfig('displaytype')); |
| 170 | 170 | |
| 171 | -$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD . ' ' . $moduleName); |
|
| 171 | +$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD.' '.$moduleName); |
|
| 172 | 172 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($helper->getConfig('indexwelcomemsg'), 1)); |
| 173 | 173 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_SMARTFAQS); |
| 174 | 174 | $xoopsTpl->assign('lang_home', _MD_SF_HOME); |
@@ -187,20 +187,20 @@ discard block |
||
| 187 | 187 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
| 188 | 188 | |
| 189 | 189 | // Category Navigation Bar |
| 190 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 190 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 191 | 191 | $pagenav = new \XoopsPageNav($totalCategories, $helper->getConfig('catperpage'), $catstart, 'catstart', ''); |
| 192 | 192 | if (1 == $helper->getConfig('useimagenavpage')) { |
| 193 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 193 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 194 | 194 | } else { |
| 195 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 195 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | // FAQ Navigation Bar |
| 199 | 199 | $pagenav = new \XoopsPageNav($totalFaqs, $helper->getConfig('indexperpage'), $start, 'start', ''); |
| 200 | 200 | if (1 == $helper->getConfig('useimagenavpage')) { |
| 201 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 201 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 202 | 202 | } else { |
| 203 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 203 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // Page Title Hack by marcan |
@@ -208,4 +208,4 @@ discard block |
||
| 208 | 208 | $xoopsTpl->assign('xoops_pagetitle', $module_name); |
| 209 | 209 | // End Page Title Hack by marcan |
| 210 | 210 | |
| 211 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 211 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | /** @var Smartfaq\Helper $helper */ |
| 13 | 13 | $helper = Smartfaq\Helper::getInstance(); |
| 14 | 14 | |
| 15 | -require_once __DIR__ . '/header.php'; |
|
| 15 | +require_once __DIR__.'/header.php'; |
|
| 16 | 16 | |
| 17 | 17 | global $xoopsUser, $xoopsConfig, $xoopsModule; |
| 18 | 18 | |
@@ -135,12 +135,12 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | // Storing the FAQ object in the database |
| 137 | 137 | if (!$faqObj->store()) { |
| 138 | - redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR . Smartfaq\Utility::formatErrors($faqObj->getErrors())); |
|
| 138 | + redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR.Smartfaq\Utility::formatErrors($faqObj->getErrors())); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // Storing the answer object in the database |
| 142 | 142 | if (!$newAnswerObj->store()) { |
| 143 | - redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR . Smartfaq\Utility::formatErrors($newAnswerObj->getErrors())); |
|
| 143 | + redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR.Smartfaq\Utility::formatErrors($newAnswerObj->getErrors())); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** @var \XoopsNotificationHandler $notificationHandler */ |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | case 2: |
| 158 | 158 | // Answer for an open question submitted, auto-approved; became Q&A, need approbation |
| 159 | 159 | if (isset($_POST['notifypub']) && 1 == $_POST['notifypub']) { |
| 160 | - require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 160 | + require_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 161 | 161 | $notificationHandler->subscribe('faq', $faqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 162 | 162 | } |
| 163 | 163 | // Send notifications |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | case 3: |
| 168 | 168 | // Answer submitted, needs approbation |
| 169 | 169 | if (isset($_POST['notifypub']) && 1 == $_POST['notifypub']) { |
| 170 | - require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 170 | + require_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 171 | 171 | $notificationHandler->subscribe('question', $newAnswerObj->answerid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 172 | 172 | } |
| 173 | 173 | // Send notifications |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | // New answer submitted for a published Q&A, need approbation |
| 183 | 183 | // Send notifications |
| 184 | 184 | if (isset($_POST['notifypub']) && 1 == $_POST['notifypub']) { |
| 185 | - require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 185 | + require_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 186 | 186 | $notificationHandler->subscribe('faq', $newAnswerObj->answerid(), 'answer_approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -218,20 +218,20 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
| 221 | - require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 222 | - require_once __DIR__ . '/footer.php'; |
|
| 221 | + require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 222 | + require_once __DIR__.'/footer.php'; |
|
| 223 | 223 | |
| 224 | 224 | $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
| 225 | 225 | |
| 226 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 226 | + $moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 227 | 227 | $xoopsTpl->assign('whereInSection', $moduleName); |
| 228 | 228 | $xoopsTpl->assign('lang_submit', _MD_SF_SUBMITANSWER); |
| 229 | 229 | |
| 230 | 230 | $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUBMITANSWERTO, ucwords($xoopsModule->name()))); |
| 231 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUBMITANSWER_INTRO); |
|
| 231 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUBMITANSWER_INTRO); |
|
| 232 | 232 | |
| 233 | - require_once __DIR__ . '/include/answer.inc.php'; |
|
| 233 | + require_once __DIR__.'/include/answer.inc.php'; |
|
| 234 | 234 | |
| 235 | - require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 235 | + require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
| 236 | 236 | break; |
| 237 | 237 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $attachment_save = base64_encode(serialize($this->attachment_array)); |
| 103 | 103 | } |
| 104 | 104 | $this->setVar('attachment', $attachment_save); |
| 105 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid'); |
|
| 105 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('smartfaq_answers').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachment_save).' WHERE post_id = '.$this->getVar('answerid'); |
|
| 106 | 106 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 107 | 107 | //xoops_error($GLOBALS["xoopsDB"]->error()); |
| 108 | 108 | return false; |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | foreach ($attach_old as $key => $attach) { |
| 137 | 137 | if (in_array($key, $attach_array)) { |
| 138 | - @unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attach['name_saved']); |
|
| 139 | - @unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/thumbs/' . $attach['name_saved']); // delete thumbnails |
|
| 138 | + @unlink(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$attach['name_saved']); |
|
| 139 | + @unlink(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/thumbs/'.$attach['name_saved']); // delete thumbnails |
|
| 140 | 140 | continue; |
| 141 | 141 | } |
| 142 | 142 | $this->attachment_array[$key] = $attach; |
@@ -195,24 +195,24 @@ discard block |
||
| 195 | 195 | if (is_array($attachments) && count($attachments) > 0) { |
| 196 | 196 | $iconHandler = sf_getIconHandler(); |
| 197 | 197 | $mime_path = $iconHandler->getPath('mime'); |
| 198 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/include/functions.image.php'; |
|
| 198 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/include/functions.image.php'; |
|
| 199 | 199 | $image_extensions = ['jpg', 'jpeg', 'gif', 'png', 'bmp']; // need improve !!! |
| 200 | - $post_attachment .= '<br><strong>' . _MD_ATTACHMENT . '</strong>:'; |
|
| 200 | + $post_attachment .= '<br><strong>'._MD_ATTACHMENT.'</strong>:'; |
|
| 201 | 201 | $post_attachment .= '<br><hr size="1" noshade="noshade"><br>'; |
| 202 | 202 | foreach ($attachments as $key => $att) { |
| 203 | 203 | $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.'); |
| 204 | 204 | $filetype = $file_extension; |
| 205 | - if (file_exists(XOOPS_ROOT_PATH . '/' . $mime_path . '/' . $filetype . '.gif')) { |
|
| 206 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif'; |
|
| 205 | + if (file_exists(XOOPS_ROOT_PATH.'/'.$mime_path.'/'.$filetype.'.gif')) { |
|
| 206 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif'; |
|
| 207 | 207 | } else { |
| 208 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif'; |
|
| 208 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif'; |
|
| 209 | 209 | } |
| 210 | - $file_size = @filesize(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $att['name_saved']); |
|
| 211 | - $file_size = number_format($file_size / 1024, 2) . ' KB'; |
|
| 210 | + $file_size = @filesize(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$att['name_saved']); |
|
| 211 | + $file_size = number_format($file_size / 1024, 2).' KB'; |
|
| 212 | 212 | if ($helper->getConfig('media_allowed') && in_array(strtolower($file_extension), $image_extensions)) { |
| 213 | - $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '"><strong> ' . $att['name_display'] . '</strong> <small>(' . $file_size . ')</small>'; |
|
| 214 | - $post_attachment .= '<br>' . sf_attachmentImage($att['name_saved']); |
|
| 215 | - $isDisplayed = true; |
|
| 213 | + $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'"><strong> '.$att['name_display'].'</strong> <small>('.$file_size.')</small>'; |
|
| 214 | + $post_attachment .= '<br>'.sf_attachmentImage($att['name_saved']); |
|
| 215 | + $isDisplayed = true; |
|
| 216 | 216 | } else { |
| 217 | 217 | global $xoopsUser; |
| 218 | 218 | if (empty($helper->getConfig('show_userattach'))) { |
@@ -369,9 +369,9 @@ discard block |
||
| 369 | 369 | $tags = []; |
| 370 | 370 | $tags['MODULE_NAME'] = $myts->displayTarea($smartModule->getVar('name')); |
| 371 | 371 | $tags['FAQ_NAME'] = $faqObj->question(); |
| 372 | - $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $faqObj->faqid(); |
|
| 372 | + $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$faqObj->faqid(); |
|
| 373 | 373 | $tags['CATEGORY_NAME'] = $faqObj->getCategoryName(); |
| 374 | - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $faqObj->categoryid(); |
|
| 374 | + $tags['CATEGORY_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$faqObj->categoryid(); |
|
| 375 | 375 | $tags['FAQ_QUESTION'] = $faqObj->question(); |
| 376 | 376 | |
| 377 | 377 | // TODO : Not sure about the 'formpreview' ... |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | break; |
| 72 | 72 | |
| 73 | 73 | case 'inside': |
| 74 | - return XOOPS_URL . '/modules/smartfaq/doc/'; |
|
| 74 | + return XOOPS_URL.'/modules/smartfaq/doc/'; |
|
| 75 | 75 | break; |
| 76 | 76 | |
| 77 | 77 | case 'custom': |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | $ret = ''; |
| 90 | 90 | foreach ($errors as $key => $value) { |
| 91 | - $ret .= '<br> - ' . $value; |
|
| 91 | + $ret .= '<br> - '.$value; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | return $ret; |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | $spaces .= '--'; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - $ret .= "<option value='" . $categoryObj->categoryid() . "'"; |
|
| 115 | + $ret .= "<option value='".$categoryObj->categoryid()."'"; |
|
| 116 | 116 | if ($selectedid == $categoryObj->categoryid()) { |
| 117 | 117 | $ret .= ' selected'; |
| 118 | 118 | } |
| 119 | - $ret .= '>' . $spaces . $categoryObj->name() . "</option>\n"; |
|
| 119 | + $ret .= '>'.$spaces.$categoryObj->name()."</option>\n"; |
|
| 120 | 120 | |
| 121 | - $subCategoriesObj =& $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
|
| 121 | + $subCategoriesObj = & $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
|
| 122 | 122 | if (count($subCategoriesObj) > 0) { |
| 123 | 123 | ++$level; |
| 124 | 124 | foreach ($subCategoriesObj as $catID => $subCategoryObj) { |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public static function createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true) |
| 139 | 139 | { |
| 140 | - $ret = '' . _MB_SF_SELECTCAT . " <select name='options[]'>"; |
|
| 140 | + $ret = ''._MB_SF_SELECTCAT." <select name='options[]'>"; |
|
| 141 | 141 | if ($allCatOption) { |
| 142 | 142 | $ret .= "<option value='0'"; |
| 143 | - $ret .= '>' . _MB_SF_ALLCAT . "</option>\n"; |
|
| 143 | + $ret .= '>'._MB_SF_ALLCAT."</option>\n"; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | // Creating the category handler object |
@@ -209,9 +209,9 @@ discard block |
||
| 209 | 209 | { |
| 210 | 210 | $smartModule = self::getModuleInfo(); |
| 211 | 211 | |
| 212 | - $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . ''; |
|
| 212 | + $modfootertxt = 'Module '.$smartModule->getInfo('name').' - Version '.$smartModule->getInfo('version').''; |
|
| 213 | 213 | |
| 214 | - $modfooter = "<a href='" . $smartModule->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/sfcssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'></a>"; |
|
| 214 | + $modfooter = "<a href='".$smartModule->getInfo('support_site_url')."' target='_blank'><img src='".XOOPS_URL."/modules/smartfaq/assets/images/sfcssbutton.gif' title='".$modfootertxt."' alt='".$modfootertxt."'></a>"; |
|
| 215 | 215 | |
| 216 | 216 | return $modfooter; |
| 217 | 217 | } |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $module_id = $smartModule->getVar('mid'); |
| 234 | 234 | |
| 235 | 235 | if (!empty($xoopsUser)) { |
| 236 | - $groups =& $xoopsUser->getGroups(); |
|
| 236 | + $groups = & $xoopsUser->getGroups(); |
|
| 237 | 237 | $result = in_array(XOOPS_GROUP_ADMIN, $groups) || $xoopsUser->isAdmin($module_id); |
| 238 | 238 | } |
| 239 | 239 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | $gpermHandler = xoops_getHandler('groupperm'); |
| 309 | 309 | |
| 310 | - $sql = 'SELECT faqid FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE categoryid = '$categoryid' "; |
|
| 310 | + $sql = 'SELECT faqid FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE categoryid = '$categoryid' "; |
|
| 311 | 311 | $result = $xoopsDB->queryF($sql); |
| 312 | 312 | |
| 313 | 313 | if ($GLOBALS['xoopsDB']->getRowsNum($result) > 0) { |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | $ret = []; |
| 423 | 423 | global $xoopsDB; |
| 424 | 424 | |
| 425 | - $result = $xoopsDB->queryF('SELECT * FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE faqid = '$faqid'"); |
|
| 425 | + $result = $xoopsDB->queryF('SELECT * FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE faqid = '$faqid'"); |
|
| 426 | 426 | $ret = $xoopsDB->fetchArray($result); |
| 427 | 427 | |
| 428 | 428 | return $ret; |
@@ -439,31 +439,31 @@ discard block |
||
| 439 | 439 | // TODO : Move this to the Smartfaq\Faq class |
| 440 | 440 | public static function getAdminLinks($faqid = 0, $open = false) |
| 441 | 441 | { |
| 442 | - global $xoopsUser, $xoopsModule, $xoopsConfig; |
|
| 442 | + global $xoopsUser, $xoopsModule, $xoopsConfig; |
|
| 443 | 443 | /** @var Smartfaq\Helper $helper */ |
| 444 | 444 | $helper = Smartfaq\Helper::getInstance(); |
| 445 | 445 | |
| 446 | 446 | $adminLinks = ''; |
| 447 | - $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/'; |
|
| 447 | + $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/'; |
|
| 448 | 448 | $page = $open ? 'question.php' : 'faq.php'; |
| 449 | 449 | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { |
| 450 | 450 | // Edit button |
| 451 | - $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=mod&faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/edit.gif'" . " title='" . _MD_SF_EDIT . "' alt='" . _MD_SF_EDIT . "'></a>"; |
|
| 451 | + $adminLinks .= "<a href='".$modulePath."admin/$page?op=mod&faqid=".$faqid."'><img src='".$modulePath."assets/images/links/edit.gif'"." title='"._MD_SF_EDIT."' alt='"._MD_SF_EDIT."'></a>"; |
|
| 452 | 452 | $adminLinks .= ' '; |
| 453 | 453 | // Delete button |
| 454 | - $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=del&faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/delete.gif'" . " title='" . _MD_SF_DELETE . "' alt='" . _MD_SF_DELETE . "'></a>"; |
|
| 454 | + $adminLinks .= "<a href='".$modulePath."admin/$page?op=del&faqid=".$faqid."'><img src='".$modulePath."assets/images/links/delete.gif'"." title='"._MD_SF_DELETE."' alt='"._MD_SF_DELETE."'></a>"; |
|
| 455 | 455 | $adminLinks .= ' '; |
| 456 | 456 | } |
| 457 | 457 | // Print button |
| 458 | - $adminLinks .= "<a href='" . $modulePath . 'print.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/print.gif' title='" . _MD_SF_PRINT . "' alt='" . _MD_SF_PRINT . "'></a>"; |
|
| 458 | + $adminLinks .= "<a href='".$modulePath.'print.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/print.gif' title='"._MD_SF_PRINT."' alt='"._MD_SF_PRINT."'></a>"; |
|
| 459 | 459 | $adminLinks .= ' '; |
| 460 | 460 | // Email button |
| 461 | - $maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . $modulePath . 'faq.php?faqid=' . $faqid; |
|
| 462 | - $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'></a>"; |
|
| 461 | + $maillink = 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).': '.$modulePath.'faq.php?faqid='.$faqid; |
|
| 462 | + $adminLinks .= '<a href="'.$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'></a>"; |
|
| 463 | 463 | $adminLinks .= ' '; |
| 464 | 464 | // Submit New Answer button |
| 465 | 465 | if ($helper->getConfig('allownewanswer') && (is_object($xoopsUser) || $helper->getConfig('anonpost'))) { |
| 466 | - $adminLinks .= "<a href='" . $modulePath . 'answer.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/newanswer.gif' title='" . _MD_SF_SUBMITANSWER . "' alt='" . _MD_SF_SUBMITANSWER . "'></a>"; |
|
| 466 | + $adminLinks .= "<a href='".$modulePath.'answer.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/newanswer.gif' title='"._MD_SF_SUBMITANSWER."' alt='"._MD_SF_SUBMITANSWER."'></a>"; |
|
| 467 | 467 | $adminLinks .= ' '; |
| 468 | 468 | } |
| 469 | 469 | |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | if (!isset($users[$userid])) { |
| 495 | 495 | return $GLOBALS['xoopsConfig']['anonymous']; |
| 496 | 496 | } |
| 497 | - $user =& $users[$userid]; |
|
| 497 | + $user = & $users[$userid]; |
|
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | if (is_object($user)) { |
@@ -508,9 +508,9 @@ discard block |
||
| 508 | 508 | $fullname = $user->getVar('name'); |
| 509 | 509 | } |
| 510 | 510 | if (!empty($fullname)) { |
| 511 | - $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]'; |
|
| 511 | + $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]'; |
|
| 512 | 512 | } else { |
| 513 | - $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>'; |
|
| 513 | + $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>'; |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | return $linkeduser; |
@@ -592,6 +592,6 @@ discard block |
||
| 592 | 592 | //--> |
| 593 | 593 | </script> |
| 594 | 594 | <?php |
| 595 | - echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">"; |
|
| 595 | + echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">"; |
|
| 596 | 596 | } |
| 597 | 597 | } |
@@ -52,18 +52,18 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | echo '<tr>'; |
| 54 | 54 | echo "<td class='even' align='lefet'>" |
| 55 | - . $spaces |
|
| 56 | - . "<a href='" |
|
| 57 | - . XOOPS_URL |
|
| 58 | - . '/modules/' |
|
| 59 | - . $xoopsModule->dirname() |
|
| 60 | - . '/category.php?categoryid=' |
|
| 61 | - . $categoryObj->categoryid() |
|
| 62 | - . "'><img src='" |
|
| 63 | - . XOOPS_URL |
|
| 64 | - . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''> " |
|
| 65 | - . $categoryObj->name() |
|
| 66 | - . '</a></td>'; |
|
| 55 | + . $spaces |
|
| 56 | + . "<a href='" |
|
| 57 | + . XOOPS_URL |
|
| 58 | + . '/modules/' |
|
| 59 | + . $xoopsModule->dirname() |
|
| 60 | + . '/category.php?categoryid=' |
|
| 61 | + . $categoryObj->categoryid() |
|
| 62 | + . "'><img src='" |
|
| 63 | + . XOOPS_URL |
|
| 64 | + . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''> " |
|
| 65 | + . $categoryObj->name() |
|
| 66 | + . '</a></td>'; |
|
| 67 | 67 | echo "<td class='even' align='left'>" . $description . '</td>'; |
| 68 | 68 | echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>'; |
| 69 | 69 | echo "<td class='even' align='center'> $modify $delete </td>"; |
@@ -323,11 +323,11 @@ discard block |
||
| 323 | 323 | $categoryid = \Xmf\Request::getInt('categoryid', 0, 'GET'); |
| 324 | 324 | xoops_cp_header(); |
| 325 | 325 | xoops_confirm([ |
| 326 | - 'op' => 'del', |
|
| 327 | - 'categoryid' => $categoryObj->categoryid(), |
|
| 328 | - 'confirm' => 1, |
|
| 329 | - 'name' => $categoryObj->name() |
|
| 330 | - ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
| 326 | + 'op' => 'del', |
|
| 327 | + 'categoryid' => $categoryObj->categoryid(), |
|
| 328 | + 'confirm' => 1, |
|
| 329 | + 'name' => $categoryObj->name() |
|
| 330 | + ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
| 331 | 331 | xoops_cp_footer(); |
| 332 | 332 | } |
| 333 | 333 | exit(); |
@@ -236,149 +236,149 @@ |
||
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | switch ($op) { |
| 239 | - case 'mod': |
|
| 240 | - $categoryid = \Xmf\Request::getInt('categoryid', 0, 'GET'); |
|
| 241 | - $destList = \Xmf\Request::getString('destList', '', 'POST'); |
|
| 242 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 243 | - xoops_cp_header(); |
|
| 239 | + case 'mod': |
|
| 240 | + $categoryid = \Xmf\Request::getInt('categoryid', 0, 'GET'); |
|
| 241 | + $destList = \Xmf\Request::getString('destList', '', 'POST'); |
|
| 242 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 243 | + xoops_cp_header(); |
|
| 244 | 244 | |
| 245 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 246 | - editcat(true, $categoryid); |
|
| 247 | - break; |
|
| 245 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 246 | + editcat(true, $categoryid); |
|
| 247 | + break; |
|
| 248 | 248 | |
| 249 | - case 'addcategory': |
|
| 250 | - global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $modify, $myts, $categoryid; |
|
| 249 | + case 'addcategory': |
|
| 250 | + global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $modify, $myts, $categoryid; |
|
| 251 | 251 | |
| 252 | - $categoryid = \Xmf\Request::getInt('categoryid', 0, 'POST'); |
|
| 252 | + $categoryid = \Xmf\Request::getInt('categoryid', 0, 'POST'); |
|
| 253 | 253 | |
| 254 | - if (0 != $categoryid) { |
|
| 255 | - $categoryObj = new Smartfaq\Category($categoryid); |
|
| 256 | - } else { |
|
| 257 | - $categoryObj = $categoryHandler->create(); |
|
| 258 | - } |
|
| 254 | + if (0 != $categoryid) { |
|
| 255 | + $categoryObj = new Smartfaq\Category($categoryid); |
|
| 256 | + } else { |
|
| 257 | + $categoryObj = $categoryHandler->create(); |
|
| 258 | + } |
|
| 259 | 259 | |
| 260 | - //if (isset($_POST['allmods'])) $allmods = $_POST['allmods']; |
|
| 261 | - //if (isset($_POST['moderators'])) $moderators = $_POST['moderators']; |
|
| 260 | + //if (isset($_POST['allmods'])) $allmods = $_POST['allmods']; |
|
| 261 | + //if (isset($_POST['moderators'])) $moderators = $_POST['moderators']; |
|
| 262 | 262 | |
| 263 | - $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0); |
|
| 264 | - $applyall = \Xmf\Request::getInt('applyall', 0, 'POST'); |
|
| 265 | - $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1); |
|
| 263 | + $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0); |
|
| 264 | + $applyall = \Xmf\Request::getInt('applyall', 0, 'POST'); |
|
| 265 | + $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1); |
|
| 266 | 266 | |
| 267 | - // Groups and permissions |
|
| 268 | - if (isset($_POST['groups_read'])) { |
|
| 269 | - $categoryObj->setGroups_read($_POST['groups_read']); |
|
| 270 | - } else { |
|
| 271 | - $categoryObj->setGroups_read(); |
|
| 272 | - } |
|
| 273 | - // $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array(); |
|
| 274 | - // $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array(); |
|
| 275 | - |
|
| 276 | - $categoryObj->setVar('name', $_POST['name']); |
|
| 277 | - |
|
| 278 | - $categoryObj->setVar('description', $_POST['description']); |
|
| 279 | - if ($categoryObj->isNew()) { |
|
| 280 | - $redirect_msg = _AM_SF_CATCREATED; |
|
| 281 | - $redirect_to = 'category.php?op=mod'; |
|
| 282 | - } else { |
|
| 283 | - $redirect_msg = _AM_SF_COLMODIFIED; |
|
| 284 | - $redirect_to = 'category.php'; |
|
| 285 | - } |
|
| 286 | - |
|
| 287 | - if (!$categoryObj->store()) { |
|
| 288 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . Smartfaq\Utility::formatErrors($categoryObj->getErrors())); |
|
| 289 | - } |
|
| 290 | - // TODO : put this function in the category class |
|
| 291 | - Smartfaq\Utility::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
|
| 292 | - //Smartfaq\Utility::saveCategoryPermissions($groups_admin, $categoriesObj->categoryid(), 'category_admin'); |
|
| 267 | + // Groups and permissions |
|
| 268 | + if (isset($_POST['groups_read'])) { |
|
| 269 | + $categoryObj->setGroups_read($_POST['groups_read']); |
|
| 270 | + } else { |
|
| 271 | + $categoryObj->setGroups_read(); |
|
| 272 | + } |
|
| 273 | + // $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array(); |
|
| 274 | + // $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array(); |
|
| 275 | + |
|
| 276 | + $categoryObj->setVar('name', $_POST['name']); |
|
| 277 | + |
|
| 278 | + $categoryObj->setVar('description', $_POST['description']); |
|
| 279 | + if ($categoryObj->isNew()) { |
|
| 280 | + $redirect_msg = _AM_SF_CATCREATED; |
|
| 281 | + $redirect_to = 'category.php?op=mod'; |
|
| 282 | + } else { |
|
| 283 | + $redirect_msg = _AM_SF_COLMODIFIED; |
|
| 284 | + $redirect_to = 'category.php'; |
|
| 285 | + } |
|
| 293 | 286 | |
| 294 | - if ($applyall) { |
|
| 287 | + if (!$categoryObj->store()) { |
|
| 288 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . Smartfaq\Utility::formatErrors($categoryObj->getErrors())); |
|
| 289 | + } |
|
| 295 | 290 | // TODO : put this function in the category class |
| 296 | - Smartfaq\Utility::overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid()); |
|
| 297 | - } |
|
| 291 | + Smartfaq\Utility::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
|
| 292 | + //Smartfaq\Utility::saveCategoryPermissions($groups_admin, $categoriesObj->categoryid(), 'category_admin'); |
|
| 298 | 293 | |
| 299 | - redirect_header($redirect_to, 2, $redirect_msg); |
|
| 300 | - break; |
|
| 294 | + if ($applyall) { |
|
| 295 | + // TODO : put this function in the category class |
|
| 296 | + Smartfaq\Utility::overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid()); |
|
| 297 | + } |
|
| 301 | 298 | |
| 302 | - case 'del': |
|
| 303 | - global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; |
|
| 299 | + redirect_header($redirect_to, 2, $redirect_msg); |
|
| 300 | + break; |
|
| 304 | 301 | |
| 305 | - $module_id = $xoopsModule->getVar('mid'); |
|
| 306 | - $gpermHandler = xoops_getHandler('groupperm'); |
|
| 302 | + case 'del': |
|
| 303 | + global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; |
|
| 307 | 304 | |
| 308 | - $categoryid = \Xmf\Request::getInt('categoryid', 0, 'POST'); |
|
| 309 | - $categoryid = \Xmf\Request::getInt('categoryid', $categoryid, 'GET'); |
|
| 305 | + $module_id = $xoopsModule->getVar('mid'); |
|
| 306 | + $gpermHandler = xoops_getHandler('groupperm'); |
|
| 310 | 307 | |
| 311 | - $categoryObj = new Smartfaq\Category($categoryid); |
|
| 308 | + $categoryid = \Xmf\Request::getInt('categoryid', 0, 'POST'); |
|
| 309 | + $categoryid = \Xmf\Request::getInt('categoryid', $categoryid, 'GET'); |
|
| 312 | 310 | |
| 313 | - $confirm = \Xmf\Request::getInt('confirm', 0, POST); |
|
| 314 | - $name = \Xmf\Request::getString('name', '', 'POST'); |
|
| 311 | + $categoryObj = new Smartfaq\Category($categoryid); |
|
| 315 | 312 | |
| 316 | - if ($confirm) { |
|
| 317 | - if (!$categoryHandler->delete($categoryObj)) { |
|
| 318 | - redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR); |
|
| 313 | + $confirm = \Xmf\Request::getInt('confirm', 0, POST); |
|
| 314 | + $name = \Xmf\Request::getString('name', '', 'POST'); |
|
| 315 | + |
|
| 316 | + if ($confirm) { |
|
| 317 | + if (!$categoryHandler->delete($categoryObj)) { |
|
| 318 | + redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR); |
|
| 319 | + } |
|
| 320 | + redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name)); |
|
| 321 | + } else { |
|
| 322 | + // no confirm: show deletion condition |
|
| 323 | + $categoryid = \Xmf\Request::getInt('categoryid', 0, 'GET'); |
|
| 324 | + xoops_cp_header(); |
|
| 325 | + xoops_confirm([ |
|
| 326 | + 'op' => 'del', |
|
| 327 | + 'categoryid' => $categoryObj->categoryid(), |
|
| 328 | + 'confirm' => 1, |
|
| 329 | + 'name' => $categoryObj->name() |
|
| 330 | + ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
| 331 | + xoops_cp_footer(); |
|
| 319 | 332 | } |
| 320 | - redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name)); |
|
| 321 | - } else { |
|
| 322 | - // no confirm: show deletion condition |
|
| 323 | - $categoryid = \Xmf\Request::getInt('categoryid', 0, 'GET'); |
|
| 333 | + exit(); |
|
| 334 | + break; |
|
| 335 | + |
|
| 336 | + case 'cancel': |
|
| 337 | + redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, '')); |
|
| 338 | + break; |
|
| 339 | + case 'default': |
|
| 340 | + default: |
|
| 341 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 324 | 342 | xoops_cp_header(); |
| 325 | - xoops_confirm([ |
|
| 326 | - 'op' => 'del', |
|
| 327 | - 'categoryid' => $categoryObj->categoryid(), |
|
| 328 | - 'confirm' => 1, |
|
| 329 | - 'name' => $categoryObj->name() |
|
| 330 | - ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
| 331 | - xoops_cp_footer(); |
|
| 332 | - } |
|
| 333 | - exit(); |
|
| 334 | - break; |
|
| 335 | - |
|
| 336 | - case 'cancel': |
|
| 337 | - redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, '')); |
|
| 338 | - break; |
|
| 339 | - case 'default': |
|
| 340 | - default: |
|
| 341 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 342 | - xoops_cp_header(); |
|
| 343 | - |
|
| 344 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
| 345 | - echo "<br>\n"; |
|
| 346 | 343 | |
| 347 | - // Creating the objects for top categories |
|
| 348 | - $categoriesObj =& $categoryHandler->getCategories($helper->getConfig('perpage'), $startcategory, 0); |
|
| 349 | - |
|
| 350 | - Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
|
| 351 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
| 352 | - echo "<div id='toptable'>"; |
|
| 353 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
| 354 | - |
|
| 355 | - echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
|
| 356 | - echo '<tr>'; |
|
| 357 | - echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
| 358 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
| 359 | - echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
| 360 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
| 361 | - echo '</tr>'; |
|
| 362 | - $totalCategories = $categoryHandler->getCategoriesCount(0); |
|
| 363 | - if (count($categoriesObj) > 0) { |
|
| 364 | - foreach ($categoriesObj as $key => $thiscat) { |
|
| 365 | - displayCategory($thiscat); |
|
| 366 | - } |
|
| 367 | - } else { |
|
| 344 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
| 345 | + echo "<br>\n"; |
|
| 346 | + |
|
| 347 | + // Creating the objects for top categories |
|
| 348 | + $categoriesObj =& $categoryHandler->getCategories($helper->getConfig('perpage'), $startcategory, 0); |
|
| 349 | + |
|
| 350 | + Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
|
| 351 | + echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
| 352 | + echo "<div id='toptable'>"; |
|
| 353 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
| 354 | + |
|
| 355 | + echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
|
| 368 | 356 | echo '<tr>'; |
| 369 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
| 357 | + echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
| 358 | + echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
| 359 | + echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
| 360 | + echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
| 370 | 361 | echo '</tr>'; |
| 371 | - $categoryid = '0'; |
|
| 372 | - } |
|
| 373 | - echo "</table>\n"; |
|
| 374 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 375 | - $pagenav = new \XoopsPageNav($totalCategories, $helper->getConfig('perpage'), $startcategory, 'startcategory'); |
|
| 376 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 377 | - echo '</div>'; |
|
| 362 | + $totalCategories = $categoryHandler->getCategoriesCount(0); |
|
| 363 | + if (count($categoriesObj) > 0) { |
|
| 364 | + foreach ($categoriesObj as $key => $thiscat) { |
|
| 365 | + displayCategory($thiscat); |
|
| 366 | + } |
|
| 367 | + } else { |
|
| 368 | + echo '<tr>'; |
|
| 369 | + echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
| 370 | + echo '</tr>'; |
|
| 371 | + $categoryid = '0'; |
|
| 372 | + } |
|
| 373 | + echo "</table>\n"; |
|
| 374 | + require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 375 | + $pagenav = new \XoopsPageNav($totalCategories, $helper->getConfig('perpage'), $startcategory, 'startcategory'); |
|
| 376 | + echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 377 | + echo '</div>'; |
|
| 378 | 378 | |
| 379 | - editcat(false); |
|
| 379 | + editcat(false); |
|
| 380 | 380 | |
| 381 | - break; |
|
| 381 | + break; |
|
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | 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 | /** @var Smartfaq\Helper $helper */ |
| 14 | 14 | $helper = Smartfaq\Helper::getInstance(); |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | $description = $categoryObj->description(); |
| 40 | 40 | if (!XOOPS_USE_MULTIBYTES) { |
| 41 | 41 | if (strlen($description) >= 100) { |
| 42 | - $description = substr($description, 0, 100 - 1) . '...'; |
|
| 42 | + $description = substr($description, 0, 100 - 1).'...'; |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | - $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITCOL . "' alt='" . _AM_SF_EDITCOL . "'></a>"; |
|
| 46 | - $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETECOL . "' alt='" . _AM_SF_DELETECOL . "'></a>"; |
|
| 45 | + $modify = "<a href='category.php?op=mod&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITCOL."' alt='"._AM_SF_EDITCOL."'></a>"; |
|
| 46 | + $delete = "<a href='category.php?op=del&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETECOL."' alt='"._AM_SF_DELETECOL."'></a>"; |
|
| 47 | 47 | |
| 48 | 48 | $spaces = ''; |
| 49 | 49 | for ($j = 0; $j < $level; ++$j) { |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''> " |
| 65 | 65 | . $categoryObj->name() |
| 66 | 66 | . '</a></td>'; |
| 67 | - echo "<td class='even' align='left'>" . $description . '</td>'; |
|
| 68 | - echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>'; |
|
| 67 | + echo "<td class='even' align='left'>".$description.'</td>'; |
|
| 68 | + echo "<td class='even' align='center'>".$categoryObj->weight().'</td>'; |
|
| 69 | 69 | echo "<td class='even' align='center'> $modify $delete </td>"; |
| 70 | 70 | echo '</tr>'; |
| 71 | - $subCategoriesObj =& $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
|
| 71 | + $subCategoriesObj = & $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
|
| 72 | 72 | if (count($subCategoriesObj) > 0) { |
| 73 | 73 | ++$level; |
| 74 | 74 | foreach ($subCategoriesObj as $key => $thiscat) { |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | //$moderators = array(); // just to define the variable |
| 88 | 88 | //$allmods = array(); |
| 89 | 89 | $startfaq = \Xmf\Request::getInt('startfaq', 0, 'GET'); |
| 90 | - global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify, $xoopsModule, $_GET; |
|
| 90 | + global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify, $xoopsModule, $_GET; |
|
| 91 | 91 | /** @var Smartfaq\Helper $helper */ |
| 92 | 92 | $helper = Smartfaq\Helper::getInstance(); |
| 93 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 93 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 94 | 94 | |
| 95 | 95 | // Creating the faq handler object |
| 96 | 96 | /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */ |
@@ -113,13 +113,13 @@ discard block |
||
| 113 | 113 | redirect_header('category.php', 1, _AM_SF_NOCOLTOEDIT); |
| 114 | 114 | } |
| 115 | 115 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
| 116 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_EDITCOL . '</h3>'; |
|
| 116 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_EDITCOL.'</h3>'; |
|
| 117 | 117 | echo "<div id='bottomtable'>"; |
| 118 | 118 | } else { |
| 119 | 119 | $categoryObj = $categoryHandler->create(); |
| 120 | 120 | echo "<br>\n"; |
| 121 | 121 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
| 122 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORY_CREATE . '</h3>'; |
|
| 122 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_CATEGORY_CREATE.'</h3>'; |
|
| 123 | 123 | echo "<div id='bottomtable'>"; |
| 124 | 124 | } |
| 125 | 125 | // Start category form |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | $sform->addElement($groups_read_checkbox); |
| 166 | 166 | // Apply permissions on all faqs |
| 167 | - $addapplyall_radio = new \XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 167 | + $addapplyall_radio = new \XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 168 | 168 | $sform->addElement($addapplyall_radio); |
| 169 | 169 | // MODERATORS |
| 170 | 170 | //$moderators_tray = new \XoopsFormElementTray(_AM_SF_MODERATORS_DEF, ''); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | echo '</div>'; |
| 230 | 230 | |
| 231 | 231 | if ($categoryid) { |
| 232 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php'; |
|
| 232 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php'; |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | unset($hidden); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | break; |
| 248 | 248 | |
| 249 | 249 | case 'addcategory': |
| 250 | - global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $modify, $myts, $categoryid; |
|
| 250 | + global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $modify, $myts, $categoryid; |
|
| 251 | 251 | |
| 252 | 252 | $categoryid = \Xmf\Request::getInt('categoryid', 0, 'POST'); |
| 253 | 253 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | if (!$categoryObj->store()) { |
| 288 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . Smartfaq\Utility::formatErrors($categoryObj->getErrors())); |
|
| 288 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR.Smartfaq\Utility::formatErrors($categoryObj->getErrors())); |
|
| 289 | 289 | } |
| 290 | 290 | // TODO : put this function in the category class |
| 291 | 291 | Smartfaq\Utility::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | 'categoryid' => $categoryObj->categoryid(), |
| 328 | 328 | 'confirm' => 1, |
| 329 | 329 | 'name' => $categoryObj->name() |
| 330 | - ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
| 330 | + ], 'category.php', _AM_SF_DELETECOL." '".$categoryObj->name()."'. <br> <br>"._AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
| 331 | 331 | xoops_cp_footer(); |
| 332 | 332 | } |
| 333 | 333 | exit(); |
@@ -345,19 +345,19 @@ discard block |
||
| 345 | 345 | echo "<br>\n"; |
| 346 | 346 | |
| 347 | 347 | // Creating the objects for top categories |
| 348 | - $categoriesObj =& $categoryHandler->getCategories($helper->getConfig('perpage'), $startcategory, 0); |
|
| 348 | + $categoriesObj = & $categoryHandler->getCategories($helper->getConfig('perpage'), $startcategory, 0); |
|
| 349 | 349 | |
| 350 | 350 | Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
| 351 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
| 351 | + echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_CATEGORIES_TITLE.'</h3>'; |
|
| 352 | 352 | echo "<div id='toptable'>"; |
| 353 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
| 353 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_CATEGORIES_DSC.'</span>'; |
|
| 354 | 354 | |
| 355 | 355 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
| 356 | 356 | echo '<tr>'; |
| 357 | - echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
| 358 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
| 359 | - echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
| 360 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
| 357 | + echo "<th width='35%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
| 358 | + echo "<th class='bg3' align='left'><b>"._AM_SF_DESCRIP.'</b></td>'; |
|
| 359 | + echo "<th class='bg3' width='65' align='center'><b>"._AM_SF_WEIGHT.'</b></td>'; |
|
| 360 | + echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
| 361 | 361 | echo '</tr>'; |
| 362 | 362 | $totalCategories = $categoryHandler->getCategoriesCount(0); |
| 363 | 363 | if (count($categoriesObj) > 0) { |
@@ -366,14 +366,14 @@ discard block |
||
| 366 | 366 | } |
| 367 | 367 | } else { |
| 368 | 368 | echo '<tr>'; |
| 369 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
| 369 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOCAT.'</td>'; |
|
| 370 | 370 | echo '</tr>'; |
| 371 | 371 | $categoryid = '0'; |
| 372 | 372 | } |
| 373 | 373 | echo "</table>\n"; |
| 374 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 374 | + require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 375 | 375 | $pagenav = new \XoopsPageNav($totalCategories, $helper->getConfig('perpage'), $startcategory, 'startcategory'); |
| 376 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 376 | + echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
| 377 | 377 | echo '</div>'; |
| 378 | 378 | |
| 379 | 379 | editcat(false); |
@@ -381,4 +381,4 @@ discard block |
||
| 381 | 381 | break; |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 384 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $criteria->add(new \Criteria('gperm_itemid', (int)$gperm_itemid)); |
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | - $sql = 'DELETE FROM ' . $db->prefix('group_permission') . ' ' . $criteria->renderWhere(); |
|
| 25 | + $sql = 'DELETE FROM '.$db->prefix('group_permission').' '.$criteria->renderWhere(); |
|
| 26 | 26 | if (!$result = $db->query($sql)) { |
| 27 | 27 | return false; |
| 28 | 28 | } |
@@ -34,16 +34,16 @@ discard block |
||
| 34 | 34 | $modid = \Xmf\Request::getInt('modid', 1, 'POST'); |
| 35 | 35 | // we dont want system module permissions to be changed here ( 1 -> 0 GIJ) |
| 36 | 36 | if ($modid <= 0 || !is_object($xoopsUser) || !$xoopsUser->isAdmin($modid)) { |
| 37 | - redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM); |
|
| 37 | + redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM); |
|
| 38 | 38 | } |
| 39 | 39 | /** @var XoopsModuleHandler $moduleHandler */ |
| 40 | 40 | $moduleHandler = xoops_getHandler('module'); |
| 41 | 41 | $module = $moduleHandler->get($modid); |
| 42 | 42 | if (!is_object($module) || !$module->getVar('isactive')) { |
| 43 | - redirect_header(XOOPS_URL . '/admin.php', 1, _MODULENOEXIST); |
|
| 43 | + redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST); |
|
| 44 | 44 | } |
| 45 | 45 | $memberHandler = xoops_getHandler('member'); |
| 46 | -$group_list =& $memberHandler->getGroupList(); |
|
| 46 | +$group_list = & $memberHandler->getGroupList(); |
|
| 47 | 47 | if (is_array($_POST['perms']) && !empty($_POST['perms'])) { |
| 48 | 48 | $gpermHandler = xoops_getHandler('groupperm'); |
| 49 | 49 | foreach ($_POST['perms'] as $perm_name => $perm_data) { |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | foreach ($parent_ids as $pid) { |
| 67 | 67 | if (0 != $pid && !in_array($pid, array_keys($item_ids))) { |
| 68 | 68 | // one of the parent items were not selected, so skip this item |
| 69 | - $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>') . ' (' . _MD_AM_PERMADDNGP . ')'; |
|
| 69 | + $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>').' ('._MD_AM_PERMADDNGP.')'; |
|
| 70 | 70 | continue 2; |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | $gperm->setVar('gperm_modid', $modid); |
| 78 | 78 | $gperm->setVar('gperm_itemid', $item_id); |
| 79 | 79 | if (!$gpermHandler->insert($gperm)) { |
| 80 | - $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>'); |
|
| 80 | + $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>'); |
|
| 81 | 81 | } else { |
| 82 | - $msg[] = sprintf(_MD_AM_PERMADDOK, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>'); |
|
| 82 | + $msg[] = sprintf(_MD_AM_PERMADDOK, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>'); |
|
| 83 | 83 | } |
| 84 | 84 | unset($gperm); |
| 85 | 85 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** @var Smartfaq\Helper $helper */ |
| 12 | 12 | $helper = Smartfaq\Helper::getInstance(); |
| 13 | 13 | |
| 14 | -require_once __DIR__ . '/admin_header.php'; |
|
| 14 | +require_once __DIR__.'/admin_header.php'; |
|
| 15 | 15 | $myts = \MyTextSanitizer::getInstance(); |
| 16 | 16 | |
| 17 | 17 | $faqid = \Xmf\Request::getInt('faqid', 0, 'POST'); |
@@ -34,29 +34,29 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | function buildTable() |
| 36 | 36 | { |
| 37 | - global $xoopsConfig, $xoopsModule; |
|
| 37 | + global $xoopsConfig, $xoopsModule; |
|
| 38 | 38 | /** @var Smartfaq\Helper $helper */ |
| 39 | 39 | $helper = Smartfaq\Helper::getInstance(); |
| 40 | 40 | |
| 41 | 41 | echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; |
| 42 | 42 | echo '<tr>'; |
| 43 | - echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_FAQID . '</b></td>'; |
|
| 44 | - echo "<th width='20%' class='bg3' align='center'><b>" . _AM_SF_FAQCAT . '</b></td>'; |
|
| 45 | - echo "<th class='bg3' align='center'><b>" . _AM_SF_QUESTION . '</b></td>'; |
|
| 43 | + echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_FAQID.'</b></td>'; |
|
| 44 | + echo "<th width='20%' class='bg3' align='center'><b>"._AM_SF_FAQCAT.'</b></td>'; |
|
| 45 | + echo "<th class='bg3' align='center'><b>"._AM_SF_QUESTION.'</b></td>'; |
|
| 46 | 46 | |
| 47 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>'; |
|
| 48 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>'; |
|
| 47 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>'; |
|
| 48 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>'; |
|
| 49 | 49 | |
| 50 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>'; |
|
| 51 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_STATUS . '</b></td>'; |
|
| 50 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>'; |
|
| 51 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_STATUS.'</b></td>'; |
|
| 52 | 52 | //echo "<td width='30' class='bg3' align='center'><b>" . _AM_SF_ANSWERS . "</b></td>"; |
| 53 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
| 53 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
| 54 | 54 | echo '</tr>'; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | // Code for the page |
| 58 | -require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
| 59 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 58 | +require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
| 59 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 60 | 60 | |
| 61 | 61 | // Creating the category handler object |
| 62 | 62 | /** @var \XoopsModules\Smartfaq\CategoryHandler $categoryHandler */ |
@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | // Construction of lower table |
| 141 | 141 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
| 142 | -echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_ALLFAQS . '</h3>'; |
|
| 142 | +echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_ALLFAQS.'</h3>'; |
|
| 143 | 143 | echo "<div id='bottomtable'>"; |
| 144 | -echo '<span style="color: #567; margin: 3px 0 18px 0; font-size: small; display: block; ">' . _AM_SF_ALLFAQSMSG . '</span>'; |
|
| 144 | +echo '<span style="color: #567; margin: 3px 0 18px 0; font-size: small; display: block; ">'._AM_SF_ALLFAQSMSG.'</span>'; |
|
| 145 | 145 | |
| 146 | 146 | $showingtxt = ''; |
| 147 | 147 | $selectedtxt = ''; |
@@ -210,98 +210,98 @@ discard block |
||
| 210 | 210 | case Constants::SF_STATUS_ASKED: |
| 211 | 211 | $selectedtxt1 = 'selected'; |
| 212 | 212 | $caption = _AM_SF_ASKED; |
| 213 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_ASKED . ' '; |
|
| 213 | + $cond = ' WHERE status = '.Constants::SF_STATUS_ASKED.' '; |
|
| 214 | 214 | $status_explaination = _AM_SF_ASKED_EXP; |
| 215 | 215 | break; |
| 216 | 216 | |
| 217 | 217 | case Constants::SF_STATUS_OPENED: |
| 218 | 218 | $selectedtxt2 = 'selected'; |
| 219 | 219 | $caption = _AM_SF_OPENED; |
| 220 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_OPENED . ' '; |
|
| 220 | + $cond = ' WHERE status = '.Constants::SF_STATUS_OPENED.' '; |
|
| 221 | 221 | $status_explaination = _AM_SF_OPENED_EXP; |
| 222 | 222 | break; |
| 223 | 223 | |
| 224 | 224 | case Constants::SF_STATUS_ANSWERED: |
| 225 | 225 | $selectedtxt3 = 'selected'; |
| 226 | 226 | $caption = _AM_SF_ANSWERED; |
| 227 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_ANSWERED . ' '; |
|
| 227 | + $cond = ' WHERE status = '.Constants::SF_STATUS_ANSWERED.' '; |
|
| 228 | 228 | $status_explaination = _AM_SF_ANSWERED_EXP; |
| 229 | 229 | break; |
| 230 | 230 | |
| 231 | 231 | case Constants::SF_STATUS_SUBMITTED: |
| 232 | 232 | $selectedtxt4 = 'selected'; |
| 233 | 233 | $caption = _AM_SF_SUBMITTED; |
| 234 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_SUBMITTED . ' '; |
|
| 234 | + $cond = ' WHERE status = '.Constants::SF_STATUS_SUBMITTED.' '; |
|
| 235 | 235 | $status_explaination = _AM_SF_SUBMITTED_EXP; |
| 236 | 236 | break; |
| 237 | 237 | |
| 238 | 238 | case Constants::SF_STATUS_PUBLISHED: |
| 239 | 239 | $selectedtxt5 = 'selected'; |
| 240 | 240 | $caption = _AM_SF_PUBLISHED; |
| 241 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_PUBLISHED . ' '; |
|
| 241 | + $cond = ' WHERE status = '.Constants::SF_STATUS_PUBLISHED.' '; |
|
| 242 | 242 | $status_explaination = _AM_SF_PUBLISHED_EXP; |
| 243 | 243 | break; |
| 244 | 244 | |
| 245 | 245 | case Constants::SF_STATUS_NEW_ANSWER: |
| 246 | 246 | $selectedtxt6 = 'selected'; |
| 247 | 247 | $caption = _AM_SF_NEW_ANSWER; |
| 248 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_NEW_ANSWER . ' '; |
|
| 248 | + $cond = ' WHERE status = '.Constants::SF_STATUS_NEW_ANSWER.' '; |
|
| 249 | 249 | $status_explaination = _AM_SF_NEW_ANSWER_EXP; |
| 250 | 250 | break; |
| 251 | 251 | |
| 252 | 252 | case Constants::SF_STATUS_OFFLINE: |
| 253 | 253 | $selectedtxt7 = 'selected'; |
| 254 | 254 | $caption = _AM_SF_OFFLINE; |
| 255 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_OFFLINE . ' '; |
|
| 255 | + $cond = ' WHERE status = '.Constants::SF_STATUS_OFFLINE.' '; |
|
| 256 | 256 | $status_explaination = _AM_SF_OFFLINE_EXP; |
| 257 | 257 | break; |
| 258 | 258 | |
| 259 | 259 | case Constants::SF_STATUS_REJECTED_QUESTION: |
| 260 | 260 | $selectedtxt8 = 'selected'; |
| 261 | 261 | $caption = _AM_SF_REJECTED_QUESTION; |
| 262 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_REJECTED_QUESTION . ' '; |
|
| 262 | + $cond = ' WHERE status = '.Constants::SF_STATUS_REJECTED_QUESTION.' '; |
|
| 263 | 263 | $status_explaination = _AM_SF_REJECTED_QUESTION_EXP; |
| 264 | 264 | break; |
| 265 | 265 | |
| 266 | 266 | case Constants::SF_STATUS_REJECTED_SMARTFAQ: |
| 267 | 267 | $selectedtxt9 = 'selected'; |
| 268 | 268 | $caption = _AM_SF_REJECTED_SMARTFAQ; |
| 269 | - $cond = ' WHERE status = ' . Constants::SF_STATUS_REJECTED_SMARTFAQ . ' '; |
|
| 269 | + $cond = ' WHERE status = '.Constants::SF_STATUS_REJECTED_SMARTFAQ.' '; |
|
| 270 | 270 | $status_explaination = _AM_SF_REJECTED_SMARTFAQ_EXP; |
| 271 | 271 | break; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /* -- Code to show selected terms -- */ |
| 275 | -echo "<form name='pick' id='pick' action='" . $_SERVER['PHP_SELF'] . "' method='POST' style='margin: 0;'>"; |
|
| 275 | +echo "<form name='pick' id='pick' action='".$_SERVER['PHP_SELF']."' method='POST' style='margin: 0;'>"; |
|
| 276 | 276 | |
| 277 | 277 | echo " |
| 278 | 278 | <table width='100%' cellspacing='1' cellpadding='2' border='0' style='border-left: 1px solid silver; border-top: 1px solid silver; border-right: 1px solid silver;'> |
| 279 | 279 | <tr> |
| 280 | - <td><span style='font-weight: bold; font-size: 12px; font-variant: small-caps;'>" . _AM_SF_SHOWING . ' ' . $caption . "</span></td> |
|
| 281 | - <td align='right'>" . _AM_SF_SELECT_SORT . " |
|
| 280 | + <td><span style='font-weight: bold; font-size: 12px; font-variant: small-caps;'>" . _AM_SF_SHOWING.' '.$caption."</span></td> |
|
| 281 | + <td align='right'>" . _AM_SF_SELECT_SORT." |
|
| 282 | 282 | <select name='sortsel' onchange='submit()'> |
| 283 | - <option value='faq.faqid' $sorttxtfaqid>" . _AM_SF_ID . "</option> |
|
| 284 | - <option value='category.name' $sorttxtcategory>" . _AM_SF_CATEGORY . "</option> |
|
| 285 | - <option value='faq.question' $sorttxtquestion>" . _AM_SF_QUESTION . "</option> |
|
| 286 | - <option value='faq.datesub' $sorttxtcreated>" . _AM_SF_CREATED . "</option> |
|
| 287 | - <option value='faq.weight' $sorttxtweight>" . _AM_SF_WEIGHT . "</option> |
|
| 283 | + <option value='faq.faqid' $sorttxtfaqid>"._AM_SF_ID."</option> |
|
| 284 | + <option value='category.name' $sorttxtcategory>"._AM_SF_CATEGORY."</option> |
|
| 285 | + <option value='faq.question' $sorttxtquestion>"._AM_SF_QUESTION."</option> |
|
| 286 | + <option value='faq.datesub' $sorttxtcreated>"._AM_SF_CREATED."</option> |
|
| 287 | + <option value='faq.weight' $sorttxtweight>"._AM_SF_WEIGHT."</option> |
|
| 288 | 288 | </select> |
| 289 | 289 | <select name='ordersel' onchange='submit()'> |
| 290 | - <option value='ASC' $ordertxtasc>" . _AM_SF_ASC . "</option> |
|
| 291 | - <option value='DESC' $ordertxtdesc>" . _AM_SF_DESC . '</option> |
|
| 290 | + <option value='ASC' $ordertxtasc>"._AM_SF_ASC."</option> |
|
| 291 | + <option value='DESC' $ordertxtdesc>"._AM_SF_DESC.'</option> |
|
| 292 | 292 | </select> |
| 293 | - ' . _AM_SF_SELECT_STATUS . " : |
|
| 293 | + ' . _AM_SF_SELECT_STATUS." : |
|
| 294 | 294 | <select name='statussel' onchange='submit()'> |
| 295 | - <option value='0' $selectedtxt0>" . _AM_SF_ALL . " [$totalfaqs]</option> |
|
| 296 | - <option value='1' $selectedtxt1>" . _AM_SF_ASKED . " [$totalasked]</option> |
|
| 297 | - <option value='2' $selectedtxt2>" . _AM_SF_OPENED . " [$totalopened]</option> |
|
| 298 | - <option value='3' $selectedtxt3>" . _AM_SF_ANSWERED . " [$totalanswered]</option> |
|
| 299 | - <option value='4' $selectedtxt4>" . _AM_SF_SUBMITTED . " [$totalsubmitted]</option> |
|
| 300 | - <option value='5' $selectedtxt5>" . _AM_SF_PUBLISHED . " [$totalpublished]</option> |
|
| 301 | - <option value='6' $selectedtxt6>" . _AM_SF_NEWANSWER . " [$totalnewanswers]</option> |
|
| 302 | - <option value='7' $selectedtxt7>" . _AM_SF_OFFLINE . " [$totaloffline]</option> |
|
| 303 | - <option value='8' $selectedtxt8>" . _AM_SF_REJECTED_QUESTION . " [$totalrejectedquestion]</option> |
|
| 304 | - <option value='9' $selectedtxt9>" . _AM_SF_REJECTED_SMARTFAQ . " [$totalrejectedsmartfaq]</option> |
|
| 295 | + <option value='0' $selectedtxt0>"._AM_SF_ALL." [$totalfaqs]</option> |
|
| 296 | + <option value='1' $selectedtxt1>"._AM_SF_ASKED." [$totalasked]</option> |
|
| 297 | + <option value='2' $selectedtxt2>"._AM_SF_OPENED." [$totalopened]</option> |
|
| 298 | + <option value='3' $selectedtxt3>"._AM_SF_ANSWERED." [$totalanswered]</option> |
|
| 299 | + <option value='4' $selectedtxt4>"._AM_SF_SUBMITTED." [$totalsubmitted]</option> |
|
| 300 | + <option value='5' $selectedtxt5>"._AM_SF_PUBLISHED." [$totalpublished]</option> |
|
| 301 | + <option value='6' $selectedtxt6>"._AM_SF_NEWANSWER." [$totalnewanswers]</option> |
|
| 302 | + <option value='7' $selectedtxt7>"._AM_SF_OFFLINE." [$totaloffline]</option> |
|
| 303 | + <option value='8' $selectedtxt8>"._AM_SF_REJECTED_QUESTION." [$totalrejectedquestion]</option> |
|
| 304 | + <option value='9' $selectedtxt9>"._AM_SF_REJECTED_SMARTFAQ." [$totalrejectedsmartfaq]</option> |
|
| 305 | 305 | </select> |
| 306 | 306 | </td> |
| 307 | 307 | </tr> |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $faqsObj = $faqHandler->getFaqsAdminSide($helper->getConfig('perpage'), $startentry, $statusSelected, -1, $sortsel, $ordersel); |
| 317 | 317 | |
| 318 | 318 | // fetching all categories |
| 319 | -$allCats = $categoryHandler->getObjects(null, true); |
|
| 319 | +$allCats = $categoryHandler->getObjects(null, true); |
|
| 320 | 320 | //$totalItemsOnPage = count($faqsObj); |
| 321 | 321 | buildTable(); |
| 322 | 322 | |
@@ -339,65 +339,65 @@ discard block |
||
| 339 | 339 | switch ($faqsObj[$i]->status()) { |
| 340 | 340 | case Constants::SF_STATUS_ASKED: |
| 341 | 341 | $statustxt = _AM_SF_ASKED; |
| 342 | - $approve = "<a href='question.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/on.png' . "' title='" . _AM_SF_QUESTION_MODERATE . "' alt='" . _AM_SF_QUESTION_MODERATE . "'></a> "; |
|
| 342 | + $approve = "<a href='question.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/on.png'."' title='"._AM_SF_QUESTION_MODERATE."' alt='"._AM_SF_QUESTION_MODERATE."'></a> "; |
|
| 343 | 343 | $modify = ''; |
| 344 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>"; |
|
| 344 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>"; |
|
| 345 | 345 | break; |
| 346 | 346 | |
| 347 | 347 | case Constants::SF_STATUS_OPENED: |
| 348 | 348 | $statustxt = _AM_SF_OPENED; |
| 349 | 349 | $approve = ''; |
| 350 | - $modify = "<a href='question.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_QUESTION_EDIT . "' alt='" . _AM_SF_QUESTION_EDIT . "'></a> "; |
|
| 351 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>"; |
|
| 350 | + $modify = "<a href='question.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_QUESTION_EDIT."' alt='"._AM_SF_QUESTION_EDIT."'></a> "; |
|
| 351 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>"; |
|
| 352 | 352 | break; |
| 353 | 353 | |
| 354 | 354 | case Constants::SF_STATUS_ANSWERED: |
| 355 | 355 | $statustxt = _AM_SF_ANSWERED; |
| 356 | - $approve = "<a href='answer.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/approve.gif' title='" . _AM_SF_ANSWERED_MODERATE . "' alt='" . _AM_SF_ANSWERED_MODERATE . "'></a> "; |
|
| 356 | + $approve = "<a href='answer.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/approve.gif' title='"._AM_SF_ANSWERED_MODERATE."' alt='"._AM_SF_ANSWERED_MODERATE."'></a> "; |
|
| 357 | 357 | $modify = ''; |
| 358 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/delete.gif' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>"; |
|
| 358 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/delete.gif' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>"; |
|
| 359 | 359 | break; |
| 360 | 360 | |
| 361 | 361 | case Constants::SF_STATUS_SUBMITTED: |
| 362 | 362 | $statustxt = _AM_SF_SUBMITTED; |
| 363 | - $approve = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/approve.gif' title='" . _AM_SF_SUBMISSION_MODERATE . "' alt='" . _AM_SF_SUBMISSION_MODERATE . "'></a> "; |
|
| 364 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/delete.gif' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 363 | + $approve = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/approve.gif' title='"._AM_SF_SUBMISSION_MODERATE."' alt='"._AM_SF_SUBMISSION_MODERATE."'></a> "; |
|
| 364 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/delete.gif' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 365 | 365 | $modify = ''; |
| 366 | 366 | break; |
| 367 | 367 | |
| 368 | 368 | case Constants::SF_STATUS_PUBLISHED: |
| 369 | 369 | $statustxt = _AM_SF_PUBLISHED; |
| 370 | 370 | $approve = ''; |
| 371 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_FAQ_EDIT . "' alt='" . _AM_SF_FAQ_EDIT . "'></a> "; |
|
| 372 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 371 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_FAQ_EDIT."' alt='"._AM_SF_FAQ_EDIT."'></a> "; |
|
| 372 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 373 | 373 | break; |
| 374 | 374 | |
| 375 | 375 | case Constants::SF_STATUS_NEW_ANSWER: |
| 376 | 376 | $statustxt = _AM_SF_NEWANSWER; |
| 377 | - $approve = "<a href='answer.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/approve.gif' title='" . _AM_SF_FAQ_EDIT . "' alt='" . _AM_SF_FAQ_EDIT . "'></a> "; |
|
| 378 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/delete.gif' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 377 | + $approve = "<a href='answer.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/approve.gif' title='"._AM_SF_FAQ_EDIT."' alt='"._AM_SF_FAQ_EDIT."'></a> "; |
|
| 378 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/delete.gif' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 379 | 379 | $modify = ''; |
| 380 | 380 | break; |
| 381 | 381 | |
| 382 | 382 | case Constants::SF_STATUS_OFFLINE: |
| 383 | 383 | $statustxt = _AM_SF_OFFLINE; |
| 384 | 384 | $approve = ''; |
| 385 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_FAQ_EDIT . "' alt='" . _AM_SF_FAQ_EDIT . "'></a> "; |
|
| 386 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 385 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_FAQ_EDIT."' alt='"._AM_SF_FAQ_EDIT."'></a> "; |
|
| 386 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 387 | 387 | break; |
| 388 | 388 | |
| 389 | 389 | case Constants::SF_STATUS_REJECTED_QUESTION: |
| 390 | 390 | $statustxt = _AM_SF_REJECTED_QUESTION; |
| 391 | 391 | $approve = ''; |
| 392 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_REJECTED_EDIT . "' alt='" . _AM_SF_REJECTED_EDIT . "'></a> "; |
|
| 393 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>"; |
|
| 392 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_REJECTED_EDIT."' alt='"._AM_SF_REJECTED_EDIT."'></a> "; |
|
| 393 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>"; |
|
| 394 | 394 | break; |
| 395 | 395 | |
| 396 | 396 | case Constants::SF_STATUS_REJECTED_SMARTFAQ: |
| 397 | 397 | $statustxt = _AM_SF_REJECTED_SMARTFAQ; |
| 398 | 398 | $approve = ''; |
| 399 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_REJECTED_EDIT . "' alt='" . _AM_SF_REJECTED_EDIT . "'></a> "; |
|
| 400 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 399 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_REJECTED_EDIT."' alt='"._AM_SF_REJECTED_EDIT."'></a> "; |
|
| 400 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 401 | 401 | break; |
| 402 | 402 | |
| 403 | 403 | case 'default': |
@@ -411,14 +411,14 @@ discard block |
||
| 411 | 411 | //$modify = "<a href='faq.php?op=mod&faqid=" . $faqid . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/assets/images/icon/edit.gif' alt='" . _AM_SF_EDITART . "'></a> "; |
| 412 | 412 | |
| 413 | 413 | echo '<tr>'; |
| 414 | - echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>'; |
|
| 415 | - echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>'; |
|
| 416 | - echo "<td class='even' align='left'>" . $faqsObj[$i]->question(100) . '</td>'; |
|
| 414 | + echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>'; |
|
| 415 | + echo "<td class='even' align='left'>".$categoryObj->name().'</td>'; |
|
| 416 | + echo "<td class='even' align='left'>".$faqsObj[$i]->question(100).'</td>'; |
|
| 417 | 417 | |
| 418 | 418 | //mb--------------------------------------- |
| 419 | 419 | //adding name of the Question Submitter |
| 420 | 420 | $requester = Smartfaq\Utility::getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
| 421 | - echo "<td class='even' align='center'>" . $requester . '</td>'; |
|
| 421 | + echo "<td class='even' align='center'>".$requester.'</td>'; |
|
| 422 | 422 | |
| 423 | 423 | //adding name of the Answer Submitter |
| 424 | 424 | /** @var \XoopsModules\Smartfaq\AnswerHandler $answerHandler */ |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | $criteria->add(new \Criteria('faqid', $faqsObj[$i]->faqid())); |
| 429 | 429 | $criteria->add(new \Criteria('status', true)); |
| 430 | 430 | |
| 431 | - $answerObjects =& $answerHandler->getObjects($criteria, true); |
|
| 431 | + $answerObjects = & $answerHandler->getObjects($criteria, true); |
|
| 432 | 432 | |
| 433 | 433 | foreach (array_keys($answerObjects) as $j) { |
| 434 | 434 | $answerObj = $answerObjects[$j]; |
@@ -441,20 +441,20 @@ discard block |
||
| 441 | 441 | } else { |
| 442 | 442 | $answerSubmitter = '--------'; |
| 443 | 443 | } |
| 444 | - echo "<td class='even' align='center'>" . $answerSubmitter . '</td>'; |
|
| 444 | + echo "<td class='even' align='center'>".$answerSubmitter.'</td>'; |
|
| 445 | 445 | |
| 446 | 446 | //mb--------------------------------------- |
| 447 | 447 | |
| 448 | - echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>'; |
|
| 449 | - echo "<td class='even' align='center'>" . $statustxt . '</td>'; |
|
| 448 | + echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>'; |
|
| 449 | + echo "<td class='even' align='center'>".$statustxt.'</td>'; |
|
| 450 | 450 | //echo "<td class='even' align='center'>" . $answers . "</td>"; |
| 451 | - echo "<td class='even' align='center'> " . $approve . $modify . $delete . '</td>'; |
|
| 451 | + echo "<td class='even' align='center'> ".$approve.$modify.$delete.'</td>'; |
|
| 452 | 452 | echo '</tr>'; |
| 453 | 453 | } |
| 454 | 454 | } else { |
| 455 | 455 | // that is, $numrows = 0, there's no entries yet |
| 456 | 456 | echo '<tr>'; |
| 457 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQSSEL . '</td>'; |
|
| 457 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQSSEL.'</td>'; |
|
| 458 | 458 | echo '</tr>'; |
| 459 | 459 | } |
| 460 | 460 | echo "</table>\n"; |
@@ -462,9 +462,9 @@ discard block |
||
| 462 | 462 | $pagenav = new \XoopsPageNav($numrows, $helper->getConfig('perpage'), $startentry, 'startentry', "statussel=$statussel&sortsel=$sortsel&ordersel=$ordersel"); |
| 463 | 463 | |
| 464 | 464 | if (1 == $helper->getConfig('useimagenavpage')) { |
| 465 | - echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderImageNav() . '</div>'; |
|
| 465 | + echo '<div style="text-align:right; background-color: white; margin: 10px 0;">'.$pagenav->renderImageNav().'</div>'; |
|
| 466 | 466 | } else { |
| 467 | - echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderNav() . '</div>'; |
|
| 467 | + echo '<div style="text-align:right; background-color: white; margin: 10px 0;">'.$pagenav->renderNav().'</div>'; |
|
| 468 | 468 | } |
| 469 | 469 | // ENDs code to show active entries |
| 470 | 470 | echo '</div>'; |
@@ -472,4 +472,4 @@ discard block |
||
| 472 | 472 | echo '</div>'; |
| 473 | 473 | echo '</div>'; |
| 474 | 474 | |
| 475 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 475 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -293,11 +293,11 @@ |
||
| 293 | 293 | $faqid = \Xmf\Request::getInt('faqid', 0, 'GET'); |
| 294 | 294 | xoops_cp_header(); |
| 295 | 295 | xoops_confirm([ |
| 296 | - 'op' => 'del', |
|
| 297 | - 'faqid' => $faqObj->faqid(), |
|
| 298 | - 'confirm' => 1, |
|
| 299 | - 'name' => $faqObj->question() |
|
| 300 | - ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 296 | + 'op' => 'del', |
|
| 297 | + 'faqid' => $faqObj->faqid(), |
|
| 298 | + 'confirm' => 1, |
|
| 299 | + 'name' => $faqObj->question() |
|
| 300 | + ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 301 | 301 | xoops_cp_footer(); |
| 302 | 302 | } |
| 303 | 303 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** @var Smartfaq\Helper $helper */ |
| 12 | 12 | $helper = Smartfaq\Helper::getInstance(); |
| 13 | 13 | |
| 14 | -require_once __DIR__ . '/admin_header.php'; |
|
| 14 | +require_once __DIR__.'/admin_header.php'; |
|
| 15 | 15 | |
| 16 | 16 | global $xoopsUser; |
| 17 | 17 | |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | function editfaq($showmenu = false, $faqid = -1) |
| 42 | 42 | { |
| 43 | - global $faqHandler, $categoryHandler, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModule, $XOOPS_URL, $myts; |
|
| 43 | + global $faqHandler, $categoryHandler, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModule, $XOOPS_URL, $myts; |
|
| 44 | 44 | /** @var Smartfaq\Helper $helper */ |
| 45 | 45 | $helper = Smartfaq\Helper::getInstance(); |
| 46 | 46 | |
| 47 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 47 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 48 | 48 | // If there is a parameter, and the id exists, retrieve data: we're editing a faq |
| 49 | 49 | if (-1 != $faqid) { |
| 50 | 50 | // Creating the FAQ object |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | echo "<br>\n"; |
| 78 | 78 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
| 79 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . $collapsableBar_title . '</h3>'; |
|
| 79 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".$collapsableBar_title.'</h3>'; |
|
| 80 | 80 | echo "<div id='bottomtable'>"; |
| 81 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>'; |
|
| 81 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>'; |
|
| 82 | 82 | } else { |
| 83 | 83 | // there's no parameter, so we're adding a faq |
| 84 | 84 | $faqObj = $faqHandler->create(); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $button_caption = _AM_SF_CREATE; |
| 90 | 90 | |
| 91 | 91 | Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon'); |
| 92 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CREATEQUESTION . '</h3>'; |
|
| 92 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_CREATEQUESTION.'</h3>'; |
|
| 93 | 93 | echo "<div id='bottomtable'>"; |
| 94 | 94 | } |
| 95 | 95 | $sform = new \XoopsThemeForm(_AM_SF_OPEN_QUESTION, 'op', xoops_getenv('PHP_SELF'), 'post', true); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $button_tray->addElement($butt_create); |
| 164 | 164 | |
| 165 | 165 | $butt_edit = new \XoopsFormButton('', '', _AM_SF_OPEN_QUESTION_EDIT, 'button'); |
| 166 | - $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&faqid=" . $faqid . "'\""); |
|
| 166 | + $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&faqid=".$faqid."'\""); |
|
| 167 | 167 | $button_tray->addElement($butt_edit); |
| 168 | 168 | |
| 169 | 169 | $butt_cancel = new \XoopsFormButton('', '', _AM_SF_CANCEL, 'button'); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | xoops_cp_header(); |
| 196 | 196 | |
| 197 | 197 | $adminObject->displayNavigation(basename(__FILE__)); |
| 198 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 198 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 199 | 199 | |
| 200 | 200 | editfaq(true, $faqid); |
| 201 | 201 | break; |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | |
| 257 | 257 | // Storing the FAQ |
| 258 | 258 | if (!$faqObj->store()) { |
| 259 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR . Smartfaq\Utility::formatErrors($faqObj->getErrors())); |
|
| 259 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR.Smartfaq\Utility::formatErrors($faqObj->getErrors())); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | // Send notifications |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | 'faqid' => $faqObj->faqid(), |
| 298 | 298 | 'confirm' => 1, |
| 299 | 299 | 'name' => $faqObj->question() |
| 300 | - ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 300 | + ], 'question.php', _AM_SF_DELETETHISQUESTION." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE); |
|
| 301 | 301 | xoops_cp_footer(); |
| 302 | 302 | } |
| 303 | 303 | |
@@ -310,18 +310,18 @@ discard block |
||
| 310 | 310 | xoops_cp_header(); |
| 311 | 311 | $adminObject->displayNavigation(basename(__FILE__)); |
| 312 | 312 | |
| 313 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 314 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 313 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 314 | + require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 315 | 315 | |
| 316 | - global $xoopsConfig, $xoopsDB, $xoopsModule, $smartModuleConfig; |
|
| 316 | + global $xoopsConfig, $xoopsDB, $xoopsModule, $smartModuleConfig; |
|
| 317 | 317 | |
| 318 | 318 | echo "<br>\n"; |
| 319 | 319 | |
| 320 | 320 | Smartfaq\Utility::collapsableBar('toptable', 'toptableicon'); |
| 321 | 321 | |
| 322 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_OPENED_TITLE . '</h3>'; |
|
| 322 | + echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_OPENED_TITLE.'</h3>'; |
|
| 323 | 323 | echo "<div id='toptable'>"; |
| 324 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_OPENED_DSC . '</span>'; |
|
| 324 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_OPENED_DSC.'</span>'; |
|
| 325 | 325 | |
| 326 | 326 | // Get the total number of published FAQs |
| 327 | 327 | $totalfaqs = $faqHandler->getFaqsCount(-1, [Constants::SF_STATUS_OPENED]); |
@@ -331,14 +331,14 @@ discard block |
||
| 331 | 331 | $allCats = $categoryHandler->getObjects(null, true); |
| 332 | 332 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
| 333 | 333 | echo '<tr>'; |
| 334 | - echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>'; |
|
| 335 | - echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
| 336 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>'; |
|
| 334 | + echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>'; |
|
| 335 | + echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
| 336 | + echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>'; |
|
| 337 | 337 | |
| 338 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>'; |
|
| 338 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>'; |
|
| 339 | 339 | |
| 340 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>'; |
|
| 341 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
| 340 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>'; |
|
| 341 | + echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
| 342 | 342 | echo '</tr>'; |
| 343 | 343 | //var_dump( $faqsObj); |
| 344 | 344 | if ($totalfaqs > 0) { |
@@ -346,33 +346,33 @@ discard block |
||
| 346 | 346 | foreach (array_keys($faqsObj) as $i) { |
| 347 | 347 | $categoryObj = $allCats[$faqsObj[$i]->categoryid()]; |
| 348 | 348 | |
| 349 | - $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>"; |
|
| 350 | - $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>"; |
|
| 349 | + $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>"; |
|
| 350 | + $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>"; |
|
| 351 | 351 | |
| 352 | 352 | $requester = Smartfaq\Utility::getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
| 353 | 353 | |
| 354 | 354 | echo '<tr>'; |
| 355 | - echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>'; |
|
| 356 | - echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>'; |
|
| 357 | - 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>'; |
|
| 355 | + echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>'; |
|
| 356 | + echo "<td class='even' align='left'>".$categoryObj->name().'</td>'; |
|
| 357 | + 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>'; |
|
| 358 | 358 | |
| 359 | - echo "<td class='even' align='center'>" . $requester . '</td>'; |
|
| 359 | + echo "<td class='even' align='center'>".$requester.'</td>'; |
|
| 360 | 360 | |
| 361 | - echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>'; |
|
| 361 | + echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>'; |
|
| 362 | 362 | echo "<td class='even' align='center'> $modify $delete </td>"; |
| 363 | 363 | echo '</tr>'; |
| 364 | 364 | } |
| 365 | 365 | } else { |
| 366 | 366 | $faqid = -1; |
| 367 | 367 | echo '<tr>'; |
| 368 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOQUEUED . '</td>'; |
|
| 368 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOQUEUED.'</td>'; |
|
| 369 | 369 | echo '</tr>'; |
| 370 | 370 | } |
| 371 | 371 | echo "</table>\n"; |
| 372 | 372 | echo "<br>\n"; |
| 373 | 373 | |
| 374 | 374 | $pagenav = new \XoopsPageNav($totalfaqs, $helper->getConfig('perpage'), $startfaq, 'startfaq'); |
| 375 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 375 | + echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
| 376 | 376 | echo '</div>'; |
| 377 | 377 | |
| 378 | 378 | $totalcategories = $categoryHandler->getCategoriesCount(-1); |
@@ -383,4 +383,4 @@ discard block |
||
| 383 | 383 | break; |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 386 | +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__ . '/header.php'; |
|
| 11 | +require_once __DIR__.'/header.php'; |
|
| 12 | 12 | |
| 13 | 13 | $faqid = \Xmf\Request::getInt('faqid', 0, 'GET'); |
| 14 | 14 | |
@@ -46,23 +46,23 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; |
| 48 | 48 | echo "<html>\n<head>\n"; |
| 49 | -echo '<title>' . _MD_SF_FAQCOMEFROM . ' ' . $xoopsConfig['sitename'] . "</title>\n"; |
|
| 50 | -echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "'>\n"; |
|
| 51 | -echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "'>\n"; |
|
| 52 | -echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "'>\n"; |
|
| 53 | -echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "'>\n"; |
|
| 54 | -echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "'>\n\n\n"; |
|
| 49 | +echo '<title>'._MD_SF_FAQCOMEFROM.' '.$xoopsConfig['sitename']."</title>\n"; |
|
| 50 | +echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."'>\n"; |
|
| 51 | +echo "<meta name='AUTHOR' content='".$xoopsConfig['sitename']."'>\n"; |
|
| 52 | +echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by ".$xoopsConfig['sitename']."'>\n"; |
|
| 53 | +echo "<meta name='DESCRIPTION' content='".$xoopsConfig['slogan']."'>\n"; |
|
| 54 | +echo "<meta name='GENERATOR' content='".XOOPS_VERSION."'>\n\n\n"; |
|
| 55 | 55 | |
| 56 | 56 | echo "<body bgcolor='#ffffff' text='#000000' onload='window.print()'> |
| 57 | 57 | <div style='width: 650px; border: 1px solid #000; padding: 20px;'> |
| 58 | - <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>" . $faqObj->question() . "</h2></div> |
|
| 59 | - <div align='center'>" . $who_where . "</div> |
|
| 58 | + <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL."/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>".$faqObj->question()."</h2></div> |
|
| 59 | + <div align='center'>" . $who_where."</div> |
|
| 60 | 60 | <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div> |
| 61 | 61 | <div></div> |
| 62 | - <b><p>" . $faqObj->question() . '</p></b> |
|
| 63 | - <p>' . $answerObj->answer() . "</p> |
|
| 62 | + <b><p>" . $faqObj->question().'</p></b> |
|
| 63 | + <p>' . $answerObj->answer()."</p> |
|
| 64 | 64 | <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div> |
| 65 | - <p>" . $comeFrom . '</p> |
|
| 65 | + <p>" . $comeFrom.'</p> |
|
| 66 | 66 | </div> |
| 67 | 67 | <br>'; |
| 68 | 68 | |