@@ -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 | } |
@@ -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 |
@@ -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 |
@@ -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); |
@@ -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); |
@@ -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; |
@@ -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' => '', |
@@ -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); |