Completed
Branch master (c92e39)
by Michael
02:32
created
admin/mygrouppermform.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 . '&nbsp;-', $parentIds);
422
+                $this->renderOptionTree($tree, $this->_optionTree[$child], $prefix.'&nbsp;-', $parentIds);
423 423
             }
424 424
         }
425 425
     }
Please login to merge, or discard this patch.
admin/menu.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,45 +18,45 @@
 block discarded – undo
18 18
 }
19 19
 $adminObject = \Xmf\Module\Admin::getInstance();
20 20
 
21
-$pathIcon32    = \Xmf\Module\Admin::menuIconPath('');
21
+$pathIcon32 = \Xmf\Module\Admin::menuIconPath('');
22 22
 //$pathModIcon32 = $moduleHelper->getModule()->getInfo('modicons32');
23 23
 
24 24
 $moduleHelper->loadLanguage('modinfo');
25 25
 
26
-$adminObject              = array();
26
+$adminObject = array();
27 27
 $i                      = 0;
28 28
 $adminmenu[$i]['title'] = _AM_MODULEADMIN_HOME;
29 29
 $adminmenu[$i]['link']  = 'admin/index.php';
30
-$adminmenu[$i]['icon']  = $pathIcon32 . '/home.png';
30
+$adminmenu[$i]['icon']  = $pathIcon32.'/home.png';
31 31
 ++$i;
32 32
 $adminmenu[$i]['title'] = _MI_SF_ADMENU1;
33 33
 $adminmenu[$i]['link']  = 'admin/main.php';
34
-$adminmenu[$i]['icon']  = $pathIcon32 . '/manage.png';
34
+$adminmenu[$i]['icon']  = $pathIcon32.'/manage.png';
35 35
 
36 36
 ++$i;
37 37
 $adminmenu[$i]['title'] = _MI_SF_ADMENU2;
38 38
 $adminmenu[$i]['link']  = 'admin/category.php';
39
-$adminmenu[$i]['icon']  = $pathIcon32 . '/category.png';
39
+$adminmenu[$i]['icon']  = $pathIcon32.'/category.png';
40 40
 ++$i;
41 41
 $adminmenu[$i]['title'] = _MI_SF_ADMENU3;
42 42
 $adminmenu[$i]['link']  = 'admin/faq.php';
43
-$adminmenu[$i]['icon']  = $pathIcon32 . '/search.png';
43
+$adminmenu[$i]['icon']  = $pathIcon32.'/search.png';
44 44
 ++$i;
45 45
 $adminmenu[$i]['title'] = _MI_SF_ADMENU4;
46 46
 $adminmenu[$i]['link']  = 'admin/question.php';
47
-$adminmenu[$i]['icon']  = $pathIcon32 . '/faq.png';
47
+$adminmenu[$i]['icon']  = $pathIcon32.'/faq.png';
48 48
 ++$i;
49 49
 $adminmenu[$i]['title'] = _MI_SF_ADMENU5;
50 50
 $adminmenu[$i]['link']  = 'admin/permissions.php';
51
-$adminmenu[$i]['icon']  = $pathIcon32 . '/permissions.png';
51
+$adminmenu[$i]['icon']  = $pathIcon32.'/permissions.png';
52 52
 ++$i;
53 53
 $adminmenu[$i]['title'] = _MI_SF_ADMENU8;
54 54
 $adminmenu[$i]['link']  = 'admin/import.php';
55
-$adminmenu[$i]['icon']  = $pathIcon32 . '/download.png';
55
+$adminmenu[$i]['icon']  = $pathIcon32.'/download.png';
56 56
 ++$i;
57 57
 $adminmenu[$i]['title'] = _AM_MODULEADMIN_ABOUT;
58 58
 $adminmenu[$i]['link']  = 'admin/about.php';
59
-$adminmenu[$i]['icon']  = $pathIcon32 . '/about.png';
59
+$adminmenu[$i]['icon']  = $pathIcon32.'/about.png';
60 60
 //++$i;
61 61
 //$adminmenu[$i]['title'] = _AM_MODULEADMIN_ABOUT;
62 62
 //$adminmenu[$i]["link"]  = "admin/about2.php";
Please login to merge, or discard this patch.
admin/question.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>&nbsp;" . $collapsableBar_title . '</h3>';
68
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;".$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
 block discarded – undo
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>&nbsp;" . _AM_SF_CREATEQUESTION . '</h3>';
81
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;"._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
 block discarded – undo
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&amp;faqid=" . $faqid . "'\"");
155
+        $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&amp;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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>&nbsp;" . _AM_SF_OPENED_TITLE . '</h3>';
313
+        echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;"._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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
400 400
         break;
401 401
 }
402 402
 
403
-require_once __DIR__ . '/admin_footer.php';
403
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/wffaq.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  *
11 11
  */
12 12
 
13
-require_once __DIR__ . '/admin_header.php';
13
+require_once __DIR__.'/admin_header.php';
14 14
 
15 15
 $importFromModuleName = 'WF-FAQ';
16 16
 $scriptname           = 'wffaq.php';
@@ -22,32 +22,32 @@  discard block
 block discarded – undo
22 22
 }
23 23
 
24 24
 if ($op === 'start') {
25
-    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
25
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
26 26
     xoops_cp_header();
27
-    $result = $xoopsDB->query('SELECT count(*) FROM ' . $xoopsDB->prefix('faqcategories'));
27
+    $result = $xoopsDB->query('SELECT count(*) FROM '.$xoopsDB->prefix('faqcategories'));
28 28
     list($totalCat) = $xoopsDB->fetchRow($result);
29 29
 
30 30
     sf_collapsableBar('bottomtable', 'bottomtableicon');
31
-    echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . sprintf(_AM_SF_IMPORT_FROM,
32
-                                                                                                                                                                $importFromModuleName) . '</h3>';
31
+    echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;".sprintf(_AM_SF_IMPORT_FROM,
32
+                                                                                                                                                                $importFromModuleName).'</h3>';
33 33
     echo "<div id='bottomtable'>";
34 34
 
35 35
     if ($totalCat == 0) {
36
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_NO_CATEGORY . '</span>';
36
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_NO_CATEGORY.'</span>';
37 37
     } else {
38
-        include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
38
+        include_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
39 39
 
40
-        $result = $xoopsDB->query('SELECT count(*) FROM ' . $xoopsDB->prefix('faqtopics'));
40
+        $result = $xoopsDB->query('SELECT count(*) FROM '.$xoopsDB->prefix('faqtopics'));
41 41
         list($totalFAQ) = $xoopsDB->fetchRow($result);
42 42
 
43 43
         if ($totalFAQ == 0) {
44
-            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat) . '</span>';
44
+            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat).'</span>';
45 45
         } else {
46 46
             echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'
47 47
                  . sprintf(_AM_SF_IMPORT_MODULE_FOUND, $importFromModuleName, $totalCat, $totalFAQ)
48 48
                  . '</span>';
49 49
 
50
-            $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL . '/modules/smartfaq/admin/' . $scriptname);
50
+            $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL.'/modules/smartfaq/admin/'.$scriptname);
51 51
 
52 52
             // Categories to be imported
53 53
             $cat_cbox = new XoopsFormCheckBox(sprintf(_AM_SF_IMPORT_CATEGORIES, $importFromModuleName), 'import_category', -1);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             ob_end_clean();
70 70
 
71 71
             // Auto-Approve
72
-            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''));
72
+            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''));
73 73
 
74 74
             // Submitted and answered by
75 75
             $memberHandler = xoops_getHandler('member');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             $form->addElement($user_select);
83 83
 
84 84
             // Q&As can be commented?
85
-            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''));
85
+            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''));
86 86
             $group_list      = $memberHandler->getGroupList();
87 87
             $groups_selected = array();
88 88
             $groups_checkbox = new XoopsFormCheckBox(_AM_SF_IMPORT_PERMISSIONS, 'groups_read');
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
         redirect_header($scriptname, 2, _AM_SF_NOCATSELECTED);
112 112
     }
113 113
 
114
-    require_once __DIR__ . '/admin_header.php';
114
+    require_once __DIR__.'/admin_header.php';
115 115
     xoops_cp_header();
116 116
 
117 117
     sf_collapsableBar('bottomtable', 'bottomtableicon');
118
-    echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . sprintf(_AM_SF_IMPORT_FROM,
119
-                                                                                                                                                                $importFromModuleName) . '</h3>';
118
+    echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;".sprintf(_AM_SF_IMPORT_FROM,
119
+                                                                                                                                                                $importFromModuleName).'</h3>';
120 120
     echo "<div id='bottomtable'>";
121
-    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_RESULT . '</span>';
121
+    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_RESULT.'</span>';
122 122
 
123 123
     $cnt_imported_cat = 0;
124 124
     $cnt_imported_faq = 0;
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     echo "Can Comment: $cancomment<br>";
147 147
     echo "Auto aprove: $autoaprove<br>";*/
148 148
 
149
-    $resultCat = $xoopsDB->query('select * from ' . $xoopsDB->prefix('faqcategories') . " where catID in ($import_category_list) order by weight");
149
+    $resultCat = $xoopsDB->query('select * from '.$xoopsDB->prefix('faqcategories')." where catID in ($import_category_list) order by weight");
150 150
 
151 151
     while ($arrCat = $xoopsDB->fetchArray($resultCat)) {
152 152
         extract($arrCat, EXTR_PREFIX_ALL, 'wfc');
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $categoryObj->setVar('description', $wfc_description);
162 162
 
163 163
         if (!$categoryObj->store(false)) {
164
-            echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name) . '<br>';
164
+            echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name).'<br>';
165 165
             continue;
166 166
         }
167 167
 
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
 
170 170
         ++$cnt_imported_cat;
171 171
 
172
-        echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $wfc_name) . "<br\>";
172
+        echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $wfc_name)."<br\>";
173 173
 
174
-        $resultFAQ = $xoopsDB->query('select * from ' . $xoopsDB->prefix('faqtopics') . " where catID=$wfc_catID order by weight");
174
+        $resultFAQ = $xoopsDB->query('select * from '.$xoopsDB->prefix('faqtopics')." where catID=$wfc_catID order by weight");
175 175
         while ($arrFAQ = $xoopsDB->fetchArray($resultFAQ)) {
176 176
             extract($arrFAQ, EXTR_PREFIX_ALL, 'wft');
177 177
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
             $faqObj->setVar('exacturl', 0);
204 204
 
205 205
             if (!$faqObj->store(false)) {
206
-                echo sprintf('  ' . _AM_SF_IMPORT_FAQ_ERROR, $wft_question) . '<br>';
206
+                echo sprintf('  '._AM_SF_IMPORT_FAQ_ERROR, $wft_question).'<br>';
207 207
                 continue;
208 208
             } else {
209 209
                 $answerObj->setVar('faqid', $faqObj->faqid());
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
                 $answerObj->setVar('status', _SF_AN_STATUS_APPROVED);
213 213
 
214 214
                 if (!$answerObj->store()) {
215
-                    echo sprintf('  ' . _AM_SF_IMPORT_FAQ_ERROR) . '<br>';
215
+                    echo sprintf('  '._AM_SF_IMPORT_FAQ_ERROR).'<br>';
216 216
                     continue;
217 217
                 } else {
218
-                    echo '&nbsp;&nbsp;' . sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)) . '<br>';
218
+                    echo '&nbsp;&nbsp;'.sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)).'<br>';
219 219
                     ++$cnt_imported_faq;
220 220
                 }
221 221
             }
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
     }
226 226
 
227 227
     echo 'Done.<br>';
228
-    echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat) . '<br>';
229
-    echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq) . '<br>';
228
+    echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat).'<br>';
229
+    echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq).'<br>';
230 230
 
231 231
     exit();
232 232
 }
Please login to merge, or discard this patch.
admin/admin_footer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
  * @author       XOOPS Development Team
18 18
  */
19 19
 
20
-$pathIcon32      = \Xmf\Module\Admin::iconUrl('', 32);
20
+$pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32);
21 21
 echo "<div class='adminfooter'>\n"
22 22
      . "  <div style='text-align: center;'>\n"
23 23
      . "    <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
Please login to merge, or discard this patch.
admin/admin_header.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @author       XOOPS Development Team
18 18
  */
19 19
 
20
-include_once __DIR__ . '/../../../include/cp_header.php';
20
+include_once __DIR__.'/../../../include/cp_header.php';
21 21
 //include_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php');
22 22
 
23 23
 //require __DIR__ . '/../class/utility.php';
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 }
29 29
 
30 30
 $path = dirname(dirname(dirname(__DIR__)));
31
-include_once $path . '/kernel/module.php';
32
-include_once $path . '/class/xoopstree.php';
33
-include_once $path . '/class/xoopslists.php';
34
-include_once $path . '/class/pagenav.php';
35
-include_once $path . '/class/xoopsformloader.php';
31
+include_once $path.'/kernel/module.php';
32
+include_once $path.'/class/xoopstree.php';
33
+include_once $path.'/class/xoopslists.php';
34
+include_once $path.'/class/pagenav.php';
35
+include_once $path.'/class/xoopsformloader.php';
36 36
 
37
-include_once __DIR__ . '/../include/functions.php';
38
-include_once __DIR__ . '/../class/category.php';
39
-include_once __DIR__ . '/../class/faq.php';
40
-include_once __DIR__ . '/../class/answer.php';
37
+include_once __DIR__.'/../include/functions.php';
38
+include_once __DIR__.'/../class/category.php';
39
+include_once __DIR__.'/../class/faq.php';
40
+include_once __DIR__.'/../class/answer.php';
41 41
 //require __DIR__ . '/../class/utility.php';
42 42
 //require_once __DIR__ . '/../include/common.php';
43 43
 
Please login to merge, or discard this patch.
admin/import.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
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
 $op = 'none';
12 12
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     case 'importExecute':
24 24
 
25 25
         $importfile      = isset($_POST['importfile']) ? $_POST['importfile'] : 'nonselected';
26
-        $importfile_path = XOOPS_ROOT_PATH . '/modules/smartfaq/admin/' . $importfile . '.php';
26
+        $importfile_path = XOOPS_ROOT_PATH.'/modules/smartfaq/admin/'.$importfile.'.php';
27 27
         if (!file_exists($importfile_path)) {
28 28
             $errs[] = sprintf(_AM_SF_IMPORT_FILE_NOT_FOUND, $importfile_path);
29 29
             $error  = true;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             include_once $importfile_path;
32 32
         }
33 33
         foreach ($msgs as $m) {
34
-            echo $m . '<br>';
34
+            echo $m.'<br>';
35 35
         }
36 36
         echo '<br>';
37 37
         $endMsg = _AM_SF_IMPORT_SUCCESS;
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
         echo $endMsg;
43 43
         echo '<br><br>';
44
-        echo "<a href='import.php'>" . _AM_SF_IMPORT_BACK . '</a>';
44
+        echo "<a href='import.php'>"._AM_SF_IMPORT_BACK.'</a>';
45 45
         echo '<br><br>';
46 46
         break;
47 47
 
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
         xoops_cp_header();
54 54
 
55 55
         sf_collapsableBar('bottomtable', 'bottomtableicon');
56
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SF_IMPORT_TITLE . '</h3>';
56
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;"._AM_SF_IMPORT_TITLE.'</h3>';
57 57
         echo "<div id='bottomtable'>";
58
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_INFO . '</span>';
58
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_INFO.'</span>';
59 59
 
60 60
         global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts;
61 61
 
62
-        include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
62
+        include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
63 63
 
64 64
         /** @var XoopsModuleHandler $moduleHandler */
65 65
         $moduleHandler = xoops_getHandler('module');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $sform->display();
100 100
             unset($hidden);
101 101
         } else {
102
-            echo '<span style="color: #567; margin: 3px 0 12px 0; font-weight: bold; font-size: small; display: block; ">' . _AM_SF_IMPORT_NO_MODULE . '</span>';
102
+            echo '<span style="color: #567; margin: 3px 0 12px 0; font-weight: bold; font-size: small; display: block; ">'._AM_SF_IMPORT_NO_MODULE.'</span>';
103 103
         }
104 104
 
105 105
         // End of collapsable bar
@@ -108,4 +108,4 @@  discard block
 block discarded – undo
108 108
         break;
109 109
 }
110 110
 
111
-require_once __DIR__ . '/admin_footer.php';
111
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/faq.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>&nbsp;" . $collapsableBar_title . '</h3>';
143
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;".$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
 block discarded – undo
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>&nbsp;" . _AM_SF_CREATESMARTFAQ . '</h3>';
159
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;"._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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
580 580
         break;
581 581
 }
582 582
 
583
-require_once __DIR__ . '/admin_footer.php';
583
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
blocks/faqs_recent_questions.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 function b_faqs_recent_questions_show($options)
13 13
 {
14
-    include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
14
+    include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
15 15
 
16 16
     $block = array();
17 17
 
@@ -60,44 +60,44 @@  discard block
 block discarded – undo
60 60
  */
61 61
 function b_faqs_recent_questions_edit($options)
62 62
 {
63
-    include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
63
+    include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
64 64
 
65 65
     $form = sf_createCategorySelect($options[0]);
66 66
 
67
-    $form .= '&nbsp;<br>' . _MB_SF_ORDER . "&nbsp;<select name='options[]'>";
67
+    $form .= '&nbsp;<br>'._MB_SF_ORDER."&nbsp;<select name='options[]'>";
68 68
 
69 69
     $form .= "<option value='datesub'";
70 70
     if ($options[1] === 'datesub') {
71 71
         $form .= ' selected';
72 72
     }
73
-    $form .= '>' . _MB_SF_DATE . "</option>\n";
73
+    $form .= '>'._MB_SF_DATE."</option>\n";
74 74
 
75 75
     $form .= "<option value='counter'";
76 76
     if ($options[1] === 'counter') {
77 77
         $form .= ' selected';
78 78
     }
79
-    $form .= '>' . _MB_SF_HITS . "</option>\n";
79
+    $form .= '>'._MB_SF_HITS."</option>\n";
80 80
 
81 81
     $form .= "<option value='weight'";
82 82
     if ($options[1] === 'weight') {
83 83
         $form .= ' selected';
84 84
     }
85
-    $form .= '>' . _MB_SF_WEIGHT . "</option>\n";
85
+    $form .= '>'._MB_SF_WEIGHT."</option>\n";
86 86
 
87 87
     $form .= "</select>\n";
88 88
 
89
-    $form .= '&nbsp;' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "' />&nbsp;" . _MB_SF_QUESTIONS . '';
90
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[3] . "' />&nbsp;" . _MB_SF_LENGTH . '';
89
+    $form .= '&nbsp;'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[2]."' />&nbsp;"._MB_SF_QUESTIONS.'';
90
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[3]."' />&nbsp;"._MB_SF_LENGTH.'';
91 91
 
92
-    $form .= '<br>' . _MB_SF_SHOW_DATE . "&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
92
+    $form .= '<br>'._MB_SF_SHOW_DATE."&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
93 93
     if ($options[4] == 1) {
94 94
         $form .= ' checked';
95 95
     }
96
-    $form .= ' />&nbsp;' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'";
96
+    $form .= ' />&nbsp;'._YES."<input type='radio' id='options[]' name='options[]' value='0'";
97 97
     if ($options[4] == 0) {
98 98
         $form .= ' checked';
99 99
     }
100
-    $form .= ' />&nbsp;' . _NO . '';
100
+    $form .= ' />&nbsp;'._NO.'';
101 101
 
102 102
     return $form;
103 103
 }
Please login to merge, or discard this patch.