@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * @param bool $showmenu |
|
| 32 | + * @param string $showmenu |
|
| 33 | 33 | * @param int $faqid |
| 34 | 34 | * @param int $answerid |
| 35 | 35 | * @param bool $merge |
@@ -549,11 +549,11 @@ |
||
| 549 | 549 | $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
| 550 | 550 | xoops_cp_header(); |
| 551 | 551 | xoops_confirm(array( |
| 552 | - 'op' => 'del', |
|
| 553 | - 'faqid' => $faqObj->faqid(), |
|
| 554 | - 'confirm' => 1, |
|
| 555 | - 'name' => $faqObj->question() |
|
| 556 | - ), 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 552 | + 'op' => 'del', |
|
| 553 | + 'faqid' => $faqObj->faqid(), |
|
| 554 | + 'confirm' => 1, |
|
| 555 | + 'name' => $faqObj->question() |
|
| 556 | + ), 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 557 | 557 | xoops_cp_footer(); |
| 558 | 558 | } |
| 559 | 559 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -require_once __DIR__ . '/admin_header.php'; |
|
| 9 | +require_once __DIR__.'/admin_header.php'; |
|
| 10 | 10 | |
| 11 | 11 | // Creating the faq handler object |
| 12 | 12 | $faqHandler = sf_gethandler('faq'); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | // Where shall we start? |
| 29 | -$startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
|
| 29 | +$startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @param bool $showmenu |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | global $answerHandler, $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts; |
| 40 | 40 | |
| 41 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 41 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 42 | 42 | // If there is a parameter, and the id exists, retrieve data: we're editing a faq |
| 43 | 43 | if ($faqid != -1) { |
| 44 | 44 | // Creating the FAQ object |
@@ -140,9 +140,9 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | echo "<br>\n"; |
| 142 | 142 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
| 143 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . $collapsableBar_title . '</h3>'; |
|
| 143 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> ".$collapsableBar_title.'</h3>'; |
|
| 144 | 144 | echo "<div id='bottomtable'>"; |
| 145 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>'; |
|
| 145 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>'; |
|
| 146 | 146 | } else { |
| 147 | 147 | // there's no parameter, so we're adding a faq |
| 148 | 148 | $faqObj = $faqHandler->create(); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $button_caption = _AM_SF_CREATE; |
| 157 | 157 | |
| 158 | 158 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
| 159 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_CREATESMARTFAQ . '</h3>'; |
|
| 159 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_CREATESMARTFAQ.'</h3>'; |
|
| 160 | 160 | echo "<div id='bottomtable'>"; |
| 161 | 161 | } |
| 162 | 162 | $sform = new XoopsThemeForm(_AM_SF_SMARTFAQ, 'op', xoops_getenv('PHP_SELF')); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | // ANSWER |
| 189 | 189 | if ($merge) { |
| 190 | - $theanswer = $originalAnswerObj->answer('e') . "\n\n" . sprintf(_AM_SF_NEW_CONTRIBUTION, sf_getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), |
|
| 190 | + $theanswer = $originalAnswerObj->answer('e')."\n\n".sprintf(_AM_SF_NEW_CONTRIBUTION, sf_getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), |
|
| 191 | 191 | $answerObj->answer('e')); |
| 192 | 192 | } else { |
| 193 | 193 | $theanswer = $answerObj->answer('e'); |
@@ -237,14 +237,14 @@ discard block |
||
| 237 | 237 | $sform->addElement(new XoopsFormText(_AM_SF_SPECIFIC_URL, 'contextpage', 50, 60, $faqObj->contextpage()), false); |
| 238 | 238 | |
| 239 | 239 | // EXACT URL? |
| 240 | - $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 240 | + $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 241 | 241 | $sform->addElement($excaturl_radio); |
| 242 | 242 | // WEIGHT |
| 243 | 243 | $sform->addElement(new XoopsFormText(_AM_SF_WEIGHT, 'weight', 5, 5, $faqObj->weight()), true); |
| 244 | 244 | |
| 245 | 245 | // COMMENTS |
| 246 | 246 | // Code to allow comments |
| 247 | - $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 247 | + $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 248 | 248 | $sform->addElement($addcomments_radio); |
| 249 | 249 | |
| 250 | 250 | // PER ITEM PERMISSIONS |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | $sform->addElement($groups_checkbox); |
| 260 | 260 | |
| 261 | - $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 261 | + $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 262 | 262 | $sform->addElement($partial_view); |
| 263 | 263 | |
| 264 | 264 | // VARIOUS OPTIONS |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | // OFFLINE |
| 282 | 282 | if ($faqObj->status() == _SF_STATUS_OFFLINE) { |
| 283 | 283 | // Back OnLine |
| 284 | - $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 284 | + $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 285 | 285 | $sform->addElement($offline_radio); |
| 286 | 286 | } |
| 287 | 287 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | xoops_cp_header(); |
| 358 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 358 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 359 | 359 | |
| 360 | 360 | editfaq(true, $faqid, $answerid, true); |
| 361 | 361 | break; |
@@ -372,11 +372,11 @@ discard block |
||
| 372 | 372 | } |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 375 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 376 | 376 | xoops_cp_header(); |
| 377 | 377 | |
| 378 | 378 | $adminObject->displayNavigation(basename(__FILE__)); |
| 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,9 +384,9 @@ discard block |
||
| 384 | 384 | case 'addfaq': |
| 385 | 385 | global $xoopsUser; |
| 386 | 386 | |
| 387 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : -1; |
|
| 388 | - $requester_uid = isset($_POST['requester_uid']) ? (int)$_POST['requester_uid'] : 0; |
|
| 389 | - $answerer_uid = isset($_POST['answerer_uid']) ? (int)$_POST['answerer_uid'] : 0; |
|
| 387 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : -1; |
|
| 388 | + $requester_uid = isset($_POST['requester_uid']) ? (int) $_POST['requester_uid'] : 0; |
|
| 389 | + $answerer_uid = isset($_POST['answerer_uid']) ? (int) $_POST['answerer_uid'] : 0; |
|
| 390 | 390 | |
| 391 | 391 | // Creating the FAQ and answer objects |
| 392 | 392 | if ($faqid != -1) { |
@@ -407,23 +407,23 @@ discard block |
||
| 407 | 407 | } else { |
| 408 | 408 | $faqObj->setGroups_read(); |
| 409 | 409 | } |
| 410 | - $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0); |
|
| 410 | + $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int) $_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']) ? (int)$_POST['status'] : _SF_STATUS_ASKED); |
|
| 415 | + $faqObj->setVar('status', isset($_POST['status']) ? (int) $_POST['status'] : _SF_STATUS_ASKED); |
|
| 416 | 416 | |
| 417 | 417 | // If this SmartFAQ is offline and the user set this option to No |
| 418 | 418 | $offline = isset($_POST['offline']) ? $_POST['offline'] : 1; |
| 419 | 419 | if ((0 == $offline) && ($faqObj->status() == _SF_STATUS_OFFLINE)) { |
| 420 | 420 | $faqObj->setVar('status', _SF_STATUS_PUBLISHED); |
| 421 | 421 | } |
| 422 | - $faqObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : $faqObj->weight()); |
|
| 423 | - $faqObj->setVar('html', isset($_POST['html']) ? (int)$_POST['html'] : 0); |
|
| 424 | - $faqObj->setVar('smiley', isset($_POST['smiley']) ? (int)$_POST['smiley'] : 0); |
|
| 425 | - $faqObj->setVar('xcodes', isset($_POST['xcodes']) ? (int)$_POST['xcodes'] : 0); |
|
| 426 | - $faqObj->setVar('cancomment', isset($_POST['cancomment']) ? (int)$_POST['cancomment'] : 0); |
|
| 422 | + $faqObj->setVar('weight', isset($_POST['weight']) ? (int) $_POST['weight'] : $faqObj->weight()); |
|
| 423 | + $faqObj->setVar('html', isset($_POST['html']) ? (int) $_POST['html'] : 0); |
|
| 424 | + $faqObj->setVar('smiley', isset($_POST['smiley']) ? (int) $_POST['smiley'] : 0); |
|
| 425 | + $faqObj->setVar('xcodes', isset($_POST['xcodes']) ? (int) $_POST['xcodes'] : 0); |
|
| 426 | + $faqObj->setVar('cancomment', isset($_POST['cancomment']) ? (int) $_POST['cancomment'] : 0); |
|
| 427 | 427 | $faqObj->setVar('modulelink', $_POST['modulelink']); |
| 428 | 428 | $faqObj->setVar('contextpage', $_POST['contextpage']); |
| 429 | 429 | $faqObj->setVar('exacturl', $_POST['exacturl']); |
@@ -507,13 +507,13 @@ discard block |
||
| 507 | 507 | |
| 508 | 508 | // Storing the FAQ |
| 509 | 509 | if (!$faqObj->store()) { |
| 510 | - redirect_header('javascript:history.go(-1)', 3, $error_msg . sf_formatErrors($faqObj->getErrors())); |
|
| 510 | + redirect_header('javascript:history.go(-1)', 3, $error_msg.sf_formatErrors($faqObj->getErrors())); |
|
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | // Storing the answer |
| 514 | 514 | $answerObj->setVar('faqid', $faqObj->faqid()); |
| 515 | 515 | if (!$answerObj->store()) { |
| 516 | - redirect_header('javascript:history.go(-1)', 3, $error_msg . sf_formatErrors($answerObj->getErrors())); |
|
| 516 | + redirect_header('javascript:history.go(-1)', 3, $error_msg.sf_formatErrors($answerObj->getErrors())); |
|
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | // Send notifications |
@@ -530,8 +530,8 @@ discard block |
||
| 530 | 530 | $module_id = $xoopsModule->getVar('mid'); |
| 531 | 531 | $gpermHandler = xoops_getHandler('groupperm'); |
| 532 | 532 | |
| 533 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0; |
|
| 534 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : $faqid; |
|
| 533 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : 0; |
|
| 534 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : $faqid; |
|
| 535 | 535 | |
| 536 | 536 | $faqObj = new sfFaq($faqid); |
| 537 | 537 | |
@@ -540,20 +540,20 @@ discard block |
||
| 540 | 540 | |
| 541 | 541 | if ($confirm) { |
| 542 | 542 | if (!$faqHandler->delete($faqObj)) { |
| 543 | - redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR . sf_formatErrors($faqObj->getErrors())); |
|
| 543 | + redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR.sf_formatErrors($faqObj->getErrors())); |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | redirect_header('faq.php', 2, sprintf(_AM_SF_ARTISDELETED, $faqObj->question())); |
| 547 | 547 | } else { |
| 548 | 548 | // no confirm: show deletion condition |
| 549 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
|
| 549 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0; |
|
| 550 | 550 | xoops_cp_header(); |
| 551 | 551 | xoops_confirm(array( |
| 552 | 552 | 'op' => 'del', |
| 553 | 553 | 'faqid' => $faqObj->faqid(), |
| 554 | 554 | 'confirm' => 1, |
| 555 | 555 | 'name' => $faqObj->question() |
| 556 | - ), 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 556 | + ), 'faq.php', _AM_SF_DELETETHISARTICLE." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE); |
|
| 557 | 557 | xoops_cp_footer(); |
| 558 | 558 | } |
| 559 | 559 | |
@@ -562,15 +562,15 @@ discard block |
||
| 562 | 562 | |
| 563 | 563 | case 'default': |
| 564 | 564 | default: |
| 565 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 565 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 566 | 566 | xoops_cp_header(); |
| 567 | 567 | |
| 568 | 568 | $adminObject->displayNavigation(basename(__FILE__)); |
| 569 | 569 | |
| 570 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 571 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 570 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 571 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 572 | 572 | |
| 573 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php'; |
|
| 573 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php'; |
|
| 574 | 574 | |
| 575 | 575 | $totalcategories = $categoryHandler->getCategoriesCount(-1); |
| 576 | 576 | if ($totalcategories > 0) { |
@@ -580,4 +580,4 @@ discard block |
||
| 580 | 580 | break; |
| 581 | 581 | } |
| 582 | 582 | |
| 583 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 583 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -120,9 +120,9 @@ discard block |
||
| 120 | 120 | * Add appendix |
| 121 | 121 | * |
| 122 | 122 | * @access public |
| 123 | - * @param $permName |
|
| 123 | + * @param string $permName |
|
| 124 | 124 | * @param $itemId |
| 125 | - * @param $itemName |
|
| 125 | + * @param string $itemName |
|
| 126 | 126 | */ |
| 127 | 127 | public function addAppendix($permName, $itemId, $itemName) |
| 128 | 128 | { |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | /** |
| 257 | 257 | * Constructor |
| 258 | 258 | * @param $caption |
| 259 | - * @param $name |
|
| 259 | + * @param string $name |
|
| 260 | 260 | * @param $groupId |
| 261 | 261 | * @param null $values |
| 262 | 262 | */ |
@@ -192,16 +192,16 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br>'; |
| 194 | 194 | $ret .= "<form name='" |
| 195 | - . $this->getName() |
|
| 196 | - . "' id='" |
|
| 197 | - . $this->getName() |
|
| 198 | - . "' action='" |
|
| 199 | - . $this->getAction() |
|
| 200 | - . "' method='" |
|
| 201 | - . $this->getMethod() |
|
| 202 | - . "'" |
|
| 203 | - . $this->getExtra() |
|
| 204 | - . ">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
| 195 | + . $this->getName() |
|
| 196 | + . "' id='" |
|
| 197 | + . $this->getName() |
|
| 198 | + . "' action='" |
|
| 199 | + . $this->getAction() |
|
| 200 | + . "' method='" |
|
| 201 | + . $this->getMethod() |
|
| 202 | + . "'" |
|
| 203 | + . $this->getExtra() |
|
| 204 | + . ">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
| 205 | 205 | $elements =& $this->getElements(); |
| 206 | 206 | foreach (array_keys($elements) as $i) { |
| 207 | 207 | if (!is_object($elements[$i])) { |
@@ -369,19 +369,19 @@ discard block |
||
| 369 | 369 | private function renderOptionTree(&$tree, $option, $prefix, $parentIds = array()) |
| 370 | 370 | { |
| 371 | 371 | $tree .= $prefix |
| 372 | - . '<input type="checkbox" name="' |
|
| 373 | - . $this->getName() |
|
| 374 | - . '[groups][' |
|
| 375 | - . $this->_groupId |
|
| 376 | - . '][' |
|
| 377 | - . $option['id'] |
|
| 378 | - . ']" id="' |
|
| 379 | - . $this->getName() |
|
| 380 | - . '[groups][' |
|
| 381 | - . $this->_groupId |
|
| 382 | - . '][' |
|
| 383 | - . $option['id'] |
|
| 384 | - . ']" onclick="'; |
|
| 372 | + . '<input type="checkbox" name="' |
|
| 373 | + . $this->getName() |
|
| 374 | + . '[groups][' |
|
| 375 | + . $this->_groupId |
|
| 376 | + . '][' |
|
| 377 | + . $option['id'] |
|
| 378 | + . ']" id="' |
|
| 379 | + . $this->getName() |
|
| 380 | + . '[groups][' |
|
| 381 | + . $this->_groupId |
|
| 382 | + . '][' |
|
| 383 | + . $option['id'] |
|
| 384 | + . ']" onclick="'; |
|
| 385 | 385 | // If there are parent elements, add javascript that will |
| 386 | 386 | // make them selecteded when this element is checked to make |
| 387 | 387 | // sure permissions to parent items are added as well. |
@@ -402,20 +402,20 @@ discard block |
||
| 402 | 402 | $tree .= ' checked'; |
| 403 | 403 | } |
| 404 | 404 | $tree .= ' />' |
| 405 | - . $option['name'] |
|
| 406 | - . '<input type="hidden" name="' |
|
| 407 | - . $this->getName() |
|
| 408 | - . '[parents][' |
|
| 409 | - . $option['id'] |
|
| 410 | - . ']" value="' |
|
| 411 | - . implode(':', $parentIds) |
|
| 412 | - . '" /><input type="hidden" name="' |
|
| 413 | - . $this->getName() |
|
| 414 | - . '[itemname][' |
|
| 415 | - . $option['id'] |
|
| 416 | - . ']" value="' |
|
| 417 | - . htmlspecialchars($option['name']) |
|
| 418 | - . "\" /><br>\n"; |
|
| 405 | + . $option['name'] |
|
| 406 | + . '<input type="hidden" name="' |
|
| 407 | + . $this->getName() |
|
| 408 | + . '[parents][' |
|
| 409 | + . $option['id'] |
|
| 410 | + . ']" value="' |
|
| 411 | + . implode(':', $parentIds) |
|
| 412 | + . '" /><input type="hidden" name="' |
|
| 413 | + . $this->getName() |
|
| 414 | + . '[itemname][' |
|
| 415 | + . $option['id'] |
|
| 416 | + . ']" value="' |
|
| 417 | + . htmlspecialchars($option['name']) |
|
| 418 | + . "\" /><br>\n"; |
|
| 419 | 419 | if (isset($option['children'])) { |
| 420 | 420 | foreach ($option['children'] as $child) { |
| 421 | 421 | array_push($parentIds, $option['id']); |
@@ -24,12 +24,12 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 26 | 26 | |
| 27 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php'; |
|
| 28 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php'; |
|
| 29 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhiddentoken.php'; |
|
| 30 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php'; |
|
| 31 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php'; |
|
| 32 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php'; |
|
| 27 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php'; |
|
| 28 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhidden.php'; |
|
| 29 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhiddentoken.php'; |
|
| 30 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formbutton.php'; |
|
| 31 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelementtray.php'; |
|
| 32 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/form.php'; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Renders a form for setting module specific group permissions |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | // $this->XoopsForm($title, 'groupperm_form', XOOPS_URL.'/modules/system/admin/groupperm.php', 'post'); GIJ |
| 82 | 82 | parent::__construct($title, 'groupperm_form', '', 'post'); |
| 83 | - $this->_modid = (int)$modid; |
|
| 83 | + $this->_modid = (int) $modid; |
|
| 84 | 84 | $this->_permName = $permname; |
| 85 | 85 | $this->_permDesc = $permdesc; |
| 86 | 86 | $this->addElement(new XoopsFormHidden('modid', $this->_modid)); |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | $gpermHandler = xoops_getHandler('groupperm'); |
| 161 | 161 | $memberHandler = xoops_getHandler('member'); |
| 162 | - $glist =& $memberHandler->getGroupList(); |
|
| 162 | + $glist = & $memberHandler->getGroupList(); |
|
| 163 | 163 | foreach (array_keys($glist) as $i) { |
| 164 | 164 | // get selected item id(s) for each group |
| 165 | 165 | $selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid); |
| 166 | - $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected); |
|
| 166 | + $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected); |
|
| 167 | 167 | $ele->setOptionTree($this->_itemTree); |
| 168 | 168 | |
| 169 | 169 | foreach ($this->_appendix as $key => $append) { |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | $tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
| 191 | 191 | $this->addElement($tray); |
| 192 | 192 | |
| 193 | - $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br>'; |
|
| 194 | - $ret .= "<form name='" |
|
| 193 | + $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br>'; |
|
| 194 | + $ret .= "<form name='" |
|
| 195 | 195 | . $this->getName() |
| 196 | 196 | . "' id='" |
| 197 | 197 | . $this->getName() |
@@ -202,16 +202,16 @@ discard block |
||
| 202 | 202 | . "'" |
| 203 | 203 | . $this->getExtra() |
| 204 | 204 | . ">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
| 205 | - $elements =& $this->getElements(); |
|
| 205 | + $elements = & $this->getElements(); |
|
| 206 | 206 | foreach (array_keys($elements) as $i) { |
| 207 | 207 | if (!is_object($elements[$i])) { |
| 208 | 208 | $ret .= $elements[$i]; |
| 209 | 209 | } elseif (!$elements[$i]->isHidden()) { |
| 210 | - $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption(); |
|
| 210 | + $ret .= "<tr valign='top' align='left'><td class='head'>".$elements[$i]->getCaption(); |
|
| 211 | 211 | if ($elements[$i]->getDescription() != '') { |
| 212 | - $ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>'; |
|
| 212 | + $ret .= '<br><br><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>'; |
|
| 213 | 213 | } |
| 214 | - $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n"; |
|
| 214 | + $ret .= "</td>\n<td class='even'>\n".$elements[$i]->render()."\n</td></tr>\n"; |
|
| 215 | 215 | } else { |
| 216 | 216 | $ret .= $elements[$i]->render(); |
| 217 | 217 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | */ |
| 298 | 298 | public function setOptionTree(&$optionTree) |
| 299 | 299 | { |
| 300 | - $this->_optionTree =& $optionTree; |
|
| 300 | + $this->_optionTree = & $optionTree; |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -322,34 +322,34 @@ discard block |
||
| 322 | 322 | $ret = ''; |
| 323 | 323 | |
| 324 | 324 | if (count($this->_appendix) > 0) { |
| 325 | - $ret .= '<table class="outer"><tr>'; |
|
| 325 | + $ret .= '<table class="outer"><tr>'; |
|
| 326 | 326 | $cols = 1; |
| 327 | 327 | foreach ($this->_appendix as $append) { |
| 328 | 328 | if ($cols > 4) { |
| 329 | - $ret .= '</tr><tr>'; |
|
| 329 | + $ret .= '</tr><tr>'; |
|
| 330 | 330 | $cols = 1; |
| 331 | 331 | } |
| 332 | 332 | $checked = $append['selected'] ? 'checked' : ''; |
| 333 | - $name = 'perms[' . $append['permname'] . ']'; |
|
| 333 | + $name = 'perms['.$append['permname'].']'; |
|
| 334 | 334 | $itemid = $append['itemid']; |
| 335 | 335 | $itemid = $append['itemid']; |
| 336 | - $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>"; |
|
| 336 | + $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>"; |
|
| 337 | 337 | ++$cols; |
| 338 | 338 | } |
| 339 | 339 | $ret .= '</tr></table>'; |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - $ret .= '<table class="outer"><tr>'; |
|
| 342 | + $ret .= '<table class="outer"><tr>'; |
|
| 343 | 343 | $cols = 1; |
| 344 | 344 | foreach ($this->_optionTree[0]['children'] as $topitem) { |
| 345 | 345 | if ($cols > 4) { |
| 346 | - $ret .= '</tr><tr>'; |
|
| 346 | + $ret .= '</tr><tr>'; |
|
| 347 | 347 | $cols = 1; |
| 348 | 348 | } |
| 349 | 349 | $tree = '<td class="odd">'; |
| 350 | 350 | $prefix = ''; |
| 351 | 351 | $this->renderOptionTree($tree, $this->_optionTree[$topitem], $prefix); |
| 352 | - $ret .= $tree . '</td>'; |
|
| 352 | + $ret .= $tree.'</td>'; |
|
| 353 | 353 | ++$cols; |
| 354 | 354 | } |
| 355 | 355 | $ret .= '</tr></table>'; |
@@ -386,16 +386,16 @@ discard block |
||
| 386 | 386 | // make them selecteded when this element is checked to make |
| 387 | 387 | // sure permissions to parent items are added as well. |
| 388 | 388 | foreach ($parentIds as $pid) { |
| 389 | - $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']'; |
|
| 390 | - $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}"; |
|
| 389 | + $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']'; |
|
| 390 | + $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if (ele.checked !== true) {ele.checked = this.checked;}"; |
|
| 391 | 391 | } |
| 392 | 392 | // If there are child elements, add javascript that will |
| 393 | 393 | // make them unchecked when this element is unchecked to make |
| 394 | 394 | // sure permissions to child items are not added when there |
| 395 | 395 | // is no permission to this item. |
| 396 | 396 | foreach ($option['allchild'] as $cid) { |
| 397 | - $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']'; |
|
| 398 | - $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}"; |
|
| 397 | + $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']'; |
|
| 398 | + $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if (this.checked !== true) {ele.checked = false;}"; |
|
| 399 | 399 | } |
| 400 | 400 | $tree .= '" value="1"'; |
| 401 | 401 | if (isset($this->_value) && in_array($option['id'], $this->_value)) { |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | if (isset($option['children'])) { |
| 420 | 420 | foreach ($option['children'] as $child) { |
| 421 | 421 | array_push($parentIds, $option['id']); |
| 422 | - $this->renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
| 422 | + $this->renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
|
| 423 | 423 | } |
| 424 | 424 | } |
| 425 | 425 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * @param bool $showmenu |
|
| 29 | + * @param string $showmenu |
|
| 30 | 30 | * @param int $faqid |
| 31 | 31 | */ |
| 32 | 32 | function editfaq($showmenu = false, $faqid = -1) |
@@ -284,11 +284,11 @@ discard block |
||
| 284 | 284 | $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
| 285 | 285 | xoops_cp_header(); |
| 286 | 286 | xoops_confirm(array( |
| 287 | - 'op' => 'del', |
|
| 288 | - 'faqid' => $faqObj->faqid(), |
|
| 289 | - 'confirm' => 1, |
|
| 290 | - 'name' => $faqObj->question() |
|
| 291 | - ), 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 287 | + 'op' => 'del', |
|
| 288 | + 'faqid' => $faqObj->faqid(), |
|
| 289 | + 'confirm' => 1, |
|
| 290 | + 'name' => $faqObj->question() |
|
| 291 | + ), 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 292 | 292 | xoops_cp_footer(); |
| 293 | 293 | } |
| 294 | 294 | |
@@ -338,25 +338,25 @@ discard block |
||
| 338 | 338 | $categoryObj = $allCats[$faqsObj[$i]->categoryid()]; |
| 339 | 339 | |
| 340 | 340 | $modify = "<a href='question.php?op=mod&faqid=" |
| 341 | - . $faqsObj[$i]->faqid() |
|
| 342 | - . "'><img src='" |
|
| 343 | - . $pathIcon16 |
|
| 344 | - . '/edit.png' |
|
| 345 | - . "' title='" |
|
| 346 | - . _AM_SF_EDITART |
|
| 347 | - . "' alt='" |
|
| 348 | - . _AM_SF_EDITART |
|
| 349 | - . "'></a>"; |
|
| 341 | + . $faqsObj[$i]->faqid() |
|
| 342 | + . "'><img src='" |
|
| 343 | + . $pathIcon16 |
|
| 344 | + . '/edit.png' |
|
| 345 | + . "' title='" |
|
| 346 | + . _AM_SF_EDITART |
|
| 347 | + . "' alt='" |
|
| 348 | + . _AM_SF_EDITART |
|
| 349 | + . "'></a>"; |
|
| 350 | 350 | $delete = "<a href='question.php?op=del&faqid=" |
| 351 | - . $faqsObj[$i]->faqid() |
|
| 352 | - . "'><img src='" |
|
| 353 | - . $pathIcon16 |
|
| 354 | - . '/delete.png' |
|
| 355 | - . "' title='" |
|
| 356 | - . _AM_SF_DELETEART |
|
| 357 | - . "' alt='" |
|
| 358 | - . _AM_SF_DELETEART |
|
| 359 | - . "'></a>"; |
|
| 351 | + . $faqsObj[$i]->faqid() |
|
| 352 | + . "'><img src='" |
|
| 353 | + . $pathIcon16 |
|
| 354 | + . '/delete.png' |
|
| 355 | + . "' title='" |
|
| 356 | + . _AM_SF_DELETEART |
|
| 357 | + . "' alt='" |
|
| 358 | + . _AM_SF_DELETEART |
|
| 359 | + . "'></a>"; |
|
| 360 | 360 | |
| 361 | 361 | $requester = sf_getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
| 362 | 362 | |
@@ -364,14 +364,14 @@ discard block |
||
| 364 | 364 | echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>'; |
| 365 | 365 | echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>'; |
| 366 | 366 | echo "<td class='even' align='left'><a href='" |
| 367 | - . XOOPS_URL |
|
| 368 | - . '/modules/' |
|
| 369 | - . $xoopsModule->dirname() |
|
| 370 | - . '/answer.php?faqid=' |
|
| 371 | - . $faqsObj[$i]->faqid() |
|
| 372 | - . "'>" |
|
| 373 | - . $faqsObj[$i]->question(100) |
|
| 374 | - . '</a></td>'; |
|
| 367 | + . XOOPS_URL |
|
| 368 | + . '/modules/' |
|
| 369 | + . $xoopsModule->dirname() |
|
| 370 | + . '/answer.php?faqid=' |
|
| 371 | + . $faqsObj[$i]->faqid() |
|
| 372 | + . "'>" |
|
| 373 | + . $faqsObj[$i]->question(100) |
|
| 374 | + . '</a></td>'; |
|
| 375 | 375 | |
| 376 | 376 | echo "<td class='even' align='center'>" . $requester . '</td>'; |
| 377 | 377 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -require_once __DIR__ . '/admin_header.php'; |
|
| 9 | +require_once __DIR__.'/admin_header.php'; |
|
| 10 | 10 | |
| 11 | 11 | // Creating the faq handler object |
| 12 | 12 | $faqHandler = sf_gethandler('faq'); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Where shall we start? |
| 26 | -$startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
|
| 26 | +$startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @param bool $showmenu |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | global $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts; |
| 35 | 35 | |
| 36 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 36 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 37 | 37 | // If there is a parameter, and the id exists, retrieve data: we're editing a faq |
| 38 | 38 | if ($faqid != -1) { |
| 39 | 39 | // Creating the FAQ object |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | echo "<br>\n"; |
| 67 | 67 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
| 68 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . $collapsableBar_title . '</h3>'; |
|
| 68 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> ".$collapsableBar_title.'</h3>'; |
|
| 69 | 69 | echo "<div id='bottomtable'>"; |
| 70 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>'; |
|
| 70 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>'; |
|
| 71 | 71 | } else { |
| 72 | 72 | // there's no parameter, so we're adding a faq |
| 73 | 73 | $faqObj = $faqHandler->create(); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $button_caption = _AM_SF_CREATE; |
| 79 | 79 | |
| 80 | 80 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
| 81 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_CREATEQUESTION . '</h3>'; |
|
| 81 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_CREATEQUESTION.'</h3>'; |
|
| 82 | 82 | echo "<div id='bottomtable'>"; |
| 83 | 83 | } |
| 84 | 84 | $sform = new XoopsThemeForm(_AM_SF_OPEN_QUESTION, 'op', xoops_getenv('PHP_SELF')); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $button_tray->addElement($butt_create); |
| 153 | 153 | |
| 154 | 154 | $butt_edit = new XoopsFormButton('', '', _AM_SF_OPEN_QUESTION_EDIT, 'button'); |
| 155 | - $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&faqid=" . $faqid . "'\""); |
|
| 155 | + $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&faqid=".$faqid."'\""); |
|
| 156 | 156 | $button_tray->addElement($butt_edit); |
| 157 | 157 | |
| 158 | 158 | $butt_cancel = new XoopsFormButton('', '', _AM_SF_CANCEL, 'button'); |
@@ -180,11 +180,11 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 183 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 184 | 184 | xoops_cp_header(); |
| 185 | 185 | |
| 186 | 186 | $adminObject->displayNavigation(basename(__FILE__)); |
| 187 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 187 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 188 | 188 | |
| 189 | 189 | editfaq(true, $faqid); |
| 190 | 190 | break; |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $uid = $xoopsUser->uid(); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : -1; |
|
| 205 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : -1; |
|
| 206 | 206 | |
| 207 | 207 | // Creating the FAQ |
| 208 | 208 | if ($faqid != -1) { |
@@ -213,9 +213,9 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | // Putting the values in the FAQ object |
| 215 | 215 | $faqObj->setGroups_read(isset($_POST['groups']) ? $_POST['groups'] : array()); |
| 216 | - $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0); |
|
| 216 | + $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0); |
|
| 217 | 217 | $faqObj->setVar('question', $_POST['question']); |
| 218 | - $faqObj->setVar('status', isset($_POST['status']) ? (int)$_POST['status'] : _SF_STATUS_ASKED); |
|
| 218 | + $faqObj->setVar('status', isset($_POST['status']) ? (int) $_POST['status'] : _SF_STATUS_ASKED); |
|
| 219 | 219 | |
| 220 | 220 | $notifToDo = null; |
| 221 | 221 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | // Storing the FAQ |
| 249 | 249 | if (!$faqObj->store()) { |
| 250 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR . sf_formatErrors($faqObj->getErrors())); |
|
| 250 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR.sf_formatErrors($faqObj->getErrors())); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | // Send notifications |
@@ -265,8 +265,8 @@ discard block |
||
| 265 | 265 | $module_id = $xoopsModule->getVar('mid'); |
| 266 | 266 | $gpermHandler = xoops_getHandler('groupperm'); |
| 267 | 267 | |
| 268 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0; |
|
| 269 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : $faqid; |
|
| 268 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : 0; |
|
| 269 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : $faqid; |
|
| 270 | 270 | |
| 271 | 271 | $faqObj = new sfFaq($faqid); |
| 272 | 272 | |
@@ -281,14 +281,14 @@ discard block |
||
| 281 | 281 | redirect_header('question.php', 2, sprintf(_AM_SF_QUESTIONISDELETED, $faqObj->question())); |
| 282 | 282 | } else { |
| 283 | 283 | // no confirm: show deletion condition |
| 284 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
|
| 284 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0; |
|
| 285 | 285 | xoops_cp_header(); |
| 286 | 286 | xoops_confirm(array( |
| 287 | 287 | 'op' => 'del', |
| 288 | 288 | 'faqid' => $faqObj->faqid(), |
| 289 | 289 | 'confirm' => 1, |
| 290 | 290 | 'name' => $faqObj->question() |
| 291 | - ), 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 291 | + ), 'question.php', _AM_SF_DELETETHISQUESTION." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE); |
|
| 292 | 292 | xoops_cp_footer(); |
| 293 | 293 | } |
| 294 | 294 | |
@@ -297,12 +297,12 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | case 'default': |
| 299 | 299 | default: |
| 300 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 300 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
| 301 | 301 | xoops_cp_header(); |
| 302 | 302 | $adminObject->displayNavigation(basename(__FILE__)); |
| 303 | 303 | |
| 304 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 305 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 304 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 305 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 306 | 306 | |
| 307 | 307 | global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $smartModuleConfig; |
| 308 | 308 | |
@@ -310,9 +310,9 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | sf_collapsableBar('toptable', 'toptableicon'); |
| 312 | 312 | |
| 313 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_OPENED_TITLE . '</h3>'; |
|
| 313 | + echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_OPENED_TITLE.'</h3>'; |
|
| 314 | 314 | echo "<div id='toptable'>"; |
| 315 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_OPENED_DSC . '</span>'; |
|
| 315 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_OPENED_DSC.'</span>'; |
|
| 316 | 316 | |
| 317 | 317 | // Get the total number of published FAQs |
| 318 | 318 | $totalfaqs = $faqHandler->getFaqsCount(-1, array(_SF_STATUS_OPENED)); |
@@ -322,14 +322,14 @@ discard block |
||
| 322 | 322 | $allCats = $categoryHandler->getObjects(null, true); |
| 323 | 323 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
| 324 | 324 | echo '<tr>'; |
| 325 | - echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>'; |
|
| 326 | - echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
| 327 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>'; |
|
| 325 | + echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>'; |
|
| 326 | + echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
| 327 | + echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>'; |
|
| 328 | 328 | |
| 329 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>'; |
|
| 329 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>'; |
|
| 330 | 330 | |
| 331 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>'; |
|
| 332 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
| 331 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>'; |
|
| 332 | + echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
| 333 | 333 | echo '</tr>'; |
| 334 | 334 | //var_dump( $faqsObj); |
| 335 | 335 | if ($totalfaqs > 0) { |
@@ -361,8 +361,8 @@ discard block |
||
| 361 | 361 | $requester = sf_getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
| 362 | 362 | |
| 363 | 363 | echo '<tr>'; |
| 364 | - echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>'; |
|
| 365 | - echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>'; |
|
| 364 | + echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>'; |
|
| 365 | + echo "<td class='even' align='left'>".$categoryObj->name().'</td>'; |
|
| 366 | 366 | echo "<td class='even' align='left'><a href='" |
| 367 | 367 | . XOOPS_URL |
| 368 | 368 | . '/modules/' |
@@ -373,23 +373,23 @@ discard block |
||
| 373 | 373 | . $faqsObj[$i]->question(100) |
| 374 | 374 | . '</a></td>'; |
| 375 | 375 | |
| 376 | - echo "<td class='even' align='center'>" . $requester . '</td>'; |
|
| 376 | + echo "<td class='even' align='center'>".$requester.'</td>'; |
|
| 377 | 377 | |
| 378 | - echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>'; |
|
| 378 | + echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>'; |
|
| 379 | 379 | echo "<td class='even' align='center'> $modify $delete </td>"; |
| 380 | 380 | echo '</tr>'; |
| 381 | 381 | } |
| 382 | 382 | } else { |
| 383 | 383 | $faqid = -1; |
| 384 | 384 | echo '<tr>'; |
| 385 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOQUEUED . '</td>'; |
|
| 385 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOQUEUED.'</td>'; |
|
| 386 | 386 | echo '</tr>'; |
| 387 | 387 | } |
| 388 | 388 | echo "</table>\n"; |
| 389 | 389 | echo "<br>\n"; |
| 390 | 390 | |
| 391 | 391 | $pagenav = new XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq'); |
| 392 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 392 | + echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
| 393 | 393 | echo '</div>'; |
| 394 | 394 | |
| 395 | 395 | $totalcategories = $categoryHandler->getCategoriesCount(-1); |
@@ -400,4 +400,4 @@ discard block |
||
| 400 | 400 | break; |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 403 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * constructor |
| 30 | - * @param null $id |
|
| 30 | + * @param integer $id |
|
| 31 | 31 | */ |
| 32 | 32 | public function __construct($id = null) |
| 33 | 33 | { |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | * create a new answer |
| 369 | 369 | * |
| 370 | 370 | * @param bool $isNew flag the new objects as "new"? |
| 371 | - * @return object sfAnswer |
|
| 371 | + * @return sfAnswer sfAnswer |
|
| 372 | 372 | */ |
| 373 | 373 | public function create($isNew = true) |
| 374 | 374 | { |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | /** |
| 411 | 411 | * insert a new answer in the database |
| 412 | 412 | * |
| 413 | - * @param XoopsObject $answerObj reference to the <a href='psi_element://sfAnswer'>sfAnswer</a> object |
|
| 413 | + * @param sfAnswer $answerObj reference to the <a href='psi_element://sfAnswer'>sfAnswer</a> object |
|
| 414 | 414 | * @param bool $force |
| 415 | 415 | * @return bool FALSE if failed, TRUE if already present and unchanged or successful |
| 416 | 416 | */ |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | if (!$attach_key) { |
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | - $this->attachment_array[(string)$attach_key]['num_download']++; |
|
| 94 | + $this->attachment_array[(string) $attach_key]['num_download']++; |
|
| 95 | 95 | |
| 96 | - return $this->attachment_array[(string)$attach_key]['num_download']; |
|
| 96 | + return $this->attachment_array[(string) $attach_key]['num_download']; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $attachment_save = base64_encode(serialize($this->attachment_array)); |
| 107 | 107 | } |
| 108 | 108 | $this->setVar('attachment', $attachment_save); |
| 109 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid'); |
|
| 109 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('smartfaq_answers').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachment_save).' WHERE post_id = '.$this->getVar('answerid'); |
|
| 110 | 110 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 111 | 111 | //xoops_error($GLOBALS["xoopsDB"]->error()); |
| 112 | 112 | return false; |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | foreach ($attach_old as $key => $attach) { |
| 140 | 140 | if (in_array($key, $attach_array)) { |
| 141 | - @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attach['name_saved']); |
|
| 142 | - @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/thumbs/' . $attach['name_saved']); // delete thumbnails |
|
| 141 | + @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attach['name_saved']); |
|
| 142 | + @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/thumbs/'.$attach['name_saved']); // delete thumbnails |
|
| 143 | 143 | continue; |
| 144 | 144 | } |
| 145 | 145 | $this->attachment_array[$key] = $attach; |
@@ -165,12 +165,12 @@ discard block |
||
| 165 | 165 | static $counter = 0; |
| 166 | 166 | $this->attachment_array = $this->getAttachment(); |
| 167 | 167 | if ($name_saved) { |
| 168 | - $key = (string)(time() + ($counter++)); |
|
| 168 | + $key = (string) (time()+($counter++)); |
|
| 169 | 169 | $this->attachment_array[$key] = array( |
| 170 | 170 | 'name_saved' => $name_saved, |
| 171 | 171 | 'name_display' => isset($name_display) ? $name_display : $name_saved, |
| 172 | 172 | 'mimetype' => $mimetype, |
| 173 | - 'num_download' => isset($num_download) ? (int)$num_download : 0 |
|
| 173 | + 'num_download' => isset($num_download) ? (int) $num_download : 0 |
|
| 174 | 174 | ); |
| 175 | 175 | } |
| 176 | 176 | $attachment_save = null; |
@@ -196,24 +196,24 @@ discard block |
||
| 196 | 196 | if (is_array($attachments) && count($attachments) > 0) { |
| 197 | 197 | $iconHandler = sf_getIconHandler(); |
| 198 | 198 | $mime_path = $iconHandler->getPath('mime'); |
| 199 | - include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/include/functions.image.php'; |
|
| 199 | + include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/include/functions.image.php'; |
|
| 200 | 200 | $image_extensions = array('jpg', 'jpeg', 'gif', 'png', 'bmp'); // need improve !!! |
| 201 | - $post_attachment .= '<br><strong>' . _MD_ATTACHMENT . '</strong>:'; |
|
| 201 | + $post_attachment .= '<br><strong>'._MD_ATTACHMENT.'</strong>:'; |
|
| 202 | 202 | $post_attachment .= '<br><hr size="1" noshade="noshade" /><br>'; |
| 203 | 203 | foreach ($attachments as $key => $att) { |
| 204 | 204 | $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.'); |
| 205 | 205 | $filetype = $file_extension; |
| 206 | - if (file_exists(XOOPS_ROOT_PATH . '/' . $mime_path . '/' . $filetype . '.gif')) { |
|
| 207 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif'; |
|
| 206 | + if (file_exists(XOOPS_ROOT_PATH.'/'.$mime_path.'/'.$filetype.'.gif')) { |
|
| 207 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif'; |
|
| 208 | 208 | } else { |
| 209 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif'; |
|
| 209 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif'; |
|
| 210 | 210 | } |
| 211 | - $file_size = @filesize(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $att['name_saved']); |
|
| 212 | - $file_size = number_format($file_size / 1024, 2) . ' KB'; |
|
| 211 | + $file_size = @filesize(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$att['name_saved']); |
|
| 212 | + $file_size = number_format($file_size / 1024, 2).' KB'; |
|
| 213 | 213 | if ($xoopsModuleConfig['media_allowed'] && in_array(strtolower($file_extension), $image_extensions)) { |
| 214 | - $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '" /><strong> ' . $att['name_display'] . '</strong> <small>(' . $file_size . ')</small>'; |
|
| 215 | - $post_attachment .= '<br>' . sf_attachmentImage($att['name_saved']); |
|
| 216 | - $isDisplayed = true; |
|
| 214 | + $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'" /><strong> '.$att['name_display'].'</strong> <small>('.$file_size.')</small>'; |
|
| 215 | + $post_attachment .= '<br>'.sf_attachmentImage($att['name_saved']); |
|
| 216 | + $isDisplayed = true; |
|
| 217 | 217 | } else { |
| 218 | 218 | global $xoopsUser; |
| 219 | 219 | if (empty($xoopsModuleConfig['show_userattach'])) { |
@@ -370,9 +370,9 @@ discard block |
||
| 370 | 370 | $tags = array(); |
| 371 | 371 | $tags['MODULE_NAME'] = $myts->displayTarea($smartModule->getVar('name')); |
| 372 | 372 | $tags['FAQ_NAME'] = $faqObj->question(); |
| 373 | - $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $faqObj->faqid(); |
|
| 373 | + $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$faqObj->faqid(); |
|
| 374 | 374 | $tags['CATEGORY_NAME'] = $faqObj->getCategoryName(); |
| 375 | - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $faqObj->categoryid(); |
|
| 375 | + $tags['CATEGORY_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$faqObj->categoryid(); |
|
| 376 | 376 | $tags['FAQ_QUESTION'] = $faqObj->question(); |
| 377 | 377 | |
| 378 | 378 | // TODO : Not sure about the 'formpreview' ... |
@@ -431,8 +431,8 @@ discard block |
||
| 431 | 431 | */ |
| 432 | 432 | public function get($id = null, $fields = null) |
| 433 | 433 | { |
| 434 | - if ((int)$id > 0) { |
|
| 435 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_answers') . ' WHERE answerid=' . $id; |
|
| 434 | + if ((int) $id > 0) { |
|
| 435 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_answers').' WHERE answerid='.$id; |
|
| 436 | 436 | if (!$result = $this->db->query($sql)) { |
| 437 | 437 | return false; |
| 438 | 438 | } |
@@ -562,11 +562,11 @@ discard block |
||
| 562 | 562 | { |
| 563 | 563 | $ret = array(); |
| 564 | 564 | $limit = $start = 0; |
| 565 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 565 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_answers'); |
|
| 566 | 566 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 567 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 567 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 568 | 568 | if ($criteria->getSort() != '') { |
| 569 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 569 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 570 | 570 | } |
| 571 | 571 | $limit = $criteria->getLimit(); |
| 572 | 572 | $start = $criteria->getStart(); |
@@ -580,9 +580,9 @@ discard block |
||
| 580 | 580 | $answer = new sfAnswer(); |
| 581 | 581 | $answer->assignVars($myrow); |
| 582 | 582 | if (!$id_as_key) { |
| 583 | - $ret[] =& $answer; |
|
| 583 | + $ret[] = & $answer; |
|
| 584 | 584 | } else { |
| 585 | - $ret[$myrow['answerid']] =& $answer; |
|
| 585 | + $ret[$myrow['answerid']] = & $answer; |
|
| 586 | 586 | } |
| 587 | 587 | unset($answer); |
| 588 | 588 | } |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | $criteria->setOrder($order); |
| 651 | 651 | $criteria->setLimit($limit); |
| 652 | 652 | $criteria->setStart($start); |
| 653 | - $ret =& $this->getObjects($criteria); |
|
| 653 | + $ret = & $this->getObjects($criteria); |
|
| 654 | 654 | |
| 655 | 655 | return $ret; |
| 656 | 656 | } |
@@ -663,9 +663,9 @@ discard block |
||
| 663 | 663 | */ |
| 664 | 664 | public function getCount(CriteriaElement $criteria = null) |
| 665 | 665 | { |
| 666 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 666 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_answers'); |
|
| 667 | 667 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 668 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 668 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 669 | 669 | } |
| 670 | 670 | $result = $this->db->query($sql); |
| 671 | 671 | if (!$result) { |
@@ -684,10 +684,10 @@ discard block |
||
| 684 | 684 | */ |
| 685 | 685 | public function getCountByFAQ($criteria = null) |
| 686 | 686 | { |
| 687 | - $sql = 'SELECT faqid, COUNT(*) FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 687 | + $sql = 'SELECT faqid, COUNT(*) FROM '.$this->db->prefix('smartfaq_answers'); |
|
| 688 | 688 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 689 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 690 | - $sql .= ' ' . $criteria->getGroupby(); |
|
| 689 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 690 | + $sql .= ' '.$criteria->getGroupby(); |
|
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | //echo "<br>$sql<br>"; |
@@ -714,9 +714,9 @@ discard block |
||
| 714 | 714 | */ |
| 715 | 715 | public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) |
| 716 | 716 | { |
| 717 | - $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 717 | + $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_answers'); |
|
| 718 | 718 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 719 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 719 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 720 | 720 | } |
| 721 | 721 | if (!$this->db->query($sql)) { |
| 722 | 722 | return false; |
@@ -736,10 +736,10 @@ discard block |
||
| 736 | 736 | */ |
| 737 | 737 | public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) |
| 738 | 738 | { |
| 739 | - $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); |
|
| 740 | - $sql = 'UPDATE ' . $this->db->prefix('smartfaq_answers') . ' SET ' . $set_clause; |
|
| 739 | + $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue); |
|
| 740 | + $sql = 'UPDATE '.$this->db->prefix('smartfaq_answers').' SET '.$set_clause; |
|
| 741 | 741 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 742 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 742 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 743 | 743 | } |
| 744 | 744 | //echo "<br>" . $sql . "<br>"; |
| 745 | 745 | if (!$this->db->queryF($sql)) { |
@@ -756,8 +756,8 @@ discard block |
||
| 756 | 756 | public function getLastPublishedByFaq($faqids) |
| 757 | 757 | { |
| 758 | 758 | $ret = array(); |
| 759 | - $sql = 'SELECT faqid, answer, uid, datesub FROM ' . $this->db->prefix('smartfaq_answers') . ' |
|
| 760 | - WHERE faqid IN (' . implode(',', $faqids) . ') AND status = ' . _SF_AN_STATUS_APPROVED . ' GROUP BY faqid'; |
|
| 759 | + $sql = 'SELECT faqid, answer, uid, datesub FROM '.$this->db->prefix('smartfaq_answers').' |
|
| 760 | + WHERE faqid IN (' . implode(',', $faqids).') AND status = '._SF_AN_STATUS_APPROVED.' GROUP BY faqid'; |
|
| 761 | 761 | $result = $this->db->query($sql); |
| 762 | 762 | if (!$result) { |
| 763 | 763 | return $ret; |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | while ($row = $this->db->fetchArray($result)) { |
| 766 | 766 | $answer = new sfAnswer(); |
| 767 | 767 | $answer->assignVars($row); |
| 768 | - $ret[$row['faqid']] =& $answer; |
|
| 768 | + $ret[$row['faqid']] = & $answer; |
|
| 769 | 769 | unset($answer); |
| 770 | 770 | } |
| 771 | 771 | |
@@ -472,10 +472,10 @@ |
||
| 472 | 472 | |
| 473 | 473 | if ($answerObj->isNew()) { |
| 474 | 474 | $sql = sprintf('INSERT INTO %s (answerid, `status`, faqid, answer, uid, datesub, notifypub) VALUES (NULL, %u, %u, %s, %u, %u, %u)', $this->db->prefix('smartfaq_answers'), $status, $faqid, |
| 475 | - $this->db->quoteString($answer), $uid, time(), $notifypub); |
|
| 475 | + $this->db->quoteString($answer), $uid, time(), $notifypub); |
|
| 476 | 476 | } else { |
| 477 | 477 | $sql = sprintf('UPDATE %s SET STATUS = %u, faqid = %s, answer = %s, uid = %u, datesub = %u, notifypub = %u WHERE answerid = %u', $this->db->prefix('smartfaq_answers'), $status, $faqid, |
| 478 | - $this->db->quoteString($answer), $uid, $datesub, $notifypub, $answerid); |
|
| 478 | + $this->db->quoteString($answer), $uid, $datesub, $notifypub, $answerid); |
|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | if (false !== $force) { |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | * create a new category |
| 270 | 270 | * |
| 271 | 271 | * @param bool $isNew flag the new objects as "new"? |
| 272 | - * @return object sfCategory |
|
| 272 | + * @return sfCategory sfCategory |
|
| 273 | 273 | */ |
| 274 | 274 | public function &create($isNew = true) |
| 275 | 275 | { |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | /** |
| 312 | 312 | * insert a new category in the database |
| 313 | 313 | * |
| 314 | - * @param XoopsObject $category reference to the {@link sfCategory} object |
|
| 314 | + * @param sfCategory $category reference to the {@link sfCategory} object |
|
| 315 | 315 | * @param bool $force |
| 316 | 316 | * @return bool FALSE if failed, TRUE if already present and unchanged or successful |
| 317 | 317 | */ |
@@ -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 | } |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | // Deleteing the sub categories |
| 378 | - $subcats =& $this->getCategories(0, 0, $category->categoryid()); |
|
| 378 | + $subcats = & $this->getCategories(0, 0, $category->categoryid()); |
|
| 379 | 379 | foreach ($subcats as $subcat) { |
| 380 | 380 | $this->delete($subcat); |
| 381 | 381 | } |
@@ -412,11 +412,11 @@ discard block |
||
| 412 | 412 | { |
| 413 | 413 | $ret = array(); |
| 414 | 414 | $limit = $start = 0; |
| 415 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories'); |
|
| 415 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories'); |
|
| 416 | 416 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 417 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 417 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 418 | 418 | if ($criteria->getSort() != '') { |
| 419 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 419 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 420 | 420 | } |
| 421 | 421 | $limit = $criteria->getLimit(); |
| 422 | 422 | $start = $criteria->getStart(); |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | $order = 'ASC', |
| 459 | 459 | $id_as_key = true |
| 460 | 460 | ) { |
| 461 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 461 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 462 | 462 | |
| 463 | 463 | $criteria = new CriteriaCompo(); |
| 464 | 464 | |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 473 | 473 | |
| 474 | 474 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 475 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 475 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 476 | 476 | } |
| 477 | 477 | $criteria->setStart($start); |
| 478 | 478 | $criteria->setLimit($limit); |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | $sort = 'weight', |
| 497 | 497 | $order = 'ASC' |
| 498 | 498 | ) { |
| 499 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 499 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 500 | 500 | |
| 501 | 501 | $criteria = new CriteriaCompo(); |
| 502 | 502 | |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 511 | 511 | |
| 512 | 512 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 513 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 513 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | $criteria->add(new Criteria('f.status', _SF_STATUS_OPENED)); |
@@ -525,9 +525,9 @@ discard block |
||
| 525 | 525 | . $this->db->prefix('smartfaq_faq') |
| 526 | 526 | . ' AS f ON c.categoryid = f.categoryid'; |
| 527 | 527 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 528 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 528 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 529 | 529 | if ($criteria->getSort() != '') { |
| 530 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 530 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 531 | 531 | } |
| 532 | 532 | $limit = $criteria->getLimit(); |
| 533 | 533 | $start = $criteria->getStart(); |
@@ -556,9 +556,9 @@ discard block |
||
| 556 | 556 | */ |
| 557 | 557 | public function getCount($criteria = null) |
| 558 | 558 | { |
| 559 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_categories'); |
|
| 559 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_categories'); |
|
| 560 | 560 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 561 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 561 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 562 | 562 | } |
| 563 | 563 | $result = $this->db->query($sql); |
| 564 | 564 | if (!$result) { |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 586 | 586 | |
| 587 | 587 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 588 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 588 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 589 | 589 | } |
| 590 | 590 | } |
| 591 | 591 | |
@@ -608,16 +608,16 @@ discard block |
||
| 608 | 608 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 609 | 609 | |
| 610 | 610 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 611 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 611 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 612 | 612 | } |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | $criteria->add(new Criteria('f.status', _SF_STATUS_OPENED)); |
| 616 | 616 | |
| 617 | - $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'; |
|
| 617 | + $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'; |
|
| 618 | 618 | |
| 619 | 619 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 620 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 620 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 621 | 621 | } |
| 622 | 622 | |
| 623 | 623 | $result = $this->db->query($sql); |
@@ -635,13 +635,13 @@ discard block |
||
| 635 | 635 | */ |
| 636 | 636 | public function getSubCats($categories) |
| 637 | 637 | { |
| 638 | - $criteria = new CriteriaCompo(new Criteria('parentid', '(' . implode(',', array_keys($categories)) . ')'), 'IN'); |
|
| 638 | + $criteria = new CriteriaCompo(new Criteria('parentid', '('.implode(',', array_keys($categories)).')'), 'IN'); |
|
| 639 | 639 | $ret = array(); |
| 640 | 640 | if (!sf_userIsAdmin()) { |
| 641 | 641 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 642 | 642 | |
| 643 | 643 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 644 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 644 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 645 | 645 | } |
| 646 | 646 | $subcats = $this->getObjects($criteria, true); |
| 647 | 647 | foreach ($subcats as $subcat_id => $subcat) { |
@@ -659,9 +659,9 @@ discard block |
||
| 659 | 659 | */ |
| 660 | 660 | public function deleteAll($criteria = null) |
| 661 | 661 | { |
| 662 | - $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_categories'); |
|
| 662 | + $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_categories'); |
|
| 663 | 663 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 664 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 664 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 665 | 665 | } |
| 666 | 666 | if (!$this->db->query($sql)) { |
| 667 | 667 | return false; |
@@ -683,10 +683,10 @@ discard block |
||
| 683 | 683 | **/ |
| 684 | 684 | public function updateAll($fieldname, $fieldvalue, $criteria = null) |
| 685 | 685 | { |
| 686 | - $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); |
|
| 687 | - $sql = 'UPDATE ' . $this->db->prefix('smartfaq_categories') . ' SET ' . $set_clause; |
|
| 686 | + $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue); |
|
| 687 | + $sql = 'UPDATE '.$this->db->prefix('smartfaq_categories').' SET '.$set_clause; |
|
| 688 | 688 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 689 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 689 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 690 | 690 | } |
| 691 | 691 | if (!$this->db->queryF($sql)) { |
| 692 | 692 | return false; |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | public function faqsCount($cat_id = 0, $status = '') |
| 713 | 713 | { |
| 714 | 714 | global $xoopsUser; |
| 715 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 715 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 716 | 716 | |
| 717 | 717 | $faqHandler = sf_gethandler('faq'); |
| 718 | 718 | |
@@ -333,10 +333,10 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | if ($category->isNew()) { |
| 335 | 335 | $sql = sprintf('INSERT INTO %s (categoryid, parentid, name, description, total, weight, created) VALUES (NULL, %u, %s, %s, %u, %u, %u)', $this->db->prefix('smartfaq_categories'), |
| 336 | - $parentid, $this->db->quoteString($name), $this->db->quoteString($description), $total, $weight, time()); |
|
| 336 | + $parentid, $this->db->quoteString($name), $this->db->quoteString($description), $total, $weight, time()); |
|
| 337 | 337 | } else { |
| 338 | 338 | $sql = sprintf('UPDATE %s SET parentid = %u, name = %s, description = %s, total = %s, weight = %u, created = %u WHERE categoryid = %u', $this->db->prefix('smartfaq_categories'), $parentid, |
| 339 | - $this->db->quoteString($name), $this->db->quoteString($description), $total, $weight, $created, $categoryid); |
|
| 339 | + $this->db->quoteString($name), $this->db->quoteString($description), $total, $weight, $created, $categoryid); |
|
| 340 | 340 | } |
| 341 | 341 | if (false !== $force) { |
| 342 | 342 | $result = $this->db->queryF($sql); |
@@ -520,10 +520,10 @@ discard block |
||
| 520 | 520 | $ret = array(); |
| 521 | 521 | $limit = $start = 0; |
| 522 | 522 | $sql = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM ' |
| 523 | - . $this->db->prefix('smartfaq_categories') |
|
| 524 | - . ' AS c INNER JOIN ' |
|
| 525 | - . $this->db->prefix('smartfaq_faq') |
|
| 526 | - . ' AS f ON c.categoryid = f.categoryid'; |
|
| 523 | + . $this->db->prefix('smartfaq_categories') |
|
| 524 | + . ' AS c INNER JOIN ' |
|
| 525 | + . $this->db->prefix('smartfaq_faq') |
|
| 526 | + . ' AS f ON c.categoryid = f.categoryid'; |
|
| 527 | 527 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 528 | 528 | $sql .= ' ' . $criteria->renderWhere(); |
| 529 | 529 | if ($criteria->getSort() != '') { |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | - * @param $field |
|
| 170 | + * @param string $field |
|
| 171 | 171 | * @return bool |
| 172 | 172 | */ |
| 173 | 173 | public function fieldExists($field) |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | /** |
| 629 | 629 | * Use to update a table |
| 630 | 630 | * |
| 631 | - * @param object $table {@link SmartDbTable} that will be updated |
|
| 631 | + * @param SmartDbTable $table {@link SmartDbTable} that will be updated |
|
| 632 | 632 | * |
| 633 | 633 | * @see SmartDbTable |
| 634 | 634 | * |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | //Verifies that a MySQL table exists |
| 17 | 17 | $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); |
| 18 | 18 | $realname = $xoopsDB->prefix($table); |
| 19 | - $sql = 'SHOW TABLES FROM ' . XOOPS_DB_NAME; |
|
| 19 | + $sql = 'SHOW TABLES FROM '.XOOPS_DB_NAME; |
|
| 20 | 20 | $ret = $xoopsDB->queryF($sql); |
| 21 | 21 | while (list($m_table) = $xoopsDB->fetchRow($ret)) { |
| 22 | 22 | if ($m_table == $realname) { |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | * Include the language constants for the SmartObjectDBUpdater |
| 54 | 54 | */ |
| 55 | 55 | global $xoopsConfig; |
| 56 | -$common_file = XOOPS_ROOT_PATH . '/modules/smartfaq/language/' . $xoopsConfig['language'] . '/smartdbupdater.php'; |
|
| 56 | +$common_file = XOOPS_ROOT_PATH.'/modules/smartfaq/language/'.$xoopsConfig['language'].'/smartdbupdater.php'; |
|
| 57 | 57 | if (!file_exists($common_file)) { |
| 58 | - $common_file = XOOPS_ROOT_PATH . '/modules/smartfaq/language/english/smartdbupdater.php'; |
|
| 58 | + $common_file = XOOPS_ROOT_PATH.'/modules/smartfaq/language/english/smartdbupdater.php'; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | include $common_file; |
@@ -152,14 +152,14 @@ discard block |
||
| 152 | 152 | public function getExistingFieldsArray() |
| 153 | 153 | { |
| 154 | 154 | global $xoopsDB; |
| 155 | - $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $this->name()); |
|
| 155 | + $result = $xoopsDB->query('SHOW COLUMNS FROM '.$this->name()); |
|
| 156 | 156 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
| 157 | 157 | $fields[$existing_field['Field']] = $existing_field['Type']; |
| 158 | 158 | if ($existing_field['Null'] !== 'YES') { |
| 159 | 159 | $fields[$existing_field['Field']] .= ' NOT NULL'; |
| 160 | 160 | } |
| 161 | 161 | if ($existing_field['Extra']) { |
| 162 | - $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
| 162 | + $fields[$existing_field['Field']] .= ' '.$existing_field['Extra']; |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
@@ -235,9 +235,9 @@ discard block |
||
| 235 | 235 | $query = sprintf('INSERT INTO %s VALUES (%s)', $this->name(), $data); |
| 236 | 236 | $ret = $xoopsDB->query($query); |
| 237 | 237 | if (!$ret) { |
| 238 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '<br>'; |
|
| 238 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()).'<br>'; |
|
| 239 | 239 | } else { |
| 240 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '<br>'; |
|
| 240 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA, $this->name()).'<br>'; |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | |
@@ -402,9 +402,9 @@ discard block |
||
| 402 | 402 | |
| 403 | 403 | $ret = $xoopsDB->query($query); |
| 404 | 404 | if (!$ret) { |
| 405 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . '<br>'; |
|
| 405 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()).'<br>'; |
|
| 406 | 406 | } else { |
| 407 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '<br>'; |
|
| 407 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE, $this->name()).'<br>'; |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | return $ret; |
@@ -423,11 +423,11 @@ discard block |
||
| 423 | 423 | $query = sprintf('DROP TABLE %s', $this->name()); |
| 424 | 424 | $ret = $xoopsDB->query($query); |
| 425 | 425 | if (!$ret) { |
| 426 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . '<br>'; |
|
| 426 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()).'<br>'; |
|
| 427 | 427 | |
| 428 | 428 | return false; |
| 429 | 429 | } else { |
| 430 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '<br>'; |
|
| 430 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE, $this->name()).'<br>'; |
|
| 431 | 431 | |
| 432 | 432 | return true; |
| 433 | 433 | } |
@@ -451,9 +451,9 @@ discard block |
||
| 451 | 451 | $ret = $ret && $xoopsDB->query($query); |
| 452 | 452 | if ($alteredField['showerror']) { |
| 453 | 453 | if (!$ret) { |
| 454 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . '<br>'; |
|
| 454 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()).'<br>'; |
|
| 455 | 455 | } else { |
| 456 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '<br>'; |
|
| 456 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()).'<br>'; |
|
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | } |
@@ -477,9 +477,9 @@ discard block |
||
| 477 | 477 | //echo $query; |
| 478 | 478 | $ret = $ret && $xoopsDB->query($query); |
| 479 | 479 | if (!$ret) { |
| 480 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '<br>'; |
|
| 480 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()).'<br>'; |
|
| 481 | 481 | } else { |
| 482 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '<br>'; |
|
| 482 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()).'<br>'; |
|
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | |
@@ -502,9 +502,9 @@ discard block |
||
| 502 | 502 | $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']); |
| 503 | 503 | $ret = $ret && $xoopsDB->query($query); |
| 504 | 504 | if (!$ret) { |
| 505 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br>'; |
|
| 505 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br>'; |
|
| 506 | 506 | } else { |
| 507 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
| 507 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
| 508 | 508 | } |
| 509 | 509 | } |
| 510 | 510 | |
@@ -527,9 +527,9 @@ discard block |
||
| 527 | 527 | //echo $query."<br>"; |
| 528 | 528 | $ret = $ret && $xoopsDB->query($query); |
| 529 | 529 | if (!$ret) { |
| 530 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br>'; |
|
| 530 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br>'; |
|
| 531 | 531 | } else { |
| 532 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
| 532 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | |
@@ -553,9 +553,9 @@ discard block |
||
| 553 | 553 | |
| 554 | 554 | $ret = $ret && $xoopsDB->query($query); |
| 555 | 555 | if (!$ret) { |
| 556 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . '<br>'; |
|
| 556 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()).'<br>'; |
|
| 557 | 557 | } else { |
| 558 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '<br>'; |
|
| 558 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()).'<br>'; |
|
| 559 | 559 | } |
| 560 | 560 | } |
| 561 | 561 | |
@@ -624,11 +624,11 @@ discard block |
||
| 624 | 624 | $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to); |
| 625 | 625 | $ret = $xoopsDB->query($query); |
| 626 | 626 | if (!$ret) { |
| 627 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>'; |
|
| 627 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>'; |
|
| 628 | 628 | |
| 629 | 629 | return false; |
| 630 | 630 | } else { |
| 631 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>'; |
|
| 631 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>'; |
|
| 632 | 632 | |
| 633 | 633 | return true; |
| 634 | 634 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * Constructor |
| 26 | 26 | * |
| 27 | 27 | * @param string $uploadDir |
| 28 | - * @param array|int $allowedMimeTypes |
|
| 28 | + * @param integer $allowedMimeTypes |
|
| 29 | 29 | * @param int $maxFileSize |
| 30 | 30 | * @param int $maxWidth |
| 31 | 31 | * @param int $maxHeight |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 13 | 13 | |
| 14 | -include_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
| 14 | +include_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Class sfUploader |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | |
| 510 | 510 | /** |
| 511 | 511 | * @param string $url |
| 512 | - * @return mixed|string |
|
| 512 | + * @return string |
|
| 513 | 513 | */ |
| 514 | 514 | function sf_getxoopslink($url = '') |
| 515 | 515 | { |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | /** |
| 585 | - * @param $name |
|
| 585 | + * @param string $name |
|
| 586 | 586 | * @param bool $optional |
| 587 | 587 | * @return bool |
| 588 | 588 | */ |
@@ -202,14 +202,14 @@ discard block |
||
| 202 | 202 | $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . ''; |
| 203 | 203 | |
| 204 | 204 | $modfooter = "<a href='" |
| 205 | - . $smartModule->getInfo('support_site_url') |
|
| 206 | - . "' target='_blank'><img src='" |
|
| 207 | - . XOOPS_URL |
|
| 208 | - . "/modules/smartfaq/assets/images/sfcssbutton.gif' title='" |
|
| 209 | - . $modfootertxt |
|
| 210 | - . "' alt='" |
|
| 211 | - . $modfootertxt |
|
| 212 | - . "'/></a>"; |
|
| 205 | + . $smartModule->getInfo('support_site_url') |
|
| 206 | + . "' target='_blank'><img src='" |
|
| 207 | + . XOOPS_URL |
|
| 208 | + . "/modules/smartfaq/assets/images/sfcssbutton.gif' title='" |
|
| 209 | + . $modfootertxt |
|
| 210 | + . "' alt='" |
|
| 211 | + . $modfootertxt |
|
| 212 | + . "'/></a>"; |
|
| 213 | 213 | |
| 214 | 214 | return $modfooter; |
| 215 | 215 | } |
@@ -444,70 +444,70 @@ discard block |
||
| 444 | 444 | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { |
| 445 | 445 | // Edit button |
| 446 | 446 | $adminLinks .= "<a href='" |
| 447 | - . $modulePath |
|
| 448 | - . "admin/$page?op=mod&faqid=" |
|
| 449 | - . $faqid |
|
| 450 | - . "'><img src='" |
|
| 451 | - . $modulePath |
|
| 452 | - . "assets/images/links/edit.gif'" |
|
| 453 | - . " title='" |
|
| 454 | - . _MD_SF_EDIT |
|
| 455 | - . "' alt='" |
|
| 456 | - . _MD_SF_EDIT |
|
| 457 | - . "'/></a>"; |
|
| 447 | + . $modulePath |
|
| 448 | + . "admin/$page?op=mod&faqid=" |
|
| 449 | + . $faqid |
|
| 450 | + . "'><img src='" |
|
| 451 | + . $modulePath |
|
| 452 | + . "assets/images/links/edit.gif'" |
|
| 453 | + . " title='" |
|
| 454 | + . _MD_SF_EDIT |
|
| 455 | + . "' alt='" |
|
| 456 | + . _MD_SF_EDIT |
|
| 457 | + . "'/></a>"; |
|
| 458 | 458 | $adminLinks .= ' '; |
| 459 | 459 | // Delete button |
| 460 | 460 | $adminLinks .= "<a href='" |
| 461 | - . $modulePath |
|
| 462 | - . "admin/$page?op=del&faqid=" |
|
| 463 | - . $faqid |
|
| 464 | - . "'><img src='" |
|
| 465 | - . $modulePath |
|
| 466 | - . "assets/images/links/delete.gif'" |
|
| 467 | - . " title='" |
|
| 468 | - . _MD_SF_DELETE |
|
| 469 | - . "' alt='" |
|
| 470 | - . _MD_SF_DELETE |
|
| 471 | - . "'/></a>"; |
|
| 461 | + . $modulePath |
|
| 462 | + . "admin/$page?op=del&faqid=" |
|
| 463 | + . $faqid |
|
| 464 | + . "'><img src='" |
|
| 465 | + . $modulePath |
|
| 466 | + . "assets/images/links/delete.gif'" |
|
| 467 | + . " title='" |
|
| 468 | + . _MD_SF_DELETE |
|
| 469 | + . "' alt='" |
|
| 470 | + . _MD_SF_DELETE |
|
| 471 | + . "'/></a>"; |
|
| 472 | 472 | $adminLinks .= ' '; |
| 473 | 473 | } |
| 474 | 474 | // Print button |
| 475 | 475 | $adminLinks .= "<a href='" |
| 476 | - . $modulePath |
|
| 477 | - . 'print.php?faqid=' |
|
| 478 | - . $faqid |
|
| 479 | - . "'><img src='" |
|
| 480 | - . $modulePath |
|
| 481 | - . "assets/images/links/print.gif' title='" |
|
| 482 | - . _MD_SF_PRINT |
|
| 483 | - . "' alt='" |
|
| 484 | - . _MD_SF_PRINT |
|
| 485 | - . "'/></a>"; |
|
| 476 | + . $modulePath |
|
| 477 | + . 'print.php?faqid=' |
|
| 478 | + . $faqid |
|
| 479 | + . "'><img src='" |
|
| 480 | + . $modulePath |
|
| 481 | + . "assets/images/links/print.gif' title='" |
|
| 482 | + . _MD_SF_PRINT |
|
| 483 | + . "' alt='" |
|
| 484 | + . _MD_SF_PRINT |
|
| 485 | + . "'/></a>"; |
|
| 486 | 486 | $adminLinks .= ' '; |
| 487 | 487 | // Email button |
| 488 | 488 | $maillink = 'mailto:?subject=' |
| 489 | - . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) |
|
| 490 | - . '&body=' |
|
| 491 | - . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) |
|
| 492 | - . ': ' |
|
| 493 | - . $modulePath |
|
| 494 | - . 'faq.php?faqid=' |
|
| 495 | - . $faqid; |
|
| 489 | + . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) |
|
| 490 | + . '&body=' |
|
| 491 | + . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) |
|
| 492 | + . ': ' |
|
| 493 | + . $modulePath |
|
| 494 | + . 'faq.php?faqid=' |
|
| 495 | + . $faqid; |
|
| 496 | 496 | $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'/></a>"; |
| 497 | 497 | $adminLinks .= ' '; |
| 498 | 498 | // Submit New Answer button |
| 499 | 499 | if ($xoopsModuleConfig['allownewanswer'] && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) { |
| 500 | 500 | $adminLinks .= "<a href='" |
| 501 | - . $modulePath |
|
| 502 | - . 'answer.php?faqid=' |
|
| 503 | - . $faqid |
|
| 504 | - . "'><img src='" |
|
| 505 | - . $modulePath |
|
| 506 | - . "assets/images/links/newanswer.gif' title='" |
|
| 507 | - . _MD_SF_SUBMITANSWER |
|
| 508 | - . "' alt='" |
|
| 509 | - . _MD_SF_SUBMITANSWER |
|
| 510 | - . "'/></a>"; |
|
| 501 | + . $modulePath |
|
| 502 | + . 'answer.php?faqid=' |
|
| 503 | + . $faqid |
|
| 504 | + . "'><img src='" |
|
| 505 | + . $modulePath |
|
| 506 | + . "assets/images/links/newanswer.gif' title='" |
|
| 507 | + . _MD_SF_SUBMITANSWER |
|
| 508 | + . "' alt='" |
|
| 509 | + . _MD_SF_SUBMITANSWER |
|
| 510 | + . "'/></a>"; |
|
| 511 | 511 | $adminLinks .= ' '; |
| 512 | 512 | } |
| 513 | 513 | |
@@ -7,9 +7,9 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 9 | 9 | |
| 10 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php'; |
|
| 11 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/faq.php'; |
|
| 12 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/answer.php'; |
|
| 10 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php'; |
|
| 11 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/faq.php'; |
|
| 12 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/answer.php'; |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * @return mixed|null |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | break; |
| 64 | 64 | |
| 65 | 65 | case 'inside': |
| 66 | - return XOOPS_URL . '/modules/smartfaq/doc/'; |
|
| 66 | + return XOOPS_URL.'/modules/smartfaq/doc/'; |
|
| 67 | 67 | break; |
| 68 | 68 | |
| 69 | 69 | case 'custom': |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $ret = ''; |
| 82 | 82 | foreach ($errors as $key => $value) { |
| 83 | - $ret .= '<br> - ' . $value; |
|
| 83 | + $ret .= '<br> - '.$value; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | return $ret; |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | $spaces .= '--'; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - $ret .= "<option value='" . $categoryObj->categoryid() . "'"; |
|
| 106 | + $ret .= "<option value='".$categoryObj->categoryid()."'"; |
|
| 107 | 107 | if ($selectedid == $categoryObj->categoryid()) { |
| 108 | 108 | $ret .= ' selected'; |
| 109 | 109 | } |
| 110 | - $ret .= '>' . $spaces . $categoryObj->name() . "</option>\n"; |
|
| 110 | + $ret .= '>'.$spaces.$categoryObj->name()."</option>\n"; |
|
| 111 | 111 | |
| 112 | 112 | $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
| 113 | 113 | if (count($subCategoriesObj) > 0) { |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | function sf_createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true) |
| 130 | 130 | { |
| 131 | - $ret = '' . _MB_SF_SELECTCAT . " <select name='options[]'>"; |
|
| 131 | + $ret = ''._MB_SF_SELECTCAT." <select name='options[]'>"; |
|
| 132 | 132 | if ($allCatOption) { |
| 133 | 133 | $ret .= "<option value='0'"; |
| 134 | - $ret .= '>' . _MB_SF_ALLCAT . "</option>\n"; |
|
| 134 | + $ret .= '>'._MB_SF_ALLCAT."</option>\n"; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // Creating the category handler object |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | { |
| 200 | 200 | $smartModule = sf_getModuleInfo(); |
| 201 | 201 | |
| 202 | - $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . ''; |
|
| 202 | + $modfootertxt = 'Module '.$smartModule->getInfo('name').' - Version '.$smartModule->getInfo('version').''; |
|
| 203 | 203 | |
| 204 | 204 | $modfooter = "<a href='" |
| 205 | 205 | . $smartModule->getInfo('support_site_url') |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | |
| 306 | 306 | $gpermHandler = xoops_getHandler('groupperm'); |
| 307 | 307 | |
| 308 | - $sql = 'SELECT faqid FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE categoryid = '$categoryid' "; |
|
| 308 | + $sql = 'SELECT faqid FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE categoryid = '$categoryid' "; |
|
| 309 | 309 | $result = $xoopsDB->query($sql); |
| 310 | 310 | |
| 311 | 311 | if (count($result) > 0) { |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | $ret = array(); |
| 421 | 421 | global $xoopsDB; |
| 422 | 422 | |
| 423 | - $result = $xoopsDB->query('SELECT * FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE faqid = '$faqid'"); |
|
| 423 | + $result = $xoopsDB->query('SELECT * FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE faqid = '$faqid'"); |
|
| 424 | 424 | $ret = $xoopsDB->fetcharray($result); |
| 425 | 425 | |
| 426 | 426 | return $ret; |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | { |
| 440 | 440 | global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsConfig; |
| 441 | 441 | $adminLinks = ''; |
| 442 | - $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/'; |
|
| 442 | + $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/'; |
|
| 443 | 443 | $page = $open ? 'question.php' : 'faq.php'; |
| 444 | 444 | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { |
| 445 | 445 | // Edit button |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | . "'/></a>"; |
| 486 | 486 | $adminLinks .= ' '; |
| 487 | 487 | // Email button |
| 488 | - $maillink = 'mailto:?subject=' |
|
| 488 | + $maillink = 'mailto:?subject=' |
|
| 489 | 489 | . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) |
| 490 | 490 | . '&body=' |
| 491 | 491 | . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | . $modulePath |
| 494 | 494 | . 'faq.php?faqid=' |
| 495 | 495 | . $faqid; |
| 496 | - $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'/></a>"; |
|
| 496 | + $adminLinks .= '<a href="'.$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'/></a>"; |
|
| 497 | 497 | $adminLinks .= ' '; |
| 498 | 498 | // Submit New Answer button |
| 499 | 499 | if ($xoopsModuleConfig['allownewanswer'] && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) { |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | return $userid; |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | - $userid = (int)$userid; |
|
| 531 | + $userid = (int) $userid; |
|
| 532 | 532 | if ($userid > 0) { |
| 533 | 533 | if ($users == array()) { |
| 534 | 534 | //fetching users |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | if (!isset($users[$userid])) { |
| 539 | 539 | return $GLOBALS['xoopsConfig']['anonymous']; |
| 540 | 540 | } |
| 541 | - $user =& $users[$userid]; |
|
| 541 | + $user = & $users[$userid]; |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | if (is_object($user)) { |
@@ -552,9 +552,9 @@ discard block |
||
| 552 | 552 | $fullname = $user->getVar('name'); |
| 553 | 553 | } |
| 554 | 554 | if (!empty($fullname)) { |
| 555 | - $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]'; |
|
| 555 | + $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]'; |
|
| 556 | 556 | } else { |
| 557 | - $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>'; |
|
| 557 | + $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>'; |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | return $linkeduser; |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | //--> |
| 636 | 636 | </script> |
| 637 | 637 | <?php |
| 638 | - echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">"; |
|
| 638 | + echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">"; |
|
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | /** |
@@ -648,16 +648,16 @@ discard block |
||
| 648 | 648 | static $handlers; |
| 649 | 649 | $name = strtolower(trim($name)); |
| 650 | 650 | if (!isset($handlers[$name])) { |
| 651 | - if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/modules/smartfaq/class/' . $name . '.php')) { |
|
| 651 | + if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/modules/smartfaq/class/'.$name.'.php')) { |
|
| 652 | 652 | require_once $hnd_file; |
| 653 | 653 | } |
| 654 | - $class = 'sf' . ucfirst($name) . 'Handler'; |
|
| 654 | + $class = 'sf'.ucfirst($name).'Handler'; |
|
| 655 | 655 | if (class_exists($class)) { |
| 656 | 656 | $handlers[$name] = new $class($GLOBALS['xoopsDB']); |
| 657 | 657 | } |
| 658 | 658 | } |
| 659 | 659 | if (!$optional && !isset($handlers[$name])) { |
| 660 | - trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR); |
|
| 660 | + trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR); |
|
| 661 | 661 | } |
| 662 | 662 | $false = false; |
| 663 | 663 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | function smartfaq_search($queryarray, $andor, $limit, $offset, $userid) |
| 17 | 17 | { |
| 18 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 18 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 19 | 19 | |
| 20 | 20 | $ret = array(); |
| 21 | 21 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | for ($i = 0, $iMax = count($faqsObj); $i < $iMax; ++$i) { |
| 27 | 27 | $ret[$i]['image'] = 'assets/images/smartfaq.gif'; |
| 28 | - $ret[$i]['link'] = 'faq.php?faqid=' . $faqsObj[$i]->faqid(); |
|
| 28 | + $ret[$i]['link'] = 'faq.php?faqid='.$faqsObj[$i]->faqid(); |
|
| 29 | 29 | $ret[$i]['title'] = $faqsObj[$i]->question(50); |
| 30 | 30 | $ret[$i]['time'] = $faqsObj[$i]->getVar('datesub'); |
| 31 | 31 | $ret[$i]['uid'] = $faqsObj[$i]->uid(); |