@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $this->assignVars($id); |
48 | 48 | } else { |
49 | 49 | $categoryHandler = new sfCategoryHandler($this->db); |
50 | - $category =& $categoryHandler->get($id); |
|
50 | + $category = & $categoryHandler->get($id); |
|
51 | 51 | foreach ($category->vars as $k => $v) { |
52 | 52 | $this->assignVar($k, $v['value']); |
53 | 53 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function checkPermission() |
82 | 82 | { |
83 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
83 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
84 | 84 | |
85 | 85 | $userIsAdmin = sf_userIsAdmin(); |
86 | 86 | if ($userIsAdmin) { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $filename = 'open_category.php'; |
158 | 158 | } |
159 | 159 | if ($withAllLink) { |
160 | - $ret = "<a href='" . XOOPS_URL . '/modules/smartfaq/' . $filename . '?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>'; |
|
160 | + $ret = "<a href='".XOOPS_URL.'/modules/smartfaq/'.$filename.'?categoryid='.$this->categoryid()."'>".$this->name().'</a>'; |
|
161 | 161 | } else { |
162 | 162 | $ret = $this->name(); |
163 | 163 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | exit; |
170 | 170 | } |
171 | 171 | $parentid = $parentObj->parentid(); |
172 | - $ret = $parentObj->getCategoryPath(true, $open) . ' > ' . $ret; |
|
172 | + $ret = $parentObj->getCategoryPath(true, $open).' > '.$ret; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | return $ret; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $tags = array(); |
224 | 224 | $tags['MODULE_NAME'] = $myts->htmlSpecialChars($smartModule->getVar('name')); |
225 | 225 | $tags['CATEGORY_NAME'] = $this->name(); |
226 | - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $this->categoryid(); |
|
226 | + $tags['CATEGORY_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$this->categoryid(); |
|
227 | 227 | |
228 | 228 | $notificationHandler = xoops_getHandler('notification'); |
229 | 229 | $notificationHandler->triggerEvent('global_faq', 0, 'category_created', $tags); |
@@ -239,9 +239,9 @@ discard block |
||
239 | 239 | $category['categoryid'] = $this->categoryid(); |
240 | 240 | $category['name'] = $this->name(); |
241 | 241 | if ($open != false) { |
242 | - $category['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/open_category.php?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>'; |
|
242 | + $category['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/open_category.php?categoryid='.$this->categoryid()."'>".$this->name().'</a>'; |
|
243 | 243 | } else { |
244 | - $category['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/category.php?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>'; |
|
244 | + $category['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/category.php?categoryid='.$this->categoryid()."'>".$this->name().'</a>'; |
|
245 | 245 | } |
246 | 246 | $category['total'] = $this->getVar('faqcount'); |
247 | 247 | $category['description'] = $this->description(); |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | public function &get($id) |
291 | 291 | { |
292 | 292 | $false = false; |
293 | - if ((int)$id > 0) { |
|
294 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories') . ' WHERE categoryid=' . $id; |
|
293 | + if ((int) $id > 0) { |
|
294 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories').' WHERE categoryid='.$id; |
|
295 | 295 | if (!$result = $this->db->query($sql)) { |
296 | 296 | return $false; |
297 | 297 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | } |
374 | 374 | |
375 | 375 | // Deleteing the sub categories |
376 | - $subcats =& $this->getCategories(0, 0, $category->categoryid()); |
|
376 | + $subcats = & $this->getCategories(0, 0, $category->categoryid()); |
|
377 | 377 | foreach ($subcats as $subcat) { |
378 | 378 | $this->delete($subcat); |
379 | 379 | } |
@@ -410,11 +410,11 @@ discard block |
||
410 | 410 | { |
411 | 411 | $ret = array(); |
412 | 412 | $limit = $start = 0; |
413 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories'); |
|
413 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories'); |
|
414 | 414 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
415 | - $sql .= ' ' . $criteria->renderWhere(); |
|
415 | + $sql .= ' '.$criteria->renderWhere(); |
|
416 | 416 | if ($criteria->getSort() != '') { |
417 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
417 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
418 | 418 | } |
419 | 419 | $limit = $criteria->getLimit(); |
420 | 420 | $start = $criteria->getStart(); |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | */ |
451 | 451 | public function &getCategories($limit = 0, $start = 0, $parentid = 0, $sort = 'weight', $order = 'ASC', $id_as_key = true) |
452 | 452 | { |
453 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
453 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
454 | 454 | |
455 | 455 | $criteria = new CriteriaCompo(); |
456 | 456 | |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
465 | 465 | |
466 | 466 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
467 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
467 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
468 | 468 | } |
469 | 469 | $criteria->setStart($start); |
470 | 470 | $criteria->setLimit($limit); |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | */ |
484 | 484 | public function &getCategoriesWithOpenQuestion($limit = 0, $start = 0, $parentid = 0, $sort = 'weight', $order = 'ASC') |
485 | 485 | { |
486 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
486 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
487 | 487 | |
488 | 488 | $criteria = new CriteriaCompo(); |
489 | 489 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
498 | 498 | |
499 | 499 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
500 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
500 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | $criteria->add(new Criteria('f.status', _SF_STATUS_OPENED)); |
@@ -506,11 +506,11 @@ discard block |
||
506 | 506 | |
507 | 507 | $ret = array(); |
508 | 508 | $limit = $start = 0; |
509 | - $sql = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid'; |
|
509 | + $sql = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid'; |
|
510 | 510 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
511 | - $sql .= ' ' . $criteria->renderWhere(); |
|
511 | + $sql .= ' '.$criteria->renderWhere(); |
|
512 | 512 | if ($criteria->getSort() != '') { |
513 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
513 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
514 | 514 | } |
515 | 515 | $limit = $criteria->getLimit(); |
516 | 516 | $start = $criteria->getStart(); |
@@ -539,9 +539,9 @@ discard block |
||
539 | 539 | */ |
540 | 540 | public function getCount($criteria = null) |
541 | 541 | { |
542 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_categories'); |
|
542 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_categories'); |
|
543 | 543 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
544 | - $sql .= ' ' . $criteria->renderWhere(); |
|
544 | + $sql .= ' '.$criteria->renderWhere(); |
|
545 | 545 | } |
546 | 546 | $result = $this->db->query($sql); |
547 | 547 | if (!$result) { |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
569 | 569 | |
570 | 570 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
571 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
571 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
572 | 572 | } |
573 | 573 | } |
574 | 574 | |
@@ -591,16 +591,16 @@ discard block |
||
591 | 591 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
592 | 592 | |
593 | 593 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
594 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
594 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
595 | 595 | } |
596 | 596 | } |
597 | 597 | |
598 | 598 | $criteria->add(new Criteria('f.status', _SF_STATUS_OPENED)); |
599 | 599 | |
600 | - $sql = 'SELECT COUNT(c.categoryid) FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid'; |
|
600 | + $sql = 'SELECT COUNT(c.categoryid) FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid'; |
|
601 | 601 | |
602 | 602 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
603 | - $sql .= ' ' . $criteria->renderWhere(); |
|
603 | + $sql .= ' '.$criteria->renderWhere(); |
|
604 | 604 | } |
605 | 605 | |
606 | 606 | $result = $this->db->query($sql); |
@@ -618,13 +618,13 @@ discard block |
||
618 | 618 | */ |
619 | 619 | public function getSubCats($categories) |
620 | 620 | { |
621 | - $criteria = new CriteriaCompo(new Criteria('parentid', '(' . implode(',', array_keys($categories)) . ')'), 'IN'); |
|
621 | + $criteria = new CriteriaCompo(new Criteria('parentid', '('.implode(',', array_keys($categories)).')'), 'IN'); |
|
622 | 622 | $ret = array(); |
623 | 623 | if (!sf_userIsAdmin()) { |
624 | 624 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
625 | 625 | |
626 | 626 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
627 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
627 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
628 | 628 | } |
629 | 629 | $subcats = $this->getObjects($criteria, true); |
630 | 630 | foreach ($subcats as $subcat_id => $subcat) { |
@@ -642,9 +642,9 @@ discard block |
||
642 | 642 | */ |
643 | 643 | public function deleteAll($criteria = null) |
644 | 644 | { |
645 | - $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_categories'); |
|
645 | + $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_categories'); |
|
646 | 646 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
647 | - $sql .= ' ' . $criteria->renderWhere(); |
|
647 | + $sql .= ' '.$criteria->renderWhere(); |
|
648 | 648 | } |
649 | 649 | if (!$this->db->query($sql)) { |
650 | 650 | return false; |
@@ -666,10 +666,10 @@ discard block |
||
666 | 666 | **/ |
667 | 667 | public function updateAll($fieldname, $fieldvalue, $criteria = null) |
668 | 668 | { |
669 | - $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); |
|
670 | - $sql = 'UPDATE ' . $this->db->prefix('smartfaq_categories') . ' SET ' . $set_clause; |
|
669 | + $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue); |
|
670 | + $sql = 'UPDATE '.$this->db->prefix('smartfaq_categories').' SET '.$set_clause; |
|
671 | 671 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
672 | - $sql .= ' ' . $criteria->renderWhere(); |
|
672 | + $sql .= ' '.$criteria->renderWhere(); |
|
673 | 673 | } |
674 | 674 | if (!$this->db->queryF($sql)) { |
675 | 675 | return false; |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | public function faqsCount($cat_id = 0, $status = '') |
696 | 696 | { |
697 | 697 | global $xoopsUser; |
698 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
698 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
699 | 699 | |
700 | 700 | $faqHandler = sf_gethandler('faq'); |
701 | 701 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | //about |
26 | 26 | $modversion['module_status'] = 'RC 1'; |
27 | 27 | $modversion['release_date'] = '2016/03/28'; |
28 | -$modversion['release_file'] = XOOPS_URL . '/modules/' . $modversion['dirname'] . '/docs/changelog.txt'; |
|
28 | +$modversion['release_file'] = XOOPS_URL.'/modules/'.$modversion['dirname'].'/docs/changelog.txt'; |
|
29 | 29 | $modversion['module_website_url'] = 'www.xoops.org'; |
30 | 30 | $modversion['module_website_name'] = 'XOOPS'; |
31 | 31 | $modversion['min_php'] = '5.5'; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $modversion['sub'][2]['url'] = 'request.php?op=add'; |
134 | 134 | } |
135 | 135 | |
136 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
136 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
137 | 137 | |
138 | 138 | // Creating the FAQ handler object |
139 | 139 | $faqHandler = sf_gethandler('faq'); |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -include_once __DIR__ . '/header.php'; |
|
9 | +include_once __DIR__.'/header.php'; |
|
10 | 10 | |
11 | -$faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
|
11 | +$faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0; |
|
12 | 12 | |
13 | 13 | if ($faqid == 0) { |
14 | 14 | redirect_header('javascript:history.go(-1)', 1, _MD_SF_NOFAQSELECTED); |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | $faqObj->updateCounter(); |
43 | 43 | } |
44 | 44 | $xoopsOption['template_main'] = 'smartfaq_faq.tpl'; |
45 | -include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
46 | -include_once __DIR__ . '/footer.php'; |
|
45 | +include_once(XOOPS_ROOT_PATH.'/header.php'); |
|
46 | +include_once __DIR__.'/footer.php'; |
|
47 | 47 | |
48 | 48 | $faq = $faqObj->toArray(null, $categoryObj, false); |
49 | 49 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $xoopsTpl->assign('display_categoryname', false); |
79 | 79 | |
80 | 80 | $xoopsTpl->assign('xcodes', $faqObj->getVar('xcodes')); |
81 | -$xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $faqObj->getVar('faqid')); |
|
81 | +$xoopsTpl->assign('mail_link', 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$faqObj->getVar('faqid')); |
|
82 | 82 | $xoopsTpl->assign('lang_printerpage', _MD_SF_PRINTERFRIENDLY); |
83 | 83 | $xoopsTpl->assign('lang_sendstory', _MD_SF_SENDSTORY); |
84 | 84 | $xoopsTpl->assign('faqid', $faqObj->getVar('faqid')); |
@@ -94,19 +94,19 @@ discard block |
||
94 | 94 | |
95 | 95 | // Page Title Hack by marcan |
96 | 96 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
97 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $categoryObj->name() . ' - ' . $faq['question']); |
|
97 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$categoryObj->name().' - '.$faq['question']); |
|
98 | 98 | // End Page Title Hack by marcan |
99 | 99 | |
100 | 100 | // Include the comments if the selected FAQ supports comments |
101 | 101 | if ($faqObj->cancomment() == 1) { |
102 | - include_once XOOPS_ROOT_PATH . '/include/comment_view.php'; |
|
102 | + include_once XOOPS_ROOT_PATH.'/include/comment_view.php'; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | //code to include smartie |
106 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
107 | - include_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
106 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
107 | + include_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
108 | 108 | $xoopsTpl->assign('smarttie', 1); |
109 | 109 | } |
110 | 110 | //end code for smarttie |
111 | 111 | |
112 | -include_once XOOPS_ROOT_PATH . '/footer.php'; |
|
112 | +include_once XOOPS_ROOT_PATH.'/footer.php'; |
@@ -6,15 +6,15 @@ discard block |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -include_once __DIR__ . '/header.php'; |
|
9 | +include_once __DIR__.'/header.php'; |
|
10 | 10 | |
11 | 11 | global $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
12 | 12 | |
13 | 13 | // At which record shall we start for the Categories |
14 | -$catstart = isset($_GET['catstart']) ? (int)$_GET['catstart'] : 0; |
|
14 | +$catstart = isset($_GET['catstart']) ? (int) $_GET['catstart'] : 0; |
|
15 | 15 | |
16 | 16 | // At which record shall we start for the FAQs |
17 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
17 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
18 | 18 | |
19 | 19 | // Creating the category handler object |
20 | 20 | $categoryHandler = sf_gethandler('category'); |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | |
43 | 43 | $xoopsOption['template_main'] = 'smartfaq_index.tpl'; |
44 | 44 | |
45 | -include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
46 | -include_once __DIR__ . '/footer.php'; |
|
45 | +include_once(XOOPS_ROOT_PATH.'/header.php'); |
|
46 | +include_once __DIR__.'/footer.php'; |
|
47 | 47 | |
48 | 48 | //get all categories for future reference |
49 | 49 | $allcategories = $categoryHandler->getObjects(null, true); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
66 | 66 | if (isset($last_qnaObj[$subcat_id])) { |
67 | 67 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
68 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>'); |
|
68 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>'); |
|
69 | 69 | } |
70 | 70 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
71 | 71 | $categories[$cat_id]['subcats'][$subcat_id] = $subcat->toArray(null, true); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | $memberHandler = xoops_getHandler('member'); |
104 | - $users = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
104 | + $users = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
105 | 105 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
106 | 106 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
107 | 107 | |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | } |
115 | 115 | } |
116 | 116 | // Language constants |
117 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
117 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
118 | 118 | $xoopsTpl->assign(array('lang_on' => _MD_SF_ON, 'lang_postedby' => _MD_SF_POSTEDBY, 'lang_total' => $totalQnasOnPage, 'lang_faq' => _MD_SF_FAQ, 'lang_datesub' => _MD_SF_DATESUB, 'lang_hits' => _MD_SF_HITS)); |
119 | 119 | |
120 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
120 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
121 | 121 | $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename'])); |
122 | 122 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['openquestionintromsg'], 1)); |
123 | 123 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_QUESTIONS); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION); |
126 | 126 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
127 | 127 | $xoopsTpl->assign('sectionname', $moduleName); |
128 | -$xoopsTpl->assign('whereInSection', "<a href='index.php'>" . $moduleName . '</a> > ' . _MD_SF_OPEN_SECTION); |
|
128 | +$xoopsTpl->assign('whereInSection', "<a href='index.php'>".$moduleName.'</a> > '._MD_SF_OPEN_SECTION); |
|
129 | 129 | |
130 | 130 | $xoopsTpl->assign('displayFull', false); |
131 | 131 | $xoopsTpl->assign('displaylastfaqs', $xoopsModuleConfig['displaylastfaqs']); |
@@ -141,25 +141,25 @@ discard block |
||
141 | 141 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
142 | 142 | |
143 | 143 | // Category Navigation Bar |
144 | -include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
144 | +include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
145 | 145 | $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', ''); |
146 | 146 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
147 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
147 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
148 | 148 | } else { |
149 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
149 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | // FAQ Navigation Bar |
153 | 153 | $pagenav = new XoopsPageNav($totalFaqs, $xoopsModuleConfig['indexperpage'], $start, 'start', ''); |
154 | 154 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
155 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
155 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
156 | 156 | } else { |
157 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
157 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | // Page Title Hack by marcan |
161 | 161 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
162 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category->getVar('name')); |
|
162 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category->getVar('name')); |
|
163 | 163 | // End Page Title Hack by marcan |
164 | 164 | |
165 | -include_once(XOOPS_ROOT_PATH . '/footer.php'); |
|
165 | +include_once(XOOPS_ROOT_PATH.'/footer.php'); |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -include_once __DIR__ . '/header.php'; |
|
9 | +include_once __DIR__.'/header.php'; |
|
10 | 10 | |
11 | -$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
11 | +$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
12 | 12 | |
13 | 13 | // Creating the category handler object |
14 | 14 | $categoryHandler = sf_gethandler('category'); |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | } |
33 | 33 | $xoopsOption['template_main'] = 'smartfaq_category.tpl'; |
34 | 34 | |
35 | -include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
36 | -include_once __DIR__ . '/footer.php'; |
|
35 | +include_once(XOOPS_ROOT_PATH.'/header.php'); |
|
36 | +include_once __DIR__.'/footer.php'; |
|
37 | 37 | |
38 | 38 | // At which record shall we start |
39 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
39 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
40 | 40 | |
41 | 41 | // Creating the faq handler object |
42 | 42 | $faqHandler = sf_gethandler('faq'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | // Get the last smartfaq |
71 | 71 | $last_qnaObj = $faqHandler->getLastPublishedByCat(); |
72 | 72 | } |
73 | -$lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize']; |
|
73 | +$lastfaqsize = (int) $xoopsModuleConfig['lastfaqsize']; |
|
74 | 74 | // Creating the sub-categories objects that belong to the selected category |
75 | 75 | $subcatsObj = $categoryHandler->getCategories(0, 0, $categoryid); |
76 | 76 | $total_subcats = count($subcatsObj); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
83 | 83 | if (isset($last_qnaObj[$subcat_id])) { |
84 | 84 | $subcatsObj[$i]->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
85 | - $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
85 | + $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | $subcatsObj[$i]->setVar('faqcount', $totalQnas[$subcat_id]); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $xoopsTpl->assign('subcats', $subcats); |
94 | 94 | } |
95 | 95 | $thiscategory_faqcount = isset($totalQnas[$categoryid]) ? $totalQnas[$categoryid] : 0; |
96 | -$category['total'] = $thiscategory_faqcount + $total_faqs; |
|
96 | +$category['total'] = $thiscategory_faqcount+$total_faqs; |
|
97 | 97 | |
98 | 98 | if (count($faqsObj) > 0) { |
99 | 99 | $userids = array(); |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | $memberHandler = xoops_getHandler('member'); |
112 | - $users = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
112 | + $users = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
113 | 113 | // Adding the Q&As of the selected category |
114 | 114 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
115 | 115 | $faq = $faqsObj[$i]->toArray(null, $categoryObj); |
116 | 116 | |
117 | 117 | // Creating the answer object |
118 | - $answerObj =& $allanswers[$faqsObj[$i]->faqid()]; |
|
118 | + $answerObj = & $allanswers[$faqsObj[$i]->faqid()]; |
|
119 | 119 | |
120 | 120 | $answerObj->setVar('dohtml', $faqsObj[$i]->getVar('html')); |
121 | 121 | $answerObj->setVar('doxcode', $faqsObj[$i]->getVar('xcodes')); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | if (isset($last_qnaObj) && $last_qnaObj) { |
137 | 137 | $category['last_faqid'] = $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid'); |
138 | - $category['last_question_link'] = "<a href='faq.php?faqid=" . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid') . "'>" . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize) . '</a>'; |
|
138 | + $category['last_question_link'] = "<a href='faq.php?faqid=".$last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')."'>".$last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize).'</a>'; |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 | |
@@ -160,26 +160,26 @@ discard block |
||
160 | 160 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
161 | 161 | |
162 | 162 | // The Navigation Bar |
163 | -include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
164 | -$pagenav = new XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
163 | +include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
164 | +$pagenav = new XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
165 | 165 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
166 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
166 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
167 | 167 | } else { |
168 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
168 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | $xoopsTpl->assign('category', $category); |
172 | 172 | |
173 | 173 | // Page Title Hack by marcan |
174 | 174 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
175 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
175 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
176 | 176 | // End Page Title Hack by marcan |
177 | 177 | |
178 | 178 | //code to include smartie |
179 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
180 | - include_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
179 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
180 | + include_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
181 | 181 | $xoopsTpl->assign('smarttie', 1); |
182 | 182 | } |
183 | 183 | //end code for smarttie |
184 | 184 | |
185 | -include_once(XOOPS_ROOT_PATH . '/footer.php'); |
|
185 | +include_once(XOOPS_ROOT_PATH.'/footer.php'); |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | // ------------------------------------------------------------------------- // |
38 | 38 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
39 | 39 | |
40 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php'; |
|
41 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php'; |
|
42 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhiddentoken.php'; |
|
43 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php'; |
|
44 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php'; |
|
45 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php'; |
|
40 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php'; |
|
41 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhidden.php'; |
|
42 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhiddentoken.php'; |
|
43 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formbutton.php'; |
|
44 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelementtray.php'; |
|
45 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/form.php'; |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Renders a form for setting module specific group permissions |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | { |
94 | 94 | // $this->XoopsForm($title, 'groupperm_form', XOOPS_URL.'/modules/system/admin/groupperm.php', 'post'); GIJ |
95 | 95 | parent::__construct($title, 'groupperm_form', '', 'post'); |
96 | - $this->_modid = (int)$modid; |
|
96 | + $this->_modid = (int) $modid; |
|
97 | 97 | $this->_permName = $permname; |
98 | 98 | $this->_permDesc = $permdesc; |
99 | 99 | $this->addElement(new XoopsFormHidden('modid', $this->_modid)); |
@@ -167,11 +167,11 @@ discard block |
||
167 | 167 | } |
168 | 168 | $gpermHandler = xoops_getHandler('groupperm'); |
169 | 169 | $memberHandler = xoops_getHandler('member'); |
170 | - $glist =& $memberHandler->getGroupList(); |
|
170 | + $glist = & $memberHandler->getGroupList(); |
|
171 | 171 | foreach (array_keys($glist) as $i) { |
172 | 172 | // get selected item id(s) for each group |
173 | 173 | $selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid); |
174 | - $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected); |
|
174 | + $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected); |
|
175 | 175 | $ele->setOptionTree($this->_itemTree); |
176 | 176 | |
177 | 177 | foreach ($this->_appendix as $key => $append) { |
@@ -198,18 +198,18 @@ discard block |
||
198 | 198 | $tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
199 | 199 | $this->addElement($tray); |
200 | 200 | |
201 | - $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br />'; |
|
202 | - $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
203 | - $elements =& $this->getElements(); |
|
201 | + $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br />'; |
|
202 | + $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
203 | + $elements = & $this->getElements(); |
|
204 | 204 | foreach (array_keys($elements) as $i) { |
205 | 205 | if (!is_object($elements[$i])) { |
206 | 206 | $ret .= $elements[$i]; |
207 | 207 | } elseif (!$elements[$i]->isHidden()) { |
208 | - $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption(); |
|
208 | + $ret .= "<tr valign='top' align='left'><td class='head'>".$elements[$i]->getCaption(); |
|
209 | 209 | if ($elements[$i]->getDescription() != '') { |
210 | - $ret .= '<br /><br /><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>'; |
|
210 | + $ret .= '<br /><br /><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>'; |
|
211 | 211 | } |
212 | - $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n"; |
|
212 | + $ret .= "</td>\n<td class='even'>\n".$elements[$i]->render()."\n</td></tr>\n"; |
|
213 | 213 | } else { |
214 | 214 | $ret .= $elements[$i]->render(); |
215 | 215 | } |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | */ |
296 | 296 | public function setOptionTree(&$optionTree) |
297 | 297 | { |
298 | - $this->_optionTree =& $optionTree; |
|
298 | + $this->_optionTree = & $optionTree; |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | $cols = 1; |
329 | 329 | } |
330 | 330 | $checked = $append['selected'] ? 'checked="checked"' : ''; |
331 | - $name = 'perms[' . $append['permname'] . ']'; |
|
331 | + $name = 'perms['.$append['permname'].']'; |
|
332 | 332 | $itemid = $append['itemid']; |
333 | 333 | $itemid = $append['itemid']; |
334 | 334 | $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked />{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\" /><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\" /><br /></td>"; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $tree = '<td class="odd">'; |
348 | 348 | $prefix = ''; |
349 | 349 | $this->renderOptionTree($tree, $this->_optionTree[$topitem], $prefix); |
350 | - $ret .= $tree . '</td>'; |
|
350 | + $ret .= $tree.'</td>'; |
|
351 | 351 | ++$cols; |
352 | 352 | } |
353 | 353 | $ret .= '</tr></table>'; |
@@ -366,31 +366,31 @@ discard block |
||
366 | 366 | */ |
367 | 367 | private function renderOptionTree(&$tree, $option, $prefix, $parentIds = array()) |
368 | 368 | { |
369 | - $tree .= $prefix . "<input type=\"checkbox\" name=\"" . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" id=\"" . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" onclick=\""; |
|
369 | + $tree .= $prefix."<input type=\"checkbox\" name=\"".$this->getName().'[groups]['.$this->_groupId.']['.$option['id']."]\" id=\"".$this->getName().'[groups]['.$this->_groupId.']['.$option['id']."]\" onclick=\""; |
|
370 | 370 | // If there are parent elements, add javascript that will |
371 | 371 | // make them selecteded when this element is checked to make |
372 | 372 | // sure permissions to parent items are added as well. |
373 | 373 | foreach ($parentIds as $pid) { |
374 | - $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']'; |
|
375 | - $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked != true) {ele.checked = this.checked;}"; |
|
374 | + $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']'; |
|
375 | + $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if (ele.checked != true) {ele.checked = this.checked;}"; |
|
376 | 376 | } |
377 | 377 | // If there are child elements, add javascript that will |
378 | 378 | // make them unchecked when this element is unchecked to make |
379 | 379 | // sure permissions to child items are not added when there |
380 | 380 | // is no permission to this item. |
381 | 381 | foreach ($option['allchild'] as $cid) { |
382 | - $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']'; |
|
383 | - $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked != true) {ele.checked = false;}"; |
|
382 | + $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']'; |
|
383 | + $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if (this.checked != true) {ele.checked = false;}"; |
|
384 | 384 | } |
385 | 385 | $tree .= '" value="1"'; |
386 | 386 | if (isset($this->_value) && in_array($option['id'], $this->_value)) { |
387 | 387 | $tree .= ' checked="checked"'; |
388 | 388 | } |
389 | - $tree .= ' />' . $option['name'] . "<input type=\"hidden\" name=\"" . $this->getName() . '[parents][' . $option['id'] . "]\" value=\"" . implode(':', $parentIds) . "\" /><input type=\"hidden\" name=\"" . $this->getName() . '[itemname][' . $option['id'] . "]\" value=\"" . htmlspecialchars($option['name']) . "\" /><br />\n"; |
|
389 | + $tree .= ' />'.$option['name']."<input type=\"hidden\" name=\"".$this->getName().'[parents]['.$option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\"".$this->getName().'[itemname]['.$option['id']."]\" value=\"".htmlspecialchars($option['name'])."\" /><br />\n"; |
|
390 | 390 | if (isset($option['children'])) { |
391 | 391 | foreach ($option['children'] as $child) { |
392 | 392 | array_push($parentIds, $option['id']); |
393 | - $this->renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
393 | + $this->renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
|
394 | 394 | } |
395 | 395 | } |
396 | 396 | } |
@@ -39,42 +39,42 @@ discard block |
||
39 | 39 | if (empty($fct)) { |
40 | 40 | $fct = 'preferences'; |
41 | 41 | } |
42 | -include dirname(dirname(dirname(__DIR__))) . '/mainfile.php'; |
|
43 | -include XOOPS_ROOT_PATH . '/include/cp_functions.php'; |
|
42 | +include dirname(dirname(dirname(__DIR__))).'/mainfile.php'; |
|
43 | +include XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
44 | 44 | |
45 | -include_once XOOPS_ROOT_PATH . '/kernel/module.php'; |
|
45 | +include_once XOOPS_ROOT_PATH.'/kernel/module.php'; |
|
46 | 46 | |
47 | 47 | $admintest = 0; |
48 | 48 | |
49 | 49 | if (is_object($xoopsUser)) { |
50 | 50 | $xoopsModule = XoopsModule::getByDirname('system'); |
51 | 51 | if (!$xoopsUser->isAdmin($xoopsModule->mid())) { |
52 | - redirect_header(XOOPS_URL . '/user.php', 3, _NOPERM); |
|
52 | + redirect_header(XOOPS_URL.'/user.php', 3, _NOPERM); |
|
53 | 53 | } |
54 | 54 | $admintest = 1; |
55 | 55 | } else { |
56 | - redirect_header(XOOPS_URL . '/user.php', 3, _NOPERM); |
|
56 | + redirect_header(XOOPS_URL.'/user.php', 3, _NOPERM); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // include system category definitions |
60 | -include_once XOOPS_ROOT_PATH . '/modules/system/constants.php'; |
|
60 | +include_once XOOPS_ROOT_PATH.'/modules/system/constants.php'; |
|
61 | 61 | $error = false; |
62 | 62 | if ($admintest != 0) { |
63 | 63 | if (isset($fct) && $fct != '') { |
64 | - if (file_exists(XOOPS_ROOT_PATH . '/modules/system/admin/' . $fct . '/xoops_version.php')) { |
|
65 | - include_once(XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin.php'); |
|
64 | + if (file_exists(XOOPS_ROOT_PATH.'/modules/system/admin/'.$fct.'/xoops_version.php')) { |
|
65 | + include_once(XOOPS_ROOT_PATH.'/modules/system/language/'.$xoopsConfig['language'].'/admin.php'); |
|
66 | 66 | |
67 | - if (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/' . $fct . '.php')) { |
|
68 | - include XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/' . $fct . '.php'; |
|
69 | - } elseif (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/english/admin/' . $fct . '.php')) { |
|
70 | - include XOOPS_ROOT_PATH . '/modules/system/language/english/admin/' . $fct . '.php'; |
|
67 | + if (file_exists(XOOPS_ROOT_PATH.'/modules/system/language/'.$xoopsConfig['language'].'/admin/'.$fct.'.php')) { |
|
68 | + include XOOPS_ROOT_PATH.'/modules/system/language/'.$xoopsConfig['language'].'/admin/'.$fct.'.php'; |
|
69 | + } elseif (file_exists(XOOPS_ROOT_PATH.'/modules/system/language/english/admin/'.$fct.'.php')) { |
|
70 | + include XOOPS_ROOT_PATH.'/modules/system/language/english/admin/'.$fct.'.php'; |
|
71 | 71 | } |
72 | - include XOOPS_ROOT_PATH . '/modules/system/admin/' . $fct . '/xoops_version.php'; |
|
72 | + include XOOPS_ROOT_PATH.'/modules/system/admin/'.$fct.'/xoops_version.php'; |
|
73 | 73 | $syspermHandler = xoops_getHandler('groupperm'); |
74 | - $category = !empty($modversion['category']) ? (int)$modversion['category'] : 0; |
|
74 | + $category = !empty($modversion['category']) ? (int) $modversion['category'] : 0; |
|
75 | 75 | unset($modversion); |
76 | 76 | if ($category > 0) { |
77 | - $groups =& $xoopsUser->getGroups(); |
|
77 | + $groups = & $xoopsUser->getGroups(); |
|
78 | 78 | if (in_array(XOOPS_GROUP_ADMIN, $groups) || false != $syspermHandler->checkRight('system_admin', $category, $groups, $xoopsModule->getVar('mid'))) { |
79 | 79 | if (file_exists("../include/{$fct}.inc.php")) { |
80 | 80 | include_once "../include/{$fct}.inc.php"; |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | $error = true; |
86 | 86 | } |
87 | 87 | } elseif ($fct === 'version') { |
88 | - if (file_exists(XOOPS_ROOT_PATH . '/modules/system/admin/version/main.php')) { |
|
89 | - include_once XOOPS_ROOT_PATH . '/modules/system/admin/version/main.php'; |
|
88 | + if (file_exists(XOOPS_ROOT_PATH.'/modules/system/admin/version/main.php')) { |
|
89 | + include_once XOOPS_ROOT_PATH.'/modules/system/admin/version/main.php'; |
|
90 | 90 | } else { |
91 | 91 | $error = true; |
92 | 92 | } |
@@ -110,22 +110,22 @@ discard block |
||
110 | 110 | $all_ok = false; |
111 | 111 | if (!in_array(XOOPS_GROUP_ADMIN, $groups)) { |
112 | 112 | $syspermHandler = xoops_getHandler('groupperm'); |
113 | - $ok_syscats =& $syspermHandler->getItemIds('system_admin', $groups); |
|
113 | + $ok_syscats = & $syspermHandler->getItemIds('system_admin', $groups); |
|
114 | 114 | } else { |
115 | 115 | $all_ok = true; |
116 | 116 | } |
117 | - $admin_dir = XOOPS_ROOT_PATH . '/modules/system/admin'; |
|
117 | + $admin_dir = XOOPS_ROOT_PATH.'/modules/system/admin'; |
|
118 | 118 | $handle = opendir($admin_dir); |
119 | 119 | $counter = 0; |
120 | 120 | $class = 'even'; |
121 | 121 | while ($file = readdir($handle)) { |
122 | - if (strtolower($file) !== 'cvs' && !preg_match('/[.]/', $file) && is_dir($admin_dir . '/' . $file)) { |
|
123 | - include $admin_dir . '/' . $file . '/xoops_version.php'; |
|
122 | + if (strtolower($file) !== 'cvs' && !preg_match('/[.]/', $file) && is_dir($admin_dir.'/'.$file)) { |
|
123 | + include $admin_dir.'/'.$file.'/xoops_version.php'; |
|
124 | 124 | if ($modversion['hasAdmin']) { |
125 | - $category = isset($modversion['category']) ? (int)$modversion['category'] : 0; |
|
125 | + $category = isset($modversion['category']) ? (int) $modversion['category'] : 0; |
|
126 | 126 | if (false != $all_ok || in_array($modversion['category'], $ok_syscats)) { |
127 | 127 | echo "<td class='$class' align='center' valign='bottom' width='19%'>"; |
128 | - echo "<a href='" . XOOPS_URL . '/modules/system/admin.php?fct=' . $file . "'><b>" . trim($modversion['name']) . "</b></a>\n"; |
|
128 | + echo "<a href='".XOOPS_URL.'/modules/system/admin.php?fct='.$file."'><b>".trim($modversion['name'])."</b></a>\n"; |
|
129 | 129 | echo '</td>'; |
130 | 130 | ++$counter; |
131 | 131 | $class = ($class === 'even') ? 'odd' : 'even'; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | } |
142 | 142 | while ($counter < 5) { |
143 | - echo '<td class="' . $class . '"> </td>'; |
|
143 | + echo '<td class="'.$class.'"> </td>'; |
|
144 | 144 | $class = ($class === 'even') ? 'odd' : 'even'; |
145 | 145 | ++$counter; |
146 | 146 | } |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | * Licence: GNU |
7 | 7 | */ |
8 | 8 | |
9 | -include_once __DIR__ . '/admin_header.php'; |
|
10 | -include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php'; |
|
9 | +include_once __DIR__.'/admin_header.php'; |
|
10 | +include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php'; |
|
11 | 11 | |
12 | 12 | if (!sf_userIsAdmin()) { |
13 | 13 | redirect_header('javascript:history.go(-1)', 1, _NOPERM); |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | // echo "<h3 style='color: #2F5376; '>"._AM_SF_PERMISSIONSADMIN."</h3>\n" ; |
38 | 38 | sf_collapsableBar('toptable', 'toptableicon'); |
39 | 39 | |
40 | - $result_view = $xoopsDB->query('SELECT categoryid, name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' '); |
|
40 | + $result_view = $xoopsDB->query('SELECT categoryid, name FROM '.$xoopsDB->prefix('smartfaq_categories').' '); |
|
41 | 41 | if ($xoopsDB->getRowsNum($result_view)) { |
42 | 42 | while ($myrow_view = $xoopsDB->fetcharray($result_view)) { |
43 | 43 | $item_list_view['cid'] = $myrow_view['categoryid']; |
44 | 44 | $item_list_view['title'] = $myrow_view['name']; |
45 | - $form_view = new XoopsGroupPermForm('', $xoopsModule->getVar('mid'), 'category_read', "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_PERMISSIONSVIEWMAN . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _AM_SF_VIEW_CATS . '</span>', 'admin/permissions.php'); |
|
45 | + $form_view = new XoopsGroupPermForm('', $xoopsModule->getVar('mid'), 'category_read', "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_PERMISSIONSVIEWMAN."</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">"._AM_SF_VIEW_CATS.'</span>', 'admin/permissions.php'); |
|
46 | 46 | $block_view[] = $item_list_view; |
47 | 47 | foreach ($block_view as $itemlists) { |
48 | 48 | $form_view->addItem($itemlists['cid'], $myts->displayTarea($itemlists['title'])); |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | } |
51 | 51 | echo $form_view->render(); |
52 | 52 | } else { |
53 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_PERMISSIONSVIEWMAN . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _AM_SF_NOPERMSSET . '</span>'; |
|
53 | + echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_PERMISSIONSVIEWMAN."</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">"._AM_SF_NOPERMSSET.'</span>'; |
|
54 | 54 | } |
55 | 55 | echo '</div>'; |
56 | 56 | |
57 | 57 | echo "<br />\n"; |
58 | 58 | } |
59 | 59 | |
60 | -include_once __DIR__ . '/admin_footer.php'; |
|
60 | +include_once __DIR__.'/admin_footer.php'; |
@@ -18,20 +18,20 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | $path = dirname(dirname(dirname(__DIR__))); |
21 | -include_once $path . '/mainfile.php'; |
|
22 | -include_once $path . '/include/cp_functions.php'; |
|
23 | -require_once $path . '/include/cp_header.php'; |
|
21 | +include_once $path.'/mainfile.php'; |
|
22 | +include_once $path.'/include/cp_functions.php'; |
|
23 | +require_once $path.'/include/cp_header.php'; |
|
24 | 24 | |
25 | -include_once $path . '/kernel/module.php'; |
|
26 | -include_once $path . '/class/xoopstree.php'; |
|
27 | -include_once $path . '/class/xoopslists.php'; |
|
28 | -include_once $path . '/class/pagenav.php'; |
|
29 | -include_once $path . '/class/xoopsformloader.php'; |
|
25 | +include_once $path.'/kernel/module.php'; |
|
26 | +include_once $path.'/class/xoopstree.php'; |
|
27 | +include_once $path.'/class/xoopslists.php'; |
|
28 | +include_once $path.'/class/pagenav.php'; |
|
29 | +include_once $path.'/class/xoopsformloader.php'; |
|
30 | 30 | |
31 | -include_once $path . '/modules/smartfaq/include/functions.php'; |
|
32 | -include_once $path . '/modules/smartfaq/class/category.php'; |
|
33 | -include_once $path . '/modules/smartfaq/class/faq.php'; |
|
34 | -include_once $path . '/modules/smartfaq/class/answer.php'; |
|
31 | +include_once $path.'/modules/smartfaq/include/functions.php'; |
|
32 | +include_once $path.'/modules/smartfaq/class/category.php'; |
|
33 | +include_once $path.'/modules/smartfaq/class/faq.php'; |
|
34 | +include_once $path.'/modules/smartfaq/class/answer.php'; |
|
35 | 35 | |
36 | 36 | $myts = MyTextSanitizer::getInstance(); |
37 | 37 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | xoops_loadLanguage('modinfo', $moduleDirName); |
48 | 48 | xoops_loadLanguage('main', $moduleDirName); |
49 | 49 | |
50 | -$pathIcon16 = '../' . $xoopsModule->getInfo('icons16'); |
|
51 | -$pathIcon32 = '../' . $xoopsModule->getInfo('icons32'); |
|
52 | -$pathModuleAdmin =& $xoopsModule->getInfo('dirmoduleadmin'); |
|
50 | +$pathIcon16 = '../'.$xoopsModule->getInfo('icons16'); |
|
51 | +$pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); |
|
52 | +$pathModuleAdmin = & $xoopsModule->getInfo('dirmoduleadmin'); |
|
53 | 53 | |
54 | -include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php'); |
|
54 | +include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); |