Passed
Push — master ( 2744eb...81ba93 )
by Michael
02:46
created
class/Answer.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             $attachment_save = base64_encode(serialize($this->attachment_array));
103 103
         }
104 104
         $this->setVar('attachment', $attachment_save);
105
-        $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid');
105
+        $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('smartfaq_answers').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachment_save).' WHERE post_id = '.$this->getVar('answerid');
106 106
         if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
107 107
             //xoops_error($GLOBALS["xoopsDB"]->error());
108 108
             return false;
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 
136 136
         foreach ($attach_old as $key => $attach) {
137 137
             if (in_array($key, $attach_array)) {
138
-                @unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attach['name_saved']);
139
-                @unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/thumbs/' . $attach['name_saved']); // delete thumbnails
138
+                @unlink(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$attach['name_saved']);
139
+                @unlink(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/thumbs/'.$attach['name_saved']); // delete thumbnails
140 140
                 continue;
141 141
             }
142 142
             $this->attachment_array[$key] = $attach;
@@ -195,24 +195,24 @@  discard block
 block discarded – undo
195 195
         if (is_array($attachments) && count($attachments) > 0) {
196 196
             $iconHandler = sf_getIconHandler();
197 197
             $mime_path   = $iconHandler->getPath('mime');
198
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/include/functions.image.php';
198
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/include/functions.image.php';
199 199
             $image_extensions = ['jpg', 'jpeg', 'gif', 'png', 'bmp']; // need improve !!!
200
-            $post_attachment  .= '<br><strong>' . _MD_ATTACHMENT . '</strong>:';
200
+            $post_attachment  .= '<br><strong>'._MD_ATTACHMENT.'</strong>:';
201 201
             $post_attachment  .= '<br><hr size="1" noshade="noshade"><br>';
202 202
             foreach ($attachments as $key => $att) {
203 203
                 $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.');
204 204
                 $filetype       = $file_extension;
205
-                if (file_exists(XOOPS_ROOT_PATH . '/' . $mime_path . '/' . $filetype . '.gif')) {
206
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif';
205
+                if (file_exists(XOOPS_ROOT_PATH.'/'.$mime_path.'/'.$filetype.'.gif')) {
206
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif';
207 207
                 } else {
208
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif';
208
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif';
209 209
                 }
210
-                $file_size = @filesize(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $att['name_saved']);
211
-                $file_size = number_format($file_size / 1024, 2) . ' KB';
210
+                $file_size = @filesize(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$att['name_saved']);
211
+                $file_size = number_format($file_size / 1024, 2).' KB';
212 212
                 if ($helper->getConfig('media_allowed') && in_array(strtolower($file_extension), $image_extensions)) {
213
-                    $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '"><strong>&nbsp; ' . $att['name_display'] . '</strong> <small>(' . $file_size . ')</small>';
214
-                    $post_attachment .= '<br>' . sf_attachmentImage($att['name_saved']);
215
-                    $isDisplayed     = true;
213
+                    $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'"><strong>&nbsp; '.$att['name_display'].'</strong> <small>('.$file_size.')</small>';
214
+                    $post_attachment .= '<br>'.sf_attachmentImage($att['name_saved']);
215
+                    $isDisplayed = true;
216 216
                 } else {
217 217
                     global $xoopsUser;
218 218
                     if (empty($helper->getConfig('show_userattach'))) {
@@ -369,9 +369,9 @@  discard block
 block discarded – undo
369 369
         $tags                  = [];
370 370
         $tags['MODULE_NAME']   = $myts->displayTarea($smartModule->getVar('name'));
371 371
         $tags['FAQ_NAME']      = $faqObj->question();
372
-        $tags['FAQ_URL']       = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $faqObj->faqid();
372
+        $tags['FAQ_URL']       = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$faqObj->faqid();
373 373
         $tags['CATEGORY_NAME'] = $faqObj->getCategoryName();
374
-        $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $faqObj->categoryid();
374
+        $tags['CATEGORY_URL']  = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$faqObj->categoryid();
375 375
         $tags['FAQ_QUESTION']  = $faqObj->question();
376 376
 
377 377
         // TODO : Not sure about the 'formpreview' ...
Please login to merge, or discard this patch.
class/Utility.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 break;
72 72
 
73 73
             case 'inside':
74
-                return XOOPS_URL . '/modules/smartfaq/doc/';
74
+                return XOOPS_URL.'/modules/smartfaq/doc/';
75 75
                 break;
76 76
 
77 77
             case 'custom':
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $ret = '';
90 90
         foreach ($errors as $key => $value) {
91
-            $ret .= '<br> - ' . $value;
91
+            $ret .= '<br> - '.$value;
92 92
         }
93 93
 
94 94
         return $ret;
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
             $spaces .= '--';
113 113
         }
114 114
 
115
-        $ret .= "<option value='" . $categoryObj->categoryid() . "'";
115
+        $ret .= "<option value='".$categoryObj->categoryid()."'";
116 116
         if ($selectedid == $categoryObj->categoryid()) {
117 117
             $ret .= ' selected';
118 118
         }
119
-        $ret .= '>' . $spaces . $categoryObj->name() . "</option>\n";
119
+        $ret .= '>'.$spaces.$categoryObj->name()."</option>\n";
120 120
 
121
-        $subCategoriesObj =& $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
121
+        $subCategoriesObj = & $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
122 122
         if (count($subCategoriesObj) > 0) {
123 123
             ++$level;
124 124
             foreach ($subCategoriesObj as $catID => $subCategoryObj) {
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public static function createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true)
139 139
     {
140
-        $ret = '' . _MB_SF_SELECTCAT . "&nbsp;<select name='options[]'>";
140
+        $ret = ''._MB_SF_SELECTCAT."&nbsp;<select name='options[]'>";
141 141
         if ($allCatOption) {
142 142
             $ret .= "<option value='0'";
143
-            $ret .= '>' . _MB_SF_ALLCAT . "</option>\n";
143
+            $ret .= '>'._MB_SF_ALLCAT."</option>\n";
144 144
         }
145 145
 
146 146
         // Creating the category handler object
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
     {
210 210
         $smartModule = self::getModuleInfo();
211 211
 
212
-        $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . '';
212
+        $modfootertxt = 'Module '.$smartModule->getInfo('name').' - Version '.$smartModule->getInfo('version').'';
213 213
 
214
-        $modfooter = "<a href='" . $smartModule->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/sfcssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'></a>";
214
+        $modfooter = "<a href='".$smartModule->getInfo('support_site_url')."' target='_blank'><img src='".XOOPS_URL."/modules/smartfaq/assets/images/sfcssbutton.gif' title='".$modfootertxt."' alt='".$modfootertxt."'></a>";
215 215
 
216 216
         return $modfooter;
217 217
     }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         $module_id   = $smartModule->getVar('mid');
234 234
 
235 235
         if (!empty($xoopsUser)) {
236
-            $groups =& $xoopsUser->getGroups();
236
+            $groups = & $xoopsUser->getGroups();
237 237
             $result = in_array(XOOPS_GROUP_ADMIN, $groups) || $xoopsUser->isAdmin($module_id);
238 238
         }
239 239
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
         $gpermHandler = xoops_getHandler('groupperm');
309 309
 
310
-        $sql    = 'SELECT faqid FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE categoryid = '$categoryid' ";
310
+        $sql    = 'SELECT faqid FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE categoryid = '$categoryid' ";
311 311
         $result = $xoopsDB->queryF($sql);
312 312
 
313 313
         if ($GLOBALS['xoopsDB']->getRowsNum($result) > 0) {
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         $ret = [];
423 423
         global $xoopsDB;
424 424
 
425
-        $result = $xoopsDB->queryF('SELECT * FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE faqid = '$faqid'");
425
+        $result = $xoopsDB->queryF('SELECT * FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE faqid = '$faqid'");
426 426
         $ret    = $xoopsDB->fetchArray($result);
427 427
 
428 428
         return $ret;
@@ -439,31 +439,31 @@  discard block
 block discarded – undo
439 439
     // TODO : Move this to the Smartfaq\Faq class
440 440
     public static function getAdminLinks($faqid = 0, $open = false)
441 441
     {
442
-        global $xoopsUser, $xoopsModule,  $xoopsConfig;
442
+        global $xoopsUser, $xoopsModule, $xoopsConfig;
443 443
         /** @var Smartfaq\Helper $helper */
444 444
         $helper = Smartfaq\Helper::getInstance();
445 445
 
446 446
         $adminLinks = '';
447
-        $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/';
447
+        $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/';
448 448
         $page       = $open ? 'question.php' : 'faq.php';
449 449
         if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
450 450
             // Edit button
451
-            $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=mod&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/edit.gif'" . " title='" . _MD_SF_EDIT . "' alt='" . _MD_SF_EDIT . "'></a>";
451
+            $adminLinks .= "<a href='".$modulePath."admin/$page?op=mod&amp;faqid=".$faqid."'><img src='".$modulePath."assets/images/links/edit.gif'"." title='"._MD_SF_EDIT."' alt='"._MD_SF_EDIT."'></a>";
452 452
             $adminLinks .= ' ';
453 453
             // Delete button
454
-            $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=del&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/delete.gif'" . " title='" . _MD_SF_DELETE . "' alt='" . _MD_SF_DELETE . "'></a>";
454
+            $adminLinks .= "<a href='".$modulePath."admin/$page?op=del&amp;faqid=".$faqid."'><img src='".$modulePath."assets/images/links/delete.gif'"." title='"._MD_SF_DELETE."' alt='"._MD_SF_DELETE."'></a>";
455 455
             $adminLinks .= ' ';
456 456
         }
457 457
         // Print button
458
-        $adminLinks .= "<a href='" . $modulePath . 'print.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/print.gif' title='" . _MD_SF_PRINT . "' alt='" . _MD_SF_PRINT . "'></a>";
458
+        $adminLinks .= "<a href='".$modulePath.'print.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/print.gif' title='"._MD_SF_PRINT."' alt='"._MD_SF_PRINT."'></a>";
459 459
         $adminLinks .= ' ';
460 460
         // Email button
461
-        $maillink   = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . $modulePath . 'faq.php?faqid=' . $faqid;
462
-        $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'></a>";
461
+        $maillink = 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&amp;body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).':  '.$modulePath.'faq.php?faqid='.$faqid;
462
+        $adminLinks .= '<a href="'.$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'></a>";
463 463
         $adminLinks .= ' ';
464 464
         // Submit New Answer button
465 465
         if ($helper->getConfig('allownewanswer') && (is_object($xoopsUser) || $helper->getConfig('anonpost'))) {
466
-            $adminLinks .= "<a href='" . $modulePath . 'answer.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/newanswer.gif' title='" . _MD_SF_SUBMITANSWER . "' alt='" . _MD_SF_SUBMITANSWER . "'></a>";
466
+            $adminLinks .= "<a href='".$modulePath.'answer.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/newanswer.gif' title='"._MD_SF_SUBMITANSWER."' alt='"._MD_SF_SUBMITANSWER."'></a>";
467 467
             $adminLinks .= ' ';
468 468
         }
469 469
 
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                 if (!isset($users[$userid])) {
495 495
                     return $GLOBALS['xoopsConfig']['anonymous'];
496 496
                 }
497
-                $user =& $users[$userid];
497
+                $user = & $users[$userid];
498 498
             }
499 499
 
500 500
             if (is_object($user)) {
@@ -508,9 +508,9 @@  discard block
 block discarded – undo
508 508
                     $fullname = $user->getVar('name');
509 509
                 }
510 510
                 if (!empty($fullname)) {
511
-                    $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]';
511
+                    $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]';
512 512
                 } else {
513
-                    $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>';
513
+                    $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>';
514 514
                 }
515 515
 
516 516
                 return $linkeduser;
@@ -592,6 +592,6 @@  discard block
 block discarded – undo
592 592
             //-->
593 593
         </script>
594 594
         <?php
595
-        echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">";
595
+        echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">";
596 596
     }
597 597
 }
Please login to merge, or discard this patch.
admin/category.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use XoopsModules\Smartfaq;
10 10
 
11
-require_once __DIR__ . '/admin_header.php';
11
+require_once __DIR__.'/admin_header.php';
12 12
 
13 13
 /** @var Smartfaq\Helper $helper */
14 14
 $helper = Smartfaq\Helper::getInstance();
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
     $description = $categoryObj->description();
40 40
     if (!XOOPS_USE_MULTIBYTES) {
41 41
         if (strlen($description) >= 100) {
42
-            $description = substr($description, 0, 100 - 1) . '...';
42
+            $description = substr($description, 0, 100 - 1).'...';
43 43
         }
44 44
     }
45
-    $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITCOL . "' alt='" . _AM_SF_EDITCOL . "'></a>";
46
-    $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETECOL . "' alt='" . _AM_SF_DELETECOL . "'></a>";
45
+    $modify = "<a href='category.php?op=mod&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITCOL."' alt='"._AM_SF_EDITCOL."'></a>";
46
+    $delete = "<a href='category.php?op=del&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETECOL."' alt='"._AM_SF_DELETECOL."'></a>";
47 47
 
48 48
     $spaces = '';
49 49
     for ($j = 0; $j < $level; ++$j) {
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
          . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''>&nbsp;"
65 65
          . $categoryObj->name()
66 66
          . '</a></td>';
67
-    echo "<td class='even' align='left'>" . $description . '</td>';
68
-    echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>';
67
+    echo "<td class='even' align='left'>".$description.'</td>';
68
+    echo "<td class='even' align='center'>".$categoryObj->weight().'</td>';
69 69
     echo "<td class='even' align='center'> $modify $delete </td>";
70 70
     echo '</tr>';
71
-    $subCategoriesObj =& $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
71
+    $subCategoriesObj = & $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
72 72
     if (count($subCategoriesObj) > 0) {
73 73
         ++$level;
74 74
         foreach ($subCategoriesObj as $key => $thiscat) {
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
     //$moderators = array(); // just to define the variable
88 88
     //$allmods = array();
89 89
     $startfaq = \Xmf\Request::getInt('startfaq', 0, 'GET');
90
-    global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify,  $xoopsModule, $_GET;
90
+    global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify, $xoopsModule, $_GET;
91 91
     /** @var Smartfaq\Helper $helper */
92 92
     $helper = Smartfaq\Helper::getInstance();
93
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
93
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
94 94
 
95 95
     // Creating the faq handler object
96 96
     /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
             redirect_header('category.php', 1, _AM_SF_NOCOLTOEDIT);
114 114
         }
115 115
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
116
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_EDITCOL . '</h3>';
116
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_EDITCOL.'</h3>';
117 117
         echo "<div id='bottomtable'>";
118 118
     } else {
119 119
         $categoryObj = $categoryHandler->create();
120 120
         echo "<br>\n";
121 121
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
122
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CATEGORY_CREATE . '</h3>';
122
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CATEGORY_CREATE.'</h3>';
123 123
         echo "<div id='bottomtable'>";
124 124
     }
125 125
     // Start category form
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     }
165 165
     $sform->addElement($groups_read_checkbox);
166 166
     // Apply permissions on all faqs
167
-    $addapplyall_radio = new \XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
167
+    $addapplyall_radio = new \XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
168 168
     $sform->addElement($addapplyall_radio);
169 169
     // MODERATORS
170 170
     //$moderators_tray = new \XoopsFormElementTray(_AM_SF_MODERATORS_DEF, '');
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     echo '</div>';
230 230
 
231 231
     if ($categoryid) {
232
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php';
232
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php';
233 233
     }
234 234
 
235 235
     unset($hidden);
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
         break;
248 248
 
249 249
     case 'addcategory':
250
-        global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule,  $modify, $myts, $categoryid;
250
+        global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $modify, $myts, $categoryid;
251 251
 
252 252
         $categoryid = \Xmf\Request::getInt('categoryid', 0, 'POST');
253 253
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         }
286 286
 
287 287
         if (!$categoryObj->store()) {
288
-            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . Smartfaq\Utility::formatErrors($categoryObj->getErrors()));
288
+            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR.Smartfaq\Utility::formatErrors($categoryObj->getErrors()));
289 289
         }
290 290
         // TODO : put this function in the category class
291 291
         Smartfaq\Utility::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read');
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                               'categoryid' => $categoryObj->categoryid(),
328 328
                               'confirm'    => 1,
329 329
                               'name'       => $categoryObj->name()
330
-                          ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
330
+                          ], 'category.php', _AM_SF_DELETECOL." '".$categoryObj->name()."'. <br> <br>"._AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
331 331
             xoops_cp_footer();
332 332
         }
333 333
         exit();
@@ -345,19 +345,19 @@  discard block
 block discarded – undo
345 345
         echo "<br>\n";
346 346
 
347 347
         // Creating the objects for top categories
348
-        $categoriesObj =& $categoryHandler->getCategories($helper->getConfig('perpage'), $startcategory, 0);
348
+        $categoriesObj = & $categoryHandler->getCategories($helper->getConfig('perpage'), $startcategory, 0);
349 349
 
350 350
         Smartfaq\Utility::collapsableBar('toptable', 'toptableicon');
351
-        echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CATEGORIES_TITLE . '</h3>';
351
+        echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CATEGORIES_TITLE.'</h3>';
352 352
         echo "<div id='toptable'>";
353
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>';
353
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_CATEGORIES_DSC.'</span>';
354 354
 
355 355
         echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
356 356
         echo '<tr>';
357
-        echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
358
-        echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>';
359
-        echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>';
360
-        echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
357
+        echo "<th width='35%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
358
+        echo "<th class='bg3' align='left'><b>"._AM_SF_DESCRIP.'</b></td>';
359
+        echo "<th class='bg3' width='65' align='center'><b>"._AM_SF_WEIGHT.'</b></td>';
360
+        echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
361 361
         echo '</tr>';
362 362
         $totalCategories = $categoryHandler->getCategoriesCount(0);
363 363
         if (count($categoriesObj) > 0) {
@@ -366,14 +366,14 @@  discard block
 block discarded – undo
366 366
             }
367 367
         } else {
368 368
             echo '<tr>';
369
-            echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>';
369
+            echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOCAT.'</td>';
370 370
             echo '</tr>';
371 371
             $categoryid = '0';
372 372
         }
373 373
         echo "</table>\n";
374
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
374
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
375 375
         $pagenav = new \XoopsPageNav($totalCategories, $helper->getConfig('perpage'), $startcategory, 'startcategory');
376
-        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
376
+        echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
377 377
         echo '</div>';
378 378
 
379 379
         editcat(false);
@@ -381,4 +381,4 @@  discard block
 block discarded – undo
381 381
         break;
382 382
 }
383 383
 
384
-require_once __DIR__ . '/admin_footer.php';
384
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/faq.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 use XoopsModules\Smartfaq;
11 11
 use XoopsModules\Smartfaq\Constants;
12 12
 
13
-require_once __DIR__ . '/admin_header.php';
13
+require_once __DIR__.'/admin_header.php';
14 14
 
15 15
 /** @var Smartfaq\Helper $helper */
16 16
 $helper = Smartfaq\Helper::getInstance();
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
  */
47 47
 function editfaq($showmenu = false, $faqid = -1, $answerid = -1, $merge = false)
48 48
 {
49
-    global $answerHandler, $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify,  $xoopsModule, $XOOPS_URL, $myts;
49
+    global $answerHandler, $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModule, $XOOPS_URL, $myts;
50 50
     /** @var Smartfaq\Helper $helper */
51 51
     $helper = Smartfaq\Helper::getInstance();
52 52
 
53
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
53
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
54 54
     // If there is a parameter, and the id exists, retrieve data: we're editing a faq
55 55
     if (-1 != $faqid) {
56 56
         // Creating the FAQ object
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
 
153 153
         echo "<br>\n";
154 154
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
155
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . $collapsableBar_title . '</h3>';
155
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".$collapsableBar_title.'</h3>';
156 156
         echo "<div id='bottomtable'>";
157
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>';
157
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>';
158 158
     } else {
159 159
         // there's no parameter, so we're adding a faq
160 160
         $faqObj = $faqHandler->create();
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $button_caption     = _AM_SF_CREATE;
169 169
 
170 170
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
171
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CREATESMARTFAQ . '</h3>';
171
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CREATESMARTFAQ.'</h3>';
172 172
         echo "<div id='bottomtable'>";
173 173
     }
174 174
     $sform = new \XoopsThemeForm(_AM_SF_SMARTFAQ, 'op', xoops_getenv('PHP_SELF'), 'post', true);
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
     // ANSWER
201 201
     if ($merge) {
202
-        $theanswer = $originalAnswerObj->answer('e') . "\n\n" . sprintf(_AM_SF_NEW_CONTRIBUTION, Smartfaq\Utility::getLinkedUnameFromId($answerObj->uid(), $helper->getConfig('userealname')), $answerObj->datesub(), $answerObj->answer('e'));
202
+        $theanswer = $originalAnswerObj->answer('e')."\n\n".sprintf(_AM_SF_NEW_CONTRIBUTION, Smartfaq\Utility::getLinkedUnameFromId($answerObj->uid(), $helper->getConfig('userealname')), $answerObj->datesub(), $answerObj->answer('e'));
203 203
     } else {
204 204
         $theanswer = $answerObj->answer('e');
205 205
     }
@@ -248,14 +248,14 @@  discard block
 block discarded – undo
248 248
     $sform->addElement(new \XoopsFormText(_AM_SF_SPECIFIC_URL, 'contextpage', 50, 60, $faqObj->contextpage()), false);
249 249
 
250 250
     // EXACT URL?
251
-    $excaturl_radio = new \XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
251
+    $excaturl_radio = new \XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
252 252
     $sform->addElement($excaturl_radio);
253 253
     // WEIGHT
254 254
     $sform->addElement(new \XoopsFormText(_AM_SF_WEIGHT, 'weight', 5, 5, $faqObj->weight()), true);
255 255
 
256 256
     // COMMENTS
257 257
     // Code to allow comments
258
-    $addcomments_radio = new \XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
258
+    $addcomments_radio = new \XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
259 259
     $sform->addElement($addcomments_radio);
260 260
 
261 261
     // PER ITEM PERMISSIONS
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
     }
270 270
     $sform->addElement($groups_checkbox);
271 271
 
272
-    $partial_view = new \XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
272
+    $partial_view = new \XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
273 273
     $sform->addElement($partial_view);
274 274
 
275 275
     // VARIOUS OPTIONS
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     // OFFLINE
293 293
     if (Constants::SF_STATUS_OFFLINE == $faqObj->status()) {
294 294
         // Back OnLine
295
-        $offline_radio = new \XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
295
+        $offline_radio = new \XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
296 296
         $sform->addElement($offline_radio);
297 297
     }
298 298
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         }
367 367
 
368 368
         xoops_cp_header();
369
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
369
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
370 370
 
371 371
         editfaq(true, $faqid, $answerid, true);
372 372
         break;
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
         xoops_cp_header();
388 388
 
389 389
         $adminObject->displayNavigation(basename(__FILE__));
390
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
390
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
391 391
 
392 392
         editfaq(true, $faqid, $answerid);
393 393
         break;
@@ -525,13 +525,13 @@  discard block
 block discarded – undo
525 525
 
526 526
         // Storing the FAQ
527 527
         if (!$faqObj->store()) {
528
-            redirect_header('javascript:history.go(-1)', 3, $error_msg . Smartfaq\Utility::formatErrors($faqObj->getErrors()));
528
+            redirect_header('javascript:history.go(-1)', 3, $error_msg.Smartfaq\Utility::formatErrors($faqObj->getErrors()));
529 529
         }
530 530
 
531 531
         // Storing the answer
532 532
         $answerObj->setVar('faqid', $faqObj->faqid());
533 533
         if (!$answerObj->store()) {
534
-            redirect_header('javascript:history.go(-1)', 3, $error_msg . Smartfaq\Utility::formatErrors($answerObj->getErrors()));
534
+            redirect_header('javascript:history.go(-1)', 3, $error_msg.Smartfaq\Utility::formatErrors($answerObj->getErrors()));
535 535
         }
536 536
 
537 537
         // Send notifications
@@ -558,20 +558,20 @@  discard block
 block discarded – undo
558 558
 
559 559
         if ($confirm) {
560 560
             if (!$faqHandler->delete($faqObj)) {
561
-                redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR . Smartfaq\Utility::formatErrors($faqObj->getErrors()));
561
+                redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR.Smartfaq\Utility::formatErrors($faqObj->getErrors()));
562 562
             }
563 563
 
564 564
             redirect_header('faq.php', 2, sprintf(_AM_SF_ARTISDELETED, $faqObj->question()));
565 565
         } else {
566 566
             // no confirm: show deletion condition
567
-            $faqid =  Request::getInt('faqid', 0, 'POST');
567
+            $faqid = Request::getInt('faqid', 0, 'POST');
568 568
             xoops_cp_header();
569 569
             xoops_confirm([
570 570
                               'op'      => 'del',
571 571
                               'faqid'   => $faqObj->faqid(),
572 572
                               'confirm' => 1,
573 573
                               'name'    => $faqObj->question()
574
-                          ], 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
574
+                          ], 'faq.php', _AM_SF_DELETETHISARTICLE." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE);
575 575
             xoops_cp_footer();
576 576
         }
577 577
 
@@ -585,10 +585,10 @@  discard block
 block discarded – undo
585 585
 
586 586
         $adminObject->displayNavigation(basename(__FILE__));
587 587
 
588
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
589
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
588
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
589
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
590 590
 
591
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php';
591
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php';
592 592
 
593 593
         $totalcategories = $categoryHandler->getCategoriesCount(-1);
594 594
         if ($totalcategories > 0) {
@@ -598,4 +598,4 @@  discard block
 block discarded – undo
598 598
         break;
599 599
 }
600 600
 
601
-require_once __DIR__ . '/admin_footer.php';
601
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/answer.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 /** @var Smartfaq\Helper $helper */
13 13
 $helper = Smartfaq\Helper::getInstance();
14 14
 
15
-require_once __DIR__ . '/admin_header.php';
15
+require_once __DIR__.'/admin_header.php';
16 16
 
17 17
 $op = '';
18 18
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     /** @var Smartfaq\Helper $helper */
38 38
     $helper = Smartfaq\Helper::getInstance();
39 39
 
40
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
40
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
41 41
 
42 42
     // Creating the FAQ object
43 43
     $faqObj = new Smartfaq\Faq($faqid);
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
     $official_answer = $faqObj->answer();
75 75
 
76 76
     Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
77
-    echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_SUBMITTED_ANSWER . '</h3>';
77
+    echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_SUBMITTED_ANSWER.'</h3>';
78 78
     echo "<div id='bottomtable'>";
79
-    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_SUBMITTED_ANSWER_INFO . '</span>';
79
+    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_SUBMITTED_ANSWER_INFO.'</span>';
80 80
 
81 81
     $proposed_answers = $answerHandler->getAllAnswers($faqid, Constants::SF_AN_STATUS_PROPOSED);
82 82
 
@@ -86,31 +86,31 @@  discard block
 block discarded – undo
86 86
 
87 87
     echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>
88 88
             <tr>
89
-              <td class='head' width='100px'>" . _AM_SF_CATEGORY . "</td>
90
-              <td class='even'>" . $categoryObj->name() . "</td>
89
+              <td class='head' width='100px'>" . _AM_SF_CATEGORY."</td>
90
+              <td class='even'>" . $categoryObj->name()."</td>
91 91
             </tr>
92 92
             <tr>
93
-              <td class='head' width='100px'>" . _AM_SF_QUESTION . "</td>
94
-              <td class='even'>" . $faqObj->question() . '</td>
93
+              <td class='head' width='100px'>" . _AM_SF_QUESTION."</td>
94
+              <td class='even'>" . $faqObj->question().'</td>
95 95
             </tr>';
96 96
     if ($official_answer) {
97 97
         echo "
98 98
             <tr>
99
-              <td class='head' width='100px'>" . _AM_SF_ANSWER_OFFICIAL . "</td>
100
-              <td class='even'>" . $official_answer->answer() . '</td>
99
+              <td class='head' width='100px'>" . _AM_SF_ANSWER_OFFICIAL."</td>
100
+              <td class='even'>" . $official_answer->answer().'</td>
101 101
             </tr>';
102 102
     }
103 103
     echo "</table><br>\n";
104 104
 
105 105
     echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
106 106
     echo '<tr>';
107
-    echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>';
108
-    echo "<th class='bg3' class='bg3' align='center'><b>" . _AM_SF_ANSWER . '</b></td>';
107
+    echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>';
108
+    echo "<th class='bg3' class='bg3' align='center'><b>"._AM_SF_ANSWER.'</b></td>';
109 109
 
110
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>';
110
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>';
111 111
 
112
-    echo "<th width='180' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
113
-    echo "<th width='120' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
112
+    echo "<th width='180' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
113
+    echo "<th width='120' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
114 114
     echo '</tr>';
115 115
 
116 116
     $merge   = '';
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     $approve = '';
119 119
     foreach ($proposed_answers as $proposed_answer) {
120 120
         if (Constants::SF_STATUS_NEW_ANSWER == $faqObj->status()) {
121
-            $merge   = "<a href='faq.php?op=merge&amp;faqid="
121
+            $merge = "<a href='faq.php?op=merge&amp;faqid="
122 122
                        . $faqObj->faqid()
123 123
                        . '&amp;answerid='
124 124
                        . $proposed_answer->answerid()
@@ -131,19 +131,19 @@  discard block
 block discarded – undo
131 131
                        . "' alt='"
132 132
                        . _AM_SF_FAQ_MERGE
133 133
                        . "'></a>&nbsp;";
134
-            $approve = "<a href='answer.php?op=selectanswer&amp;faqid=" . $faqid . '&amp;answerid=' . $proposed_answer->answerid() . "'><img src='" . $pathIcon16 . '/on.png' . "' title='" . _AM_SF_FAQ_APPROVE_NEW_ANSWER . "' alt='" . _AM_SF_APPROVESUB . "'></a>";
134
+            $approve = "<a href='answer.php?op=selectanswer&amp;faqid=".$faqid.'&amp;answerid='.$proposed_answer->answerid()."'><img src='".$pathIcon16.'/on.png'."' title='"._AM_SF_FAQ_APPROVE_NEW_ANSWER."' alt='"._AM_SF_APPROVESUB."'></a>";
135 135
         }
136
-        $modify = "<a href='faq.php?op=mod&amp;faqid=" . $faqObj->faqid() . '&amp;answerid=' . $proposed_answer->answerid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_FAQ_REVIEW . "' alt='" . _AM_SF_FAQ_REVIEW . "'></a>&nbsp;";
137
-        $delete = "<a href='answer.php?op=del&amp;faqid=" . $faqObj->faqid() . '&amp;answerid=' . $proposed_answer->answerid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETESUBM . "' alt='" . _AM_SF_DELETESUBM . "'></a>";
136
+        $modify = "<a href='faq.php?op=mod&amp;faqid=".$faqObj->faqid().'&amp;answerid='.$proposed_answer->answerid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_FAQ_REVIEW."' alt='"._AM_SF_FAQ_REVIEW."'></a>&nbsp;";
137
+        $delete = "<a href='answer.php?op=del&amp;faqid=".$faqObj->faqid().'&amp;answerid='.$proposed_answer->answerid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETESUBM."' alt='"._AM_SF_DELETESUBM."'></a>";
138 138
         echo '<tr>';
139
-        echo "<td class='head' align='center'>" . $proposed_answer->answerid() . '</td>';
140
-        echo "<td class='even' align='left'>" . $proposed_answer->answer() . '</td>';
139
+        echo "<td class='head' align='center'>".$proposed_answer->answerid().'</td>';
140
+        echo "<td class='even' align='left'>".$proposed_answer->answer().'</td>';
141 141
 
142 142
         //show name of the answer submitter
143 143
         $submitter = Smartfaq\Utility::getLinkedUnameFromId($proposed_answer->uid(), $smartModuleConfig['userealname']);
144
-        echo "<td class='even' align='center'>" . $submitter . '</td>';
144
+        echo "<td class='even' align='center'>".$submitter.'</td>';
145 145
 
146
-        echo "<td class='even' align='center'>" . $proposed_answer->datesub() . '</td>';
146
+        echo "<td class='even' align='center'>".$proposed_answer->datesub().'</td>';
147 147
         echo "<td class='even' align='center'> $merge $modify $approve $delete </td>";
148 148
         echo '</tr>';
149 149
     }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 switch ($op) {
156 156
     case 'mod':
157 157
         xoops_cp_header();
158
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
158
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
159 159
         global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $modify, $myts;
160 160
         $faqid = \Xmf\Request::getInt('faqid', 0, 'GET');
161 161
         editfaq($faqid);
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                     $proposed_answers = $answerHandler->getAllAnswers($faqid, Constants::SF_AN_STATUS_PROPOSED);
263 263
                     if (count($proposed_answers) > 0) {
264 264
                         // This question has other proposed answer
265
-                        $redirect_page = 'answer.php?op=mod&faqid=' . $faqid;
265
+                        $redirect_page = 'answer.php?op=mod&faqid='.$faqid;
266 266
                         $redirect_msg  = _AM_SF_ANSWER_REJECTED;
267 267
                     } else {
268 268
                         // The question has no other proposed answer
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     default:
287 287
         xoops_cp_header();
288 288
 
289
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
289
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
290 290
         global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule;
291 291
         /** @var Smartfaq\Helper $helper */
292 292
         $helper = Smartfaq\Helper::getInstance();
@@ -295,4 +295,4 @@  discard block
 block discarded – undo
295 295
         break;
296 296
 }
297 297
 
298
-require_once __DIR__ . '/admin_footer.php';
298
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/mygroupperm.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             $criteria->add(new \Criteria('gperm_itemid', (int)$gperm_itemid));
23 23
         }
24 24
     }
25
-    $sql = 'DELETE FROM ' . $db->prefix('group_permission') . ' ' . $criteria->renderWhere();
25
+    $sql = 'DELETE FROM '.$db->prefix('group_permission').' '.$criteria->renderWhere();
26 26
     if (!$result = $db->query($sql)) {
27 27
         return false;
28 28
     }
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
34 34
 $modid = \Xmf\Request::getInt('modid', 1, 'POST');
35 35
 // we dont want system module permissions to be changed here ( 1 -> 0 GIJ)
36 36
 if ($modid <= 0 || !is_object($xoopsUser) || !$xoopsUser->isAdmin($modid)) {
37
-    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
37
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
38 38
 }
39 39
 /** @var XoopsModuleHandler $moduleHandler */
40 40
 $moduleHandler = xoops_getHandler('module');
41 41
 $module        = $moduleHandler->get($modid);
42 42
 if (!is_object($module) || !$module->getVar('isactive')) {
43
-    redirect_header(XOOPS_URL . '/admin.php', 1, _MODULENOEXIST);
43
+    redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST);
44 44
 }
45 45
 $memberHandler = xoops_getHandler('member');
46
-$group_list    =& $memberHandler->getGroupList();
46
+$group_list    = & $memberHandler->getGroupList();
47 47
 if (is_array($_POST['perms']) && !empty($_POST['perms'])) {
48 48
     $gpermHandler = xoops_getHandler('groupperm');
49 49
     foreach ($_POST['perms'] as $perm_name => $perm_data) {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                             foreach ($parent_ids as $pid) {
67 67
                                 if (0 != $pid && !in_array($pid, array_keys($item_ids))) {
68 68
                                     // one of the parent items were not selected, so skip this item
69
-                                    $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>') . ' (' . _MD_AM_PERMADDNGP . ')';
69
+                                    $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>').' ('._MD_AM_PERMADDNGP.')';
70 70
                                     continue 2;
71 71
                                 }
72 72
                             }
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
                         $gperm->setVar('gperm_modid', $modid);
78 78
                         $gperm->setVar('gperm_itemid', $item_id);
79 79
                         if (!$gpermHandler->insert($gperm)) {
80
-                            $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>');
80
+                            $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
81 81
                         } else {
82
-                            $msg[] = sprintf(_MD_AM_PERMADDOK, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>');
82
+                            $msg[] = sprintf(_MD_AM_PERMADDOK, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
83 83
                         }
84 84
                         unset($gperm);
85 85
                     }
Please login to merge, or discard this patch.
admin/main.php 1 patch
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 /** @var Smartfaq\Helper $helper */
12 12
 $helper = Smartfaq\Helper::getInstance();
13 13
 
14
-require_once __DIR__ . '/admin_header.php';
14
+require_once __DIR__.'/admin_header.php';
15 15
 $myts = \MyTextSanitizer::getInstance();
16 16
 
17 17
 $faqid = \Xmf\Request::getInt('faqid', 0, 'POST');
@@ -34,29 +34,29 @@  discard block
 block discarded – undo
34 34
 
35 35
 function buildTable()
36 36
 {
37
-    global $xoopsConfig,  $xoopsModule;
37
+    global $xoopsConfig, $xoopsModule;
38 38
     /** @var Smartfaq\Helper $helper */
39 39
     $helper = Smartfaq\Helper::getInstance();
40 40
 
41 41
     echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>";
42 42
     echo '<tr>';
43
-    echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_FAQID . '</b></td>';
44
-    echo "<th width='20%' class='bg3' align='center'><b>" . _AM_SF_FAQCAT . '</b></td>';
45
-    echo "<th class='bg3' align='center'><b>" . _AM_SF_QUESTION . '</b></td>';
43
+    echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_FAQID.'</b></td>';
44
+    echo "<th width='20%' class='bg3' align='center'><b>"._AM_SF_FAQCAT.'</b></td>';
45
+    echo "<th class='bg3' align='center'><b>"._AM_SF_QUESTION.'</b></td>';
46 46
 
47
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>';
48
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>';
47
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>';
48
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>';
49 49
 
50
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
51
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_STATUS . '</b></td>';
50
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
51
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_STATUS.'</b></td>';
52 52
     //echo "<td width='30' class='bg3' align='center'><b>" . _AM_SF_ANSWERS . "</b></td>";
53
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
53
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
54 54
     echo '</tr>';
55 55
 }
56 56
 
57 57
 // Code for the page
58
-require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
59
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
58
+require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
59
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
60 60
 
61 61
 // Creating the category handler object
62 62
 /** @var \XoopsModules\Smartfaq\CategoryHandler $categoryHandler */
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 
140 140
 // Construction of lower table
141 141
 Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
142
-echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_ALLFAQS . '</h3>';
142
+echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_ALLFAQS.'</h3>';
143 143
 echo "<div id='bottomtable'>";
144
-echo '<span style="color: #567; margin: 3px 0 18px 0; font-size: small; display: block; ">' . _AM_SF_ALLFAQSMSG . '</span>';
144
+echo '<span style="color: #567; margin: 3px 0 18px 0; font-size: small; display: block; ">'._AM_SF_ALLFAQSMSG.'</span>';
145 145
 
146 146
 $showingtxt    = '';
147 147
 $selectedtxt   = '';
@@ -210,98 +210,98 @@  discard block
 block discarded – undo
210 210
     case Constants::SF_STATUS_ASKED:
211 211
         $selectedtxt1        = 'selected';
212 212
         $caption             = _AM_SF_ASKED;
213
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_ASKED . ' ';
213
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_ASKED.' ';
214 214
         $status_explaination = _AM_SF_ASKED_EXP;
215 215
         break;
216 216
 
217 217
     case Constants::SF_STATUS_OPENED:
218 218
         $selectedtxt2        = 'selected';
219 219
         $caption             = _AM_SF_OPENED;
220
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_OPENED . ' ';
220
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_OPENED.' ';
221 221
         $status_explaination = _AM_SF_OPENED_EXP;
222 222
         break;
223 223
 
224 224
     case Constants::SF_STATUS_ANSWERED:
225 225
         $selectedtxt3        = 'selected';
226 226
         $caption             = _AM_SF_ANSWERED;
227
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_ANSWERED . ' ';
227
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_ANSWERED.' ';
228 228
         $status_explaination = _AM_SF_ANSWERED_EXP;
229 229
         break;
230 230
 
231 231
     case Constants::SF_STATUS_SUBMITTED:
232 232
         $selectedtxt4        = 'selected';
233 233
         $caption             = _AM_SF_SUBMITTED;
234
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_SUBMITTED . ' ';
234
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_SUBMITTED.' ';
235 235
         $status_explaination = _AM_SF_SUBMITTED_EXP;
236 236
         break;
237 237
 
238 238
     case Constants::SF_STATUS_PUBLISHED:
239 239
         $selectedtxt5        = 'selected';
240 240
         $caption             = _AM_SF_PUBLISHED;
241
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_PUBLISHED . ' ';
241
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_PUBLISHED.' ';
242 242
         $status_explaination = _AM_SF_PUBLISHED_EXP;
243 243
         break;
244 244
 
245 245
     case Constants::SF_STATUS_NEW_ANSWER:
246 246
         $selectedtxt6        = 'selected';
247 247
         $caption             = _AM_SF_NEW_ANSWER;
248
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_NEW_ANSWER . ' ';
248
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_NEW_ANSWER.' ';
249 249
         $status_explaination = _AM_SF_NEW_ANSWER_EXP;
250 250
         break;
251 251
 
252 252
     case Constants::SF_STATUS_OFFLINE:
253 253
         $selectedtxt7        = 'selected';
254 254
         $caption             = _AM_SF_OFFLINE;
255
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_OFFLINE . ' ';
255
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_OFFLINE.' ';
256 256
         $status_explaination = _AM_SF_OFFLINE_EXP;
257 257
         break;
258 258
 
259 259
     case Constants::SF_STATUS_REJECTED_QUESTION:
260 260
         $selectedtxt8        = 'selected';
261 261
         $caption             = _AM_SF_REJECTED_QUESTION;
262
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_REJECTED_QUESTION . ' ';
262
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_REJECTED_QUESTION.' ';
263 263
         $status_explaination = _AM_SF_REJECTED_QUESTION_EXP;
264 264
         break;
265 265
 
266 266
     case Constants::SF_STATUS_REJECTED_SMARTFAQ:
267 267
         $selectedtxt9        = 'selected';
268 268
         $caption             = _AM_SF_REJECTED_SMARTFAQ;
269
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_REJECTED_SMARTFAQ . ' ';
269
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_REJECTED_SMARTFAQ.' ';
270 270
         $status_explaination = _AM_SF_REJECTED_SMARTFAQ_EXP;
271 271
         break;
272 272
 }
273 273
 
274 274
 /* -- Code to show selected terms -- */
275
-echo "<form name='pick' id='pick' action='" . $_SERVER['PHP_SELF'] . "' method='POST' style='margin: 0;'>";
275
+echo "<form name='pick' id='pick' action='".$_SERVER['PHP_SELF']."' method='POST' style='margin: 0;'>";
276 276
 
277 277
 echo "
278 278
     <table width='100%' cellspacing='1' cellpadding='2' border='0' style='border-left: 1px solid silver; border-top: 1px solid silver; border-right: 1px solid silver;'>
279 279
         <tr>
280
-            <td><span style='font-weight: bold; font-size: 12px; font-variant: small-caps;'>" . _AM_SF_SHOWING . ' ' . $caption . "</span></td>
281
-            <td align='right'>" . _AM_SF_SELECT_SORT . "
280
+            <td><span style='font-weight: bold; font-size: 12px; font-variant: small-caps;'>" . _AM_SF_SHOWING.' '.$caption."</span></td>
281
+            <td align='right'>" . _AM_SF_SELECT_SORT."
282 282
                 <select name='sortsel' onchange='submit()'>
283
-                    <option value='faq.faqid' $sorttxtfaqid>" . _AM_SF_ID . "</option>
284
-                    <option value='category.name' $sorttxtcategory>" . _AM_SF_CATEGORY . "</option>
285
-                    <option value='faq.question' $sorttxtquestion>" . _AM_SF_QUESTION . "</option>
286
-                    <option value='faq.datesub' $sorttxtcreated>" . _AM_SF_CREATED . "</option>
287
-                    <option value='faq.weight' $sorttxtweight>" . _AM_SF_WEIGHT . "</option>
283
+                    <option value='faq.faqid' $sorttxtfaqid>"._AM_SF_ID."</option>
284
+                    <option value='category.name' $sorttxtcategory>"._AM_SF_CATEGORY."</option>
285
+                    <option value='faq.question' $sorttxtquestion>"._AM_SF_QUESTION."</option>
286
+                    <option value='faq.datesub' $sorttxtcreated>"._AM_SF_CREATED."</option>
287
+                    <option value='faq.weight' $sorttxtweight>"._AM_SF_WEIGHT."</option>
288 288
                 </select>
289 289
                 <select name='ordersel' onchange='submit()'>
290
-                    <option value='ASC' $ordertxtasc>" . _AM_SF_ASC . "</option>
291
-                    <option value='DESC' $ordertxtdesc>" . _AM_SF_DESC . '</option>
290
+                    <option value='ASC' $ordertxtasc>"._AM_SF_ASC."</option>
291
+                    <option value='DESC' $ordertxtdesc>"._AM_SF_DESC.'</option>
292 292
                 </select>
293
-            ' . _AM_SF_SELECT_STATUS . " :
293
+            ' . _AM_SF_SELECT_STATUS." :
294 294
                 <select name='statussel' onchange='submit()'>
295
-                    <option value='0' $selectedtxt0>" . _AM_SF_ALL . " [$totalfaqs]</option>
296
-                    <option value='1' $selectedtxt1>" . _AM_SF_ASKED . " [$totalasked]</option>
297
-                    <option value='2' $selectedtxt2>" . _AM_SF_OPENED . " [$totalopened]</option>
298
-                    <option value='3' $selectedtxt3>" . _AM_SF_ANSWERED . " [$totalanswered]</option>
299
-                    <option value='4' $selectedtxt4>" . _AM_SF_SUBMITTED . " [$totalsubmitted]</option>
300
-                    <option value='5' $selectedtxt5>" . _AM_SF_PUBLISHED . " [$totalpublished]</option>
301
-                    <option value='6' $selectedtxt6>" . _AM_SF_NEWANSWER . " [$totalnewanswers]</option>
302
-                    <option value='7' $selectedtxt7>" . _AM_SF_OFFLINE . " [$totaloffline]</option>
303
-                    <option value='8' $selectedtxt8>" . _AM_SF_REJECTED_QUESTION . " [$totalrejectedquestion]</option>
304
-                    <option value='9' $selectedtxt9>" . _AM_SF_REJECTED_SMARTFAQ . " [$totalrejectedsmartfaq]</option>
295
+                    <option value='0' $selectedtxt0>"._AM_SF_ALL." [$totalfaqs]</option>
296
+                    <option value='1' $selectedtxt1>"._AM_SF_ASKED." [$totalasked]</option>
297
+                    <option value='2' $selectedtxt2>"._AM_SF_OPENED." [$totalopened]</option>
298
+                    <option value='3' $selectedtxt3>"._AM_SF_ANSWERED." [$totalanswered]</option>
299
+                    <option value='4' $selectedtxt4>"._AM_SF_SUBMITTED." [$totalsubmitted]</option>
300
+                    <option value='5' $selectedtxt5>"._AM_SF_PUBLISHED." [$totalpublished]</option>
301
+                    <option value='6' $selectedtxt6>"._AM_SF_NEWANSWER." [$totalnewanswers]</option>
302
+                    <option value='7' $selectedtxt7>"._AM_SF_OFFLINE." [$totaloffline]</option>
303
+                    <option value='8' $selectedtxt8>"._AM_SF_REJECTED_QUESTION." [$totalrejectedquestion]</option>
304
+                    <option value='9' $selectedtxt9>"._AM_SF_REJECTED_SMARTFAQ." [$totalrejectedsmartfaq]</option>
305 305
                 </select>
306 306
             </td>
307 307
         </tr>
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 $faqsObj = $faqHandler->getFaqsAdminSide($helper->getConfig('perpage'), $startentry, $statusSelected, -1, $sortsel, $ordersel);
317 317
 
318 318
 // fetching all categories
319
-$allCats          = $categoryHandler->getObjects(null, true);
319
+$allCats = $categoryHandler->getObjects(null, true);
320 320
 //$totalItemsOnPage = count($faqsObj);
321 321
 buildTable();
322 322
 
@@ -339,65 +339,65 @@  discard block
 block discarded – undo
339 339
         switch ($faqsObj[$i]->status()) {
340 340
             case Constants::SF_STATUS_ASKED:
341 341
                 $statustxt = _AM_SF_ASKED;
342
-                $approve   = "<a href='question.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/on.png' . "'  title='" . _AM_SF_QUESTION_MODERATE . "'  alt='" . _AM_SF_QUESTION_MODERATE . "'></a>&nbsp;";
342
+                $approve   = "<a href='question.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/on.png'."'  title='"._AM_SF_QUESTION_MODERATE."'  alt='"._AM_SF_QUESTION_MODERATE."'></a>&nbsp;";
343 343
                 $modify    = '';
344
-                $delete    = "<a href='question.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>";
344
+                $delete    = "<a href='question.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>";
345 345
                 break;
346 346
 
347 347
             case Constants::SF_STATUS_OPENED:
348 348
                 $statustxt = _AM_SF_OPENED;
349 349
                 $approve   = '';
350
-                $modify    = "<a href='question.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_QUESTION_EDIT . "' alt='" . _AM_SF_QUESTION_EDIT . "'></a>&nbsp;";
351
-                $delete    = "<a href='question.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>";
350
+                $modify    = "<a href='question.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_QUESTION_EDIT."' alt='"._AM_SF_QUESTION_EDIT."'></a>&nbsp;";
351
+                $delete    = "<a href='question.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>";
352 352
                 break;
353 353
 
354 354
             case Constants::SF_STATUS_ANSWERED:
355 355
                 $statustxt = _AM_SF_ANSWERED;
356
-                $approve   = "<a href='answer.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/approve.gif' title='" . _AM_SF_ANSWERED_MODERATE . "' alt='" . _AM_SF_ANSWERED_MODERATE . "'></a>&nbsp;";
356
+                $approve   = "<a href='answer.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/approve.gif' title='"._AM_SF_ANSWERED_MODERATE."' alt='"._AM_SF_ANSWERED_MODERATE."'></a>&nbsp;";
357 357
                 $modify    = '';
358
-                $delete    = "<a href='question.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/delete.gif' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>";
358
+                $delete    = "<a href='question.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/delete.gif' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>";
359 359
                 break;
360 360
 
361 361
             case Constants::SF_STATUS_SUBMITTED:
362 362
                 $statustxt = _AM_SF_SUBMITTED;
363
-                $approve   = "<a href='faq.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/approve.gif' title='" . _AM_SF_SUBMISSION_MODERATE . "' alt='" . _AM_SF_SUBMISSION_MODERATE . "'></a>&nbsp;";
364
-                $delete    = "<a href='faq.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/delete.gif' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>";
363
+                $approve   = "<a href='faq.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/approve.gif' title='"._AM_SF_SUBMISSION_MODERATE."' alt='"._AM_SF_SUBMISSION_MODERATE."'></a>&nbsp;";
364
+                $delete    = "<a href='faq.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/delete.gif' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>";
365 365
                 $modify    = '';
366 366
                 break;
367 367
 
368 368
             case Constants::SF_STATUS_PUBLISHED:
369 369
                 $statustxt = _AM_SF_PUBLISHED;
370 370
                 $approve   = '';
371
-                $modify    = "<a href='faq.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_FAQ_EDIT . "' alt='" . _AM_SF_FAQ_EDIT . "'></a>&nbsp;";
372
-                $delete    = "<a href='faq.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>";
371
+                $modify    = "<a href='faq.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_FAQ_EDIT."' alt='"._AM_SF_FAQ_EDIT."'></a>&nbsp;";
372
+                $delete    = "<a href='faq.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>";
373 373
                 break;
374 374
 
375 375
             case Constants::SF_STATUS_NEW_ANSWER:
376 376
                 $statustxt = _AM_SF_NEWANSWER;
377
-                $approve   = "<a href='answer.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/approve.gif' title='" . _AM_SF_FAQ_EDIT . "' alt='" . _AM_SF_FAQ_EDIT . "'></a>&nbsp;";
378
-                $delete    = "<a href='faq.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/delete.gif' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>";
377
+                $approve   = "<a href='answer.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/approve.gif' title='"._AM_SF_FAQ_EDIT."' alt='"._AM_SF_FAQ_EDIT."'></a>&nbsp;";
378
+                $delete    = "<a href='faq.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/delete.gif' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>";
379 379
                 $modify    = '';
380 380
                 break;
381 381
 
382 382
             case Constants::SF_STATUS_OFFLINE:
383 383
                 $statustxt = _AM_SF_OFFLINE;
384 384
                 $approve   = '';
385
-                $modify    = "<a href='faq.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_FAQ_EDIT . "' alt='" . _AM_SF_FAQ_EDIT . "'></a>&nbsp;";
386
-                $delete    = "<a href='faq.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>";
385
+                $modify    = "<a href='faq.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_FAQ_EDIT."' alt='"._AM_SF_FAQ_EDIT."'></a>&nbsp;";
386
+                $delete    = "<a href='faq.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>";
387 387
                 break;
388 388
 
389 389
             case Constants::SF_STATUS_REJECTED_QUESTION:
390 390
                 $statustxt = _AM_SF_REJECTED_QUESTION;
391 391
                 $approve   = '';
392
-                $modify    = "<a href='faq.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_REJECTED_EDIT . "' alt='" . _AM_SF_REJECTED_EDIT . "'></a>&nbsp;";
393
-                $delete    = "<a href='question.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEQUESTION . "' alt='" . _AM_SF_DELETEQUESTION . "'></a>";
392
+                $modify    = "<a href='faq.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_REJECTED_EDIT."' alt='"._AM_SF_REJECTED_EDIT."'></a>&nbsp;";
393
+                $delete    = "<a href='question.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEQUESTION."' alt='"._AM_SF_DELETEQUESTION."'></a>";
394 394
                 break;
395 395
 
396 396
             case Constants::SF_STATUS_REJECTED_SMARTFAQ:
397 397
                 $statustxt = _AM_SF_REJECTED_SMARTFAQ;
398 398
                 $approve   = '';
399
-                $modify    = "<a href='faq.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_REJECTED_EDIT . "' alt='" . _AM_SF_REJECTED_EDIT . "'></a>&nbsp;";
400
-                $delete    = "<a href='faq.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>";
399
+                $modify    = "<a href='faq.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_REJECTED_EDIT."' alt='"._AM_SF_REJECTED_EDIT."'></a>&nbsp;";
400
+                $delete    = "<a href='faq.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>";
401 401
                 break;
402 402
 
403 403
             case 'default':
@@ -411,14 +411,14 @@  discard block
 block discarded – undo
411 411
         //$modify = "<a href='faq.php?op=mod&amp;faqid=" . $faqid . "'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/assets/images/icon/edit.gif' alt='" . _AM_SF_EDITART . "'></a>&nbsp;";
412 412
 
413 413
         echo '<tr>';
414
-        echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>';
415
-        echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>';
416
-        echo "<td class='even' align='left'>" . $faqsObj[$i]->question(100) . '</td>';
414
+        echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>';
415
+        echo "<td class='even' align='left'>".$categoryObj->name().'</td>';
416
+        echo "<td class='even' align='left'>".$faqsObj[$i]->question(100).'</td>';
417 417
 
418 418
         //mb---------------------------------------
419 419
         //adding name of the Question Submitter
420 420
         $requester = Smartfaq\Utility::getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']);
421
-        echo "<td class='even' align='center'>" . $requester . '</td>';
421
+        echo "<td class='even' align='center'>".$requester.'</td>';
422 422
 
423 423
         //adding name of the Answer Submitter
424 424
         /** @var \XoopsModules\Smartfaq\AnswerHandler $answerHandler */
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
         $criteria->add(new \Criteria('faqid', $faqsObj[$i]->faqid()));
429 429
         $criteria->add(new \Criteria('status', true));
430 430
 
431
-        $answerObjects =& $answerHandler->getObjects($criteria, true);
431
+        $answerObjects = & $answerHandler->getObjects($criteria, true);
432 432
 
433 433
         foreach (array_keys($answerObjects) as $j) {
434 434
             $answerObj = $answerObjects[$j];
@@ -441,20 +441,20 @@  discard block
 block discarded – undo
441 441
         } else {
442 442
             $answerSubmitter = '--------';
443 443
         }
444
-        echo "<td class='even' align='center'>" . $answerSubmitter . '</td>';
444
+        echo "<td class='even' align='center'>".$answerSubmitter.'</td>';
445 445
 
446 446
         //mb---------------------------------------
447 447
 
448
-        echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>';
449
-        echo "<td class='even' align='center'>" . $statustxt . '</td>';
448
+        echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>';
449
+        echo "<td class='even' align='center'>".$statustxt.'</td>';
450 450
         //echo "<td class='even' align='center'>" . $answers . "</td>";
451
-        echo "<td class='even' align='center'> " . $approve . $modify . $delete . '</td>';
451
+        echo "<td class='even' align='center'> ".$approve.$modify.$delete.'</td>';
452 452
         echo '</tr>';
453 453
     }
454 454
 } else {
455 455
     // that is, $numrows = 0, there's no entries yet
456 456
     echo '<tr>';
457
-    echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQSSEL . '</td>';
457
+    echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQSSEL.'</td>';
458 458
     echo '</tr>';
459 459
 }
460 460
 echo "</table>\n";
@@ -462,9 +462,9 @@  discard block
 block discarded – undo
462 462
 $pagenav = new \XoopsPageNav($numrows, $helper->getConfig('perpage'), $startentry, 'startentry', "statussel=$statussel&amp;sortsel=$sortsel&amp;ordersel=$ordersel");
463 463
 
464 464
 if (1 == $helper->getConfig('useimagenavpage')) {
465
-    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderImageNav() . '</div>';
465
+    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">'.$pagenav->renderImageNav().'</div>';
466 466
 } else {
467
-    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderNav() . '</div>';
467
+    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">'.$pagenav->renderNav().'</div>';
468 468
 }
469 469
 // ENDs code to show active entries
470 470
 echo '</div>';
@@ -472,4 +472,4 @@  discard block
 block discarded – undo
472 472
 echo '</div>';
473 473
 echo '</div>';
474 474
 
475
-require_once __DIR__ . '/admin_footer.php';
475
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/question.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 /** @var Smartfaq\Helper $helper */
12 12
 $helper = Smartfaq\Helper::getInstance();
13 13
 
14
-require_once __DIR__ . '/admin_header.php';
14
+require_once __DIR__.'/admin_header.php';
15 15
 
16 16
 global $xoopsUser;
17 17
 
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
  */
41 41
 function editfaq($showmenu = false, $faqid = -1)
42 42
 {
43
-    global $faqHandler, $categoryHandler, $xoopsUser, $xoopsConfig, $xoopsDB, $modify,  $xoopsModule, $XOOPS_URL, $myts;
43
+    global $faqHandler, $categoryHandler, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModule, $XOOPS_URL, $myts;
44 44
     /** @var Smartfaq\Helper $helper */
45 45
     $helper = Smartfaq\Helper::getInstance();
46 46
 
47
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
47
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
48 48
     // If there is a parameter, and the id exists, retrieve data: we're editing a faq
49 49
     if (-1 != $faqid) {
50 50
         // Creating the FAQ object
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 
77 77
         echo "<br>\n";
78 78
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
79
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . $collapsableBar_title . '</h3>';
79
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".$collapsableBar_title.'</h3>';
80 80
         echo "<div id='bottomtable'>";
81
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>';
81
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>';
82 82
     } else {
83 83
         // there's no parameter, so we're adding a faq
84 84
         $faqObj = $faqHandler->create();
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $button_caption    = _AM_SF_CREATE;
90 90
 
91 91
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
92
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CREATEQUESTION . '</h3>';
92
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CREATEQUESTION.'</h3>';
93 93
         echo "<div id='bottomtable'>";
94 94
     }
95 95
     $sform = new \XoopsThemeForm(_AM_SF_OPEN_QUESTION, 'op', xoops_getenv('PHP_SELF'), 'post', true);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $button_tray->addElement($butt_create);
164 164
 
165 165
         $butt_edit = new \XoopsFormButton('', '', _AM_SF_OPEN_QUESTION_EDIT, 'button');
166
-        $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&amp;faqid=" . $faqid . "'\"");
166
+        $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&amp;faqid=".$faqid."'\"");
167 167
         $button_tray->addElement($butt_edit);
168 168
 
169 169
         $butt_cancel = new \XoopsFormButton('', '', _AM_SF_CANCEL, 'button');
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         xoops_cp_header();
196 196
 
197 197
         $adminObject->displayNavigation(basename(__FILE__));
198
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
198
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
199 199
 
200 200
         editfaq(true, $faqid);
201 201
         break;
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
         // Storing the FAQ
258 258
         if (!$faqObj->store()) {
259
-            redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR . Smartfaq\Utility::formatErrors($faqObj->getErrors()));
259
+            redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR.Smartfaq\Utility::formatErrors($faqObj->getErrors()));
260 260
         }
261 261
 
262 262
         // Send notifications
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
                               'faqid'   => $faqObj->faqid(),
298 298
                               'confirm' => 1,
299 299
                               'name'    => $faqObj->question()
300
-                          ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
300
+                          ], 'question.php', _AM_SF_DELETETHISQUESTION." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE);
301 301
             xoops_cp_footer();
302 302
         }
303 303
 
@@ -310,18 +310,18 @@  discard block
 block discarded – undo
310 310
         xoops_cp_header();
311 311
         $adminObject->displayNavigation(basename(__FILE__));
312 312
 
313
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
314
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
313
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
314
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
315 315
 
316
-        global  $xoopsConfig, $xoopsDB,  $xoopsModule, $smartModuleConfig;
316
+        global  $xoopsConfig, $xoopsDB, $xoopsModule, $smartModuleConfig;
317 317
 
318 318
         echo "<br>\n";
319 319
 
320 320
         Smartfaq\Utility::collapsableBar('toptable', 'toptableicon');
321 321
 
322
-        echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_OPENED_TITLE . '</h3>';
322
+        echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_OPENED_TITLE.'</h3>';
323 323
         echo "<div id='toptable'>";
324
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_OPENED_DSC . '</span>';
324
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_OPENED_DSC.'</span>';
325 325
 
326 326
         // Get the total number of published FAQs
327 327
         $totalfaqs = $faqHandler->getFaqsCount(-1, [Constants::SF_STATUS_OPENED]);
@@ -331,14 +331,14 @@  discard block
 block discarded – undo
331 331
         $allCats         = $categoryHandler->getObjects(null, true);
332 332
         echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
333 333
         echo '<tr>';
334
-        echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>';
335
-        echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
336
-        echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>';
334
+        echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>';
335
+        echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
336
+        echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>';
337 337
 
338
-        echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>';
338
+        echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>';
339 339
 
340
-        echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
341
-        echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
340
+        echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
341
+        echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
342 342
         echo '</tr>';
343 343
         //var_dump( $faqsObj);
344 344
         if ($totalfaqs > 0) {
@@ -346,33 +346,33 @@  discard block
 block discarded – undo
346 346
             foreach (array_keys($faqsObj) as $i) {
347 347
                 $categoryObj = $allCats[$faqsObj[$i]->categoryid()];
348 348
 
349
-                $modify = "<a href='question.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_EDITART . "'></a>";
350
-                $delete = "<a href='question.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>";
349
+                $modify = "<a href='question.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_EDITART."'></a>";
350
+                $delete = "<a href='question.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>";
351 351
 
352 352
                 $requester = Smartfaq\Utility::getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']);
353 353
 
354 354
                 echo '<tr>';
355
-                echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>';
356
-                echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>';
357
-                echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/answer.php?faqid=' . $faqsObj[$i]->faqid() . "'>" . $faqsObj[$i]->question(100) . '</a></td>';
355
+                echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>';
356
+                echo "<td class='even' align='left'>".$categoryObj->name().'</td>';
357
+                echo "<td class='even' align='left'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/answer.php?faqid='.$faqsObj[$i]->faqid()."'>".$faqsObj[$i]->question(100).'</a></td>';
358 358
 
359
-                echo "<td class='even' align='center'>" . $requester . '</td>';
359
+                echo "<td class='even' align='center'>".$requester.'</td>';
360 360
 
361
-                echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>';
361
+                echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>';
362 362
                 echo "<td class='even' align='center'> $modify $delete </td>";
363 363
                 echo '</tr>';
364 364
             }
365 365
         } else {
366 366
             $faqid = -1;
367 367
             echo '<tr>';
368
-            echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOQUEUED . '</td>';
368
+            echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOQUEUED.'</td>';
369 369
             echo '</tr>';
370 370
         }
371 371
         echo "</table>\n";
372 372
         echo "<br>\n";
373 373
 
374 374
         $pagenav = new \XoopsPageNav($totalfaqs, $helper->getConfig('perpage'), $startfaq, 'startfaq');
375
-        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
375
+        echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
376 376
         echo '</div>';
377 377
 
378 378
         $totalcategories = $categoryHandler->getCategoriesCount(-1);
@@ -383,4 +383,4 @@  discard block
 block discarded – undo
383 383
         break;
384 384
 }
385 385
 
386
-require_once __DIR__ . '/admin_footer.php';
386
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
print.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use XoopsModules\Smartfaq;
10 10
 
11
-require_once __DIR__ . '/header.php';
11
+require_once __DIR__.'/header.php';
12 12
 
13 13
 $faqid = \Xmf\Request::getInt('faqid', 0, 'GET');
14 14
 
@@ -46,23 +46,23 @@  discard block
 block discarded – undo
46 46
 
47 47
 echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
48 48
 echo "<html>\n<head>\n";
49
-echo '<title>' . _MD_SF_FAQCOMEFROM . ' ' . $xoopsConfig['sitename'] . "</title>\n";
50
-echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "'>\n";
51
-echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "'>\n";
52
-echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "'>\n";
53
-echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "'>\n";
54
-echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "'>\n\n\n";
49
+echo '<title>'._MD_SF_FAQCOMEFROM.' '.$xoopsConfig['sitename']."</title>\n";
50
+echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."'>\n";
51
+echo "<meta name='AUTHOR' content='".$xoopsConfig['sitename']."'>\n";
52
+echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by ".$xoopsConfig['sitename']."'>\n";
53
+echo "<meta name='DESCRIPTION' content='".$xoopsConfig['slogan']."'>\n";
54
+echo "<meta name='GENERATOR' content='".XOOPS_VERSION."'>\n\n\n";
55 55
 
56 56
 echo "<body bgcolor='#ffffff' text='#000000' onload='window.print()'>
57 57
      <div style='width: 650px; border: 1px solid #000; padding: 20px;'>
58
-     <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>" . $faqObj->question() . "</h2></div>
59
-     <div align='center'>" . $who_where . "</div>
58
+     <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL."/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>".$faqObj->question()."</h2></div>
59
+     <div align='center'>" . $who_where."</div>
60 60
                 <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div>
61 61
                 <div></div>
62
-                <b><p>" . $faqObj->question() . '</p></b>
63
-                <p>' . $answerObj->answer() . "</p>
62
+                <b><p>" . $faqObj->question().'</p></b>
63
+                <p>' . $answerObj->answer()."</p>
64 64
                 <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div>
65
-                <p>" . $comeFrom . '</p>
65
+                <p>" . $comeFrom.'</p>
66 66
             </div>
67 67
     <br>';
68 68
 
Please login to merge, or discard this patch.