@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | |
96 | 96 | include_once $GLOBALS['xoops']->path('/class/xoopsformloader.php'); |
97 | 97 | |
98 | - $caption = ($this->isNew()) ? _AM_XOOPSFAQ_CREATE_NEW: sprintf(_AM_XOOPSFAQ_MODIFY_ITEM, $this->getVar('contents_title')); |
|
98 | + $caption = ($this->isNew()) ? _AM_XOOPSFAQ_CREATE_NEW : sprintf(_AM_XOOPSFAQ_MODIFY_ITEM, $this->getVar('contents_title')); |
|
99 | 99 | $form = new XoopsThemeForm($caption, 'content', $_SERVER['REQUEST_URI'], 'post', true); |
100 | 100 | // $form->addElement(new XoopsFormHiddenToken()); |
101 | 101 | $form->addElement(new xoopsFormHidden('op', 'save')); |
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'), |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $criteria->setStart(0); |
255 | 255 | $criteria->setLimit(0); |
256 | 256 | } else { |
257 | - $obj['list'] = $this->getObjects($sort, false); |
|
257 | + $obj['list'] = $this->getObjects($sort, false); |
|
258 | 258 | } |
259 | 259 | $obj['list'] = $this->getObjects($criteria, false); |
260 | 260 | $obj['count'] = (false !== $obj['list']) ? count($obj['list']) : 0; |
@@ -130,7 +130,7 @@ |
||
130 | 130 | $oldFiles = array($xfHelper->path('include/functions.php'), |
131 | 131 | $xsHelper->path('class/utilities.php') |
132 | 132 | ); |
133 | - foreach($oldFiles as $file) { |
|
133 | + foreach ($oldFiles as $file) { |
|
134 | 134 | if (is_file($file)) { |
135 | 135 | if (false === ($delOk = unlink($file))) { |
136 | 136 | $module->setErrors(sprintf(_AM_XOOPSFAQ_ERROR_BAD_REMOVE, $file)); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | return $ret; |
44 | 44 | } |
45 | 45 | |
46 | - $moduleDirName = basename(dirname(__DIR__)) ; |
|
46 | + $moduleDirName = basename(dirname(__DIR__)); |
|
47 | 47 | xoops_load('constants', $moduleDirName); |
48 | 48 | |
49 | 49 | $xfHelper = Xmf\Module\Helper::getHelper($moduleDirName); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $catCount = !empty($catArray) ? count($catArray) : 0; |
70 | 70 | $totalLimit = (int)$limit - $catCount; |
71 | 71 | foreach ($catArray as $cId => $cat) { |
72 | - $ret[] = array ('image' => 'assets/images/folder.png', |
|
72 | + $ret[] = array('image' => 'assets/images/folder.png', |
|
73 | 73 | 'link' => $xfHelper->url('index.php?cat_id=' . $cId), |
74 | 74 | 'title' => $cat['category_title'], |
75 | 75 | ); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | $contentArray = $xfFaqHandler->getAll($criteria, $contentFields, false); |
101 | 101 | foreach ($contentArray as $content) { |
102 | - $ret[] = array ('image' => 'assets/images/question2.gif', |
|
102 | + $ret[] = array('image' => 'assets/images/question2.gif', |
|
103 | 103 | 'link' => $xfHelper->url('index.php?cat_id=' . $content['contents_cid'] . '#q' . $content['contents_id']), |
104 | 104 | 'title' => $content['contents_title'], |
105 | 105 | 'time' => $content['contents_publish'], |
@@ -25,13 +25,13 @@ |
||
25 | 25 | |
26 | 26 | $myts = MyTextSanitizer::getInstance(); |
27 | 27 | |
28 | - $moduleDirName = basename(dirname(__DIR__)) ; |
|
28 | + $moduleDirName = basename(dirname(__DIR__)); |
|
29 | 29 | $xfHelper = Xmf\Module\Helper::getHelper($moduleDirName); |
30 | 30 | $xfCatHandler = $xfHelper->getHandler('category'); |
31 | 31 | $catList = $xfCatHandler->getList(); |
32 | 32 | |
33 | - $retVal = array() ; |
|
34 | - foreach ($catList as $id=>$title){ |
|
33 | + $retVal = array(); |
|
34 | + foreach ($catList as $id=>$title) { |
|
35 | 35 | $retVal['parent'][] = array('id' => $id, |
36 | 36 | 'title' => $myts->htmlSpecialChars($title), |
37 | 37 | 'url' => $xfHelper->url('index.php?cat_id=' . $id) |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $retVal = array(); |
55 | 55 | |
56 | 56 | foreach ($contentObjs as $contentObj) { |
57 | - $retVal[] = array ('image' => '', |
|
57 | + $retVal[] = array('image' => '', |
|
58 | 58 | 'title' => $contentObj->getVar('contents_title'), |
59 | 59 | 'link' => $contentObj->getVar('contents_contents'), |
60 | 60 | 'time' => $contentObj->getVar('contents_publish'), |
@@ -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'); |
@@ -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; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $faqTitle = $myts->displayTarea($faqObj->getVar('contents_title')); |
82 | 82 | if (!empty($options[1])) { |
83 | 83 | $txtAns = strip_tags($faqObj->getVar('contents_contents')); // get rid of html for block |
84 | - $faqAns = $myts->displayTarea(xoops_substr($txtAns, 0, $options[1]), 0, 0 ,0 ,0 ,0); |
|
84 | + $faqAns = $myts->displayTarea(xoops_substr($txtAns, 0, $options[1]), 0, 0, 0, 0, 0); |
|
85 | 85 | } else { |
86 | 86 | $faqAns = $myts->displayTarea($faqObj->getVar('contents_contents'), |
87 | 87 | (int)$faqObj->getVar('dohtml'), |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $formSelect->addOptionArray($optionArray); |
126 | 126 | $selOptions = (false === strpos($options[3], ',')) ? $options[3] : explode(',', $options[3]); |
127 | 127 | $formSelect->setValue($selOptions); |
128 | - $selectCat = $formSelect->render(); |
|
128 | + $selectCat = $formSelect->render(); |
|
129 | 129 | |
130 | 130 | $ychck = (isset($options[2]) && ($options[2] > 0)) ? ' checked' : ''; |
131 | 131 | $nchck = !empty($ychck) ? '' : ' checked'; |
@@ -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 . ' ' |