@@ -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 | { |
@@ -170,32 +170,32 @@ |
||
170 | 170 | $buttons = array('edit', 'delete'); |
171 | 171 | |
172 | 172 | $ret = '<table class="outer width100 bnone pad3 marg5">' |
173 | - . ' <thead>' |
|
174 | - . ' <tr class="xoopsCenter">' |
|
175 | - . ' <th class="width5">' . _AM_XOOPSFAQ_CATEGORY_ORDER . '</th>' |
|
176 | - . ' <th class="width5">' . _AM_XOOPSFAQ_CATEGORY_ID . '</th>' |
|
177 | - . ' <th class="txtleft">' . _AM_XOOPSFAQ_CATEGORY_TITLE . '</th>' |
|
178 | - . ' <th class="width20">' . _AM_XOOPSFAQ_ACTIONS . '</th>' |
|
179 | - . ' </tr>' |
|
180 | - . ' </thead>' |
|
181 | - . ' <tbody>'; |
|
173 | + . ' <thead>' |
|
174 | + . ' <tr class="xoopsCenter">' |
|
175 | + . ' <th class="width5">' . _AM_XOOPSFAQ_CATEGORY_ORDER . '</th>' |
|
176 | + . ' <th class="width5">' . _AM_XOOPSFAQ_CATEGORY_ID . '</th>' |
|
177 | + . ' <th class="txtleft">' . _AM_XOOPSFAQ_CATEGORY_TITLE . '</th>' |
|
178 | + . ' <th class="width20">' . _AM_XOOPSFAQ_ACTIONS . '</th>' |
|
179 | + . ' </tr>' |
|
180 | + . ' </thead>' |
|
181 | + . ' <tbody>'; |
|
182 | 182 | if ($objects['count'] > 0) { |
183 | 183 | foreach ($objects['list'] as $object) { |
184 | 184 | $ret .= ' <tr class="xoopsCenter">' |
185 | - . ' <td class="even txtcenter">' . $object->getVar('category_order') . '</td>' |
|
186 | - . ' <td class="even txtcenter">' . $object->getVar('category_id') . '</td>' |
|
187 | - . ' <td class="even txtleft">' . $object->getVar('category_title') . '</td>' |
|
188 | - . ' <td class="even txtcenter">'; |
|
185 | + . ' <td class="even txtcenter">' . $object->getVar('category_order') . '</td>' |
|
186 | + . ' <td class="even txtcenter">' . $object->getVar('category_id') . '</td>' |
|
187 | + . ' <td class="even txtleft">' . $object->getVar('category_title') . '</td>' |
|
188 | + . ' <td class="even txtcenter">'; |
|
189 | 189 | $ret .= XoopsfaqUtility::renderIconLinks($buttons, 'category_id', $object->getVar('category_id')); |
190 | 190 | $ret .= ' </td>' |
191 | - . ' </tr>'; |
|
191 | + . ' </tr>'; |
|
192 | 192 | } |
193 | 193 | } else { |
194 | 194 | $ret .= ' <tr class="txtcenter"><td colspan="4" class="even">' . _AM_XOOPSFAQ_NOLISTING . '</td></tr>'; |
195 | 195 | } |
196 | 196 | $ret .= ' </tbody>' |
197 | 197 | // . ' <tfoot><tr class="txtcenter"><td colspan="4" class="head"> </td></tr></tfoot>' |
198 | - . '</table>'; |
|
198 | + . '</table>'; |
|
199 | 199 | return $ret; |
200 | 200 | } |
201 | 201 |
@@ -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 | { |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | */ |
31 | 31 | class XoopsfaqContents extends XoopsObject |
32 | 32 | { |
33 | - /** |
|
34 | - * @var string contains this modules directory name |
|
35 | - */ |
|
33 | + /** |
|
34 | + * @var string contains this modules directory name |
|
35 | + */ |
|
36 | 36 | protected $dirname; |
37 | 37 | |
38 | 38 | /** |
@@ -131,11 +131,11 @@ discard block |
||
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'), |
134 | - 'rows' => 25, |
|
135 | - 'cols' => '100%', |
|
134 | + 'rows' => 25, |
|
135 | + 'cols' => '100%', |
|
136 | 136 | 'width' => '100%', |
137 | - 'height' => '600px', |
|
138 | - 'name' => 'contents_contents', |
|
137 | + 'height' => '600px', |
|
138 | + 'name' => 'contents_contents', |
|
139 | 139 | 'value' => $this->getVar('contents_contents', 'e') |
140 | 140 | ); |
141 | 141 | $contents_contents = new XoopsFormEditor('', 'contents_contents', $editorConfigs); |
@@ -331,18 +331,18 @@ discard block |
||
331 | 331 | $buttons = array('edit', 'delete'); |
332 | 332 | |
333 | 333 | $ret = '<table class="outer width100 bnone pad3 marg5">' |
334 | - . ' <thead>' |
|
335 | - . ' <tr class="center">' |
|
336 | - . ' <th class="width5">' . _AM_XOOPSFAQ_CONTENTS_ID . '</th>' |
|
337 | - . ' <th class="width5">' . _AM_XOOPSFAQ_CONTENTS_ACTIVE . '</th>' |
|
338 | - . ' <th class="width5">' . _AM_XOOPSFAQ_CONTENTS_WEIGHT . '</th>' |
|
339 | - . ' <th class="left">' . _AM_XOOPSFAQ_CONTENTS_TITLE . '</th>' |
|
340 | - . ' <th class="left">' . _AM_XOOPSFAQ_CATEGORY_TITLE . '</th>' |
|
341 | - . ' <th>' . _AM_XOOPSFAQ_CONTENTS_PUBLISH . '</th>' |
|
342 | - . ' <th class="width20">' . _AM_XOOPSFAQ_ACTIONS . '</th>' |
|
343 | - . ' </tr>' |
|
344 | - . ' </thead>' |
|
345 | - . ' <tbody>'; |
|
334 | + . ' <thead>' |
|
335 | + . ' <tr class="center">' |
|
336 | + . ' <th class="width5">' . _AM_XOOPSFAQ_CONTENTS_ID . '</th>' |
|
337 | + . ' <th class="width5">' . _AM_XOOPSFAQ_CONTENTS_ACTIVE . '</th>' |
|
338 | + . ' <th class="width5">' . _AM_XOOPSFAQ_CONTENTS_WEIGHT . '</th>' |
|
339 | + . ' <th class="left">' . _AM_XOOPSFAQ_CONTENTS_TITLE . '</th>' |
|
340 | + . ' <th class="left">' . _AM_XOOPSFAQ_CATEGORY_TITLE . '</th>' |
|
341 | + . ' <th>' . _AM_XOOPSFAQ_CONTENTS_PUBLISH . '</th>' |
|
342 | + . ' <th class="width20">' . _AM_XOOPSFAQ_ACTIONS . '</th>' |
|
343 | + . ' </tr>' |
|
344 | + . ' </thead>' |
|
345 | + . ' <tbody>'; |
|
346 | 346 | if ($objects['count'] > 0) { |
347 | 347 | $tdClass = 0; |
348 | 348 | foreach ($objects['list'] as $object) { |
@@ -352,23 +352,23 @@ discard block |
||
352 | 352 | ++$tdClass; |
353 | 353 | $dispClass = ($tdClass % 1) ? 'even' : 'odd'; |
354 | 354 | $ret .= ' <tr class="center middle">' |
355 | - . ' <td class="' . $dispClass . '">' . $object->getVar('contents_id') . '</td>' |
|
356 | - . ' <td class="' . $dispClass . '">' . $object->getActiveIcon() . '</td>' |
|
357 | - . ' <td class="' . $dispClass . '">' . $object->getVar('contents_weight') . '</td>' |
|
358 | - . ' <td class="' . $dispClass . ' left">' . $thisContentTitle . '</td>' |
|
359 | - . ' <td class="' . $dispClass . ' left">' . $thisCatTitle . '</td>' |
|
360 | - . ' <td class="' . $dispClass . '">' . $object->getPublished(_SHORTDATESTRING) . '</td>' |
|
361 | - . ' <td class="' . $dispClass . '">'; |
|
355 | + . ' <td class="' . $dispClass . '">' . $object->getVar('contents_id') . '</td>' |
|
356 | + . ' <td class="' . $dispClass . '">' . $object->getActiveIcon() . '</td>' |
|
357 | + . ' <td class="' . $dispClass . '">' . $object->getVar('contents_weight') . '</td>' |
|
358 | + . ' <td class="' . $dispClass . ' left">' . $thisContentTitle . '</td>' |
|
359 | + . ' <td class="' . $dispClass . ' left">' . $thisCatTitle . '</td>' |
|
360 | + . ' <td class="' . $dispClass . '">' . $object->getPublished(_SHORTDATESTRING) . '</td>' |
|
361 | + . ' <td class="' . $dispClass . '">'; |
|
362 | 362 | $ret .= XoopsfaqUtility::renderIconLinks($buttons, 'contents_id', $object->getVar('contents_id')) |
363 | - . '</td>' |
|
364 | - . ' </tr>'; |
|
363 | + . '</td>' |
|
364 | + . ' </tr>'; |
|
365 | 365 | } |
366 | 366 | } else { |
367 | 367 | $ret .= ' <tr class="center"><td colspan="7" class="even">' . _AM_XOOPSFAQ_NOLISTING . '</td></tr>'; |
368 | 368 | } |
369 | 369 | $ret .= ' </tbody>' |
370 | 370 | // . ' <tr class="center"><td colspan="7" class="foot"> </td></tr>' |
371 | - . '</table>'; |
|
371 | + . '</table>'; |
|
372 | 372 | return $ret; |
373 | 373 | } |
374 | 374 |
@@ -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; |
@@ -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 |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | * @since:: File available since version 4.10 |
23 | 23 | */ |
24 | 24 | |
25 | - /** |
|
26 | - * XoopsfaqUtility |
|
27 | - * |
|
28 | - * Static utility class to provide common functionality |
|
29 | - * |
|
30 | - */ |
|
25 | + /** |
|
26 | + * XoopsfaqUtility |
|
27 | + * |
|
28 | + * Static utility class to provide common functionality |
|
29 | + * |
|
30 | + */ |
|
31 | 31 | class XoopsfaqUtility |
32 | 32 | { |
33 | 33 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | // Open the source directory to read in files |
172 | 172 | $iterator = new DirectoryIterator($src); |
173 | - foreach ($iterator as $fObj) { |
|
173 | + foreach ($iterator as $fObj) { |
|
174 | 174 | if ($fObj->isFile()) { |
175 | 175 | $filename = $fObj->getPathname(); |
176 | 176 | $fObj = null; // clear this iterator object to close the file |
@@ -294,9 +294,9 @@ discard block |
||
294 | 294 | } |
295 | 295 | $title = constant (htmlspecialchars(mb_strtoupper('_XO_LA_' . $iconName))); |
296 | 296 | $img = '<img src="' . Xmf\Module\Admin::iconUrl($iconName . '.' . $iconExt, '16') . '"' |
297 | - . ' title ="' . $title . '"' |
|
298 | - . ' alt = "' . $title . '"' |
|
299 | - . ' class="bnone middle">'; |
|
297 | + . ' title ="' . $title . '"' |
|
298 | + . ' alt = "' . $title . '"' |
|
299 | + . ' class="bnone middle">'; |
|
300 | 300 | $ret .= '<a href="' . $url . '"' . $extra . '>' . $img . '</a>'; |
301 | 301 | } |
302 | 302 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | static::rrmdir($fObj->getPathname()); |
183 | 183 | } |
184 | 184 | } |
185 | - $iterator = null; // clear iterator Obj to close file/directory |
|
185 | + $iterator = null; // clear iterator Obj to close file/directory |
|
186 | 186 | return rmdir($src); // remove the directory & return results |
187 | 187 | } |
188 | 188 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | static::rmove($fObj->getPathname(), $dest . '/' . $fObj->getFilename()); |
222 | 222 | } |
223 | 223 | } |
224 | - $iterator = null; // clear iterator Obj to close file/directory |
|
224 | + $iterator = null; // clear iterator Obj to close file/directory |
|
225 | 225 | return rmdir($src); // remove the directory & return results |
226 | 226 | } |
227 | 227 | |
@@ -255,11 +255,11 @@ discard block |
||
255 | 255 | |
256 | 256 | // Open the source directory to read in files |
257 | 257 | $iterator = new DirectoryIterator($src); |
258 | - foreach($iterator as $fObj) { |
|
259 | - if($fObj->isFile()) { |
|
258 | + foreach ($iterator as $fObj) { |
|
259 | + if ($fObj->isFile()) { |
|
260 | 260 | copy($fObj->getPathname(), $dest . '/' . $fObj->getFilename()); |
261 | - } else if(!$fObj->isDot() && $fObj->isDir()) { |
|
262 | - static::rcopy($fObj->getPathname(), $dest . '/' . $fObj-getFilename()); |
|
261 | + } else if (!$fObj->isDot() && $fObj->isDir()) { |
|
262 | + static::rcopy($fObj->getPathname(), $dest . '/' . $fObj - getFilename()); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | return true; |
@@ -280,19 +280,19 @@ discard block |
||
280 | 280 | xoops_loadLanguage('admin', $moduleDirName); |
281 | 281 | $ret = ''; |
282 | 282 | if (null !== $value) { |
283 | - foreach($icon_array as $_op => $icon) { |
|
283 | + foreach ($icon_array as $_op => $icon) { |
|
284 | 284 | if (false === strpos($icon, '.')) { |
285 | 285 | $iconName = $icon; |
286 | 286 | $iconExt = 'png'; |
287 | 287 | } else { |
288 | - $iconName = substr($icon, 0, strlen($icon)-strrchr($icon, '.')); |
|
288 | + $iconName = substr($icon, 0, strlen($icon) - strrchr($icon, '.')); |
|
289 | 289 | $iconExt = substr(strrchr($icon, '.'), 1); |
290 | 290 | } |
291 | 291 | $url = (!is_numeric($_op)) ? $_op . '?' . $param . '=' . $value : xoops_getenv('PHP_SELF') . '?op=' . $iconName . '&' . $param . '=' . $value; |
292 | 292 | if (null !== $extra) { |
293 | 293 | $url .= ' ' . $extra; |
294 | 294 | } |
295 | - $title = constant (htmlspecialchars(mb_strtoupper('_XO_LA_' . $iconName))); |
|
295 | + $title = constant(htmlspecialchars(mb_strtoupper('_XO_LA_' . $iconName))); |
|
296 | 296 | $img = '<img src="' . Xmf\Module\Admin::iconUrl($iconName . '.' . $iconExt, '16') . '"' |
297 | 297 | . ' title ="' . $title . '"' |
298 | 298 | . ' alt = "' . $title . '"' |
@@ -21,9 +21,7 @@ |
||
21 | 21 | * @since File available since version 1.25 |
22 | 22 | */ |
23 | 23 | //use Xmf\Debug; |
24 | -use Xmf\Database\Tables; |
|
25 | 24 | use Xmf\Module\Helper; |
26 | -use Xmf\Request; |
|
27 | 25 | |
28 | 26 | /** |
29 | 27 | * @internal {Make sure you PROTECT THIS FILE} |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | || !($GLOBALS['xoopsUser'] instanceof XoopsUser) |
34 | 34 | || !($GLOBALS['xoopsUser']->isAdmin())) |
35 | 35 | { |
36 | - exit("Restricted access" . PHP_EOL); |
|
36 | + exit("Restricted access" . PHP_EOL); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | // been relocated to ./assets |
94 | 94 | //---------------------------------------------------------------- |
95 | 95 | $old_directories = array($xfHelper->path('css/'), |
96 | - $xfHelper->path('js/'), |
|
97 | - $xfHelper->path('images/') |
|
96 | + $xfHelper->path('js/'), |
|
97 | + $xfHelper->path('images/') |
|
98 | 98 | ); |
99 | 99 | foreach ($old_directories as $old_dir) { |
100 | 100 | $dirInfo = new SplFileInfo($old_dir); |
@@ -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)); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $totalLimit = (int)$limit - $catCount; |
71 | 71 | foreach ($catArray as $cId => $cat) { |
72 | 72 | $ret[] = array ('image' => 'assets/images/folder.png', |
73 | - 'link' => $xfHelper->url('index.php?cat_id=' . $cId), |
|
73 | + 'link' => $xfHelper->url('index.php?cat_id=' . $cId), |
|
74 | 74 | 'title' => $cat['category_title'], |
75 | 75 | ); |
76 | 76 | } |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | $contentArray = $xfFaqHandler->getAll($criteria, $contentFields, false); |
101 | 101 | foreach ($contentArray as $content) { |
102 | 102 | $ret[] = array ('image' => 'assets/images/question2.gif', |
103 | - 'link' => $xfHelper->url('index.php?cat_id=' . $content['contents_cid'] . '#q' . $content['contents_id']), |
|
103 | + 'link' => $xfHelper->url('index.php?cat_id=' . $content['contents_cid'] . '#q' . $content['contents_id']), |
|
104 | 104 | 'title' => $content['contents_title'], |
105 | - 'time' => $content['contents_publish'], |
|
105 | + 'time' => $content['contents_publish'], |
|
106 | 106 | ); |
107 | 107 | } |
108 | 108 | unset($contentArray); |
@@ -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'], |
@@ -33,8 +33,8 @@ |
||
33 | 33 | $retVal = array() ; |
34 | 34 | foreach ($catList as $id=>$title){ |
35 | 35 | $retVal['parent'][] = array('id' => $id, |
36 | - 'title' => $myts->htmlSpecialChars($title), |
|
37 | - 'url' => $xfHelper->url('index.php?cat_id=' . $id) |
|
36 | + 'title' => $myts->htmlSpecialChars($title), |
|
37 | + 'url' => $xfHelper->url('index.php?cat_id=' . $id) |
|
38 | 38 | ); |
39 | 39 | } |
40 | 40 | return $retVal; |
@@ -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) |
@@ -29,7 +29,7 @@ |
||
29 | 29 | || !($GLOBALS['xoopsUser'] instanceof XoopsUser) |
30 | 30 | || !($GLOBALS['xoopsUser']->isAdmin())) |
31 | 31 | { |
32 | - exit("Restricted access" . PHP_EOL); |
|
32 | + exit("Restricted access" . PHP_EOL); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | foreach ($contentObjs as $contentObj) { |
57 | 57 | $retVal[] = array ('image' => '', |
58 | - 'title' => $contentObj->getVar('contents_title'), |
|
58 | + 'title' => $contentObj->getVar('contents_title'), |
|
59 | 59 | 'link' => $contentObj->getVar('contents_contents'), |
60 | 60 | 'time' => $contentObj->getVar('contents_publish'), |
61 | 61 | 'desc' => '', |
@@ -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'), |
@@ -74,15 +74,15 @@ |
||
74 | 74 | if (is_object($obj) && $obj instanceof XoopsfaqContents) { |
75 | 75 | $contents_publish = strtotime(Request::getString('contents_publish', time(), 'POST')); |
76 | 76 | $obj->setVars(array('contents_cid' => Request::getInt('contents_cid', XoopsfaqConstants::DEFAULT_CATEGORY, 'POST'), |
77 | - 'contents_title' => Request::getString('contents_title', '', 'POST'), |
|
78 | - 'contents_contents' => $contents_contents, |
|
79 | - 'contents_weight' => Request::getInt('contents_weight', XoopsfaqConstants::DEFAULT_WEIGHT, 'POST'), |
|
80 | - 'contents_active' => Request::getInt('contents_active', XoopsfaqConstants::ACTIVE, 'POST'), |
|
77 | + 'contents_title' => Request::getString('contents_title', '', 'POST'), |
|
78 | + 'contents_contents' => $contents_contents, |
|
79 | + 'contents_weight' => Request::getInt('contents_weight', XoopsfaqConstants::DEFAULT_WEIGHT, 'POST'), |
|
80 | + 'contents_active' => Request::getInt('contents_active', XoopsfaqConstants::ACTIVE, 'POST'), |
|
81 | 81 | 'contents_publish' => $contents_publish, |
82 | - 'dohtml' => isset($_POST['dohtml']) ? XoopsfaqConstants::SET : XoopsfaqConstants::NOTSET, |
|
82 | + 'dohtml' => isset($_POST['dohtml']) ? XoopsfaqConstants::SET : XoopsfaqConstants::NOTSET, |
|
83 | 83 | 'dosmiley' => isset($_POST['dosmiley']) ? XoopsfaqConstants::SET : XoopsfaqConstants::NOTSET, |
84 | - 'doxcode' => isset($_POST['doxcode']) ? XoopsfaqConstants::SET : XoopsfaqConstants::NOTSET, |
|
85 | - 'doimage' => isset($_POST['doimage']) ? XoopsfaqConstants::SET : XoopsfaqConstants::NOTSET, |
|
84 | + 'doxcode' => isset($_POST['doxcode']) ? XoopsfaqConstants::SET : XoopsfaqConstants::NOTSET, |
|
85 | + 'doimage' => isset($_POST['doimage']) ? XoopsfaqConstants::SET : XoopsfaqConstants::NOTSET, |
|
86 | 86 | 'dobr' => isset($_POST['dobr']) ? XoopsfaqConstants::SET : XoopsfaqConstants::NOTSET) |
87 | 87 | ); |
88 | 88 | $ret = $xfFaqHandler->insert($obj, true); |
@@ -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'); |