Completed
Push — master ( 80219e...2744eb )
by Michael
08:05
created
admin/answer.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use XoopsModules\Smartfaq;
10 10
 use XoopsModules\Smartfaq\Constants;
11 11
 
12
-require_once __DIR__ . '/admin_header.php';
12
+require_once __DIR__.'/admin_header.php';
13 13
 
14 14
 $op = '';
15 15
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 {
33 33
     global $answerHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts, $pathIcon16, $smartModuleConfig;
34 34
 
35
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
35
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
36 36
 
37 37
     // Creating the FAQ object
38 38
     $faqObj = new Smartfaq\Faq($faqid);
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
     $official_answer = $faqObj->answer();
70 70
 
71 71
     Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
72
-    echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_SUBMITTED_ANSWER . '</h3>';
72
+    echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_SUBMITTED_ANSWER.'</h3>';
73 73
     echo "<div id='bottomtable'>";
74
-    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_SUBMITTED_ANSWER_INFO . '</span>';
74
+    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_SUBMITTED_ANSWER_INFO.'</span>';
75 75
 
76 76
     $proposed_answers = $answerHandler->getAllAnswers($faqid, Constants::SF_AN_STATUS_PROPOSED);
77 77
 
@@ -81,31 +81,31 @@  discard block
 block discarded – undo
81 81
 
82 82
     echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>
83 83
             <tr>
84
-              <td class='head' width='100px'>" . _AM_SF_CATEGORY . "</td>
85
-              <td class='even'>" . $categoryObj->name() . "</td>
84
+              <td class='head' width='100px'>" . _AM_SF_CATEGORY."</td>
85
+              <td class='even'>" . $categoryObj->name()."</td>
86 86
             </tr>
87 87
             <tr>
88
-              <td class='head' width='100px'>" . _AM_SF_QUESTION . "</td>
89
-              <td class='even'>" . $faqObj->question() . '</td>
88
+              <td class='head' width='100px'>" . _AM_SF_QUESTION."</td>
89
+              <td class='even'>" . $faqObj->question().'</td>
90 90
             </tr>';
91 91
     if ($official_answer) {
92 92
         echo "
93 93
             <tr>
94
-              <td class='head' width='100px'>" . _AM_SF_ANSWER_OFFICIAL . "</td>
95
-              <td class='even'>" . $official_answer->answer() . '</td>
94
+              <td class='head' width='100px'>" . _AM_SF_ANSWER_OFFICIAL."</td>
95
+              <td class='even'>" . $official_answer->answer().'</td>
96 96
             </tr>';
97 97
     }
98 98
     echo "</table><br>\n";
99 99
 
100 100
     echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
101 101
     echo '<tr>';
102
-    echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>';
103
-    echo "<th class='bg3' class='bg3' align='center'><b>" . _AM_SF_ANSWER . '</b></td>';
102
+    echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>';
103
+    echo "<th class='bg3' class='bg3' align='center'><b>"._AM_SF_ANSWER.'</b></td>';
104 104
 
105
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>';
105
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>';
106 106
 
107
-    echo "<th width='180' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
108
-    echo "<th width='120' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
107
+    echo "<th width='180' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
108
+    echo "<th width='120' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
109 109
     echo '</tr>';
110 110
 
111 111
     $merge   = '';
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     $approve = '';
114 114
     foreach ($proposed_answers as $proposed_answer) {
115 115
         if (Constants::SF_STATUS_NEW_ANSWER == $faqObj->status()) {
116
-            $merge   = "<a href='faq.php?op=merge&amp;faqid="
116
+            $merge = "<a href='faq.php?op=merge&amp;faqid="
117 117
                        . $faqObj->faqid()
118 118
                        . '&amp;answerid='
119 119
                        . $proposed_answer->answerid()
@@ -126,19 +126,19 @@  discard block
 block discarded – undo
126 126
                        . "' alt='"
127 127
                        . _AM_SF_FAQ_MERGE
128 128
                        . "'></a>&nbsp;";
129
-            $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>";
129
+            $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>";
130 130
         }
131
-        $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;";
132
-        $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>";
131
+        $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;";
132
+        $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>";
133 133
         echo '<tr>';
134
-        echo "<td class='head' align='center'>" . $proposed_answer->answerid() . '</td>';
135
-        echo "<td class='even' align='left'>" . $proposed_answer->answer() . '</td>';
134
+        echo "<td class='head' align='center'>".$proposed_answer->answerid().'</td>';
135
+        echo "<td class='even' align='left'>".$proposed_answer->answer().'</td>';
136 136
 
137 137
         //show name of the answer submitter
138 138
         $submitter = Smartfaq\Utility::getLinkedUnameFromId($proposed_answer->uid(), $smartModuleConfig['userealname']);
139
-        echo "<td class='even' align='center'>" . $submitter . '</td>';
139
+        echo "<td class='even' align='center'>".$submitter.'</td>';
140 140
 
141
-        echo "<td class='even' align='center'>" . $proposed_answer->datesub() . '</td>';
141
+        echo "<td class='even' align='center'>".$proposed_answer->datesub().'</td>';
142 142
         echo "<td class='even' align='center'> $merge $modify $approve $delete </td>";
143 143
         echo '</tr>';
144 144
     }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 switch ($op) {
151 151
     case 'mod':
152 152
         xoops_cp_header();
153
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
153
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
154 154
         global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $modify, $myts;
155 155
         $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
156 156
         editfaq($faqid);
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                     $proposed_answers = $answerHandler->getAllAnswers($faqid, Constants::SF_AN_STATUS_PROPOSED);
258 258
                     if (count($proposed_answers) > 0) {
259 259
                         // This question has other proposed answer
260
-                        $redirect_page = 'answer.php?op=mod&faqid=' . $faqid;
260
+                        $redirect_page = 'answer.php?op=mod&faqid='.$faqid;
261 261
                         $redirect_msg  = _AM_SF_ANSWER_REJECTED;
262 262
                     } else {
263 263
                         // The question has no other proposed answer
@@ -281,11 +281,11 @@  discard block
 block discarded – undo
281 281
     default:
282 282
         xoops_cp_header();
283 283
 
284
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
284
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
285 285
         global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule;
286 286
 
287 287
         editfaq();
288 288
         break;
289 289
 }
290 290
 
291
-require_once __DIR__ . '/admin_footer.php';
291
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/admin.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -28,42 +28,42 @@  discard block
 block discarded – undo
28 28
 if (empty($fct)) {
29 29
     $fct = 'preferences';
30 30
 }
31
-include __DIR__ . '/../../../mainfile.php';
32
-include XOOPS_ROOT_PATH . '/include/cp_functions.php';
31
+include __DIR__.'/../../../mainfile.php';
32
+include XOOPS_ROOT_PATH.'/include/cp_functions.php';
33 33
 
34
-require_once XOOPS_ROOT_PATH . '/kernel/module.php';
34
+require_once XOOPS_ROOT_PATH.'/kernel/module.php';
35 35
 
36 36
 $admintest = 0;
37 37
 
38 38
 if (is_object($xoopsUser)) {
39 39
     $xoopsModule = XoopsModule::getByDirname('system');
40 40
     if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
41
-        redirect_header(XOOPS_URL . '/user.php', 3, _NOPERM);
41
+        redirect_header(XOOPS_URL.'/user.php', 3, _NOPERM);
42 42
     }
43 43
     $admintest = 1;
44 44
 } else {
45
-    redirect_header(XOOPS_URL . '/user.php', 3, _NOPERM);
45
+    redirect_header(XOOPS_URL.'/user.php', 3, _NOPERM);
46 46
 }
47 47
 
48 48
 // include system category definitions
49
-require_once XOOPS_ROOT_PATH . '/modules/system/constants.php';
49
+require_once XOOPS_ROOT_PATH.'/modules/system/constants.php';
50 50
 $error = false;
51 51
 if (0 != $admintest) {
52 52
     if (isset($fct) && '' != $fct) {
53
-        if (file_exists(XOOPS_ROOT_PATH . '/modules/system/admin/' . $fct . '/xoops_version.php')) {
53
+        if (file_exists(XOOPS_ROOT_PATH.'/modules/system/admin/'.$fct.'/xoops_version.php')) {
54 54
             xoops_loadLanguage('admin', 'system');
55
-            xoops_loadLanguage('admin/' . $fct, 'system');
55
+            xoops_loadLanguage('admin/'.$fct, 'system');
56 56
 
57
-            include XOOPS_ROOT_PATH . '/modules/system/admin/' . $fct . '/xoops_version.php';
57
+            include XOOPS_ROOT_PATH.'/modules/system/admin/'.$fct.'/xoops_version.php';
58 58
             $syspermHandler = xoops_getHandler('groupperm');
59 59
             $category       = !empty($modversion['category']) ? (int)$modversion['category'] : 0;
60 60
             unset($modversion);
61 61
             if ($category > 0) {
62
-                $groups =& $xoopsUser->getGroups();
62
+                $groups = & $xoopsUser->getGroups();
63 63
                 if (in_array(XOOPS_GROUP_ADMIN, $groups)
64 64
                     || false !== $syspermHandler->checkRight('system_admin', $category, $groups, $xoopsModule->getVar('mid'))) {
65 65
                     if (file_exists("../include/{$fct}.inc.php")) {
66
-                        require_once __DIR__ . "/../include/{$fct}.inc.php";
66
+                        require_once __DIR__."/../include/{$fct}.inc.php";
67 67
                     } else {
68 68
                         $error = true;
69 69
                     }
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
                     $error = true;
72 72
                 }
73 73
             } elseif ('version' === $fct) {
74
-                if (file_exists(XOOPS_ROOT_PATH . '/modules/system/admin/version/main.php')) {
75
-                    require_once XOOPS_ROOT_PATH . '/modules/system/admin/version/main.php';
74
+                if (file_exists(XOOPS_ROOT_PATH.'/modules/system/admin/version/main.php')) {
75
+                    require_once XOOPS_ROOT_PATH.'/modules/system/admin/version/main.php';
76 76
                 } else {
77 77
                     $error = true;
78 78
                 }
@@ -92,26 +92,26 @@  discard block
 block discarded – undo
92 92
     echo '<h4>System Configuration</h4>';
93 93
     echo '<table class="outer" cellpadding="4" cellspacing="1">';
94 94
     echo '<tr>';
95
-    $groups =& $xoopsUser->getGroups();
95
+    $groups = & $xoopsUser->getGroups();
96 96
     $all_ok = false;
97 97
     if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
98 98
         $syspermHandler = xoops_getHandler('groupperm');
99
-        $ok_syscats     =& $syspermHandler->getItemIds('system_admin', $groups);
99
+        $ok_syscats     = & $syspermHandler->getItemIds('system_admin', $groups);
100 100
     } else {
101 101
         $all_ok = true;
102 102
     }
103
-    $admin_dir = XOOPS_ROOT_PATH . '/modules/system/admin';
103
+    $admin_dir = XOOPS_ROOT_PATH.'/modules/system/admin';
104 104
     $handle    = opendir($admin_dir);
105 105
     $counter   = 0;
106 106
     $class     = 'even';
107 107
     while ($file = readdir($handle)) {
108
-        if ('cvs' !== strtolower($file) && !preg_match('/[.]/', $file) && is_dir($admin_dir . '/' . $file)) {
109
-            include $admin_dir . '/' . $file . '/xoops_version.php';
108
+        if ('cvs' !== strtolower($file) && !preg_match('/[.]/', $file) && is_dir($admin_dir.'/'.$file)) {
109
+            include $admin_dir.'/'.$file.'/xoops_version.php';
110 110
             if ($modversion['hasAdmin']) {
111 111
                 $category = isset($modversion['category']) ? (int)$modversion['category'] : 0;
112 112
                 if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) {
113 113
                     echo "<td class='$class' align='center' valign='bottom' width='19%'>";
114
-                    echo "<a href='" . XOOPS_URL . '/modules/system/admin.php?fct=' . $file . "'><b>" . trim($modversion['name']) . "</b></a>\n";
114
+                    echo "<a href='".XOOPS_URL.'/modules/system/admin.php?fct='.$file."'><b>".trim($modversion['name'])."</b></a>\n";
115 115
                     echo '</td>';
116 116
                     ++$counter;
117 117
                     $class = ('even' === $class) ? 'odd' : 'even';
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         }
127 127
     }
128 128
     while ($counter < 5) {
129
-        echo '<td class="' . $class . '">&nbsp;</td>';
129
+        echo '<td class="'.$class.'">&nbsp;</td>';
130 130
         $class = ('even' === $class) ? 'odd' : 'even';
131 131
         ++$counter;
132 132
     }
Please login to merge, or discard this patch.
admin/faq.php 1 patch
Spacing   +21 added lines, -21 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
 // Creating the faq handler object
16 16
 /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 {
46 46
     global $answerHandler, $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts;
47 47
 
48
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
48
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
49 49
     // If there is a parameter, and the id exists, retrieve data: we're editing a faq
50 50
     if (-1 != $faqid) {
51 51
         // Creating the FAQ object
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 
148 148
         echo "<br>\n";
149 149
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
150
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . $collapsableBar_title . '</h3>';
150
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".$collapsableBar_title.'</h3>';
151 151
         echo "<div id='bottomtable'>";
152
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>';
152
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>';
153 153
     } else {
154 154
         // there's no parameter, so we're adding a faq
155 155
         $faqObj = $faqHandler->create();
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $button_caption     = _AM_SF_CREATE;
164 164
 
165 165
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
166
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CREATESMARTFAQ . '</h3>';
166
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CREATESMARTFAQ.'</h3>';
167 167
         echo "<div id='bottomtable'>";
168 168
     }
169 169
     $sform = new \XoopsThemeForm(_AM_SF_SMARTFAQ, 'op', xoops_getenv('PHP_SELF'), 'post', true);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 
195 195
     // ANSWER
196 196
     if ($merge) {
197
-        $theanswer = $originalAnswerObj->answer('e') . "\n\n" . sprintf(_AM_SF_NEW_CONTRIBUTION, Smartfaq\Utility::getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), $answerObj->answer('e'));
197
+        $theanswer = $originalAnswerObj->answer('e')."\n\n".sprintf(_AM_SF_NEW_CONTRIBUTION, Smartfaq\Utility::getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), $answerObj->answer('e'));
198 198
     } else {
199 199
         $theanswer = $answerObj->answer('e');
200 200
     }
@@ -243,14 +243,14 @@  discard block
 block discarded – undo
243 243
     $sform->addElement(new \XoopsFormText(_AM_SF_SPECIFIC_URL, 'contextpage', 50, 60, $faqObj->contextpage()), false);
244 244
 
245 245
     // EXACT URL?
246
-    $excaturl_radio = new \XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
246
+    $excaturl_radio = new \XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
247 247
     $sform->addElement($excaturl_radio);
248 248
     // WEIGHT
249 249
     $sform->addElement(new \XoopsFormText(_AM_SF_WEIGHT, 'weight', 5, 5, $faqObj->weight()), true);
250 250
 
251 251
     // COMMENTS
252 252
     // Code to allow comments
253
-    $addcomments_radio = new \XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
253
+    $addcomments_radio = new \XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
254 254
     $sform->addElement($addcomments_radio);
255 255
 
256 256
     // PER ITEM PERMISSIONS
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     }
265 265
     $sform->addElement($groups_checkbox);
266 266
 
267
-    $partial_view = new \XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
267
+    $partial_view = new \XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
268 268
     $sform->addElement($partial_view);
269 269
 
270 270
     // VARIOUS OPTIONS
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     // OFFLINE
288 288
     if (Constants::SF_STATUS_OFFLINE == $faqObj->status()) {
289 289
         // Back OnLine
290
-        $offline_radio = new \XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
290
+        $offline_radio = new \XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
291 291
         $sform->addElement($offline_radio);
292 292
     }
293 293
 
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         }
362 362
 
363 363
         xoops_cp_header();
364
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
364
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
365 365
 
366 366
         editfaq(true, $faqid, $answerid, true);
367 367
         break;
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
         xoops_cp_header();
383 383
 
384 384
         $adminObject->displayNavigation(basename(__FILE__));
385
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
385
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
386 386
 
387 387
         editfaq(true, $faqid, $answerid);
388 388
         break;
@@ -520,13 +520,13 @@  discard block
 block discarded – undo
520 520
 
521 521
         // Storing the FAQ
522 522
         if (!$faqObj->store()) {
523
-            redirect_header('javascript:history.go(-1)', 3, $error_msg . Smartfaq\Utility::formatErrors($faqObj->getErrors()));
523
+            redirect_header('javascript:history.go(-1)', 3, $error_msg.Smartfaq\Utility::formatErrors($faqObj->getErrors()));
524 524
         }
525 525
 
526 526
         // Storing the answer
527 527
         $answerObj->setVar('faqid', $faqObj->faqid());
528 528
         if (!$answerObj->store()) {
529
-            redirect_header('javascript:history.go(-1)', 3, $error_msg . Smartfaq\Utility::formatErrors($answerObj->getErrors()));
529
+            redirect_header('javascript:history.go(-1)', 3, $error_msg.Smartfaq\Utility::formatErrors($answerObj->getErrors()));
530 530
         }
531 531
 
532 532
         // Send notifications
@@ -553,20 +553,20 @@  discard block
 block discarded – undo
553 553
 
554 554
         if ($confirm) {
555 555
             if (!$faqHandler->delete($faqObj)) {
556
-                redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR . Smartfaq\Utility::formatErrors($faqObj->getErrors()));
556
+                redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR.Smartfaq\Utility::formatErrors($faqObj->getErrors()));
557 557
             }
558 558
 
559 559
             redirect_header('faq.php', 2, sprintf(_AM_SF_ARTISDELETED, $faqObj->question()));
560 560
         } else {
561 561
             // no confirm: show deletion condition
562
-            $faqid =  Request::getInt('faqid', 0, 'POST');
562
+            $faqid = Request::getInt('faqid', 0, 'POST');
563 563
             xoops_cp_header();
564 564
             xoops_confirm([
565 565
                               'op'      => 'del',
566 566
                               'faqid'   => $faqObj->faqid(),
567 567
                               'confirm' => 1,
568 568
                               'name'    => $faqObj->question()
569
-                          ], 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
569
+                          ], 'faq.php', _AM_SF_DELETETHISARTICLE." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE);
570 570
             xoops_cp_footer();
571 571
         }
572 572
 
@@ -580,10 +580,10 @@  discard block
 block discarded – undo
580 580
 
581 581
         $adminObject->displayNavigation(basename(__FILE__));
582 582
 
583
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
584
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
583
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
584
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
585 585
 
586
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php';
586
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php';
587 587
 
588 588
         $totalcategories = $categoryHandler->getCategoriesCount(-1);
589 589
         if ($totalcategories > 0) {
@@ -593,4 +593,4 @@  discard block
 block discarded – undo
593 593
         break;
594 594
 }
595 595
 
596
-require_once __DIR__ . '/admin_footer.php';
596
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/mygrouppermform.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 
25 25
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
26 26
 
27
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php';
28
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php';
29
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhiddentoken.php';
30
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php';
31
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php';
32
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php';
27
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php';
28
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhidden.php';
29
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhiddentoken.php';
30
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formbutton.php';
31
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelementtray.php';
32
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/form.php';
33 33
 
34 34
 /**
35 35
  * Renders a form for setting module specific group permissions
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
         }
160 160
         $gpermHandler  = xoops_getHandler('groupperm');
161 161
         $memberHandler = xoops_getHandler('member');
162
-        $glist         =& $memberHandler->getGroupList();
162
+        $glist         = & $memberHandler->getGroupList();
163 163
         foreach (array_keys($glist) as $i) {
164 164
             // get selected item id(s) for each group
165 165
             $selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid);
166
-            $ele      = new MyXoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
166
+            $ele      = new MyXoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected);
167 167
             $ele->setOptionTree($this->_itemTree);
168 168
 
169 169
             foreach ($this->_appendix as $key => $append) {
@@ -190,18 +190,18 @@  discard block
 block discarded – undo
190 190
         $tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
191 191
         $this->addElement($tray);
192 192
 
193
-        $ret      = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br>';
194
-        $ret      .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n";
195
-        $elements =& $this->getElements();
193
+        $ret      = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br>';
194
+        $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n";
195
+        $elements = & $this->getElements();
196 196
         foreach (array_keys($elements) as $i) {
197 197
             if (!is_object($elements[$i])) {
198 198
                 $ret .= $elements[$i];
199 199
             } elseif (!$elements[$i]->isHidden()) {
200
-                $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption();
200
+                $ret .= "<tr valign='top' align='left'><td class='head'>".$elements[$i]->getCaption();
201 201
                 if ('' != $elements[$i]->getDescription()) {
202
-                    $ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
202
+                    $ret .= '<br><br><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>';
203 203
                 }
204
-                $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
204
+                $ret .= "</td>\n<td class='even'>\n".$elements[$i]->render()."\n</td></tr>\n";
205 205
             } else {
206 206
                 $ret .= $elements[$i]->render();
207 207
             }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
      */
288 288
     public function setOptionTree(&$optionTree)
289 289
     {
290
-        $this->_optionTree =& $optionTree;
290
+        $this->_optionTree = & $optionTree;
291 291
     }
292 292
 
293 293
     /**
@@ -312,34 +312,34 @@  discard block
 block discarded – undo
312 312
         $ret = '';
313 313
 
314 314
         if (count($this->_appendix) > 0) {
315
-            $ret  .= '<table class="outer"><tr>';
315
+            $ret .= '<table class="outer"><tr>';
316 316
             $cols = 1;
317 317
             foreach ($this->_appendix as $append) {
318 318
                 if ($cols > 4) {
319
-                    $ret  .= '</tr><tr>';
319
+                    $ret .= '</tr><tr>';
320 320
                     $cols = 1;
321 321
                 }
322 322
                 $checked = $append['selected'] ? 'checked' : '';
323
-                $name    = 'perms[' . $append['permname'] . ']';
323
+                $name    = 'perms['.$append['permname'].']';
324 324
                 $itemid  = $append['itemid'];
325 325
                 $itemid  = $append['itemid'];
326
-                $ret     .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked>{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\"><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\"><br></td>";
326
+                $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked>{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\"><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\"><br></td>";
327 327
                 ++$cols;
328 328
             }
329 329
             $ret .= '</tr></table>';
330 330
         }
331 331
 
332
-        $ret  .= '<table class="outer"><tr>';
332
+        $ret .= '<table class="outer"><tr>';
333 333
         $cols = 1;
334 334
         foreach ($this->_optionTree[0]['children'] as $topitem) {
335 335
             if ($cols > 4) {
336
-                $ret  .= '</tr><tr>';
336
+                $ret .= '</tr><tr>';
337 337
                 $cols = 1;
338 338
             }
339 339
             $tree   = '<td class="odd">';
340 340
             $prefix = '';
341 341
             $this->renderOptionTree($tree, $this->_optionTree[$topitem], $prefix);
342
-            $ret .= $tree . '</td>';
342
+            $ret .= $tree.'</td>';
343 343
             ++$cols;
344 344
         }
345 345
         $ret .= '</tr></table>';
@@ -358,21 +358,21 @@  discard block
 block discarded – undo
358 358
      */
359 359
     private function renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
360 360
     {
361
-        $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
361
+        $tree .= $prefix.'<input type="checkbox" name="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" onclick="';
362 362
         // If there are parent elements, add javascript that will
363 363
         // make them selecteded when this element is checked to make
364 364
         // sure permissions to parent items are added as well.
365 365
         foreach ($parentIds as $pid) {
366
-            $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
367
-            $tree       .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}";
366
+            $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']';
367
+            $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if (ele.checked !== true) {ele.checked = this.checked;}";
368 368
         }
369 369
         // If there are child elements, add javascript that will
370 370
         // make them unchecked when this element is unchecked to make
371 371
         // sure permissions to child items are not added when there
372 372
         // is no permission to this item.
373 373
         foreach ($option['allchild'] as $cid) {
374
-            $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
375
-            $tree      .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}";
374
+            $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']';
375
+            $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if (this.checked !== true) {ele.checked = false;}";
376 376
         }
377 377
         $tree .= '" value="1"';
378 378
         if (null !== $this->_value && in_array($option['id'], $this->_value)) {
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
         if (isset($option['children'])) {
397 397
             foreach ($option['children'] as $child) {
398 398
                 array_push($parentIds, $option['id']);
399
-                $this->renderOptionTree($tree, $this->_optionTree[$child], $prefix . '&nbsp;-', $parentIds);
399
+                $this->renderOptionTree($tree, $this->_optionTree[$child], $prefix.'&nbsp;-', $parentIds);
400 400
             }
401 401
         }
402 402
     }
Please login to merge, or discard this patch.
admin/main.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use XoopsModules\Smartfaq;
10 10
 use XoopsModules\Smartfaq\Constants;
11 11
 
12
-require_once __DIR__ . '/admin_header.php';
12
+require_once __DIR__.'/admin_header.php';
13 13
 $myts = \MyTextSanitizer::getInstance();
14 14
 
15 15
 $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0;
@@ -35,23 +35,23 @@  discard block
 block discarded – undo
35 35
     global $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
36 36
     echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>";
37 37
     echo '<tr>';
38
-    echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_FAQID . '</b></td>';
39
-    echo "<th width='20%' class='bg3' align='center'><b>" . _AM_SF_FAQCAT . '</b></td>';
40
-    echo "<th class='bg3' align='center'><b>" . _AM_SF_QUESTION . '</b></td>';
38
+    echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_FAQID.'</b></td>';
39
+    echo "<th width='20%' class='bg3' align='center'><b>"._AM_SF_FAQCAT.'</b></td>';
40
+    echo "<th class='bg3' align='center'><b>"._AM_SF_QUESTION.'</b></td>';
41 41
 
42
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>';
43
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>';
42
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>';
43
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>';
44 44
 
45
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
46
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_STATUS . '</b></td>';
45
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
46
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_STATUS.'</b></td>';
47 47
     //echo "<td width='30' class='bg3' align='center'><b>" . _AM_SF_ANSWERS . "</b></td>";
48
-    echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
48
+    echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
49 49
     echo '</tr>';
50 50
 }
51 51
 
52 52
 // Code for the page
53
-require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
54
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
53
+require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
54
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
55 55
 
56 56
 // Creating the category handler object
57 57
 /** @var \XoopsModules\Smartfaq\CategoryHandler $categoryHandler */
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 
135 135
 // Construction of lower table
136 136
 Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
137
-echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_ALLFAQS . '</h3>';
137
+echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_ALLFAQS.'</h3>';
138 138
 echo "<div id='bottomtable'>";
139
-echo '<span style="color: #567; margin: 3px 0 18px 0; font-size: small; display: block; ">' . _AM_SF_ALLFAQSMSG . '</span>';
139
+echo '<span style="color: #567; margin: 3px 0 18px 0; font-size: small; display: block; ">'._AM_SF_ALLFAQSMSG.'</span>';
140 140
 
141 141
 $showingtxt    = '';
142 142
 $selectedtxt   = '';
@@ -205,98 +205,98 @@  discard block
 block discarded – undo
205 205
     case Constants::SF_STATUS_ASKED:
206 206
         $selectedtxt1        = 'selected';
207 207
         $caption             = _AM_SF_ASKED;
208
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_ASKED . ' ';
208
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_ASKED.' ';
209 209
         $status_explaination = _AM_SF_ASKED_EXP;
210 210
         break;
211 211
 
212 212
     case Constants::SF_STATUS_OPENED:
213 213
         $selectedtxt2        = 'selected';
214 214
         $caption             = _AM_SF_OPENED;
215
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_OPENED . ' ';
215
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_OPENED.' ';
216 216
         $status_explaination = _AM_SF_OPENED_EXP;
217 217
         break;
218 218
 
219 219
     case Constants::SF_STATUS_ANSWERED:
220 220
         $selectedtxt3        = 'selected';
221 221
         $caption             = _AM_SF_ANSWERED;
222
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_ANSWERED . ' ';
222
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_ANSWERED.' ';
223 223
         $status_explaination = _AM_SF_ANSWERED_EXP;
224 224
         break;
225 225
 
226 226
     case Constants::SF_STATUS_SUBMITTED:
227 227
         $selectedtxt4        = 'selected';
228 228
         $caption             = _AM_SF_SUBMITTED;
229
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_SUBMITTED . ' ';
229
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_SUBMITTED.' ';
230 230
         $status_explaination = _AM_SF_SUBMITTED_EXP;
231 231
         break;
232 232
 
233 233
     case Constants::SF_STATUS_PUBLISHED:
234 234
         $selectedtxt5        = 'selected';
235 235
         $caption             = _AM_SF_PUBLISHED;
236
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_PUBLISHED . ' ';
236
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_PUBLISHED.' ';
237 237
         $status_explaination = _AM_SF_PUBLISHED_EXP;
238 238
         break;
239 239
 
240 240
     case Constants::SF_STATUS_NEW_ANSWER:
241 241
         $selectedtxt6        = 'selected';
242 242
         $caption             = _AM_SF_NEW_ANSWER;
243
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_NEW_ANSWER . ' ';
243
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_NEW_ANSWER.' ';
244 244
         $status_explaination = _AM_SF_NEW_ANSWER_EXP;
245 245
         break;
246 246
 
247 247
     case Constants::SF_STATUS_OFFLINE:
248 248
         $selectedtxt7        = 'selected';
249 249
         $caption             = _AM_SF_OFFLINE;
250
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_OFFLINE . ' ';
250
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_OFFLINE.' ';
251 251
         $status_explaination = _AM_SF_OFFLINE_EXP;
252 252
         break;
253 253
 
254 254
     case Constants::SF_STATUS_REJECTED_QUESTION:
255 255
         $selectedtxt8        = 'selected';
256 256
         $caption             = _AM_SF_REJECTED_QUESTION;
257
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_REJECTED_QUESTION . ' ';
257
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_REJECTED_QUESTION.' ';
258 258
         $status_explaination = _AM_SF_REJECTED_QUESTION_EXP;
259 259
         break;
260 260
 
261 261
     case Constants::SF_STATUS_REJECTED_SMARTFAQ:
262 262
         $selectedtxt9        = 'selected';
263 263
         $caption             = _AM_SF_REJECTED_SMARTFAQ;
264
-        $cond                = ' WHERE status = ' . Constants::SF_STATUS_REJECTED_SMARTFAQ . ' ';
264
+        $cond                = ' WHERE status = '.Constants::SF_STATUS_REJECTED_SMARTFAQ.' ';
265 265
         $status_explaination = _AM_SF_REJECTED_SMARTFAQ_EXP;
266 266
         break;
267 267
 }
268 268
 
269 269
 /* -- Code to show selected terms -- */
270
-echo "<form name='pick' id='pick' action='" . $_SERVER['PHP_SELF'] . "' method='POST' style='margin: 0;'>";
270
+echo "<form name='pick' id='pick' action='".$_SERVER['PHP_SELF']."' method='POST' style='margin: 0;'>";
271 271
 
272 272
 echo "
273 273
     <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;'>
274 274
         <tr>
275
-            <td><span style='font-weight: bold; font-size: 12px; font-variant: small-caps;'>" . _AM_SF_SHOWING . ' ' . $caption . "</span></td>
276
-            <td align='right'>" . _AM_SF_SELECT_SORT . "
275
+            <td><span style='font-weight: bold; font-size: 12px; font-variant: small-caps;'>" . _AM_SF_SHOWING.' '.$caption."</span></td>
276
+            <td align='right'>" . _AM_SF_SELECT_SORT."
277 277
                 <select name='sortsel' onchange='submit()'>
278
-                    <option value='faq.faqid' $sorttxtfaqid>" . _AM_SF_ID . "</option>
279
-                    <option value='category.name' $sorttxtcategory>" . _AM_SF_CATEGORY . "</option>
280
-                    <option value='faq.question' $sorttxtquestion>" . _AM_SF_QUESTION . "</option>
281
-                    <option value='faq.datesub' $sorttxtcreated>" . _AM_SF_CREATED . "</option>
282
-                    <option value='faq.weight' $sorttxtweight>" . _AM_SF_WEIGHT . "</option>
278
+                    <option value='faq.faqid' $sorttxtfaqid>"._AM_SF_ID."</option>
279
+                    <option value='category.name' $sorttxtcategory>"._AM_SF_CATEGORY."</option>
280
+                    <option value='faq.question' $sorttxtquestion>"._AM_SF_QUESTION."</option>
281
+                    <option value='faq.datesub' $sorttxtcreated>"._AM_SF_CREATED."</option>
282
+                    <option value='faq.weight' $sorttxtweight>"._AM_SF_WEIGHT."</option>
283 283
                 </select>
284 284
                 <select name='ordersel' onchange='submit()'>
285
-                    <option value='ASC' $ordertxtasc>" . _AM_SF_ASC . "</option>
286
-                    <option value='DESC' $ordertxtdesc>" . _AM_SF_DESC . '</option>
285
+                    <option value='ASC' $ordertxtasc>"._AM_SF_ASC."</option>
286
+                    <option value='DESC' $ordertxtdesc>"._AM_SF_DESC.'</option>
287 287
                 </select>
288
-            ' . _AM_SF_SELECT_STATUS . " :
288
+            ' . _AM_SF_SELECT_STATUS." :
289 289
                 <select name='statussel' onchange='submit()'>
290
-                    <option value='0' $selectedtxt0>" . _AM_SF_ALL . " [$totalfaqs]</option>
291
-                    <option value='1' $selectedtxt1>" . _AM_SF_ASKED . " [$totalasked]</option>
292
-                    <option value='2' $selectedtxt2>" . _AM_SF_OPENED . " [$totalopened]</option>
293
-                    <option value='3' $selectedtxt3>" . _AM_SF_ANSWERED . " [$totalanswered]</option>
294
-                    <option value='4' $selectedtxt4>" . _AM_SF_SUBMITTED . " [$totalsubmitted]</option>
295
-                    <option value='5' $selectedtxt5>" . _AM_SF_PUBLISHED . " [$totalpublished]</option>
296
-                    <option value='6' $selectedtxt6>" . _AM_SF_NEWANSWER . " [$totalnewanswers]</option>
297
-                    <option value='7' $selectedtxt7>" . _AM_SF_OFFLINE . " [$totaloffline]</option>
298
-                    <option value='8' $selectedtxt8>" . _AM_SF_REJECTED_QUESTION . " [$totalrejectedquestion]</option>
299
-                    <option value='9' $selectedtxt9>" . _AM_SF_REJECTED_SMARTFAQ . " [$totalrejectedsmartfaq]</option>
290
+                    <option value='0' $selectedtxt0>"._AM_SF_ALL." [$totalfaqs]</option>
291
+                    <option value='1' $selectedtxt1>"._AM_SF_ASKED." [$totalasked]</option>
292
+                    <option value='2' $selectedtxt2>"._AM_SF_OPENED." [$totalopened]</option>
293
+                    <option value='3' $selectedtxt3>"._AM_SF_ANSWERED." [$totalanswered]</option>
294
+                    <option value='4' $selectedtxt4>"._AM_SF_SUBMITTED." [$totalsubmitted]</option>
295
+                    <option value='5' $selectedtxt5>"._AM_SF_PUBLISHED." [$totalpublished]</option>
296
+                    <option value='6' $selectedtxt6>"._AM_SF_NEWANSWER." [$totalnewanswers]</option>
297
+                    <option value='7' $selectedtxt7>"._AM_SF_OFFLINE." [$totaloffline]</option>
298
+                    <option value='8' $selectedtxt8>"._AM_SF_REJECTED_QUESTION." [$totalrejectedquestion]</option>
299
+                    <option value='9' $selectedtxt9>"._AM_SF_REJECTED_SMARTFAQ." [$totalrejectedsmartfaq]</option>
300 300
                 </select>
301 301
             </td>
302 302
         </tr>
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 $faqsObj = $faqHandler->getFaqsAdminSide($xoopsModuleConfig['perpage'], $startentry, $statusSelected, -1, $sortsel, $ordersel);
312 312
 
313 313
 // fetching all categories
314
-$allCats          = $categoryHandler->getObjects(null, true);
314
+$allCats = $categoryHandler->getObjects(null, true);
315 315
 //$totalItemsOnPage = count($faqsObj);
316 316
 buildTable();
317 317
 
@@ -334,65 +334,65 @@  discard block
 block discarded – undo
334 334
         switch ($faqsObj[$i]->status()) {
335 335
             case Constants::SF_STATUS_ASKED:
336 336
                 $statustxt = _AM_SF_ASKED;
337
-                $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;";
337
+                $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;";
338 338
                 $modify    = '';
339
-                $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>";
339
+                $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>";
340 340
                 break;
341 341
 
342 342
             case Constants::SF_STATUS_OPENED:
343 343
                 $statustxt = _AM_SF_OPENED;
344 344
                 $approve   = '';
345
-                $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;";
346
-                $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
+                $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;";
346
+                $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>";
347 347
                 break;
348 348
 
349 349
             case Constants::SF_STATUS_ANSWERED:
350 350
                 $statustxt = _AM_SF_ANSWERED;
351
-                $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;";
351
+                $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;";
352 352
                 $modify    = '';
353
-                $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>";
353
+                $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>";
354 354
                 break;
355 355
 
356 356
             case Constants::SF_STATUS_SUBMITTED:
357 357
                 $statustxt = _AM_SF_SUBMITTED;
358
-                $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;";
359
-                $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>";
358
+                $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;";
359
+                $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>";
360 360
                 $modify    = '';
361 361
                 break;
362 362
 
363 363
             case Constants::SF_STATUS_PUBLISHED:
364 364
                 $statustxt = _AM_SF_PUBLISHED;
365 365
                 $approve   = '';
366
-                $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;";
367
-                $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>";
366
+                $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;";
367
+                $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>";
368 368
                 break;
369 369
 
370 370
             case Constants::SF_STATUS_NEW_ANSWER:
371 371
                 $statustxt = _AM_SF_NEWANSWER;
372
-                $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;";
373
-                $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>";
372
+                $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;";
373
+                $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>";
374 374
                 $modify    = '';
375 375
                 break;
376 376
 
377 377
             case Constants::SF_STATUS_OFFLINE:
378 378
                 $statustxt = _AM_SF_OFFLINE;
379 379
                 $approve   = '';
380
-                $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;";
381
-                $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>";
380
+                $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;";
381
+                $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>";
382 382
                 break;
383 383
 
384 384
             case Constants::SF_STATUS_REJECTED_QUESTION:
385 385
                 $statustxt = _AM_SF_REJECTED_QUESTION;
386 386
                 $approve   = '';
387
-                $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;";
388
-                $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>";
387
+                $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;";
388
+                $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>";
389 389
                 break;
390 390
 
391 391
             case Constants::SF_STATUS_REJECTED_SMARTFAQ:
392 392
                 $statustxt = _AM_SF_REJECTED_SMARTFAQ;
393 393
                 $approve   = '';
394
-                $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;";
395
-                $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>";
394
+                $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;";
395
+                $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>";
396 396
                 break;
397 397
 
398 398
             case 'default':
@@ -406,14 +406,14 @@  discard block
 block discarded – undo
406 406
         //$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;";
407 407
 
408 408
         echo '<tr>';
409
-        echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>';
410
-        echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>';
411
-        echo "<td class='even' align='left'>" . $faqsObj[$i]->question(100) . '</td>';
409
+        echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>';
410
+        echo "<td class='even' align='left'>".$categoryObj->name().'</td>';
411
+        echo "<td class='even' align='left'>".$faqsObj[$i]->question(100).'</td>';
412 412
 
413 413
         //mb---------------------------------------
414 414
         //adding name of the Question Submitter
415 415
         $requester = Smartfaq\Utility::getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']);
416
-        echo "<td class='even' align='center'>" . $requester . '</td>';
416
+        echo "<td class='even' align='center'>".$requester.'</td>';
417 417
 
418 418
         //adding name of the Answer Submitter
419 419
         /** @var \XoopsModules\Smartfaq\AnswerHandler $answerHandler */
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         $criteria->add(new \Criteria('faqid', $faqsObj[$i]->faqid()));
424 424
         $criteria->add(new \Criteria('status', true));
425 425
 
426
-        $answerObjects =& $answerHandler->getObjects($criteria, true);
426
+        $answerObjects = & $answerHandler->getObjects($criteria, true);
427 427
 
428 428
         foreach (array_keys($answerObjects) as $j) {
429 429
             $answerObj = $answerObjects[$j];
@@ -436,20 +436,20 @@  discard block
 block discarded – undo
436 436
         } else {
437 437
             $answerSubmitter = '--------';
438 438
         }
439
-        echo "<td class='even' align='center'>" . $answerSubmitter . '</td>';
439
+        echo "<td class='even' align='center'>".$answerSubmitter.'</td>';
440 440
 
441 441
         //mb---------------------------------------
442 442
 
443
-        echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>';
444
-        echo "<td class='even' align='center'>" . $statustxt . '</td>';
443
+        echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>';
444
+        echo "<td class='even' align='center'>".$statustxt.'</td>';
445 445
         //echo "<td class='even' align='center'>" . $answers . "</td>";
446
-        echo "<td class='even' align='center'> " . $approve . $modify . $delete . '</td>';
446
+        echo "<td class='even' align='center'> ".$approve.$modify.$delete.'</td>';
447 447
         echo '</tr>';
448 448
     }
449 449
 } else {
450 450
     // that is, $numrows = 0, there's no entries yet
451 451
     echo '<tr>';
452
-    echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQSSEL . '</td>';
452
+    echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQSSEL.'</td>';
453 453
     echo '</tr>';
454 454
 }
455 455
 echo "</table>\n";
@@ -457,9 +457,9 @@  discard block
 block discarded – undo
457 457
 $pagenav = new \XoopsPageNav($numrows, $xoopsModuleConfig['perpage'], $startentry, 'startentry', "statussel=$statussel&amp;sortsel=$sortsel&amp;ordersel=$ordersel");
458 458
 
459 459
 if (1 == $xoopsModuleConfig['useimagenavpage']) {
460
-    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderImageNav() . '</div>';
460
+    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">'.$pagenav->renderImageNav().'</div>';
461 461
 } else {
462
-    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">' . $pagenav->renderNav() . '</div>';
462
+    echo '<div style="text-align:right; background-color: white; margin: 10px 0;">'.$pagenav->renderNav().'</div>';
463 463
 }
464 464
 // ENDs code to show active entries
465 465
 echo '</div>';
@@ -467,4 +467,4 @@  discard block
 block discarded – undo
467 467
 echo '</div>';
468 468
 echo '</div>';
469 469
 
470
-require_once __DIR__ . '/admin_footer.php';
470
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/category.php 1 patch
Spacing   +25 added lines, -25 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
 // Creating the category handler object
14 14
 /** @var \XoopsModules\Smartfaq\CategoryHandler $categoryHandler */
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
     $description = $categoryObj->description();
37 37
     if (!XOOPS_USE_MULTIBYTES) {
38 38
         if (strlen($description) >= 100) {
39
-            $description = substr($description, 0, 100 - 1) . '...';
39
+            $description = substr($description, 0, 100 - 1).'...';
40 40
         }
41 41
     }
42
-    $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITCOL . "' alt='" . _AM_SF_EDITCOL . "'></a>";
43
-    $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETECOL . "' alt='" . _AM_SF_DELETECOL . "'></a>";
42
+    $modify = "<a href='category.php?op=mod&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITCOL."' alt='"._AM_SF_EDITCOL."'></a>";
43
+    $delete = "<a href='category.php?op=del&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETECOL."' alt='"._AM_SF_DELETECOL."'></a>";
44 44
 
45 45
     $spaces = '';
46 46
     for ($j = 0; $j < $level; ++$j) {
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
          . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''>&nbsp;"
62 62
          . $categoryObj->name()
63 63
          . '</a></td>';
64
-    echo "<td class='even' align='left'>" . $description . '</td>';
65
-    echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>';
64
+    echo "<td class='even' align='left'>".$description.'</td>';
65
+    echo "<td class='even' align='center'>".$categoryObj->weight().'</td>';
66 66
     echo "<td class='even' align='center'> $modify $delete </td>";
67 67
     echo '</tr>';
68
-    $subCategoriesObj =& $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
68
+    $subCategoriesObj = & $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
69 69
     if (count($subCategoriesObj) > 0) {
70 70
         ++$level;
71 71
         foreach ($subCategoriesObj as $key => $thiscat) {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     //$allmods = array();
86 86
     $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0;
87 87
     global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $_GET;
88
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
88
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
89 89
 
90 90
     // Creating the faq handler object
91 91
     /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */
@@ -108,13 +108,13 @@  discard block
 block discarded – undo
108 108
             redirect_header('category.php', 1, _AM_SF_NOCOLTOEDIT);
109 109
         }
110 110
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
111
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_EDITCOL . '</h3>';
111
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_EDITCOL.'</h3>';
112 112
         echo "<div id='bottomtable'>";
113 113
     } else {
114 114
         $categoryObj = $categoryHandler->create();
115 115
         echo "<br>\n";
116 116
         Smartfaq\Utility::collapsableBar('bottomtable', 'bottomtableicon');
117
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CATEGORY_CREATE . '</h3>';
117
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CATEGORY_CREATE.'</h3>';
118 118
         echo "<div id='bottomtable'>";
119 119
     }
120 120
     // Start category form
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     }
160 160
     $sform->addElement($groups_read_checkbox);
161 161
     // Apply permissions on all faqs
162
-    $addapplyall_radio = new \XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
162
+    $addapplyall_radio = new \XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
163 163
     $sform->addElement($addapplyall_radio);
164 164
     // MODERATORS
165 165
     //$moderators_tray = new \XoopsFormElementTray(_AM_SF_MODERATORS_DEF, '');
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     echo '</div>';
225 225
 
226 226
     if ($categoryid) {
227
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php';
227
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php';
228 228
     }
229 229
 
230 230
     unset($hidden);
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         }
281 281
 
282 282
         if (!$categoryObj->store()) {
283
-            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . Smartfaq\Utility::formatErrors($categoryObj->getErrors()));
283
+            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR.Smartfaq\Utility::formatErrors($categoryObj->getErrors()));
284 284
         }
285 285
         // TODO : put this function in the category class
286 286
         Smartfaq\Utility::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read');
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
                               'categoryid' => $categoryObj->categoryid(),
323 323
                               'confirm'    => 1,
324 324
                               'name'       => $categoryObj->name()
325
-                          ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
325
+                          ], 'category.php', _AM_SF_DELETECOL." '".$categoryObj->name()."'. <br> <br>"._AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
326 326
             xoops_cp_footer();
327 327
         }
328 328
         exit();
@@ -340,19 +340,19 @@  discard block
 block discarded – undo
340 340
         echo "<br>\n";
341 341
 
342 342
         // Creating the objects for top categories
343
-        $categoriesObj =& $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0);
343
+        $categoriesObj = & $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0);
344 344
 
345 345
         Smartfaq\Utility::collapsableBar('toptable', 'toptableicon');
346
-        echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CATEGORIES_TITLE . '</h3>';
346
+        echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CATEGORIES_TITLE.'</h3>';
347 347
         echo "<div id='toptable'>";
348
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>';
348
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_CATEGORIES_DSC.'</span>';
349 349
 
350 350
         echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
351 351
         echo '<tr>';
352
-        echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
353
-        echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>';
354
-        echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>';
355
-        echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
352
+        echo "<th width='35%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
353
+        echo "<th class='bg3' align='left'><b>"._AM_SF_DESCRIP.'</b></td>';
354
+        echo "<th class='bg3' width='65' align='center'><b>"._AM_SF_WEIGHT.'</b></td>';
355
+        echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
356 356
         echo '</tr>';
357 357
         $totalCategories = $categoryHandler->getCategoriesCount(0);
358 358
         if (count($categoriesObj) > 0) {
@@ -361,14 +361,14 @@  discard block
 block discarded – undo
361 361
             }
362 362
         } else {
363 363
             echo '<tr>';
364
-            echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>';
364
+            echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOCAT.'</td>';
365 365
             echo '</tr>';
366 366
             $categoryid = '0';
367 367
         }
368 368
         echo "</table>\n";
369
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
369
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
370 370
         $pagenav = new \XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory');
371
-        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
371
+        echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
372 372
         echo '</div>';
373 373
 
374 374
         editcat(false);
@@ -376,4 +376,4 @@  discard block
 block discarded – undo
376 376
         break;
377 377
 }
378 378
 
379
-require_once __DIR__ . '/admin_footer.php';
379
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
open_category.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
 use XoopsModules\Smartfaq;
10 10
 use XoopsModules\Smartfaq\Constants;
11 11
 
12
-require_once __DIR__ . '/header.php';
12
+require_once __DIR__.'/header.php';
13 13
 
14 14
 global $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
15 15
 
16 16
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl';
17 17
 
18
-require_once XOOPS_ROOT_PATH . '/header.php';
19
-require_once __DIR__ . '/footer.php';
18
+require_once XOOPS_ROOT_PATH.'/header.php';
19
+require_once __DIR__.'/footer.php';
20 20
 
21 21
 $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
22 22
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 $last_qnaObj = $faqHandler->getLastPublishedByCat([Constants::SF_STATUS_OPENED]);
64 64
 if (isset($last_qnaObj[$categoryid])) {
65 65
     $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid'));
66
-    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . '</a>');
66
+    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50).'</a>');
67 67
 }
68 68
 // Populating the smarty variables with informations related to the selected category
69 69
 $category                 = $categoryObj->toArray(null, true);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 $category['categoryPath'] = $categoryObj->getCategoryPath(false, true);
72 72
 
73 73
 // Creating the sub-categories objects that belong to the selected category
74
-$subcatsObj     =& $categoryHandler->getCategories(0, 0, $categoryid);
74
+$subcatsObj     = & $categoryHandler->getCategories(0, 0, $categoryid);
75 75
 $total_subcats  = count($subcatsObj);
76 76
 $catQnasWithSub = 0;
77 77
 if (0 != $total_subcats) {
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
         if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
83 83
             if (isset($last_qnaObj[$subcat_id])) {
84 84
                 $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
85
-                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>');
85
+                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>');
86 86
             }
87 87
             $subcat->setVar('faqcount', $totalQnas[$subcat_id]);
88 88
             $subcats[$subcat_id] = $subcat->toArray(null, true);
89
-            $catQnasWithSub      += $subcats[$subcat_id]['total'];
89
+            $catQnasWithSub += $subcats[$subcat_id]['total'];
90 90
         }
91 91
     }
92 92
     $xoopsTpl->assign('subcats', $subcats);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     }
101 101
 
102 102
     $memberHandler = xoops_getHandler('member');
103
-    $users         = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
103
+    $users         = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
104 104
     foreach ($faqsObj as $iValue) {
105 105
         $faq = $iValue->toArray(null, $allcategories);
106 106
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     }
113 113
 }
114 114
 // Language constants
115
-$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . '</a>');
115
+$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION.'</a>');
116 116
 $xoopsTpl->assign('modulename', $xoopsModule->dirname());
117 117
 
118 118
 $xoopsTpl->assign('displaylastfaqs', true);
@@ -129,19 +129,19 @@  discard block
 block discarded – undo
129 129
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
130 130
 
131 131
 // The Navigation Bar
132
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
133
-$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid'));
132
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
133
+$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid'));
134 134
 if (1 == $xoopsModuleConfig['useimagenavpage']) {
135
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>';
135
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>';
136 136
 } else {
137
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
137
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
138 138
 }
139 139
 
140 140
 $xoopsTpl->assign('category', $category);
141 141
 
142 142
 // Page Title Hack by marcan
143 143
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
144
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']);
144
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']);
145 145
 // End Page Title Hack by marcan
146 146
 
147
-require_once XOOPS_ROOT_PATH . '/footer.php';
147
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
class/Answer.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $attachment_save = base64_encode(serialize($this->attachment_array));
101 101
         }
102 102
         $this->setVar('attachment', $attachment_save);
103
-        $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid');
103
+        $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('smartfaq_answers').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachment_save).' WHERE post_id = '.$this->getVar('answerid');
104 104
         if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
105 105
             //xoops_error($GLOBALS["xoopsDB"]->error());
106 106
             return false;
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 
133 133
         foreach ($attach_old as $key => $attach) {
134 134
             if (in_array($key, $attach_array)) {
135
-                @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attach['name_saved']);
136
-                @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/thumbs/' . $attach['name_saved']); // delete thumbnails
135
+                @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attach['name_saved']);
136
+                @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/thumbs/'.$attach['name_saved']); // delete thumbnails
137 137
                 continue;
138 138
             }
139 139
             $this->attachment_array[$key] = $attach;
@@ -190,24 +190,24 @@  discard block
 block discarded – undo
190 190
         if (is_array($attachments) && count($attachments) > 0) {
191 191
             $iconHandler = sf_getIconHandler();
192 192
             $mime_path   = $iconHandler->getPath('mime');
193
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/include/functions.image.php';
193
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/include/functions.image.php';
194 194
             $image_extensions = ['jpg', 'jpeg', 'gif', 'png', 'bmp']; // need improve !!!
195
-            $post_attachment  .= '<br><strong>' . _MD_ATTACHMENT . '</strong>:';
195
+            $post_attachment  .= '<br><strong>'._MD_ATTACHMENT.'</strong>:';
196 196
             $post_attachment  .= '<br><hr size="1" noshade="noshade"><br>';
197 197
             foreach ($attachments as $key => $att) {
198 198
                 $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.');
199 199
                 $filetype       = $file_extension;
200
-                if (file_exists(XOOPS_ROOT_PATH . '/' . $mime_path . '/' . $filetype . '.gif')) {
201
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif';
200
+                if (file_exists(XOOPS_ROOT_PATH.'/'.$mime_path.'/'.$filetype.'.gif')) {
201
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif';
202 202
                 } else {
203
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif';
203
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif';
204 204
                 }
205
-                $file_size = @filesize(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $att['name_saved']);
206
-                $file_size = number_format($file_size / 1024, 2) . ' KB';
205
+                $file_size = @filesize(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$att['name_saved']);
206
+                $file_size = number_format($file_size / 1024, 2).' KB';
207 207
                 if ($xoopsModuleConfig['media_allowed'] && in_array(strtolower($file_extension), $image_extensions)) {
208
-                    $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '"><strong>&nbsp; ' . $att['name_display'] . '</strong> <small>(' . $file_size . ')</small>';
209
-                    $post_attachment .= '<br>' . sf_attachmentImage($att['name_saved']);
210
-                    $isDisplayed     = true;
208
+                    $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'"><strong>&nbsp; '.$att['name_display'].'</strong> <small>('.$file_size.')</small>';
209
+                    $post_attachment .= '<br>'.sf_attachmentImage($att['name_saved']);
210
+                    $isDisplayed = true;
211 211
                 } else {
212 212
                     global $xoopsUser;
213 213
                     if (empty($xoopsModuleConfig['show_userattach'])) {
@@ -364,9 +364,9 @@  discard block
 block discarded – undo
364 364
         $tags                  = [];
365 365
         $tags['MODULE_NAME']   = $myts->displayTarea($smartModule->getVar('name'));
366 366
         $tags['FAQ_NAME']      = $faqObj->question();
367
-        $tags['FAQ_URL']       = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $faqObj->faqid();
367
+        $tags['FAQ_URL']       = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$faqObj->faqid();
368 368
         $tags['CATEGORY_NAME'] = $faqObj->getCategoryName();
369
-        $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $faqObj->categoryid();
369
+        $tags['CATEGORY_URL']  = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$faqObj->categoryid();
370 370
         $tags['FAQ_QUESTION']  = $faqObj->question();
371 371
 
372 372
         // TODO : Not sure about the 'formpreview' ...
Please login to merge, or discard this patch.
class/Faq.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         if (0 != $maxLength) {
188 188
             if (!XOOPS_USE_MULTIBYTES) {
189 189
                 if (strlen($ret) >= $maxLength) {
190
-                    $ret = substr($ret, 0, $maxLength - 1) . '...';
190
+                    $ret = substr($ret, 0, $maxLength - 1).'...';
191 191
                 }
192 192
             }
193 193
         }
@@ -379,14 +379,14 @@  discard block
 block discarded – undo
379 379
                 $theAnswers = $answerHandler->getAllAnswers($this->faqid(), Constants::SF_AN_STATUS_APPROVED, 1, 0);
380 380
                 //echo "test";
381 381
                 //exit;
382
-                $this->answer =& $theAnswers[0];
382
+                $this->answer = & $theAnswers[0];
383 383
                 break;
384 384
 
385 385
             case Constants::SF_STATUS_ANSWERED:
386 386
                 $theAnswers = $answerHandler->getAllAnswers($this->faqid(), Constants::SF_AN_STATUS_PROPOSED, 1, 0);
387 387
                 //echo "test";
388 388
                 //exit;
389
-                $this->answer =& $theAnswers[0];
389
+                $this->answer = & $theAnswers[0];
390 390
                 break;
391 391
 
392 392
             case Constants::SF_STATUS_PUBLISHED:
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
         $tags['MODULE_NAME']   = $myts->displayTarea($smartModule->getVar('name'));
473 473
         $tags['FAQ_NAME']      = $this->question();
474 474
         $tags['CATEGORY_NAME'] = $this->getCategoryName();
475
-        $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $this->categoryid();
475
+        $tags['CATEGORY_URL']  = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$this->categoryid();
476 476
         $tags['FAQ_QUESTION']  = $this->question();
477 477
         $answerObj             = $this->answer();
478 478
         if (is_object($answerObj)) {
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
         foreach ($notifications as $notification) {
485 485
             switch ($notification) {
486 486
                 case Constants::SF_NOT_FAQ_PUBLISHED:
487
-                    $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $this->faqid();
487
+                    $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$this->faqid();
488 488
 
489 489
                     $notificationHandler->triggerEvent('global_faq', 0, 'published', $tags);
490 490
                     $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'published', $tags);
@@ -492,20 +492,20 @@  discard block
 block discarded – undo
492 492
                     break;
493 493
 
494 494
                 case Constants::SF_NOT_FAQ_SUBMITTED:
495
-                    $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/faq.php?faqid=' . $this->faqid();
495
+                    $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/faq.php?faqid='.$this->faqid();
496 496
                     $notificationHandler->triggerEvent('global_faq', 0, 'submitted', $tags);
497 497
                     $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'submitted', $tags);
498 498
                     break;
499 499
 
500 500
                 case Constants::SF_NOT_QUESTION_PUBLISHED:
501
-                    $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/answer.php?faqid=' . $this->faqid();
501
+                    $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/answer.php?faqid='.$this->faqid();
502 502
                     $notificationHandler->triggerEvent('global_question', 0, 'published', $tags);
503 503
                     $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'published', $tags);
504 504
                     $notificationHandler->triggerEvent('question', $this->faqid(), 'approved', $tags);
505 505
                     break;
506 506
 
507 507
                 case Constants::SF_NOT_QUESTION_SUBMITTED:
508
-                    $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/question.php?op=mod&faqid=' . $this->faqid();
508
+                    $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/question.php?op=mod&faqid='.$this->faqid();
509 509
                     $notificationHandler->triggerEvent('global_question', 0, 'submitted', $tags);
510 510
                     $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'submitted', $tags);
511 511
                     break;
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
                     break;
516 516
 
517 517
                 case Constants::SF_NOT_NEW_ANSWER_PROPOSED:
518
-                    $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/answer.php?op=mod&faqid=' . $this->faqid();
518
+                    $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/answer.php?op=mod&faqid='.$this->faqid();
519 519
                     $notificationHandler->triggerEvent('global_faq', 0, 'answer_proposed', $tags);
520 520
                     $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'answer_proposed', $tags);
521 521
                     break;
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
             $text = _MD_SF_FAQCOMEFROM;
630 630
         }
631 631
 
632
-        return $text . $xoopsConfig['sitename'] . ' : <a href=' . XOOPS_URL . '/modules/smartfaq/faq.php?faqid=' . $this->faqid() . '>' . XOOPS_URL . '/modules/smartfaq/faq.php?faqid=' . $this->faqid() . '</a>';
632
+        return $text.$xoopsConfig['sitename'].' : <a href='.XOOPS_URL.'/modules/smartfaq/faq.php?faqid='.$this->faqid().'>'.XOOPS_URL.'/modules/smartfaq/faq.php?faqid='.$this->faqid().'</a>';
633 633
     }
634 634
 
635 635
     /**
@@ -648,9 +648,9 @@  discard block
 block discarded – undo
648 648
         $faq['question']   = $this->question();
649 649
         $page              = (Constants::SF_STATUS_OPENED == $this->status()) ? 'answer.php' : 'faq.php';
650 650
 
651
-        $faq['questionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question($lastfaqsize) . '</a>';
651
+        $faq['questionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question($lastfaqsize).'</a>';
652 652
         if ($linkInQuestion) {
653
-            $faq['fullquestionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question() . '</a>';
653
+            $faq['fullquestionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question().'</a>';
654 654
         } else {
655 655
             $faq['fullquestionlink'] = $this->question();
656 656
         }
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
                 $categoryObj = $category[$this->categoryid()];
667 667
             }
668 668
             $faq['categoryname'] = $categoryObj->getVar('name');
669
-            $faq['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/category.php?categoryid=' . $this->categoryid() . "'>" . $categoryObj->getVar('name') . '</a>';
669
+            $faq['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/category.php?categoryid='.$this->categoryid()."'>".$categoryObj->getVar('name').'</a>';
670 670
         }
671 671
 
672 672
         return $faq;
Please login to merge, or discard this patch.