@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | $xpFaqObj = $xpFaqObjArray[$faqNum]; |
| 75 | 75 | $faq = $myts->displayTarea($xpFaqObj->getVar('contents_title')); |
| 76 | 76 | $txtAns = strip_tags($xpFaqObj->getVar('contents_contents')); // get rid of html for block |
| 77 | - $faqAns = $myts->displayTarea(xoops_substr($txtAns, 0, $options[0]), 0, 0 ,0 ,0 ,0); |
|
| 77 | + $faqAns = $myts->displayTarea(xoops_substr($txtAns, 0, $options[0]), 0, 0, 0, 0, 0); |
|
| 78 | 78 | |
| 79 | 79 | $xfCatHandler = $xfHelper->getHandler('category'); |
| 80 | 80 | $catObj = $xfCatHandler->get($xpFaqObj->getVar('contents_cid')); |
| 81 | 81 | $cid = $catObj->getVar('category_id'); |
| 82 | - $block = array( 'title' => _MB_XOOPSFAQ_RANDOM_TITLE, |
|
| 82 | + $block = array('title' => _MB_XOOPSFAQ_RANDOM_TITLE, |
|
| 83 | 83 | 'faq' => $faq, |
| 84 | 84 | 'faqans' => $faqAns, |
| 85 | 85 | 'morelink' => $xfHelper->url('index.php?cat_id=' . $cid . '#q' . $xpFaqObj->getVar('contents_id')), |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $formSelect->addOptionArray($optionArray); |
| 115 | 115 | $selOptions = (false === strpos($options[1], ',')) ? $options[1] : explode(',', $options[1]); |
| 116 | 116 | $formSelect->setValue($selOptions); |
| 117 | - $selectCat = $formSelect->render(); |
|
| 117 | + $selectCat = $formSelect->render(); |
|
| 118 | 118 | |
| 119 | 119 | $form = '<div class="line140">' |
| 120 | 120 | . _MB_XOOPSFAQ_CHARS . ' ' |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | break; |
| 81 | 81 | |
| 82 | 82 | case 'save': |
| 83 | - if ( ($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity) ) { |
|
| 84 | - if ( !$GLOBALS['xoopsSecurity']->check() ) { |
|
| 83 | + if (($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity)) { |
|
| 84 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
| 85 | 85 | // failed xoops security check |
| 86 | 86 | $xfHelper->redirect('admin/index.php', 3, $GLOBALS['xoopsSecurity']->getErrors(true)); |
| 87 | 87 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | case 'default': |
| 110 | 110 | default: |
| 111 | 111 | $adminObject->displayNavigation('category.php'); |
| 112 | - $adminObject->addItemButton(_XO_XOOPSFAQ_ADDCAT, 'category.php?op=edit', 'add' , ''); |
|
| 112 | + $adminObject->addItemButton(_XO_XOOPSFAQ_ADDCAT, 'category.php?op=edit', 'add', ''); |
|
| 113 | 113 | $adminObject->displayButton('left'); |
| 114 | 114 | $xfCatHandler->displayAdminListing('order'); |
| 115 | 115 | break; |
@@ -99,7 +99,7 @@ |
||
| 99 | 99 | $catCount = $xfCatHandler->getCount(); |
| 100 | 100 | $adminObject->displayNavigation(basename(__FILE__)); |
| 101 | 101 | if (!empty($catCount)) { |
| 102 | - $adminObject->addItemButton(_AM_XOOPSFAQ_CREATE_NEW, basename(__FILE__) . '?op=edit', 'add' , ''); |
|
| 102 | + $adminObject->addItemButton(_AM_XOOPSFAQ_CREATE_NEW, basename(__FILE__) . '?op=edit', 'add', ''); |
|
| 103 | 103 | $adminObject->displayButton('left'); |
| 104 | 104 | } |
| 105 | 105 | $xfFaqHandler->displayAdminListing('weight'); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // Module SQL Tables |
| 64 | 64 | $modversion['tables'] = array('xoopsfaq_contents', |
| 65 | 65 | 'xoopsfaq_categories' |
| 66 | -) ; |
|
| 66 | +); |
|
| 67 | 67 | |
| 68 | 68 | // Scripts to run upon installation or update |
| 69 | 69 | $modversion['onInstall'] = "include/oninstall.inc.php"; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $editor_handler = XoopsEditorHandler::getInstance(); |
| 137 | 137 | $editorList = array_flip($editor_handler->getList()); |
| 138 | 138 | |
| 139 | -$modversion['config'] = array(array('name' => 'use_wysiwyg', |
|
| 139 | +$modversion['config'] = array(array('name' => 'use_wysiwyg', |
|
| 140 | 140 | 'title' => '_MI_XOOPSFAQ_EDITORS', |
| 141 | 141 | 'description' => '_MI_XOOPSFAQ_EDITORS_DESC', |
| 142 | 142 | 'formtype' => 'select', |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | * |
| 241 | 241 | * @param CriteriaElement|string sort order ('id', 'cid', 'title', 'publish', or 'weight') default: 'id' |
| 242 | 242 | * |
| 243 | - * @return mixed XoopsfaqContents object | false on failure |
|
| 243 | + * @return boolean XoopsfaqContents object | false on failure |
|
| 244 | 244 | */ |
| 245 | 245 | public function getObj($sort = 'id') |
| 246 | 246 | { |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | * XoopsfaqContentsHandler::getPublished() |
| 266 | 266 | * |
| 267 | 267 | * @param string $id |
| 268 | - * @return mixed array of XoopsfaqContent objects | false on failure |
|
| 268 | + * @return boolean array of XoopsfaqContent objects | false on failure |
|
| 269 | 269 | */ |
| 270 | 270 | public function getPublished($id = '') |
| 271 | 271 | { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $form->addElement(new xoopsFormHidden('contents_id', $this->getVar('contents_id', 'e'))); |
| 103 | 103 | |
| 104 | 104 | // Active |
| 105 | - $contents_active = new XoopsFormRadioYN(_AM_XOOPSFAQ_E_CONTENTS_ACTIVE, 'contents_active', $this->getVar('contents_active', 'e'), ' ' . _YES . '', ' ' . _NO . '' ); |
|
| 105 | + $contents_active = new XoopsFormRadioYN(_AM_XOOPSFAQ_E_CONTENTS_ACTIVE, 'contents_active', $this->getVar('contents_active', 'e'), ' ' . _YES . '', ' ' . _NO . ''); |
|
| 106 | 106 | $contents_active->setDescription(_AM_XOOPSFAQ_E_CONTENTS_ACTIVE_DESC); |
| 107 | 107 | $form->addElement($contents_active, false); |
| 108 | 108 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $form->addElement($contents_weight, false); |
| 128 | 128 | |
| 129 | 129 | // Editor |
| 130 | - $options_tray = new XoopsFormElementTray(_AM_XOOPSFAQ_E_CONTENTS_CONTENT, '<br>'); |
|
| 130 | + $options_tray = new XoopsFormElementTray(_AM_XOOPSFAQ_E_CONTENTS_CONTENT, '<br>'); |
|
| 131 | 131 | if (class_exists('XoopsFormEditor')) { |
| 132 | 132 | // $editorConfigs = array('editor' => $GLOBALS['xoopsConfig']['general_editor'], |
| 133 | 133 | $editorConfigs = array('editor' => $xfHelper->getConfig('use_wysiwyg', 'dhtmltextarea'), |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | $ret = array(); |
| 300 | 300 | $sql = 'SELECT contents_cid '; |
| 301 | 301 | $sql .= 'FROM `' . $this->table . '` '; |
| 302 | - $sql .= 'WHERE (contents_active =\''. XoopsfaqConstants::ACTIVE . '\') '; |
|
| 302 | + $sql .= 'WHERE (contents_active =\'' . XoopsfaqConstants::ACTIVE . '\') '; |
|
| 303 | 303 | $sql .= 'GROUP BY contents_cid'; |
| 304 | 304 | if (!$result = $this->db->query($sql)) { |
| 305 | 305 | return $ret; |
@@ -268,8 +268,8 @@ |
||
| 268 | 268 | /** |
| 269 | 269 | * Render the icon links |
| 270 | 270 | * |
| 271 | - * @param array $icon_array contains operation=>icon_name as key=>value |
|
| 272 | - * @param mixed $param HTML parameter |
|
| 271 | + * @param string[] $icon_array contains operation=>icon_name as key=>value |
|
| 272 | + * @param string $param HTML parameter |
|
| 273 | 273 | * @param mixed $value HTML parameter value to set |
| 274 | 274 | * @param mixed $extra are any additional HTML attributes desired for the <a> tag |
| 275 | 275 | * @return string |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $currentVersion = strtolower(str_replace('XOOPS ', '', XOOPS_VERSION)); |
| 44 | 44 | $requiredVersion = strtolower($module->getInfo('min_xoops')); |
| 45 | - $vc = version_compare ($currentVersion , $requiredVersion); |
|
| 46 | - $success = ($vc>=0); |
|
| 45 | + $vc = version_compare($currentVersion, $requiredVersion); |
|
| 46 | + $success = ($vc >= 0); |
|
| 47 | 47 | if (false === $success) { |
| 48 | 48 | xoops_loadLanguage('admin', $module->dirname()); |
| 49 | 49 | $module->setErrors(sprintf(_AM_XOOPSFAQ_ERROR_BAD_XOOPS, $requiredVersion, $currentVersion)); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | static::rrmdir($fObj->getPathname()); |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 162 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 163 | 163 | return rmdir($src); // remove the directory & return results |
| 164 | 164 | } |
| 165 | 165 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | static::rmove($fObj->getPathname(), $dest . '/' . $fObj->getFilename()); |
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | - $iterator = null; // clear iterator Obj to close file/directory |
|
| 201 | + $iterator = null; // clear iterator Obj to close file/directory |
|
| 202 | 202 | return rmdir($src); // remove the directory & return results |
| 203 | 203 | } |
| 204 | 204 | |
@@ -232,11 +232,11 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | // Open the source directory to read in files |
| 234 | 234 | $iterator = new DirectoryIterator($src); |
| 235 | - foreach($iterator as $fObj) { |
|
| 236 | - if($fObj->isFile()) { |
|
| 235 | + foreach ($iterator as $fObj) { |
|
| 236 | + if ($fObj->isFile()) { |
|
| 237 | 237 | copy($fObj->getPathname(), $dest . '/' . $fObj->getFilename()); |
| 238 | - } else if(!$fObj->isDot() && $fObj->isDir()) { |
|
| 239 | - static::rcopy($fObj->getPathname(), $dest . '/' . $fObj-getFilename()); |
|
| 238 | + } else if (!$fObj->isDot() && $fObj->isDir()) { |
|
| 239 | + static::rcopy($fObj->getPathname(), $dest . '/' . $fObj - getFilename()); |
|
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | return true; |
@@ -257,19 +257,19 @@ discard block |
||
| 257 | 257 | xoops_loadLanguage('admin', $moduleDirName); |
| 258 | 258 | $ret = ''; |
| 259 | 259 | if (null !== $value) { |
| 260 | - foreach($icon_array as $_op => $icon) { |
|
| 260 | + foreach ($icon_array as $_op => $icon) { |
|
| 261 | 261 | if (false === strpos($icon, '.')) { |
| 262 | 262 | $iconName = $icon; |
| 263 | 263 | $iconExt = 'png'; |
| 264 | 264 | } else { |
| 265 | - $iconName = substr($icon, 0, strlen($icon)-strrchr($icon, '.')); |
|
| 265 | + $iconName = substr($icon, 0, strlen($icon) - strrchr($icon, '.')); |
|
| 266 | 266 | $iconExt = substr(strrchr($icon, '.'), 1); |
| 267 | 267 | } |
| 268 | 268 | $url = (!is_numeric($_op)) ? $_op . '?' . $param . '=' . $value : xoops_getenv('PHP_SELF') . '?op=' . $iconName . '&' . $param . '=' . $value; |
| 269 | 269 | if (null !== $extra) { |
| 270 | 270 | $url .= ' ' . $extra; |
| 271 | 271 | } |
| 272 | - $title = constant (htmlspecialchars(mb_strtoupper('_XO_LA_' . $iconName))); |
|
| 272 | + $title = constant(htmlspecialchars(mb_strtoupper('_XO_LA_' . $iconName))); |
|
| 273 | 273 | $img = '<img src="' . Xmf\Module\Admin::iconUrl($iconName . '.' . $iconExt, '16') . '"' |
| 274 | 274 | . ' title ="' . $title . '"' |
| 275 | 275 | . ' alt = "' . $title . '"' |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | * |
| 119 | 119 | * @param string $sort order ('id', order', or 'title') - default: id |
| 120 | 120 | * |
| 121 | - * @return mixed XoopsfaqCategory | false on failure |
|
| 121 | + * @return boolean XoopsfaqCategory | false on failure |
|
| 122 | 122 | */ |
| 123 | 123 | public function getObj($sort = 'id') |
| 124 | 124 | { |
@@ -131,7 +131,7 @@ |
||
| 131 | 131 | $oldFiles = array($xfHelper->path('include/functions.php'), |
| 132 | 132 | $xfHelper->path('class/utilities.php') |
| 133 | 133 | ); |
| 134 | - foreach($oldFiles as $file) { |
|
| 134 | + foreach ($oldFiles as $file) { |
|
| 135 | 135 | if (is_file($file)) { |
| 136 | 136 | if (false === ($delOk = unlink($file))) { |
| 137 | 137 | $module->setErrors(sprintf(_AM_XOOPSFAQ_ERROR_BAD_REMOVE, $file)); |
@@ -27,13 +27,13 @@ |
||
| 27 | 27 | /** @var Xmf\Module\Helper\GenericHelper $xfHelper */ |
| 28 | 28 | $myts = MyTextSanitizer::getInstance(); |
| 29 | 29 | |
| 30 | - $moduleDirName = basename(dirname(__DIR__)) ; |
|
| 30 | + $moduleDirName = basename(dirname(__DIR__)); |
|
| 31 | 31 | $xfHelper = Xmf\Module\Helper::getHelper($moduleDirName); |
| 32 | 32 | $xfCatHandler = $xfHelper->getHandler('category'); |
| 33 | 33 | $catList = $xfCatHandler->getList(); |
| 34 | 34 | |
| 35 | - $retVal = array() ; |
|
| 36 | - foreach ($catList as $id=>$title){ |
|
| 35 | + $retVal = array(); |
|
| 36 | + foreach ($catList as $id=>$title) { |
|
| 37 | 37 | $retVal['parent'][] = array('id' => $id, |
| 38 | 38 | 'title' => $myts->htmlSpecialChars($title), |
| 39 | 39 | 'url' => $xfHelper->url('index.php?cat_id=' . $id) |