@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | |
10 | 10 | global $xoopsTpl, $xoopsModule, $xoopsModuleConfig; |
11 | 11 | |
12 | -$uid = ($xoopsUser)? ($xoopsUser->getVar("uid")) : 0; |
|
12 | +$uid = ($xoopsUser) ? ($xoopsUser->getVar("uid")) : 0; |
|
13 | 13 | $isAdmin = (sf_userIsAdmin() || sf_moderator()); |
14 | 14 | |
15 | -$xoopsTpl->assign("sf_adminpage", "<a href='" . XOOPS_URL . "/modules/smartfaq/admin/index.php'>" . _MD_SF_ADMIN_PAGE . "</a>"); |
|
15 | +$xoopsTpl->assign("sf_adminpage", "<a href='".XOOPS_URL."/modules/smartfaq/admin/index.php'>"._MD_SF_ADMIN_PAGE."</a>"); |
|
16 | 16 | $xoopsTpl->assign("isAdmin", $isAdmin); |
17 | 17 | |
18 | 18 | $xoopsTpl->assign(array('lang_on' => _MD_SF_ON, 'lang_postedby' => _MD_SF_POSTEDBY, 'lang_faq' => _MD_SF_QUESTION, 'lang_datesub' => _MD_SF_DATESUB, 'lang_hits' => _MD_SF_HITS)); |
@@ -29,4 +29,4 @@ discard block |
||
29 | 29 | |
30 | 30 | $xoopsTpl->assign("ref_smartfaq", "SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)"); |
31 | 31 | |
32 | -$xoopsTpl->assign("xoops_module_header", "<link rel='stylesheet' type='text/css' href='" . XOOPS_URL . "/modules/smartfaq/smartfaq.css'/>"); |
|
32 | +$xoopsTpl->assign("xoops_module_header", "<link rel='stylesheet' type='text/css' href='".XOOPS_URL."/modules/smartfaq/smartfaq.css'/>"); |
@@ -6,27 +6,27 @@ discard block |
||
6 | 6 | * Author: The SmartFactory <www.smartfactory.ca> |
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | -include_once __DIR__ . '/header.php'; |
|
9 | +include_once __DIR__.'/header.php'; |
|
10 | 10 | |
11 | 11 | // At which record shall we start for the Categories |
12 | -$catstart = isset($_GET['catstart'])? intval($_GET['catstart']) : 0; |
|
12 | +$catstart = isset($_GET['catstart']) ? intval($_GET['catstart']) : 0; |
|
13 | 13 | |
14 | 14 | // At which record shall we start for the FAQ |
15 | -$start = isset($_GET['start'])? intval($_GET['start']) : 0; |
|
15 | +$start = isset($_GET['start']) ? intval($_GET['start']) : 0; |
|
16 | 16 | |
17 | 17 | // Creating the category handler object |
18 | -$category_handler =& sf_gethandler('category'); |
|
18 | +$category_handler = & sf_gethandler('category'); |
|
19 | 19 | |
20 | 20 | // Creating the faq handler object |
21 | -$faq_handler =& sf_gethandler('faq'); |
|
21 | +$faq_handler = & sf_gethandler('faq'); |
|
22 | 22 | |
23 | 23 | $totalCategories = $category_handler->getCategoriesCount(0); |
24 | 24 | |
25 | 25 | // Total number of published FAQ in the module |
26 | 26 | $totalFaqs = $faq_handler->getFaqsCount(-1, array(_SF_STATUS_PUBLISHED, _SF_STATUS_NEW_ANSWER)); |
27 | 27 | |
28 | -if ($totalFaqs == 0) { |
|
29 | - if ( ($totalCategories > 0) && ($xoopsModuleConfig['allowrequest'] && ($xoopsModuleConfig['anonpost']) || is_object($xoopsUser))) { |
|
28 | +if ($totalFaqs == 0) { |
|
29 | + if (($totalCategories > 0) && ($xoopsModuleConfig['allowrequest'] && ($xoopsModuleConfig['anonpost']) || is_object($xoopsUser))) { |
|
30 | 30 | redirect_header("request.php", 2, _AM_SF_NO_TOP_PERMISSIONS); |
31 | 31 | } else { |
32 | 32 | redirect_header("../../index.php", 2, _AM_SF_NO_TOP_PERMISSIONS); |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | |
37 | 37 | $xoopsOption['template_main'] = 'smartfaq_index.tpl'; |
38 | 38 | |
39 | -include_once(XOOPS_ROOT_PATH . "/header.php"); |
|
40 | -include_once __DIR__ . '/footer.php'; |
|
39 | +include_once(XOOPS_ROOT_PATH."/header.php"); |
|
40 | +include_once __DIR__.'/footer.php'; |
|
41 | 41 | |
42 | 42 | // Creating the categories objects |
43 | 43 | $categoriesObj = $category_handler->getCategories($xoopsModuleConfig['catperpage'], $catstart); |
44 | 44 | // If no categories are found, exit |
45 | 45 | $totalCategoriesOnPage = count($categoriesObj); |
46 | -if ($totalCategoriesOnPage == 0) { |
|
46 | +if ($totalCategoriesOnPage == 0) { |
|
47 | 47 | redirect_header("javascript:history.go(-1)", 2, _AM_SF_NO_CAT_EXISTS); |
48 | 48 | exit; |
49 | 49 | } |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | $subcats = $category_handler->getSubCats($categoriesObj); |
56 | 56 | //} |
57 | 57 | $totalQnas = $category_handler->publishedFaqsCount(); |
58 | -$faq_handler =& sf_gethandler('faq'); |
|
58 | +$faq_handler = & sf_gethandler('faq'); |
|
59 | 59 | |
60 | 60 | if ($xoopsModuleConfig['displaylastfaq'] == 1) { |
61 | 61 | // Get the last smartfaq in each category |
62 | 62 | $last_qnaObj = $faq_handler->getLastPublishedByCat(); |
63 | 63 | } |
64 | -$lastfaqsize = intval($xoopsModuleConfig['lastfaqsize']) ; |
|
64 | +$lastfaqsize = intval($xoopsModuleConfig['lastfaqsize']); |
|
65 | 65 | $categories = array(); |
66 | 66 | foreach ($categoriesObj as $cat_id => $category) { |
67 | 67 | $total = 0; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
72 | 72 | if (isset($last_qnaObj[$subcat_id])) { |
73 | 73 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
74 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . "</a>"); |
|
74 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize)."</a>"); |
|
75 | 75 | } |
76 | 76 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
77 | 77 | if ($xoopsModuleConfig['displaysubcatonindex']) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if ($total > 0) { |
90 | 90 | if (isset($last_qnaObj[$cat_id])) { |
91 | 91 | $category->setVar('last_faqid', $last_qnaObj[$cat_id]->getVar('faqid')); |
92 | - $category->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$cat_id]->getVar('faqid') . "'>" . $last_qnaObj[$cat_id]->question($lastfaqsize) . "</a>"); |
|
92 | + $category->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$cat_id]->getVar('faqid')."'>".$last_qnaObj[$cat_id]->question($lastfaqsize)."</a>"); |
|
93 | 93 | } |
94 | 94 | $category->setVar('faqcount', $total); |
95 | 95 | if (!isset($categories[$cat_id])) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $faqids[] = $thisfaq->getVar('faqid'); |
121 | 121 | $userids[$thisfaq->uid()] = 1; |
122 | 122 | } |
123 | - $answer_handler =& sf_gethandler('answer'); |
|
123 | + $answer_handler = & sf_gethandler('answer'); |
|
124 | 124 | $allanswers = $answer_handler->getLastPublishedByFaq($faqids); |
125 | 125 | |
126 | 126 | foreach ($allanswers as $key => $thisanswer) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
134 | 134 | |
135 | 135 | // Creating the answer object |
136 | - $answerObj =& $allanswers[$faqsObj[$i]->faqid()]; |
|
136 | + $answerObj = & $allanswers[$faqsObj[$i]->faqid()]; |
|
137 | 137 | |
138 | 138 | $answerObj->setVar('dohtml', $faqsObj[$i]->getVar('html')); |
139 | 139 | $answerObj->setVar('doxcode', $faqsObj[$i]->getVar('xcodes')); |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | $xoopsTpl->assign('displaysubcatonindex', $xoopsModuleConfig['displaysubcatonindex']); |
160 | 160 | $xoopsTpl->assign('displaylastfaqs', $xoopsModuleConfig['displaylastfaqs']); |
161 | 161 | $xoopsTpl->assign('display_categoryname', true); |
162 | -$xoopsTpl->assign('displayFull', $xoopsModuleConfig['displaytype']=='full'); |
|
162 | +$xoopsTpl->assign('displayFull', $xoopsModuleConfig['displaytype'] == 'full'); |
|
163 | 163 | |
164 | -$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD . " " . $moduleName); |
|
164 | +$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD." ".$moduleName); |
|
165 | 165 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['indexwelcomemsg'], 1)); |
166 | 166 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_SMARTFAQS); |
167 | 167 | $xoopsTpl->assign('lang_home', _MD_SF_HOME); |
@@ -180,20 +180,20 @@ discard block |
||
180 | 180 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
181 | 181 | |
182 | 182 | // Category Navigation Bar |
183 | -include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
183 | +include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
184 | 184 | $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', ''); |
185 | 185 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
186 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
186 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
187 | 187 | } else { |
188 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
188 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | // FAQ Navigation Bar |
192 | 192 | $pagenav = new XoopsPageNav($totalFaqs, $xoopsModuleConfig['indexperpage'], $start, 'start', ''); |
193 | 193 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
194 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
194 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
195 | 195 | } else { |
196 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
196 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | // Page Title Hack by marcan |
@@ -201,4 +201,4 @@ discard block |
||
201 | 201 | $xoopsTpl->assign('xoops_pagetitle', $module_name); |
202 | 202 | // End Page Title Hack by marcan |
203 | 203 | |
204 | -include_once(XOOPS_ROOT_PATH . "/footer.php"); |
|
204 | +include_once(XOOPS_ROOT_PATH."/footer.php"); |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | |
10 | -include_once __DIR__ . '/header.php'; |
|
10 | +include_once __DIR__.'/header.php'; |
|
11 | 11 | |
12 | -$faqid = isset($_GET['faqid'])? intval($_GET['faqid']) : 0; |
|
12 | +$faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : 0; |
|
13 | 13 | |
14 | 14 | if ($faqid == 0) { |
15 | 15 | redirect_header("javascript:history.go(-1)", 1, _MD_SF_NOFAQSELECTED); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | // Creating the FAQ handler object |
20 | -$faq_handler =& sf_gethandler('faq'); |
|
20 | +$faq_handler = & sf_gethandler('faq'); |
|
21 | 21 | |
22 | 22 | // Creating the FAQ object for the selected FAQ |
23 | 23 | $faqObj = new sfFaq($faqid); |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | // Creating the category object that holds the selected FAQ |
32 | -$categoryObj =& $faqObj->category(); |
|
32 | +$categoryObj = & $faqObj->category(); |
|
33 | 33 | |
34 | 34 | // Creating the answer object |
35 | -$answerObj =& $faqObj->answer(); |
|
35 | +$answerObj = & $faqObj->answer(); |
|
36 | 36 | |
37 | 37 | // Check user permissions to access that category of the selected FAQ |
38 | 38 | if (faqAccessGranted($faqObj) < 0) { |
@@ -43,27 +43,27 @@ discard block |
||
43 | 43 | global $xoopsConfig, $xoopsDB, $xoopsModule, $myts; |
44 | 44 | |
45 | 45 | $who_where = $faqObj->getWhoAndWhen(); |
46 | -$comeFrom = $faqObj->getComeFrom(); |
|
46 | +$comeFrom = $faqObj->getComeFrom(); |
|
47 | 47 | |
48 | 48 | echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; |
49 | 49 | echo "<html>\n<head>\n"; |
50 | -echo "<title>" . _MD_SF_FAQCOMEFROM . " " . $xoopsConfig['sitename'] . "</title>\n"; |
|
51 | -echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "' />\n"; |
|
52 | -echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "' />\n"; |
|
53 | -echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "' />\n"; |
|
54 | -echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "' />\n"; |
|
55 | -echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "' />\n\n\n"; |
|
50 | +echo "<title>"._MD_SF_FAQCOMEFROM." ".$xoopsConfig['sitename']."</title>\n"; |
|
51 | +echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."' />\n"; |
|
52 | +echo "<meta name='AUTHOR' content='".$xoopsConfig['sitename']."' />\n"; |
|
53 | +echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by ".$xoopsConfig['sitename']."' />\n"; |
|
54 | +echo "<meta name='DESCRIPTION' content='".$xoopsConfig['slogan']."' />\n"; |
|
55 | +echo "<meta name='GENERATOR' content='".XOOPS_VERSION."' />\n\n\n"; |
|
56 | 56 | |
57 | 57 | echo "<body bgcolor='#ffffff' text='#000000' onload='window.print()'> |
58 | 58 | <div style='width: 650px; border: 1px solid #000; padding: 20px;'> |
59 | - <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/smartfaq_logo.png' border='0' alt='' /><h2 style='margin: 0;'>" . $faqObj->question() . "</h2></div> |
|
60 | - <div align='center'>" . $who_where . "</div> |
|
59 | + <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL."/modules/smartfaq/assets/images/smartfaq_logo.png' border='0' alt='' /><h2 style='margin: 0;'>".$faqObj->question()."</h2></div> |
|
60 | + <div align='center'>" . $who_where."</div> |
|
61 | 61 | <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div> |
62 | 62 | <div></div> |
63 | - <b><p>" . $faqObj->question() . "</p></b> |
|
64 | - <p>" . $answerObj->answer() . "</p> |
|
63 | + <b><p>" . $faqObj->question()."</p></b> |
|
64 | + <p>" . $answerObj->answer()."</p> |
|
65 | 65 | <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div> |
66 | - <p>". $comeFrom . "</p> |
|
66 | + <p>". $comeFrom."</p> |
|
67 | 67 | </div> |
68 | 68 | <br />"; |
69 | 69 |
@@ -7,16 +7,16 @@ discard block |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | |
10 | -include_once __DIR__ . '/header.php'; |
|
10 | +include_once __DIR__.'/header.php'; |
|
11 | 11 | |
12 | 12 | global $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
13 | 13 | |
14 | 14 | $xoopsOption['template_main'] = 'smartfaq_category.tpl'; |
15 | 15 | |
16 | -include_once(XOOPS_ROOT_PATH . "/header.php"); |
|
17 | -include_once __DIR__ . '/footer.php'; |
|
16 | +include_once(XOOPS_ROOT_PATH."/header.php"); |
|
17 | +include_once __DIR__.'/footer.php'; |
|
18 | 18 | |
19 | -$categoryid = isset($_GET['categoryid'])? intval($_GET['categoryid']) : 0; |
|
19 | +$categoryid = isset($_GET['categoryid']) ? intval($_GET['categoryid']) : 0; |
|
20 | 20 | |
21 | 21 | // Creating the category object for the selected category |
22 | 22 | $categoryObj = new sfCategory($categoryid); |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | // Creating the category handler object |
37 | -$category_handler =& sf_gethandler('category'); |
|
37 | +$category_handler = & sf_gethandler('category'); |
|
38 | 38 | |
39 | 39 | // At which record shall we start |
40 | -$start = isset($_GET['start'])? intval($_GET['start']) : 0; |
|
40 | +$start = isset($_GET['start']) ? intval($_GET['start']) : 0; |
|
41 | 41 | |
42 | 42 | // Creating the faq handler object |
43 | -$faq_handler =& sf_gethandler('faq'); |
|
43 | +$faq_handler = & sf_gethandler('faq'); |
|
44 | 44 | |
45 | 45 | // creating the FAQ objects that belong to the selected category |
46 | 46 | $faqsObj = $faq_handler->getFaqs($xoopsModuleConfig['indexperpage'], $start, _SF_STATUS_OPENED, $categoryid); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $last_qnaObj = $faq_handler->getLastPublishedByCat(array(_SF_STATUS_OPENED)); |
64 | 64 | if (isset($last_qnaObj[$categoryid])) { |
65 | 65 | $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid')); |
66 | - $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . "</a>"); |
|
66 | + $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50)."</a>"); |
|
67 | 67 | } |
68 | 68 | // Populating the smarty variables with informations related to the selected category |
69 | 69 | $category = $categoryObj->toArray(null, true); |
@@ -75,14 +75,14 @@ discard block |
||
75 | 75 | $total_subcats = count($subcatsObj); |
76 | 76 | $catQnasWithSub = 0; |
77 | 77 | if ($total_subcats != 0) { |
78 | - $faq_handler =& sf_gethandler('faq'); |
|
78 | + $faq_handler = & sf_gethandler('faq'); |
|
79 | 79 | // Arrays that will hold the informations passed on to smarty variables |
80 | 80 | foreach ($subcatsObj as $key => $subcat) { |
81 | 81 | $subcat_id = $subcat->getVar('categoryid'); |
82 | 82 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
83 | 83 | if (isset($last_qnaObj[$subcat_id])) { |
84 | 84 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
85 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . "</a>"); |
|
85 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50)."</a>"); |
|
86 | 86 | } |
87 | 87 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
88 | 88 | $subcats[$subcat_id] = $subcat->toArray(null, true); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | $xoopsTpl->assign('subcats', $subcats); |
93 | 93 | } |
94 | -$category['total'] = $catQnasWithSub + $totalQnas[$categoryid]; |
|
94 | +$category['total'] = $catQnasWithSub+$totalQnas[$categoryid]; |
|
95 | 95 | if ($faqsObj) { |
96 | 96 | $userids = array(); |
97 | 97 | foreach ($faqsObj as $key => $thisfaq) { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | } |
114 | 114 | // Language constants |
115 | -$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . "</a>"); |
|
115 | +$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION."</a>"); |
|
116 | 116 | $xoopsTpl->assign('modulename', $xoopsModule->dirname()); |
117 | 117 | |
118 | 118 | $xoopsTpl->assign('displaylastfaqs', true); |
@@ -129,19 +129,19 @@ discard block |
||
129 | 129 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
130 | 130 | |
131 | 131 | // The Navigation Bar |
132 | -include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
133 | -$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
132 | +include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
133 | +$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
134 | 134 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
135 | - $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'; |
|
135 | + $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'; |
|
136 | 136 | } else { |
137 | - $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
137 | + $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $xoopsTpl->assign('category', $category); |
141 | 141 | |
142 | 142 | // Page Title Hack by marcan |
143 | 143 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
144 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
144 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
145 | 145 | // End Page Title Hack by marcan |
146 | 146 | |
147 | -include_once(XOOPS_ROOT_PATH . "/footer.php"); |
|
147 | +include_once(XOOPS_ROOT_PATH."/footer.php"); |
@@ -7,5 +7,5 @@ |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | |
10 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
11 | -include_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
10 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
11 | +include_once XOOPS_ROOT_PATH.'/include/comment_new.php'; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @version $Id $ |
19 | 19 | */ |
20 | 20 | |
21 | -include_once __DIR__ . '/admin_header.php'; |
|
21 | +include_once __DIR__.'/admin_header.php'; |
|
22 | 22 | |
23 | 23 | xoops_cp_header(); |
24 | 24 | |
@@ -27,4 +27,4 @@ discard block |
||
27 | 27 | echo $aboutAdmin->addNavigation('about.php'); |
28 | 28 | echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false); |
29 | 29 | |
30 | -include_once __DIR__ . '/admin_footer.php'; |
|
30 | +include_once __DIR__.'/admin_footer.php'; |
@@ -19,20 +19,20 @@ discard block |
||
19 | 19 | */ |
20 | 20 | |
21 | 21 | $path = dirname(dirname(dirname(__DIR__))); |
22 | -include_once $path . '/mainfile.php'; |
|
23 | -include_once $path . '/include/cp_functions.php'; |
|
24 | -require_once $path . '/include/cp_header.php'; |
|
22 | +include_once $path.'/mainfile.php'; |
|
23 | +include_once $path.'/include/cp_functions.php'; |
|
24 | +require_once $path.'/include/cp_header.php'; |
|
25 | 25 | |
26 | -include_once $path . "/kernel/module.php"; |
|
27 | -include_once $path . "/class/xoopstree.php"; |
|
28 | -include_once $path . "/class/xoopslists.php"; |
|
29 | -include_once $path . '/class/pagenav.php'; |
|
30 | -include_once $path . "/class/xoopsformloader.php"; |
|
26 | +include_once $path."/kernel/module.php"; |
|
27 | +include_once $path."/class/xoopstree.php"; |
|
28 | +include_once $path."/class/xoopslists.php"; |
|
29 | +include_once $path.'/class/pagenav.php'; |
|
30 | +include_once $path."/class/xoopsformloader.php"; |
|
31 | 31 | |
32 | -include_once $path .'/modules/smartfaq/include/functions.php'; |
|
33 | -include_once $path .'/modules/smartfaq/class/category.php'; |
|
34 | -include_once $path .'/modules/smartfaq/class/faq.php'; |
|
35 | -include_once $path .'/modules/smartfaq/class/answer.php'; |
|
32 | +include_once $path.'/modules/smartfaq/include/functions.php'; |
|
33 | +include_once $path.'/modules/smartfaq/class/category.php'; |
|
34 | +include_once $path.'/modules/smartfaq/class/faq.php'; |
|
35 | +include_once $path.'/modules/smartfaq/class/answer.php'; |
|
36 | 36 | |
37 | 37 | $myts = &MyTextSanitizer::getInstance(); |
38 | 38 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); |
53 | 53 | $pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); |
54 | 54 | |
55 | -if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))) { |
|
55 | +if (file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))) { |
|
56 | 56 | include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); |
57 | 57 | } else { |
58 | 58 | redirect_header("../../../admin.php", 5, _AM_BIRTHDAY_MODULEADMIN_MISSING, false); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | |
10 | -include_once __DIR__ . '/admin_header.php'; |
|
10 | +include_once __DIR__.'/admin_header.php'; |
|
11 | 11 | |
12 | 12 | $op = ''; |
13 | 13 | |
@@ -16,20 +16,20 @@ discard block |
||
16 | 16 | if (isset($_POST['op'])) $op = $_POST['op']; |
17 | 17 | |
18 | 18 | // Creating the answer handler object |
19 | -$answer_handler =& sf_gethandler('answer'); |
|
19 | +$answer_handler = & sf_gethandler('answer'); |
|
20 | 20 | |
21 | 21 | function editfaq($faqid = '') |
22 | 22 | { |
23 | 23 | |
24 | 24 | global $answer_handler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts, $pathIcon16, $smartModuleConfig; |
25 | 25 | |
26 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
26 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
27 | 27 | |
28 | 28 | // Creating the FAQ object |
29 | 29 | $faqObj = new sfFaq($faqid); |
30 | 30 | |
31 | 31 | // Creating the category object |
32 | - $categoryObj =& $faqObj->category(); |
|
32 | + $categoryObj = & $faqObj->category(); |
|
33 | 33 | |
34 | 34 | if ($faqObj->notLoaded()) { |
35 | 35 | redirect_header("index.php", 1, _AM_SF_NOFAQSELECTED); |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | switch ($faqObj->status()) { |
40 | 40 | |
41 | 41 | case _SF_STATUS_ANSWERED : |
42 | - $breadcrumb_action1 = _AM_SF_SUBMITTED; |
|
43 | - $breadcrumb_action2 = _AM_SF_APPROVING; |
|
42 | + $breadcrumb_action1 = _AM_SF_SUBMITTED; |
|
43 | + $breadcrumb_action2 = _AM_SF_APPROVING; |
|
44 | 44 | $collapsableBar_title = _AM_SF_SUBMITTED_TITLE; |
45 | 45 | $collapsableBar_info = _AM_SF_SUBMITTED_INFO; |
46 | 46 | $button_caption = _AM_SF_APPROVE; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | $module_id = $xoopsModule->getVar('mid'); |
53 | 53 | $gperm_handler = &xoops_gethandler('groupperm'); |
54 | - $groups = ($xoopsUser)? ($xoopsUser->getGroups()) : XOOPS_GROUP_ANONYMOUS; |
|
54 | + $groups = ($xoopsUser) ? ($xoopsUser->getGroups()) : XOOPS_GROUP_ANONYMOUS; |
|
55 | 55 | |
56 | 56 | if (!sf_userIsAdmin() && (!($gperm_handler->checkRight('category_admin', $faqObj->categoryid(), $groups, $module_id)))) { |
57 | 57 | redirect_header("javascript:history.go(-1)", 1, _NOPERM); |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | //sf_adminMenu(-1, _AM_SF_SMARTFAQ . " > " . _AM_SF_ANSWER); |
64 | 64 | |
65 | 65 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
66 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_SUBMITTED_ANSWER . "</h3>"; |
|
66 | + echo "<img id='bottomtableicon' src=".XOOPS_URL."/modules/".$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_SUBMITTED_ANSWER."</h3>"; |
|
67 | 67 | echo "<div id='bottomtable'>"; |
68 | - echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_SF_SUBMITTED_ANSWER_INFO . "</span>"; |
|
68 | + echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">"._AM_SF_SUBMITTED_ANSWER_INFO."</span>"; |
|
69 | 69 | |
70 | 70 | $proposed_answers = $answer_handler->getAllAnswers($faqid, _SF_AN_STATUS_PROPOSED); |
71 | 71 | |
@@ -76,31 +76,31 @@ discard block |
||
76 | 76 | |
77 | 77 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer> |
78 | 78 | <tr> |
79 | - <td class='head' width='100px'>" . _AM_SF_CATEGORY . "</td> |
|
80 | - <td class='even'>" . $categoryObj->name() . "</td> |
|
79 | + <td class='head' width='100px'>" . _AM_SF_CATEGORY."</td> |
|
80 | + <td class='even'>" . $categoryObj->name()."</td> |
|
81 | 81 | </tr> |
82 | 82 | <tr> |
83 | - <td class='head' width='100px'>" . _AM_SF_QUESTION . "</td> |
|
84 | - <td class='even'>" . $faqObj->question() . "</td> |
|
83 | + <td class='head' width='100px'>" . _AM_SF_QUESTION."</td> |
|
84 | + <td class='even'>" . $faqObj->question()."</td> |
|
85 | 85 | </tr>"; |
86 | 86 | if ($official_answer) { |
87 | 87 | echo " |
88 | 88 | <tr> |
89 | - <td class='head' width='100px'>" . _AM_SF_ANSWER_OFFICIAL . "</td> |
|
90 | - <td class='even'>" . $official_answer->answer() . "</td> |
|
89 | + <td class='head' width='100px'>" . _AM_SF_ANSWER_OFFICIAL."</td> |
|
90 | + <td class='even'>" . $official_answer->answer()."</td> |
|
91 | 91 | </tr>"; |
92 | 92 | } |
93 | 93 | echo "</table><br />\n"; |
94 | 94 | |
95 | 95 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
96 | 96 | echo "<tr>"; |
97 | - echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . "</b></td>"; |
|
98 | - echo "<th class='bg3' class='bg3' align='center'><b>" . _AM_SF_ANSWER . "</b></td>"; |
|
97 | + echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID."</b></td>"; |
|
98 | + echo "<th class='bg3' class='bg3' align='center'><b>"._AM_SF_ANSWER."</b></td>"; |
|
99 | 99 | |
100 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . "</b></td>"; |
|
100 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED."</b></td>"; |
|
101 | 101 | |
102 | - echo "<th width='180' class='bg3' align='center'><b>" . _AM_SF_CREATED . "</b></td>"; |
|
103 | - echo "<th width='120' class='bg3' align='center'><b>" . _AM_SF_ACTION . "</b></td>"; |
|
102 | + echo "<th width='180' class='bg3' align='center'><b>"._AM_SF_CREATED."</b></td>"; |
|
103 | + echo "<th width='120' class='bg3' align='center'><b>"._AM_SF_ACTION."</b></td>"; |
|
104 | 104 | echo "</tr>"; |
105 | 105 | |
106 | 106 | $merge = ''; |
@@ -108,20 +108,20 @@ discard block |
||
108 | 108 | $approve = ''; |
109 | 109 | foreach ($proposed_answers as $proposed_answer) { |
110 | 110 | if ($faqObj->status() == _SF_STATUS_NEW_ANSWER) { |
111 | - $merge = "<a href='faq.php?op=merge&faqid=" . $faqObj->faqid() . "&answerid=" . $proposed_answer->answerid() . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/assets/images/icon/merge.gif' title='" . _AM_SF_FAQ_MERGE . "' alt='" . _AM_SF_FAQ_MERGE . "' /></a> "; |
|
112 | - $approve = "<a href='answer.php?op=selectanswer&faqid=" . $faqid . "&answerid=" . $proposed_answer->answerid() . "'><img src='". $pathIcon16 .'/on.png'."' title='" . _AM_SF_FAQ_APPROVE_NEW_ANSWER . "' alt='" . _AM_SF_APPROVESUB . "' /></a>"; |
|
111 | + $merge = "<a href='faq.php?op=merge&faqid=".$faqObj->faqid()."&answerid=".$proposed_answer->answerid()."'><img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/assets/images/icon/merge.gif' title='"._AM_SF_FAQ_MERGE."' alt='"._AM_SF_FAQ_MERGE."' /></a> "; |
|
112 | + $approve = "<a href='answer.php?op=selectanswer&faqid=".$faqid."&answerid=".$proposed_answer->answerid()."'><img src='".$pathIcon16.'/on.png'."' title='"._AM_SF_FAQ_APPROVE_NEW_ANSWER."' alt='"._AM_SF_APPROVESUB."' /></a>"; |
|
113 | 113 | } |
114 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqObj->faqid() . "&answerid=" . $proposed_answer->answerid() . "'><img src='". $pathIcon16 .'/edit.png'."' title='" . _AM_SF_FAQ_REVIEW . "' alt='" . _AM_SF_FAQ_REVIEW . "' /></a> "; |
|
115 | - $delete = "<a href='answer.php?op=del&faqid=" . $faqObj->faqid() . "&answerid=" . $proposed_answer->answerid() . "'><img src='". $pathIcon16 .'/delete.png'."' title='" . _AM_SF_DELETESUBM . "' alt='" . _AM_SF_DELETESUBM . "' /></a>"; |
|
114 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqObj->faqid()."&answerid=".$proposed_answer->answerid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_FAQ_REVIEW."' alt='"._AM_SF_FAQ_REVIEW."' /></a> "; |
|
115 | + $delete = "<a href='answer.php?op=del&faqid=".$faqObj->faqid()."&answerid=".$proposed_answer->answerid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETESUBM."' alt='"._AM_SF_DELETESUBM."' /></a>"; |
|
116 | 116 | echo "<tr>"; |
117 | - echo "<td class='head' align='center'>" . $proposed_answer->answerid(). "</td>"; |
|
118 | - echo "<td class='even' align='left'>" . $proposed_answer->answer() . "</td>"; |
|
117 | + echo "<td class='head' align='center'>".$proposed_answer->answerid()."</td>"; |
|
118 | + echo "<td class='even' align='left'>".$proposed_answer->answer()."</td>"; |
|
119 | 119 | |
120 | 120 | //show name of the answer submitter |
121 | - $submitter= sf_getLinkedUnameFromId($proposed_answer->uid(), $smartModuleConfig['userealname']); |
|
122 | - echo "<td class='even' align='center'>" . $submitter . "</td>"; |
|
121 | + $submitter = sf_getLinkedUnameFromId($proposed_answer->uid(), $smartModuleConfig['userealname']); |
|
122 | + echo "<td class='even' align='center'>".$submitter."</td>"; |
|
123 | 123 | |
124 | - echo "<td class='even' align='center'>" . $proposed_answer->datesub() . "</td>"; |
|
124 | + echo "<td class='even' align='center'>".$proposed_answer->datesub()."</td>"; |
|
125 | 125 | echo "<td class='even' align='center'> $merge $modify $approve $delete </td>"; |
126 | 126 | echo "</tr>"; |
127 | 127 | } |
@@ -133,17 +133,17 @@ discard block |
||
133 | 133 | switch ($op) { |
134 | 134 | case "mod": |
135 | 135 | xoops_cp_header(); |
136 | - include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; |
|
136 | + include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
137 | 137 | Global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $modify, $myts; |
138 | - $faqid = isset($_GET['faqid'])? intval($_GET['faqid']) : 0; |
|
138 | + $faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : 0; |
|
139 | 139 | editfaq($faqid); |
140 | 140 | break; |
141 | 141 | |
142 | 142 | case "selectanswer": |
143 | 143 | global $xoopsUser, $_GET, $xoopsModuleConfig; |
144 | 144 | |
145 | - $faqid = isset($_GET['faqid'])? intval($_GET['faqid']) : 0; |
|
146 | - $answerid = isset($_GET['answerid'])? intval($_GET['answerid']) : 0; |
|
145 | + $faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : 0; |
|
146 | + $answerid = isset($_GET['answerid']) ? intval($_GET['answerid']) : 0; |
|
147 | 147 | |
148 | 148 | // Creating the FAQ object |
149 | 149 | $faqObj = new sfFaq($faqid); |
@@ -194,13 +194,13 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | // Storing the FAQ object in the database |
197 | - if ( !$faqObj->store() ) { |
|
197 | + if (!$faqObj->store()) { |
|
198 | 198 | redirect_header("javascript:history.go(-1)", 2, _AM_SF_ERROR_FAQ_NOT_SAVED); |
199 | 199 | exit(); |
200 | 200 | } |
201 | 201 | |
202 | 202 | // Storing the answer object in the database |
203 | - if ( !$answerObj->store() ) { |
|
203 | + if (!$answerObj->store()) { |
|
204 | 204 | redirect_header("javascript:history.go(-1)", 2, _AM_SF_ERROR_ANSWER_NOT_SAVED); |
205 | 205 | exit(); |
206 | 206 | } |
@@ -222,11 +222,11 @@ discard block |
||
222 | 222 | case "del": |
223 | 223 | Global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB; |
224 | 224 | |
225 | - $faqid = isset($_POST['faqid'])? intval($_POST['faqid']) : 0; |
|
226 | - $faqid = isset($_GET['faqid'])? intval($_GET['faqid']) : $faqid; |
|
227 | - $answerid = isset($_POST['answerid'])? intval($_POST['answerid']) : 0; |
|
228 | - $answerid = isset($_GET['answerid'])? intval($_GET['answerid']) : $answerid; |
|
229 | - $confirm = isset($_POST['confirm'])? intval($_POST['confirm']) : 0; |
|
225 | + $faqid = isset($_POST['faqid']) ? intval($_POST['faqid']) : 0; |
|
226 | + $faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : $faqid; |
|
227 | + $answerid = isset($_POST['answerid']) ? intval($_POST['answerid']) : 0; |
|
228 | + $answerid = isset($_GET['answerid']) ? intval($_GET['answerid']) : $answerid; |
|
229 | + $confirm = isset($_POST['confirm']) ? intval($_POST['confirm']) : 0; |
|
230 | 230 | $faqObj = new sfFaq($faqid); |
231 | 231 | $answerObj = new sfAnswer($answerid); |
232 | 232 | if ($confirm) { |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $proposed_answers = $answer_handler->getAllAnswers($faqid, _SF_AN_STATUS_PROPOSED); |
246 | 246 | if (count($proposed_answers) > 0) { |
247 | 247 | // This question has other proposed answer |
248 | - $redirect_page = "answer.php?op=mod&faqid=" . $faqid; |
|
248 | + $redirect_page = "answer.php?op=mod&faqid=".$faqid; |
|
249 | 249 | $redirect_msg = _AM_SF_ANSWER_REJECTED; |
250 | 250 | } else { |
251 | 251 | // The question has no other proposed answer |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | default: |
271 | 271 | xoops_cp_header(); |
272 | 272 | |
273 | - include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; |
|
273 | + include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
274 | 274 | global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule; |
275 | 275 | |
276 | 276 | editfaq(); |
277 | 277 | break; |
278 | 278 | } |
279 | 279 | |
280 | -include_once __DIR__ . '/admin_footer.php'; |
|
280 | +include_once __DIR__.'/admin_footer.php'; |
@@ -12,8 +12,12 @@ |
||
12 | 12 | $op = ''; |
13 | 13 | |
14 | 14 | // Getting the operation we are doing |
15 | -if (isset($_GET['op'])) $op = $_GET['op']; |
|
16 | -if (isset($_POST['op'])) $op = $_POST['op']; |
|
15 | +if (isset($_GET['op'])) { |
|
16 | + $op = $_GET['op']; |
|
17 | +} |
|
18 | +if (isset($_POST['op'])) { |
|
19 | + $op = $_POST['op']; |
|
20 | +} |
|
17 | 21 | |
18 | 22 | // Creating the answer handler object |
19 | 23 | $answer_handler =& sf_gethandler('answer'); |
@@ -195,19 +195,19 @@ |
||
195 | 195 | |
196 | 196 | |
197 | 197 | $editorTray = new XoopsFormElementTray(_AM_SF_ANSWER_FAQ, '<br />'); |
198 | - if (class_exists('XoopsFormEditor')) { |
|
199 | - $options['name'] = 'answer'; |
|
200 | - $options['value'] = $theanswer; |
|
201 | - $options['rows'] = 5; |
|
202 | - $options['cols'] = '100%'; |
|
203 | - $options['width'] = '100%'; |
|
204 | - $options['height'] = '200px'; |
|
205 | - $answerEditor = new XoopsFormEditor('', $xoopsModuleConfig['form_editorOptions'], $options, $nohtml = false, $onfailure = 'textarea'); |
|
206 | - $editorTray->addElement($answerEditor,true ); |
|
207 | - } else { |
|
208 | - $answerEditor = new XoopsFormDhtmlTextArea(_AM_SF_ANSWER_FAQ, 'answer', $theanswer, '100%', '100%'); |
|
209 | - $editorTray->addElement($answerEditor,true ); |
|
210 | - } |
|
198 | + if (class_exists('XoopsFormEditor')) { |
|
199 | + $options['name'] = 'answer'; |
|
200 | + $options['value'] = $theanswer; |
|
201 | + $options['rows'] = 5; |
|
202 | + $options['cols'] = '100%'; |
|
203 | + $options['width'] = '100%'; |
|
204 | + $options['height'] = '200px'; |
|
205 | + $answerEditor = new XoopsFormEditor('', $xoopsModuleConfig['form_editorOptions'], $options, $nohtml = false, $onfailure = 'textarea'); |
|
206 | + $editorTray->addElement($answerEditor,true ); |
|
207 | + } else { |
|
208 | + $answerEditor = new XoopsFormDhtmlTextArea(_AM_SF_ANSWER_FAQ, 'answer', $theanswer, '100%', '100%'); |
|
209 | + $editorTray->addElement($answerEditor,true ); |
|
210 | + } |
|
211 | 211 | |
212 | 212 | $sform->addElement($editorTray); |
213 | 213 |
@@ -7,29 +7,29 @@ discard block |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | |
10 | -include_once __DIR__ . '/admin_header.php'; |
|
10 | +include_once __DIR__.'/admin_header.php'; |
|
11 | 11 | |
12 | 12 | // Creating the faq handler object |
13 | -$faq_handler =& sf_gethandler('faq'); |
|
13 | +$faq_handler = & sf_gethandler('faq'); |
|
14 | 14 | |
15 | 15 | // Creating the category handler object |
16 | -$category_handler =& sf_gethandler('category'); |
|
16 | +$category_handler = & sf_gethandler('category'); |
|
17 | 17 | |
18 | 18 | // Creating the answer handler object |
19 | -$answer_handler =& sf_gethandler('answer'); |
|
19 | +$answer_handler = & sf_gethandler('answer'); |
|
20 | 20 | |
21 | 21 | $op = ''; |
22 | 22 | if (isset($_GET['op'])) $op = $_GET['op']; |
23 | 23 | if (isset($_POST['op'])) $op = $_POST['op']; |
24 | 24 | |
25 | 25 | // Where shall we start? |
26 | -$startfaq = isset($_GET['startfaq'])? intval($_GET['startfaq']) : 0; |
|
26 | +$startfaq = isset($_GET['startfaq']) ? intval($_GET['startfaq']) : 0; |
|
27 | 27 | |
28 | -function editfaq($showmenu = false, $faqid = -1, $answerid = -1, $merge=false) |
|
28 | +function editfaq($showmenu = false, $faqid = -1, $answerid = -1, $merge = false) |
|
29 | 29 | { |
30 | 30 | global $answer_handler, $faq_handler, $category_handler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts; |
31 | 31 | |
32 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
32 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
33 | 33 | // If there is a parameter, and the id exists, retrieve data: we're editing a faq |
34 | 34 | if ($faqid != -1) { |
35 | 35 | // Creating the FAQ object |
@@ -42,20 +42,20 @@ discard block |
||
42 | 42 | |
43 | 43 | if ($answerid == -1) { |
44 | 44 | // Creating the object for the official answer |
45 | - $answerObj =& $faqObj->answer(); |
|
45 | + $answerObj = & $faqObj->answer(); |
|
46 | 46 | if (!$answerObj) { |
47 | 47 | $answerObj = $answer_handler->create(); |
48 | 48 | } |
49 | 49 | } else { |
50 | 50 | $answerObj = new sfAnswer($answerid); |
51 | - $originalAnswerObj =& $faqObj->answer(); |
|
51 | + $originalAnswerObj = & $faqObj->answer(); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | switch ($faqObj->status()) { |
55 | 55 | |
56 | 56 | case _SF_STATUS_ASKED : |
57 | - $breadcrumb_action1 = _AM_SF_ASKED; |
|
58 | - $breadcrumb_action2 = _AM_SF_APPROVING; |
|
57 | + $breadcrumb_action1 = _AM_SF_ASKED; |
|
58 | + $breadcrumb_action2 = _AM_SF_APPROVING; |
|
59 | 59 | $collapsableBar_title = _AM_SF_ASKED_TITLE; |
60 | 60 | $collapsableBar_info = _AM_SF_ASKED_TITLE_INFO; |
61 | 61 | $button_caption = _AM_SF_PUBLISHED; |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | break; |
65 | 65 | |
66 | 66 | case _SF_STATUS_ANSWERED : |
67 | - $breadcrumb_action1 = _AM_SF_ANSWERED; |
|
68 | - $breadcrumb_action2 = _AM_SF_APPROVING; |
|
67 | + $breadcrumb_action1 = _AM_SF_ANSWERED; |
|
68 | + $breadcrumb_action2 = _AM_SF_APPROVING; |
|
69 | 69 | $collapsableBar_title = _AM_SF_ANSWERED_TITLE; |
70 | 70 | $collapsableBar_info = _AM_SF_ANSWERED_TITLE_INFO; |
71 | 71 | $button_caption = _AM_SF_APPROVE; |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | break; |
74 | 74 | |
75 | 75 | case _SF_STATUS_SUBMITTED : |
76 | - $breadcrumb_action1 = _AM_SF_SUBMITTED; |
|
77 | - $breadcrumb_action2 = _AM_SF_APPROVING; |
|
76 | + $breadcrumb_action1 = _AM_SF_SUBMITTED; |
|
77 | + $breadcrumb_action2 = _AM_SF_APPROVING; |
|
78 | 78 | $collapsableBar_title = _AM_SF_SUBMITTED_TITLE; |
79 | 79 | $collapsableBar_info = _AM_SF_SUBMITTED_INFO; |
80 | 80 | $button_caption = _AM_SF_APPROVE; |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | break; |
83 | 83 | |
84 | 84 | case _SF_STATUS_PUBLISHED : |
85 | - $breadcrumb_action1 = _AM_SF_PUBLISHED; |
|
86 | - $breadcrumb_action2 = _AM_SF_EDITING; |
|
85 | + $breadcrumb_action1 = _AM_SF_PUBLISHED; |
|
86 | + $breadcrumb_action2 = _AM_SF_EDITING; |
|
87 | 87 | $collapsableBar_title = _AM_SF_PUBLISHEDEDITING; |
88 | 88 | $collapsableBar_info = _AM_SF_PUBLISHEDEDITING_INFO; |
89 | 89 | $button_caption = _AM_SF_MODIFY; |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | break; |
92 | 92 | |
93 | 93 | case _SF_STATUS_OFFLINE : |
94 | - $breadcrumb_action1 = _AM_SF_OFFLINE; |
|
95 | - $breadcrumb_action2 = _AM_SF_EDITING; |
|
94 | + $breadcrumb_action1 = _AM_SF_OFFLINE; |
|
95 | + $breadcrumb_action2 = _AM_SF_EDITING; |
|
96 | 96 | $collapsableBar_title = _AM_SF_OFFLINEEDITING; |
97 | 97 | $collapsableBar_info = _AM_SF_OFFLINEEDITING_INFO; |
98 | 98 | $button_caption = _AM_SF_MODIFY; |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | break; |
101 | 101 | |
102 | 102 | case _SF_STATUS_OPENED : |
103 | - $breadcrumb_action1 = _AM_SF_OPEN_QUESTIONS; |
|
104 | - $breadcrumb_action2 = _AM_SF_ANSWERING; |
|
103 | + $breadcrumb_action1 = _AM_SF_OPEN_QUESTIONS; |
|
104 | + $breadcrumb_action2 = _AM_SF_ANSWERING; |
|
105 | 105 | $collapsableBar_title = _AM_SF_OPEN_QUESTION_ANSWERING; |
106 | 106 | $collapsableBar_info = _AM_SF_OPEN_QUESTION_ANSWERING_INFO; |
107 | 107 | $button_caption = _AM_SF_PUBLISH; |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | break; |
111 | 111 | |
112 | 112 | case _SF_STATUS_NEW_ANSWER : |
113 | - $breadcrumb_action1 = _AM_SF_PUBLISHED; |
|
114 | - $breadcrumb_action2 = _AM_SF_EDITING; |
|
113 | + $breadcrumb_action1 = _AM_SF_PUBLISHED; |
|
114 | + $breadcrumb_action2 = _AM_SF_EDITING; |
|
115 | 115 | $collapsableBar_title = _AM_SF_NEW_ANSWER_EDITING; |
116 | 116 | $collapsableBar_info = _AM_SF_NEW_ANSWER_EDITING_INFO; |
117 | 117 | $button_caption = _AM_SF_PUBLISH; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } */ |
130 | 130 | |
131 | 131 | // Creating the category of this FAQ |
132 | - $categoryObj =& $faqObj->category(); |
|
132 | + $categoryObj = & $faqObj->category(); |
|
133 | 133 | |
134 | 134 | if ($showmenu) { |
135 | 135 | //sf_adminMenu(2, $breadcrumb_action1 . " > " . $breadcrumb_action2); |
@@ -137,15 +137,15 @@ discard block |
||
137 | 137 | |
138 | 138 | echo "<br />\n"; |
139 | 139 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
140 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . $collapsableBar_title . "</h3>"; |
|
140 | + echo "<img id='bottomtableicon' src=".XOOPS_URL."/modules/".$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> ".$collapsableBar_title."</h3>"; |
|
141 | 141 | echo "<div id='bottomtable'>"; |
142 | - echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $collapsableBar_info . "</span>"; |
|
142 | + echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">".$collapsableBar_info."</span>"; |
|
143 | 143 | } else { |
144 | 144 | // there's no parameter, so we're adding a faq |
145 | - $faqObj =& $faq_handler->create(); |
|
145 | + $faqObj = & $faq_handler->create(); |
|
146 | 146 | $faqObj->setVar('uid', $xoopsUser->getVar('uid')); |
147 | - $categoryObj =& $category_handler->create(); |
|
148 | - $answerObj =& $answer_handler->create(); |
|
147 | + $categoryObj = & $category_handler->create(); |
|
148 | + $answerObj = & $answer_handler->create(); |
|
149 | 149 | $answerObj->setVar('uid', $xoopsUser->getVar('uid')); |
150 | 150 | |
151 | 151 | $breadcrumb_action1 = _AM_SF_SMARTFAQS; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | //sf_adminMenu(2, $breadcrumb_action1 . " > " . $breadcrumb_action2); |
156 | 156 | } |
157 | 157 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
158 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_CREATESMARTFAQ . "</h3>"; |
|
158 | + echo "<img id='bottomtableicon' src=".XOOPS_URL."/modules/".$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_CREATESMARTFAQ."</h3>"; |
|
159 | 159 | echo "<div id='bottomtable'>"; |
160 | 160 | } |
161 | 161 | $sform = new XoopsThemeForm(_AM_SF_SMARTFAQ, "op", xoops_getenv('PHP_SELF')); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * Last one is not set as we do not have sub menus in Smartfaq |
176 | 176 | */ |
177 | 177 | |
178 | - $mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid" , "parentid"); |
|
178 | + $mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid", "parentid"); |
|
179 | 179 | ob_start(); |
180 | 180 | $mytree->makeMySelBox("name", "weight", $categoryObj->categoryid()); |
181 | 181 | $sform->addElement(new XoopsFormLabel(_AM_SF_CATEGORY_FAQ, ob_get_contents())); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | // ANSWER |
188 | 188 | if ($merge) { |
189 | - $theanswer = $originalAnswerObj->answer('e') . "\n\n" . sprintf(_AM_SF_NEW_CONTRIBUTION, sf_getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), $answerObj->answer('e')); |
|
189 | + $theanswer = $originalAnswerObj->answer('e')."\n\n".sprintf(_AM_SF_NEW_CONTRIBUTION, sf_getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), $answerObj->answer('e')); |
|
190 | 190 | } else { |
191 | 191 | $theanswer = $answerObj->answer('e'); |
192 | 192 | } |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | $options['width'] = '100%'; |
204 | 204 | $options['height'] = '200px'; |
205 | 205 | $answerEditor = new XoopsFormEditor('', $xoopsModuleConfig['form_editorOptions'], $options, $nohtml = false, $onfailure = 'textarea'); |
206 | - $editorTray->addElement($answerEditor,true ); |
|
206 | + $editorTray->addElement($answerEditor, true); |
|
207 | 207 | } else { |
208 | 208 | $answerEditor = new XoopsFormDhtmlTextArea(_AM_SF_ANSWER_FAQ, 'answer', $theanswer, '100%', '100%'); |
209 | - $editorTray->addElement($answerEditor,true ); |
|
209 | + $editorTray->addElement($answerEditor, true); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | $sform->addElement($editorTray); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | $modulelink_select = new XoopsFormSelect('', 'modulelink', $faqObj->modulelink()); |
229 | 229 | $modulelink_select->addOptionArray($modulelink_select_array); |
230 | - $modulelink_tray = new XoopsFormElementTray(_AM_SF_CONTEXTMODULELINK_FAQ , ' '); |
|
230 | + $modulelink_tray = new XoopsFormElementTray(_AM_SF_CONTEXTMODULELINK_FAQ, ' '); |
|
231 | 231 | $modulelink_tray->addElement($modulelink_select); |
232 | 232 | $sform->addElement($modulelink_tray); |
233 | 233 | |
@@ -235,14 +235,14 @@ discard block |
||
235 | 235 | $sform->addElement(new XoopsFormText(_AM_SF_SPECIFIC_URL, 'contextpage', 50, 60, $faqObj->contextpage()), false); |
236 | 236 | |
237 | 237 | // EXACT URL? |
238 | - $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
238 | + $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
239 | 239 | $sform->addElement($excaturl_radio); |
240 | 240 | // WEIGHT |
241 | 241 | $sform->addElement(new XoopsFormText(_AM_SF_WEIGHT, 'weight', 5, 5, $faqObj->weight()), true); |
242 | 242 | |
243 | 243 | // COMMENTS |
244 | 244 | // Code to allow comments |
245 | - $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
245 | + $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
246 | 246 | $sform->addElement($addcomments_radio); |
247 | 247 | |
248 | 248 | // PER ITEM PERMISSIONS |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | $sform->addElement($groups_checkbox); |
258 | 258 | |
259 | - $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
259 | + $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
260 | 260 | $sform->addElement($partial_view); |
261 | 261 | |
262 | 262 | // VARIOUS OPTIONS |
@@ -277,9 +277,9 @@ discard block |
||
277 | 277 | $sform->addElement($options_tray); |
278 | 278 | |
279 | 279 | // OFFLINE |
280 | - if ( $faqObj->status() == _SF_STATUS_OFFLINE ) { |
|
280 | + if ($faqObj->status() == _SF_STATUS_OFFLINE) { |
|
281 | 281 | // Back OnLine |
282 | - $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
282 | + $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
283 | 283 | $sform->addElement($offline_radio); |
284 | 284 | } |
285 | 285 | |
@@ -343,8 +343,8 @@ discard block |
||
343 | 343 | switch ($op) { |
344 | 344 | case "merge": |
345 | 345 | |
346 | - $faqid = (isset($_GET['faqid']))? $_GET['faqid'] : -1; |
|
347 | - $answerid = (isset($_GET['answerid']))? $_GET['answerid'] : -1; |
|
346 | + $faqid = (isset($_GET['faqid'])) ? $_GET['faqid'] : -1; |
|
347 | + $answerid = (isset($_GET['answerid'])) ? $_GET['answerid'] : -1; |
|
348 | 348 | if ($faqid == -1) { |
349 | 349 | $totalcategories = $category_handler->getCategoriesCount(-1); |
350 | 350 | if ($totalcategories == 0) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | xoops_cp_header(); |
357 | - include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; |
|
357 | + include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
358 | 358 | |
359 | 359 | editfaq(true, $faqid, $answerid, true); |
360 | 360 | break; |
@@ -362,8 +362,8 @@ discard block |
||
362 | 362 | case "mod": |
363 | 363 | |
364 | 364 | Global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $modify, $myts; |
365 | - $faqid = (isset($_GET['faqid']))? $_GET['faqid'] : -1; |
|
366 | - $answerid = (isset($_GET['answerid']))? $_GET['answerid'] : -1; |
|
365 | + $faqid = (isset($_GET['faqid'])) ? $_GET['faqid'] : -1; |
|
366 | + $answerid = (isset($_GET['answerid'])) ? $_GET['answerid'] : -1; |
|
367 | 367 | if ($faqid == -1) { |
368 | 368 | $totalcategories = $category_handler->getCategoriesCount(-1); |
369 | 369 | if ($totalcategories == 0) { |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | xoops_cp_header(); |
377 | 377 | |
378 | 378 | echo $indexAdmin->addNavigation('faq.php'); |
379 | - include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; |
|
379 | + include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
380 | 380 | |
381 | 381 | editfaq(true, $faqid, $answerid); |
382 | 382 | break; |
@@ -384,14 +384,14 @@ discard block |
||
384 | 384 | case "addfaq": |
385 | 385 | global $xoopsUser; |
386 | 386 | |
387 | - $faqid = (isset($_POST['faqid']))? intval($_POST['faqid']) : -1; |
|
388 | - $requester_uid = (isset($_POST['requester_uid']))? intval($_POST['requester_uid']) : 0; |
|
389 | - $answerer_uid = (isset($_POST['answerer_uid']))? intval($_POST['answerer_uid']) : 0; |
|
387 | + $faqid = (isset($_POST['faqid'])) ? intval($_POST['faqid']) : -1; |
|
388 | + $requester_uid = (isset($_POST['requester_uid'])) ? intval($_POST['requester_uid']) : 0; |
|
389 | + $answerer_uid = (isset($_POST['answerer_uid'])) ? intval($_POST['answerer_uid']) : 0; |
|
390 | 390 | |
391 | 391 | // Creating the FAQ and answer objects |
392 | 392 | if ($faqid != -1) { |
393 | 393 | $faqObj = new sfFaq($faqid); |
394 | - $answerObj =& $faqObj -> answer(); |
|
394 | + $answerObj = & $faqObj -> answer(); |
|
395 | 395 | // If the FAQ does not have an answer, then it's an answered opened question |
396 | 396 | if (!$answerObj) { |
397 | 397 | echo "error in faq.php...200412111827"; |
@@ -407,23 +407,23 @@ discard block |
||
407 | 407 | } else { |
408 | 408 | $faqObj->setGroups_read(); |
409 | 409 | } |
410 | - $faqObj->setVar('categoryid', (isset($_POST['categoryid']))? intval($_POST['categoryid']) : 0); |
|
410 | + $faqObj->setVar('categoryid', (isset($_POST['categoryid'])) ? intval($_POST['categoryid']) : 0); |
|
411 | 411 | $faqObj->setVar('question', $_POST['question']); |
412 | 412 | $faqObj->setVar('howdoi', $_POST['howdoi']); |
413 | 413 | $faqObj->setVar('diduno', $_POST['diduno']); |
414 | 414 | |
415 | - $faqObj->setVar('status', (isset($_POST['status']))? intval($_POST['status']) : _SF_STATUS_ASKED); |
|
415 | + $faqObj->setVar('status', (isset($_POST['status'])) ? intval($_POST['status']) : _SF_STATUS_ASKED); |
|
416 | 416 | |
417 | 417 | // If this SmartFAQ is offline and the user set this option to No |
418 | - $offline = (isset($_POST['offline']))? $_POST['offline'] : 1; |
|
419 | - if ( ($faqObj->status() == _SF_STATUS_OFFLINE) && ($offline == 0) ) { |
|
418 | + $offline = (isset($_POST['offline'])) ? $_POST['offline'] : 1; |
|
419 | + if (($faqObj->status() == _SF_STATUS_OFFLINE) && ($offline == 0)) { |
|
420 | 420 | $faqObj->setVar('status', _SF_STATUS_PUBLISHED); |
421 | 421 | } |
422 | - $faqObj->setVar('weight', (isset($_POST['weight']))? intval($_POST['weight']) : $faqObj->weight()); |
|
423 | - $faqObj->setVar('html', (isset($_POST['html']))? intval($_POST['html']) : 0); |
|
424 | - $faqObj->setVar('smiley', (isset($_POST['smiley']))? intval($_POST['smiley']) : 0); |
|
425 | - $faqObj->setVar('xcodes', (isset($_POST['xcodes']))? intval($_POST['xcodes']) : 0); |
|
426 | - $faqObj->setVar('cancomment', (isset($_POST['cancomment']))? intval($_POST['cancomment']) : 0); |
|
422 | + $faqObj->setVar('weight', (isset($_POST['weight'])) ? intval($_POST['weight']) : $faqObj->weight()); |
|
423 | + $faqObj->setVar('html', (isset($_POST['html'])) ? intval($_POST['html']) : 0); |
|
424 | + $faqObj->setVar('smiley', (isset($_POST['smiley'])) ? intval($_POST['smiley']) : 0); |
|
425 | + $faqObj->setVar('xcodes', (isset($_POST['xcodes'])) ? intval($_POST['xcodes']) : 0); |
|
426 | + $faqObj->setVar('cancomment', (isset($_POST['cancomment'])) ? intval($_POST['cancomment']) : 0); |
|
427 | 427 | $faqObj->setVar('modulelink', $_POST['modulelink']); |
428 | 428 | $faqObj->setVar('contextpage', $_POST['contextpage']); |
429 | 429 | $faqObj->setVar('exacturl', $_POST['exacturl']); |
@@ -506,15 +506,15 @@ discard block |
||
506 | 506 | $answerObj->setVar('uid', $answerer_uid); |
507 | 507 | |
508 | 508 | // Storing the FAQ |
509 | - if ( !$faqObj->store() ) { |
|
510 | - redirect_header("javascript:history.go(-1)", 3, $error_msg . sf_formatErrors($faqObj->getErrors())); |
|
509 | + if (!$faqObj->store()) { |
|
510 | + redirect_header("javascript:history.go(-1)", 3, $error_msg.sf_formatErrors($faqObj->getErrors())); |
|
511 | 511 | exit; |
512 | 512 | } |
513 | 513 | |
514 | 514 | // Storing the answer |
515 | 515 | $answerObj->setVar('faqid', $faqObj->faqid()); |
516 | - if ( !$answerObj->store() ) { |
|
517 | - redirect_header("javascript:history.go(-1)", 3, $error_msg . sf_formatErrors($answerObj->getErrors())); |
|
516 | + if (!$answerObj->store()) { |
|
517 | + redirect_header("javascript:history.go(-1)", 3, $error_msg.sf_formatErrors($answerObj->getErrors())); |
|
518 | 518 | exit; |
519 | 519 | } |
520 | 520 | |
@@ -534,17 +534,17 @@ discard block |
||
534 | 534 | $module_id = $xoopsModule->getVar('mid'); |
535 | 535 | $gperm_handler = &xoops_gethandler('groupperm'); |
536 | 536 | |
537 | - $faqid = (isset($_POST['faqid']))? intval($_POST['faqid']) : 0; |
|
538 | - $faqid = (isset($_GET['faqid']))? intval($_GET['faqid']) : $faqid; |
|
537 | + $faqid = (isset($_POST['faqid'])) ? intval($_POST['faqid']) : 0; |
|
538 | + $faqid = (isset($_GET['faqid'])) ? intval($_GET['faqid']) : $faqid; |
|
539 | 539 | |
540 | 540 | $faqObj = new sfFaq($faqid); |
541 | 541 | |
542 | - $confirm = (isset($_POST['confirm']))? $_POST['confirm'] : 0; |
|
543 | - $question = (isset($_POST['question']))? $_POST['question'] : ''; |
|
542 | + $confirm = (isset($_POST['confirm'])) ? $_POST['confirm'] : 0; |
|
543 | + $question = (isset($_POST['question'])) ? $_POST['question'] : ''; |
|
544 | 544 | |
545 | 545 | if ($confirm) { |
546 | - if ( !$faq_handler->delete($faqObj)) { |
|
547 | - redirect_header("faq.php", 2, _AM_SF_FAQ_DELETE_ERROR . sf_formatErrors($faqObj->getErrors())); |
|
546 | + if (!$faq_handler->delete($faqObj)) { |
|
547 | + redirect_header("faq.php", 2, _AM_SF_FAQ_DELETE_ERROR.sf_formatErrors($faqObj->getErrors())); |
|
548 | 548 | exit; |
549 | 549 | } |
550 | 550 | |
@@ -552,9 +552,9 @@ discard block |
||
552 | 552 | exit(); |
553 | 553 | } else { |
554 | 554 | // no confirm: show deletion condition |
555 | - $faqid = (isset($_GET['faqid']))? intval($_GET['faqid']) : 0; |
|
555 | + $faqid = (isset($_GET['faqid'])) ? intval($_GET['faqid']) : 0; |
|
556 | 556 | xoops_cp_header(); |
557 | - xoops_confirm(array('op' => 'del', 'faqid' => $faqObj->faqid(), 'confirm' => 1, 'name' => $faqObj->question()), 'faq.php', _AM_SF_DELETETHISARTICLE . " <br />'" . $faqObj->question() . "'. <br /> <br />", _AM_SF_DELETE); |
|
557 | + xoops_confirm(array('op' => 'del', 'faqid' => $faqObj->faqid(), 'confirm' => 1, 'name' => $faqObj->question()), 'faq.php', _AM_SF_DELETETHISARTICLE." <br />'".$faqObj->question()."'. <br /> <br />", _AM_SF_DELETE); |
|
558 | 558 | xoops_cp_footer(); |
559 | 559 | } |
560 | 560 | |
@@ -570,10 +570,10 @@ discard block |
||
570 | 570 | |
571 | 571 | //sf_adminMenu(2, _AM_SF_SMARTFAQS); |
572 | 572 | |
573 | - include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; |
|
574 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
573 | + include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
574 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
575 | 575 | |
576 | - include_once XOOPS_ROOT_PATH . "/modules/smartfaq/include/displayfaqs.php"; |
|
576 | + include_once XOOPS_ROOT_PATH."/modules/smartfaq/include/displayfaqs.php"; |
|
577 | 577 | |
578 | 578 | $totalcategories = $category_handler->getCategoriesCount(-1); |
579 | 579 | if ($totalcategories > 0) { |
@@ -583,4 +583,4 @@ discard block |
||
583 | 583 | break; |
584 | 584 | } |
585 | 585 | |
586 | -include_once __DIR__ . '/admin_footer.php'; |
|
586 | +include_once __DIR__.'/admin_footer.php'; |
@@ -19,8 +19,12 @@ |
||
19 | 19 | $answer_handler =& sf_gethandler('answer'); |
20 | 20 | |
21 | 21 | $op = ''; |
22 | -if (isset($_GET['op'])) $op = $_GET['op']; |
|
23 | -if (isset($_POST['op'])) $op = $_POST['op']; |
|
22 | +if (isset($_GET['op'])) { |
|
23 | + $op = $_GET['op']; |
|
24 | +} |
|
25 | +if (isset($_POST['op'])) { |
|
26 | + $op = $_POST['op']; |
|
27 | +} |
|
24 | 28 | |
25 | 29 | // Where shall we start? |
26 | 30 | $startfaq = isset($_GET['startfaq'])? intval($_GET['startfaq']) : 0; |