Completed
Push — master ( 0d7d1b...48b96e )
by Michael
02:08
created
open_category.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-require_once __DIR__ . '/header.php';
9
+require_once __DIR__.'/header.php';
10 10
 
11 11
 global $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
12 12
 
13 13
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl';
14 14
 
15
-require_once XOOPS_ROOT_PATH . '/header.php';
16
-require_once __DIR__ . '/footer.php';
15
+require_once XOOPS_ROOT_PATH.'/header.php';
16
+require_once __DIR__.'/footer.php';
17 17
 
18
-$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
18
+$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0;
19 19
 
20 20
 // Creating the category object for the selected category
21 21
 $categoryObj = new sfCategory($categoryid);
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 $categoryHandler = sf_gethandler('category');
35 35
 
36 36
 // At which record shall we start
37
-$start = isset($_GET['start']) ? (int)$_GET['start'] : 0;
37
+$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
38 38
 
39 39
 // Creating the faq handler object
40 40
 $faqHandler = sf_gethandler('faq');
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 $last_qnaObj = $faqHandler->getLastPublishedByCat([_SF_STATUS_OPENED]);
59 59
 if (isset($last_qnaObj[$categoryid])) {
60 60
     $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid'));
61
-    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . '</a>');
61
+    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50).'</a>');
62 62
 }
63 63
 // Populating the smarty variables with informations related to the selected category
64 64
 $category                 = $categoryObj->toArray(null, true);
@@ -77,16 +77,16 @@  discard block
 block discarded – undo
77 77
         if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
78 78
             if (isset($last_qnaObj[$subcat_id])) {
79 79
                 $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
80
-                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>');
80
+                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>');
81 81
             }
82 82
             $subcat->setVar('faqcount', $totalQnas[$subcat_id]);
83 83
             $subcats[$subcat_id] = $subcat->toArray(null, true);
84
-            $catQnasWithSub      += $subcats[$subcat_id]['total'];
84
+            $catQnasWithSub += $subcats[$subcat_id]['total'];
85 85
         }
86 86
     }
87 87
     $xoopsTpl->assign('subcats', $subcats);
88 88
 }
89
-$category['total'] = $catQnasWithSub + $totalQnas[$categoryid];
89
+$category['total'] = $catQnasWithSub+$totalQnas[$categoryid];
90 90
 if ($faqsObj) {
91 91
     $userids = [];
92 92
     foreach ($faqsObj as $key => $thisfaq) {
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     }
96 96
 
97 97
     $memberHandler = xoops_getHandler('member');
98
-    $users         = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
98
+    $users         = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
99 99
     for ($i = 0; $i < $totalQnasOnPage; ++$i) {
100 100
         $faq = $faqsObj[$i]->toArray(null, $allcategories);
101 101
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     }
108 108
 }
109 109
 // Language constants
110
-$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . '</a>');
110
+$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION.'</a>');
111 111
 $xoopsTpl->assign('modulename', $xoopsModule->dirname());
112 112
 
113 113
 $xoopsTpl->assign('displaylastfaqs', true);
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
125 125
 
126 126
 // The Navigation Bar
127
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
128
-$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid'));
127
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
128
+$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid'));
129 129
 if ($xoopsModuleConfig['useimagenavpage'] == 1) {
130
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>';
130
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>';
131 131
 } else {
132
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
132
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
133 133
 }
134 134
 
135 135
 $xoopsTpl->assign('category', $category);
136 136
 
137 137
 // Page Title Hack by marcan
138 138
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
139
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']);
139
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']);
140 140
 // End Page Title Hack by marcan
141 141
 
142
-require_once XOOPS_ROOT_PATH . '/footer.php';
142
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
admin/category.php 3 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -46,18 +46,18 @@  discard block
 block discarded – undo
46 46
 
47 47
     echo '<tr>';
48 48
     echo "<td class='even' align='lefet'>"
49
-         . $spaces
50
-         . "<a href='"
51
-         . XOOPS_URL
52
-         . '/modules/'
53
-         . $xoopsModule->dirname()
54
-         . '/category.php?categoryid='
55
-         . $categoryObj->categoryid()
56
-         . "'><img src='"
57
-         . XOOPS_URL
58
-         . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''>&nbsp;"
59
-         . $categoryObj->name()
60
-         . '</a></td>';
49
+            . $spaces
50
+            . "<a href='"
51
+            . XOOPS_URL
52
+            . '/modules/'
53
+            . $xoopsModule->dirname()
54
+            . '/category.php?categoryid='
55
+            . $categoryObj->categoryid()
56
+            . "'><img src='"
57
+            . XOOPS_URL
58
+            . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''>&nbsp;"
59
+            . $categoryObj->name()
60
+            . '</a></td>';
61 61
     echo "<td class='even' align='left'>" . $description . '</td>';
62 62
     echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>';
63 63
     echo "<td class='even' align='center'> $modify $delete </td>";
@@ -314,11 +314,11 @@  discard block
 block discarded – undo
314 314
             $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
315 315
             xoops_cp_header();
316 316
             xoops_confirm([
317
-                              'op'         => 'del',
318
-                              'categoryid' => $categoryObj->categoryid(),
319
-                              'confirm'    => 1,
320
-                              'name'       => $categoryObj->name()
321
-                          ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
317
+                                'op'         => 'del',
318
+                                'categoryid' => $categoryObj->categoryid(),
319
+                                'confirm'    => 1,
320
+                                'name'       => $categoryObj->name()
321
+                            ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
322 322
             xoops_cp_footer();
323 323
         }
324 324
         exit();
Please login to merge, or discard this patch.
Switch Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -227,149 +227,149 @@
 block discarded – undo
227 227
 }
228 228
 
229 229
 switch ($op) {
230
-    case 'mod':
231
-        $categoryid  = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
232
-        $destList    = isset($_POST['destList']) ? $_POST['destList'] : '';
233
-        $adminObject = \Xmf\Module\Admin::getInstance();
234
-        xoops_cp_header();
235
-
236
-        $adminObject->displayNavigation(basename(__FILE__));
237
-        editcat(true, $categoryid);
238
-        break;
230
+        case 'mod':
231
+            $categoryid  = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
232
+            $destList    = isset($_POST['destList']) ? $_POST['destList'] : '';
233
+            $adminObject = \Xmf\Module\Admin::getInstance();
234
+            xoops_cp_header();
239 235
 
240
-    case 'addcategory':
241
-        global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid;
236
+            $adminObject->displayNavigation(basename(__FILE__));
237
+            editcat(true, $categoryid);
238
+            break;
242 239
 
243
-        $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
240
+        case 'addcategory':
241
+            global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid;
244 242
 
245
-        if ($categoryid != 0) {
246
-            $categoryObj = new sfCategory($categoryid);
247
-        } else {
248
-            $categoryObj = $categoryHandler->create();
249
-        }
243
+            $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
250 244
 
251
-        //if (isset($_POST['allmods'])) $allmods = $_POST['allmods'];
252
-        //if (isset($_POST['moderators'])) $moderators = $_POST['moderators'];
245
+            if ($categoryid != 0) {
246
+                $categoryObj = new sfCategory($categoryid);
247
+            } else {
248
+                $categoryObj = $categoryHandler->create();
249
+            }
253 250
 
254
-        $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0);
255
-        $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0;
256
-        $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1);
251
+            //if (isset($_POST['allmods'])) $allmods = $_POST['allmods'];
252
+            //if (isset($_POST['moderators'])) $moderators = $_POST['moderators'];
257 253
 
258
-        // Groups and permissions
259
-        if (isset($_POST['groups_read'])) {
260
-            $categoryObj->setGroups_read($_POST['groups_read']);
261
-        } else {
262
-            $categoryObj->setGroups_read();
263
-        }
264
-        //  $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array();
265
-        //  $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array();
266
-
267
-        $categoryObj->setVar('name', $_POST['name']);
268
-
269
-        $categoryObj->setVar('description', $_POST['description']);
270
-        if ($categoryObj->isNew()) {
271
-            $redirect_msg = _AM_SF_CATCREATED;
272
-            $redirect_to  = 'category.php?op=mod';
273
-        } else {
274
-            $redirect_msg = _AM_SF_COLMODIFIED;
275
-            $redirect_to  = 'category.php';
276
-        }
254
+            $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0);
255
+            $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0;
256
+            $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1);
277 257
 
278
-        if (!$categoryObj->store()) {
279
-            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors()));
280
-        }
281
-        // TODO : put this function in the category class
282
-        sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read');
283
-        //sf_saveCategory_Permissions($groups_admin, $categoriesObj->categoryid(), 'category_admin');
258
+            // Groups and permissions
259
+            if (isset($_POST['groups_read'])) {
260
+                $categoryObj->setGroups_read($_POST['groups_read']);
261
+            } else {
262
+                $categoryObj->setGroups_read();
263
+            }
264
+            //  $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array();
265
+            //  $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array();
266
+
267
+            $categoryObj->setVar('name', $_POST['name']);
268
+
269
+            $categoryObj->setVar('description', $_POST['description']);
270
+            if ($categoryObj->isNew()) {
271
+                $redirect_msg = _AM_SF_CATCREATED;
272
+                $redirect_to  = 'category.php?op=mod';
273
+            } else {
274
+                $redirect_msg = _AM_SF_COLMODIFIED;
275
+                $redirect_to  = 'category.php';
276
+            }
284 277
 
285
-        if ($applyall) {
278
+            if (!$categoryObj->store()) {
279
+                redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors()));
280
+            }
286 281
             // TODO : put this function in the category class
287
-            sf_overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid());
288
-        }
282
+            sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read');
283
+            //sf_saveCategory_Permissions($groups_admin, $categoriesObj->categoryid(), 'category_admin');
289 284
 
290
-        redirect_header($redirect_to, 2, $redirect_msg);
291
-        break;
285
+            if ($applyall) {
286
+                // TODO : put this function in the category class
287
+                sf_overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid());
288
+            }
292 289
 
293
-    case 'del':
294
-        global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET;
290
+            redirect_header($redirect_to, 2, $redirect_msg);
291
+            break;
295 292
 
296
-        $module_id    = $xoopsModule->getVar('mid');
297
-        $gpermHandler = xoops_getHandler('groupperm');
293
+        case 'del':
294
+            global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET;
298 295
 
299
-        $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
300
-        $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid;
296
+            $module_id    = $xoopsModule->getVar('mid');
297
+            $gpermHandler = xoops_getHandler('groupperm');
301 298
 
302
-        $categoryObj = new sfCategory($categoryid);
299
+            $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
300
+            $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid;
303 301
 
304
-        $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
305
-        $name    = isset($_POST['name']) ? $_POST['name'] : '';
302
+            $categoryObj = new sfCategory($categoryid);
306 303
 
307
-        if ($confirm) {
308
-            if (!$categoryHandler->delete($categoryObj)) {
309
-                redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR);
304
+            $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
305
+            $name    = isset($_POST['name']) ? $_POST['name'] : '';
306
+
307
+            if ($confirm) {
308
+                if (!$categoryHandler->delete($categoryObj)) {
309
+                    redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR);
310
+                }
311
+                redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name));
312
+            } else {
313
+                // no confirm: show deletion condition
314
+                $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
315
+                xoops_cp_header();
316
+                xoops_confirm([
317
+                                  'op'         => 'del',
318
+                                  'categoryid' => $categoryObj->categoryid(),
319
+                                  'confirm'    => 1,
320
+                                  'name'       => $categoryObj->name()
321
+                              ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
322
+                xoops_cp_footer();
310 323
             }
311
-            redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name));
312
-        } else {
313
-            // no confirm: show deletion condition
314
-            $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
324
+            exit();
325
+            break;
326
+
327
+        case 'cancel':
328
+            redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, ''));
329
+            break;
330
+        case 'default':
331
+        default:
332
+            $adminObject = \Xmf\Module\Admin::getInstance();
315 333
             xoops_cp_header();
316
-            xoops_confirm([
317
-                              'op'         => 'del',
318
-                              'categoryid' => $categoryObj->categoryid(),
319
-                              'confirm'    => 1,
320
-                              'name'       => $categoryObj->name()
321
-                          ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
322
-            xoops_cp_footer();
323
-        }
324
-        exit();
325
-        break;
326
-
327
-    case 'cancel':
328
-        redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, ''));
329
-        break;
330
-    case 'default':
331
-    default:
332
-        $adminObject = \Xmf\Module\Admin::getInstance();
333
-        xoops_cp_header();
334
-
335
-        $adminObject->displayNavigation(basename(__FILE__));
336
-        echo "<br>\n";
337 334
 
338
-        // Creating the objects for top categories
339
-        $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0);
340
-
341
-        sf_collapsableBar('toptable', 'toptableicon');
342
-        echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CATEGORIES_TITLE . '</h3>';
343
-        echo "<div id='toptable'>";
344
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>';
345
-
346
-        echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
347
-        echo '<tr>';
348
-        echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
349
-        echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>';
350
-        echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>';
351
-        echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
352
-        echo '</tr>';
353
-        $totalCategories = $categoryHandler->getCategoriesCount(0);
354
-        if (count($categoriesObj) > 0) {
355
-            foreach ($categoriesObj as $key => $thiscat) {
356
-                displayCategory($thiscat);
357
-            }
358
-        } else {
335
+            $adminObject->displayNavigation(basename(__FILE__));
336
+            echo "<br>\n";
337
+
338
+            // Creating the objects for top categories
339
+            $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0);
340
+
341
+            sf_collapsableBar('toptable', 'toptableicon');
342
+            echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CATEGORIES_TITLE . '</h3>';
343
+            echo "<div id='toptable'>";
344
+            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>';
345
+
346
+            echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
359 347
             echo '<tr>';
360
-            echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>';
348
+            echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
349
+            echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>';
350
+            echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>';
351
+            echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
361 352
             echo '</tr>';
362
-            $categoryid = '0';
363
-        }
364
-        echo "</table>\n";
365
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
366
-        $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory');
367
-        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
368
-        echo '</div>';
353
+            $totalCategories = $categoryHandler->getCategoriesCount(0);
354
+            if (count($categoriesObj) > 0) {
355
+                foreach ($categoriesObj as $key => $thiscat) {
356
+                    displayCategory($thiscat);
357
+                }
358
+            } else {
359
+                echo '<tr>';
360
+                echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>';
361
+                echo '</tr>';
362
+                $categoryid = '0';
363
+            }
364
+            echo "</table>\n";
365
+            require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
366
+            $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory');
367
+            echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
368
+            echo '</div>';
369 369
 
370
-        editcat(false);
370
+            editcat(false);
371 371
 
372
-        break;
372
+            break;
373 373
 }
374 374
 
375 375
 require_once __DIR__ . '/admin_footer.php';
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-require_once __DIR__ . '/admin_header.php';
9
+require_once __DIR__.'/admin_header.php';
10 10
 
11 11
 // Creating the category handler object
12 12
 $categoryHandler = sf_gethandler('category');
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 }
22 22
 
23 23
 // Where do we start?
24
-$startcategory = isset($_GET['startcategory']) ? (int)$_GET['startcategory'] : 0;
24
+$startcategory = isset($_GET['startcategory']) ? (int) $_GET['startcategory'] : 0;
25 25
 
26 26
 /**
27 27
  * @param XoopsObject $categoryObj
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
     $description = $categoryObj->description();
34 34
     if (!XOOPS_USE_MULTIBYTES) {
35 35
         if (strlen($description) >= 100) {
36
-            $description = substr($description, 0, 100 - 1) . '...';
36
+            $description = substr($description, 0, 100-1).'...';
37 37
         }
38 38
     }
39
-    $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITCOL . "' alt='" . _AM_SF_EDITCOL . "'></a>";
40
-    $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETECOL . "' alt='" . _AM_SF_DELETECOL . "'></a>";
39
+    $modify = "<a href='category.php?op=mod&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITCOL."' alt='"._AM_SF_EDITCOL."'></a>";
40
+    $delete = "<a href='category.php?op=del&categoryid=".$categoryObj->categoryid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETECOL."' alt='"._AM_SF_DELETECOL."'></a>";
41 41
 
42 42
     $spaces = '';
43 43
     for ($j = 0; $j < $level; ++$j) {
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
          . "/modules/smartfaq/assets/images/icon/subcat.gif' alt=''>&nbsp;"
59 59
          . $categoryObj->name()
60 60
          . '</a></td>';
61
-    echo "<td class='even' align='left'>" . $description . '</td>';
62
-    echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>';
61
+    echo "<td class='even' align='left'>".$description.'</td>';
62
+    echo "<td class='even' align='center'>".$categoryObj->weight().'</td>';
63 63
     echo "<td class='even' align='center'> $modify $delete </td>";
64 64
     echo '</tr>';
65 65
     $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 {
81 81
     //$moderators = array(); // just to define the variable
82 82
     //$allmods = array();
83
-    $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0;
83
+    $startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0;
84 84
     global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $_GET;
85
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
85
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
86 86
 
87 87
     // Creating the faq handler object
88 88
     $faqHandler = sf_gethandler('faq');
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
             redirect_header('category.php', 1, _AM_SF_NOCOLTOEDIT);
105 105
         }
106 106
         sf_collapsableBar('bottomtable', 'bottomtableicon');
107
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_EDITCOL . '</h3>';
107
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_EDITCOL.'</h3>';
108 108
         echo "<div id='bottomtable'>";
109 109
     } else {
110 110
         $categoryObj = $categoryHandler->create();
111 111
         echo "<br>\n";
112 112
         sf_collapsableBar('bottomtable', 'bottomtableicon');
113
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CATEGORY_CREATE . '</h3>';
113
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CATEGORY_CREATE.'</h3>';
114 114
         echo "<div id='bottomtable'>";
115 115
     }
116 116
     // Start category form
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     }
156 156
     $sform->addElement($groups_read_checkbox);
157 157
     // Apply permissions on all faqs
158
-    $addapplyall_radio = new XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
158
+    $addapplyall_radio = new XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
159 159
     $sform->addElement($addapplyall_radio);
160 160
     // MODERATORS
161 161
     //$moderators_tray = new XoopsFormElementTray(_AM_SF_MODERATORS_DEF, '');
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     echo '</div>';
221 221
 
222 222
     if ($categoryid) {
223
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php';
223
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php';
224 224
     }
225 225
 
226 226
     unset($hidden);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
 switch ($op) {
230 230
     case 'mod':
231
-        $categoryid  = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
231
+        $categoryid  = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0;
232 232
         $destList    = isset($_POST['destList']) ? $_POST['destList'] : '';
233 233
         $adminObject = \Xmf\Module\Admin::getInstance();
234 234
         xoops_cp_header();
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     case 'addcategory':
241 241
         global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid;
242 242
 
243
-        $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
243
+        $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0;
244 244
 
245 245
         if ($categoryid != 0) {
246 246
             $categoryObj = new sfCategory($categoryid);
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
         //if (isset($_POST['allmods'])) $allmods = $_POST['allmods'];
252 252
         //if (isset($_POST['moderators'])) $moderators = $_POST['moderators'];
253 253
 
254
-        $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0);
255
-        $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0;
256
-        $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1);
254
+        $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int) $_POST['parentid'] : 0);
255
+        $applyall = isset($_POST['applyall']) ? (int) $_POST['applyall'] : 0;
256
+        $categoryObj->setVar('weight', isset($_POST['weight']) ? (int) $_POST['weight'] : 1);
257 257
 
258 258
         // Groups and permissions
259 259
         if (isset($_POST['groups_read'])) {
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         }
277 277
 
278 278
         if (!$categoryObj->store()) {
279
-            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors()));
279
+            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR.sf_formatErrors($categoryObj->getErrors()));
280 280
         }
281 281
         // TODO : put this function in the category class
282 282
         sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read');
@@ -296,8 +296,8 @@  discard block
 block discarded – undo
296 296
         $module_id    = $xoopsModule->getVar('mid');
297 297
         $gpermHandler = xoops_getHandler('groupperm');
298 298
 
299
-        $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
300
-        $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid;
299
+        $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0;
300
+        $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : $categoryid;
301 301
 
302 302
         $categoryObj = new sfCategory($categoryid);
303 303
 
@@ -311,14 +311,14 @@  discard block
 block discarded – undo
311 311
             redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name));
312 312
         } else {
313 313
             // no confirm: show deletion condition
314
-            $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
314
+            $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0;
315 315
             xoops_cp_header();
316 316
             xoops_confirm([
317 317
                               'op'         => 'del',
318 318
                               'categoryid' => $categoryObj->categoryid(),
319 319
                               'confirm'    => 1,
320 320
                               'name'       => $categoryObj->name()
321
-                          ], 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
321
+                          ], 'category.php', _AM_SF_DELETECOL." '".$categoryObj->name()."'. <br> <br>"._AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
322 322
             xoops_cp_footer();
323 323
         }
324 324
         exit();
@@ -339,16 +339,16 @@  discard block
 block discarded – undo
339 339
         $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0);
340 340
 
341 341
         sf_collapsableBar('toptable', 'toptableicon');
342
-        echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CATEGORIES_TITLE . '</h3>';
342
+        echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CATEGORIES_TITLE.'</h3>';
343 343
         echo "<div id='toptable'>";
344
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>';
344
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_CATEGORIES_DSC.'</span>';
345 345
 
346 346
         echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
347 347
         echo '<tr>';
348
-        echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
349
-        echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>';
350
-        echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>';
351
-        echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
348
+        echo "<th width='35%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
349
+        echo "<th class='bg3' align='left'><b>"._AM_SF_DESCRIP.'</b></td>';
350
+        echo "<th class='bg3' width='65' align='center'><b>"._AM_SF_WEIGHT.'</b></td>';
351
+        echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
352 352
         echo '</tr>';
353 353
         $totalCategories = $categoryHandler->getCategoriesCount(0);
354 354
         if (count($categoriesObj) > 0) {
@@ -357,14 +357,14 @@  discard block
 block discarded – undo
357 357
             }
358 358
         } else {
359 359
             echo '<tr>';
360
-            echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>';
360
+            echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOCAT.'</td>';
361 361
             echo '</tr>';
362 362
             $categoryid = '0';
363 363
         }
364 364
         echo "</table>\n";
365
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
365
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
366 366
         $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory');
367
-        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
367
+        echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
368 368
         echo '</div>';
369 369
 
370 370
         editcat(false);
@@ -372,4 +372,4 @@  discard block
 block discarded – undo
372 372
         break;
373 373
 }
374 374
 
375
-require_once __DIR__ . '/admin_footer.php';
375
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/xoopsfaq.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  *
12 12
  */
13 13
 
14
-require_once __DIR__ . '/admin_header.php';
14
+require_once __DIR__.'/admin_header.php';
15 15
 
16 16
 $importFromModuleName = 'XoopsFAQ';
17 17
 $scriptname           = 'xoopsfaq.php';
@@ -24,33 +24,33 @@  discard block
 block discarded – undo
24 24
 
25 25
 if ($op === 'start') {
26 26
     xoops_cp_header();
27
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
27
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
28 28
 
29
-    $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('xoopsfaq_categories'));
29
+    $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('xoopsfaq_categories'));
30 30
     list($totalCat) = $xoopsDB->fetchRow($result);
31 31
 
32 32
     sf_collapsableBar('bottomtable', 'bottomtableicon');
33
-    echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>';
33
+    echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>';
34 34
     echo "<div id='bottomtable'>";
35 35
 
36 36
     if ($totalCat == 0) {
37
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_NO_CATEGORY . '</span>';
37
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_NO_CATEGORY.'</span>';
38 38
     } else {
39
-        require_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
39
+        require_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
40 40
 
41
-        $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('xoopsfaq_contents'));
41
+        $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('xoopsfaq_contents'));
42 42
         list($totalFAQ) = $xoopsDB->fetchRow($result);
43 43
 
44 44
         if ($totalFAQ == 0) {
45
-            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat) . '</span>';
45
+            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat).'</span>';
46 46
         } else {
47
-            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . sprintf(_AM_SF_IMPORT_MODULE_FOUND, $importFromModuleName, $totalCat, $totalFAQ) . '</span>';
47
+            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.sprintf(_AM_SF_IMPORT_MODULE_FOUND, $importFromModuleName, $totalCat, $totalFAQ).'</span>';
48 48
 
49
-            $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL . '/modules/smartfaq/admin/' . $scriptname);
49
+            $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL.'/modules/smartfaq/admin/'.$scriptname);
50 50
 
51 51
             // Categories to be imported
52 52
             $cat_cbox = new XoopsFormCheckBox(sprintf(_AM_SF_IMPORT_CATEGORIES, $importFromModuleName), 'import_category', -1);
53
-            $result   = $xoopsDB->queryF('SELECT c.category_id, c.category_title, count(q.contents_id) FROM ' . $xoopsDB->prefix('xoopsfaq_categories') . ' AS c, ' . $xoopsDB->prefix('xoopsfaq_contents') . ' AS q WHERE c.category_id=q.category_id GROUP BY c.category_id ORDER BY category_order');
53
+            $result   = $xoopsDB->queryF('SELECT c.category_id, c.category_title, count(q.contents_id) FROM '.$xoopsDB->prefix('xoopsfaq_categories').' AS c, '.$xoopsDB->prefix('xoopsfaq_contents').' AS q WHERE c.category_id=q.category_id GROUP BY c.category_id ORDER BY category_order');
54 54
 
55 55
             while (list($cid, $cat_title, $count) = $xoopsDB->fetchRow($result)) {
56 56
                 $cat_cbox->addOption($cid, "$cat_title ($count)<br\>");
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             ob_end_clean();
66 66
 
67 67
             // Auto-Approve
68
-            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''));
68
+            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''));
69 69
 
70 70
             // Submitted and answered by
71 71
             $memberHandler = xoops_getHandler('member');
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $form->addElement($user_select);
79 79
 
80 80
             // Q&As can be commented?
81
-            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''));
81
+            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''));
82 82
 
83 83
             $group_list      = $memberHandler->getGroupList();
84 84
             $groups_selected = [];
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 }
103 103
 
104 104
 if ($op === 'go') {
105
-    require_once __DIR__ . '/admin_header.php';
105
+    require_once __DIR__.'/admin_header.php';
106 106
 
107 107
     $import_category = (isset($_POST['import_category']) ? $_POST['import_category'] : null);
108 108
     if (!$import_category) {
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
     xoops_cp_header();
113 113
 
114 114
     sf_collapsableBar('bottomtable', 'bottomtableicon');
115
-    echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>';
115
+    echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>';
116 116
     echo "<div id='bottomtable'>";
117
-    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_RESULT . '</span>';
117
+    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_RESULT.'</span>';
118 118
 
119 119
     $cnt_imported_cat = 0;
120 120
     $cnt_imported_faq = 0;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     echo "Can Comment: $cancomment<br>";
143 143
     echo "Auto aprove: $autoaprove<br>";*/
144 144
 
145
-    $resultCat = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('xoopsfaq_categories') . " where category_id in ($import_category_list) order by category_order");
145
+    $resultCat = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('xoopsfaq_categories')." where category_id in ($import_category_list) order by category_order");
146 146
 
147 147
     while ($arrCat = $xoopsDB->fetchArray($resultCat)) {
148 148
         extract($arrCat, EXTR_PREFIX_ALL, 'xcat');
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         $categoryObj->setVar('name', $xcat_category_title);
157 157
 
158 158
         if (!$categoryObj->store(false)) {
159
-            echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name) . '<br>';
159
+            echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name).'<br>';
160 160
             continue;
161 161
         }
162 162
 
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 
165 165
         ++$cnt_imported_cat;
166 166
 
167
-        echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $xcat_category_title) . "<br\>";
167
+        echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $xcat_category_title)."<br\>";
168 168
 
169
-        $resultFAQ = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('xoopsfaq_contents') . " where category_id=$xcat_category_id order by contents_order");
169
+        $resultFAQ = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('xoopsfaq_contents')." where category_id=$xcat_category_id order by contents_order");
170 170
         while ($arrFAQ = $xoopsDB->fetchArray($resultFAQ)) {
171 171
             extract($arrFAQ, EXTR_PREFIX_ALL, 'xfaq');
172 172
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             $faqObj->setVar('cancomment', $cancomment);
195 195
 
196 196
             if (!$faqObj->store(false)) {
197
-                echo sprintf('  ' . _AM_SF_IMPORT_FAQ_ERROR, $xfaq_contents_title) . '<br>';
197
+                echo sprintf('  '._AM_SF_IMPORT_FAQ_ERROR, $xfaq_contents_title).'<br>';
198 198
                 continue;
199 199
             } else {
200 200
                 $answerObj->setVar('faqid', $faqObj->faqid());
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
                 $answerObj->setVar('status', _SF_AN_STATUS_APPROVED);
204 204
 
205 205
                 if (!$answerObj->store()) {
206
-                    echo sprintf('  ' . _AM_SF_IMPORT_FAQ_ERROR) . '<br>';
206
+                    echo sprintf('  '._AM_SF_IMPORT_FAQ_ERROR).'<br>';
207 207
                     continue;
208 208
                 } else {
209
-                    echo '&nbsp;&nbsp;' . sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)) . '<br>';
209
+                    echo '&nbsp;&nbsp;'.sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)).'<br>';
210 210
                     ++$cnt_imported_faq;
211 211
                 }
212 212
             }
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
     }
217 217
 
218 218
     echo 'Done.<br>';
219
-    echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat) . '<br>';
220
-    echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq) . '<br>';
219
+    echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat).'<br>';
220
+    echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq).'<br>';
221 221
 
222 222
     exit();
223 223
 }
Please login to merge, or discard this patch.
admin/question.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -284,11 +284,11 @@
 block discarded – undo
284 284
             $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
285 285
             xoops_cp_header();
286 286
             xoops_confirm([
287
-                              'op'      => 'del',
288
-                              'faqid'   => $faqObj->faqid(),
289
-                              'confirm' => 1,
290
-                              'name'    => $faqObj->question()
291
-                          ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
287
+                                'op'      => 'del',
288
+                                'faqid'   => $faqObj->faqid(),
289
+                                'confirm' => 1,
290
+                                'name'    => $faqObj->question()
291
+                            ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
292 292
             xoops_cp_footer();
293 293
         }
294 294
 
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-require_once __DIR__ . '/admin_header.php';
9
+require_once __DIR__.'/admin_header.php';
10 10
 
11 11
 // Creating the faq handler object
12 12
 $faqHandler = sf_gethandler('faq');
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 }
24 24
 
25 25
 // Where shall we start?
26
-$startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0;
26
+$startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0;
27 27
 
28 28
 /**
29 29
  * @param bool $showmenu
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 {
34 34
     global $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts;
35 35
 
36
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
36
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
37 37
     // If there is a parameter, and the id exists, retrieve data: we're editing a faq
38 38
     if ($faqid != -1) {
39 39
         // Creating the FAQ object
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
 
66 66
         echo "<br>\n";
67 67
         sf_collapsableBar('bottomtable', 'bottomtableicon');
68
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . $collapsableBar_title . '</h3>';
68
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".$collapsableBar_title.'</h3>';
69 69
         echo "<div id='bottomtable'>";
70
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>';
70
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>';
71 71
     } else {
72 72
         // there's no parameter, so we're adding a faq
73 73
         $faqObj = $faqHandler->create();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $button_caption    = _AM_SF_CREATE;
79 79
 
80 80
         sf_collapsableBar('bottomtable', 'bottomtableicon');
81
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CREATEQUESTION . '</h3>';
81
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CREATEQUESTION.'</h3>';
82 82
         echo "<div id='bottomtable'>";
83 83
     }
84 84
     $sform = new XoopsThemeForm(_AM_SF_OPEN_QUESTION, 'op', xoops_getenv('PHP_SELF'), 'post', true);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $button_tray->addElement($butt_create);
153 153
 
154 154
         $butt_edit = new XoopsFormButton('', '', _AM_SF_OPEN_QUESTION_EDIT, 'button');
155
-        $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&amp;faqid=" . $faqid . "'\"");
155
+        $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&amp;faqid=".$faqid."'\"");
156 156
         $button_tray->addElement($butt_edit);
157 157
 
158 158
         $butt_cancel = new XoopsFormButton('', '', _AM_SF_CANCEL, 'button');
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         xoops_cp_header();
185 185
 
186 186
         $adminObject->displayNavigation(basename(__FILE__));
187
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
187
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
188 188
 
189 189
         editfaq(true, $faqid);
190 190
         break;
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $uid = $xoopsUser->uid();
203 203
         }
204 204
 
205
-        $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : -1;
205
+        $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : -1;
206 206
 
207 207
         // Creating the FAQ
208 208
         if ($faqid != -1) {
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
 
214 214
         // Putting the values in the FAQ object
215 215
         $faqObj->setGroups_read(isset($_POST['groups']) ? $_POST['groups'] : []);
216
-        $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0);
216
+        $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0);
217 217
         $faqObj->setVar('question', $_POST['question']);
218
-        $faqObj->setVar('status', isset($_POST['status']) ? (int)$_POST['status'] : _SF_STATUS_ASKED);
218
+        $faqObj->setVar('status', isset($_POST['status']) ? (int) $_POST['status'] : _SF_STATUS_ASKED);
219 219
 
220 220
         $notifToDo = null;
221 221
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 
248 248
         // Storing the FAQ
249 249
         if (!$faqObj->store()) {
250
-            redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR . sf_formatErrors($faqObj->getErrors()));
250
+            redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR.sf_formatErrors($faqObj->getErrors()));
251 251
         }
252 252
 
253 253
         // Send notifications
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
         $module_id    = $xoopsModule->getVar('mid');
266 266
         $gpermHandler = xoops_getHandler('groupperm');
267 267
 
268
-        $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0;
269
-        $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : $faqid;
268
+        $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : 0;
269
+        $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : $faqid;
270 270
 
271 271
         $faqObj = new sfFaq($faqid);
272 272
 
@@ -281,14 +281,14 @@  discard block
 block discarded – undo
281 281
             redirect_header('question.php', 2, sprintf(_AM_SF_QUESTIONISDELETED, $faqObj->question()));
282 282
         } else {
283 283
             // no confirm: show deletion condition
284
-            $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
284
+            $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0;
285 285
             xoops_cp_header();
286 286
             xoops_confirm([
287 287
                               'op'      => 'del',
288 288
                               'faqid'   => $faqObj->faqid(),
289 289
                               'confirm' => 1,
290 290
                               'name'    => $faqObj->question()
291
-                          ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
291
+                          ], 'question.php', _AM_SF_DELETETHISQUESTION." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE);
292 292
             xoops_cp_footer();
293 293
         }
294 294
 
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
         xoops_cp_header();
302 302
         $adminObject->displayNavigation(basename(__FILE__));
303 303
 
304
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
305
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
304
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
305
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
306 306
 
307 307
         global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $smartModuleConfig;
308 308
 
@@ -310,9 +310,9 @@  discard block
 block discarded – undo
310 310
 
311 311
         sf_collapsableBar('toptable', 'toptableicon');
312 312
 
313
-        echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_OPENED_TITLE . '</h3>';
313
+        echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_OPENED_TITLE.'</h3>';
314 314
         echo "<div id='toptable'>";
315
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_OPENED_DSC . '</span>';
315
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_OPENED_DSC.'</span>';
316 316
 
317 317
         // Get the total number of published FAQs
318 318
         $totalfaqs = $faqHandler->getFaqsCount(-1, [_SF_STATUS_OPENED]);
@@ -322,14 +322,14 @@  discard block
 block discarded – undo
322 322
         $allCats         = $categoryHandler->getObjects(null, true);
323 323
         echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
324 324
         echo '<tr>';
325
-        echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>';
326
-        echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
327
-        echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>';
325
+        echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>';
326
+        echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
327
+        echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>';
328 328
 
329
-        echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>';
329
+        echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>';
330 330
 
331
-        echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
332
-        echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
331
+        echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
332
+        echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
333 333
         echo '</tr>';
334 334
         //var_dump( $faqsObj);
335 335
         if ($totalfaqs > 0) {
@@ -337,33 +337,33 @@  discard block
 block discarded – undo
337 337
             foreach (array_keys($faqsObj) as $i) {
338 338
                 $categoryObj = $allCats[$faqsObj[$i]->categoryid()];
339 339
 
340
-                $modify = "<a href='question.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_EDITART . "'></a>";
341
-                $delete = "<a href='question.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>";
340
+                $modify = "<a href='question.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_EDITART."'></a>";
341
+                $delete = "<a href='question.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>";
342 342
 
343 343
                 $requester = sf_getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']);
344 344
 
345 345
                 echo '<tr>';
346
-                echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>';
347
-                echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>';
348
-                echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/answer.php?faqid=' . $faqsObj[$i]->faqid() . "'>" . $faqsObj[$i]->question(100) . '</a></td>';
346
+                echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>';
347
+                echo "<td class='even' align='left'>".$categoryObj->name().'</td>';
348
+                echo "<td class='even' align='left'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/answer.php?faqid='.$faqsObj[$i]->faqid()."'>".$faqsObj[$i]->question(100).'</a></td>';
349 349
 
350
-                echo "<td class='even' align='center'>" . $requester . '</td>';
350
+                echo "<td class='even' align='center'>".$requester.'</td>';
351 351
 
352
-                echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>';
352
+                echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>';
353 353
                 echo "<td class='even' align='center'> $modify $delete </td>";
354 354
                 echo '</tr>';
355 355
             }
356 356
         } else {
357 357
             $faqid = -1;
358 358
             echo '<tr>';
359
-            echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOQUEUED . '</td>';
359
+            echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOQUEUED.'</td>';
360 360
             echo '</tr>';
361 361
         }
362 362
         echo "</table>\n";
363 363
         echo "<br>\n";
364 364
 
365 365
         $pagenav = new XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq');
366
-        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
366
+        echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
367 367
         echo '</div>';
368 368
 
369 369
         $totalcategories = $categoryHandler->getCategoriesCount(-1);
@@ -374,4 +374,4 @@  discard block
 block discarded – undo
374 374
         break;
375 375
 }
376 376
 
377
-require_once __DIR__ . '/admin_footer.php';
377
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/permissions.php 1 patch
Switch Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -24,53 +24,53 @@
 block discarded – undo
24 24
 }
25 25
 
26 26
 switch ($op) {
27
-    case 'default':
28
-    default:
29
-        global $xoopsDB, $xoopsModule;
27
+        case 'default':
28
+        default:
29
+            global $xoopsDB, $xoopsModule;
30 30
 
31
-        $adminObject = \Xmf\Module\Admin::getInstance();
32
-        xoops_cp_header();
33
-        $adminObject->displayNavigation(basename(__FILE__));
34
-        // View Categories permissions
35
-        $item_list_view = [];
36
-        $block_view     = [];
37
-        // echo "<h3 style='color: #2F5376; '>"._AM_SF_PERMISSIONSADMIN."</h3>\n" ;
38
-        sf_collapsableBar('toptable', 'toptableicon');
31
+            $adminObject = \Xmf\Module\Admin::getInstance();
32
+            xoops_cp_header();
33
+            $adminObject->displayNavigation(basename(__FILE__));
34
+            // View Categories permissions
35
+            $item_list_view = [];
36
+            $block_view     = [];
37
+            // echo "<h3 style='color: #2F5376; '>"._AM_SF_PERMISSIONSADMIN."</h3>\n" ;
38
+            sf_collapsableBar('toptable', 'toptableicon');
39 39
 
40
-        $result_view = $xoopsDB->query('SELECT categoryid, name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' ');
41
-        if ($xoopsDB->getRowsNum($result_view)) {
42
-            while ($myrow_view = $xoopsDB->fetcharray($result_view)) {
43
-                $item_list_view['cid']   = $myrow_view['categoryid'];
44
-                $item_list_view['title'] = $myrow_view['name'];
45
-                $form_view               = new XoopsGroupPermForm('', $xoopsModule->getVar('mid'), 'category_read', "<img id='toptableicon' src="
46
-                                                                                                                    . XOOPS_URL
47
-                                                                                                                    . '/modules/'
48
-                                                                                                                    . $xoopsModule->dirname()
49
-                                                                                                                    . "/assets/images/icon/close12.gif alt=''></a>&nbsp;"
50
-                                                                                                                    . _AM_SF_PERMISSIONSVIEWMAN
51
-                                                                                                                    . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">"
52
-                                                                                                                    . _AM_SF_VIEW_CATS
53
-                                                                                                                    . '</span>', 'admin/permissions.php');
54
-                $block_view[]            = $item_list_view;
55
-                foreach ($block_view as $itemlists) {
56
-                    $form_view->addItem($itemlists['cid'], $myts->displayTarea($itemlists['title']));
40
+            $result_view = $xoopsDB->query('SELECT categoryid, name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' ');
41
+            if ($xoopsDB->getRowsNum($result_view)) {
42
+                while ($myrow_view = $xoopsDB->fetcharray($result_view)) {
43
+                    $item_list_view['cid']   = $myrow_view['categoryid'];
44
+                    $item_list_view['title'] = $myrow_view['name'];
45
+                    $form_view               = new XoopsGroupPermForm('', $xoopsModule->getVar('mid'), 'category_read', "<img id='toptableicon' src="
46
+                                                                                                                        . XOOPS_URL
47
+                                                                                                                        . '/modules/'
48
+                                                                                                                        . $xoopsModule->dirname()
49
+                                                                                                                        . "/assets/images/icon/close12.gif alt=''></a>&nbsp;"
50
+                                                                                                                        . _AM_SF_PERMISSIONSVIEWMAN
51
+                                                                                                                        . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">"
52
+                                                                                                                        . _AM_SF_VIEW_CATS
53
+                                                                                                                        . '</span>', 'admin/permissions.php');
54
+                    $block_view[]            = $item_list_view;
55
+                    foreach ($block_view as $itemlists) {
56
+                        $form_view->addItem($itemlists['cid'], $myts->displayTarea($itemlists['title']));
57
+                    }
57 58
                 }
59
+                echo $form_view->render();
60
+            } else {
61
+                echo "<img id='toptableicon' src="
62
+                     . XOOPS_URL
63
+                     . '/modules/'
64
+                     . $xoopsModule->dirname()
65
+                     . "/assets/images/icon/close12.gif alt=''></a>&nbsp;"
66
+                     . _AM_SF_PERMISSIONSVIEWMAN
67
+                     . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">"
68
+                     . _AM_SF_NOPERMSSET
69
+                     . '</span>';
58 70
             }
59
-            echo $form_view->render();
60
-        } else {
61
-            echo "<img id='toptableicon' src="
62
-                 . XOOPS_URL
63
-                 . '/modules/'
64
-                 . $xoopsModule->dirname()
65
-                 . "/assets/images/icon/close12.gif alt=''></a>&nbsp;"
66
-                 . _AM_SF_PERMISSIONSVIEWMAN
67
-                 . "</h3><div id='toptable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">"
68
-                 . _AM_SF_NOPERMSSET
69
-                 . '</span>';
70
-        }
71
-        echo '</div>';
71
+            echo '</div>';
72 72
 
73
-        echo "<br>\n";
73
+            echo "<br>\n";
74 74
 }
75 75
 
76 76
 require_once __DIR__ . '/admin_footer.php';
Please login to merge, or discard this patch.
admin/myblocksadmin.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 //                          GIJOE <http://www.peak.ne.jp>                   //
13 13
 // ------------------------------------------------------------------------- //
14 14
 
15
-require_once __DIR__ . '/../../../include/cp_header.php';
16
-require_once __DIR__ . '/mygrouppermform.php';
17
-require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
18
-require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/include/functions.php';
15
+require_once __DIR__.'/../../../include/cp_header.php';
16
+require_once __DIR__.'/mygrouppermform.php';
17
+require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
18
+require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/include/functions.php';
19 19
 
20
-$xoops_system_path = XOOPS_ROOT_PATH . '/modules/system';
20
+$xoops_system_path = XOOPS_ROOT_PATH.'/modules/system';
21 21
 
22 22
 // language files
23 23
 $language = $xoopsConfig['language'];
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 
28 28
 // to prevent from notice that constants already defined
29 29
 $error_reporting_level = error_reporting(0);
30
-require_once __DIR__ . '/../../system/constants.php';
31
-require_once __DIR__ . "/../../language/$language/admin.php";
32
-require_once __DIR__ . "/../../language/$language/admin/blocksadmin.php";
33
-require_once __DIR__ . '/../include/functions.php';
30
+require_once __DIR__.'/../../system/constants.php';
31
+require_once __DIR__."/../../language/$language/admin.php";
32
+require_once __DIR__."/../../language/$language/admin/blocksadmin.php";
33
+require_once __DIR__.'/../include/functions.php';
34 34
 error_reporting($error_reporting_level);
35 35
 
36 36
 $group_defs = file("$xoops_system_path/language/$language/admin/groups.php");
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
 // check $xoopsModule
44 44
 if (!is_object($xoopsModule)) {
45
-    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
45
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
46 46
 }
47 47
 
48 48
 // check access right (needs system_admin of BLOCK)
49 49
 $syspermHandler = xoops_getHandler('groupperm');
50 50
 if (!$syspermHandler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) {
51
-    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
51
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
52 52
 }
53 53
 
54 54
 // get blocks owned by the module
@@ -75,20 +75,20 @@  discard block
 block discarded – undo
75 75
 
76 76
     // displaying TH
77 77
     sf_collapsableBar('toptable', 'toptableicon');
78
-    echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_BLOCKS . '</h3>';
78
+    echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_BLOCKS.'</h3>';
79 79
     echo "<div id='toptable'>";
80
-    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_BLOCKSTXT . '</span>';
80
+    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_BLOCKSTXT.'</span>';
81 81
 
82 82
     echo "
83 83
     <form action='admin.php' name='blockadmin' method='post'>
84 84
         <table width='100%' class='outer' cellpadding='4' cellspacing='1'>
85 85
         <tr valign='middle'>
86
-            <th>" . _AM_TITLE . "</th>
87
-            <th align='center' nowrap='nowrap'>" . _AM_SF_POSITION . "</th>
88
-            <th align='center'>" . _AM_WEIGHT . "</th>
89
-            <th align='center'>" . _AM_VISIBLEIN . "</th>
90
-            <th align='center'>" . _AM_BCACHETIME . "</th>
91
-            <th align='center'>" . _AM_ACTION . "</th>
86
+            <th>" . _AM_TITLE."</th>
87
+            <th align='center' nowrap='nowrap'>" . _AM_SF_POSITION."</th>
88
+            <th align='center'>" . _AM_WEIGHT."</th>
89
+            <th align='center'>" . _AM_VISIBLEIN."</th>
90
+            <th align='center'>" . _AM_BCACHETIME."</th>
91
+            <th align='center'>" . _AM_ACTION."</th>
92 92
         </tr>\n";
93 93
 
94 94
     // blocks displaying loop
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
 
139 139
         // target modules
140 140
         $db            = XoopsDatabaseFactory::getDatabaseConnection();
141
-        $result        = $db->query('SELECT module_id FROM ' . $db->prefix('block_module_link') . " WHERE block_id='$bid'");
141
+        $result        = $db->query('SELECT module_id FROM '.$db->prefix('block_module_link')." WHERE block_id='$bid'");
142 142
         $selected_mids = [];
143 143
         while (list($selected_mid) = $db->fetchRow($result)) {
144
-            $selected_mids[] = (int)$selected_mid;
144
+            $selected_mids[] = (int) $selected_mid;
145 145
         }
146 146
         /** @var XoopsModuleHandler $moduleHandler */
147 147
         $moduleHandler = xoops_getHandler('module');
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
         $myts           = MyTextSanitizer::getInstance();
156 156
         foreach ($module_list as $mid => $mname) {
157 157
             if (in_array($mid, $selected_mids)) {
158
-                $module_options .= "<option value='$mid' selected>" . $myts->displayTarea($mname) . "</option>\n";
158
+                $module_options .= "<option value='$mid' selected>".$myts->displayTarea($mname)."</option>\n";
159 159
             } else {
160
-                $module_options .= "<option value='$mid'>" . $myts->displayTarea($mname) . "</option>\n";
160
+                $module_options .= "<option value='$mid'>".$myts->displayTarea($mname)."</option>\n";
161 161
             }
162 162
         }
163 163
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             <td class='foot' align='center' colspan='6'>
218 218
                 <input type='hidden' name='fct' value='blocksadmin'>
219 219
                 <input type='hidden' name='op' value='order'>
220
-                <input type='submit' name='submit' value='" . _SUBMIT . "'>
220
+                <input type='submit' name='submit' value='" . _SUBMIT."'>
221 221
             </td>
222 222
         </tr>
223 223
         </table>
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
                                                           . "</h3><div id='bottomtable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">"
246 246
                                                           . _AM_SF_GROUPSINFO
247 247
                                                           . '</span>');
248
-    $form->addAppendix('module_admin', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACTIVERIGHTS);
249
-    $form->addAppendix('module_read', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACCESSRIGHTS);
248
+    $form->addAppendix('module_admin', $xoopsModule->mid(), $xoopsModule->name().' '._AM_ACTIVERIGHTS);
249
+    $form->addAppendix('module_read', $xoopsModule->mid(), $xoopsModule->name().' '._AM_ACCESSRIGHTS);
250 250
     foreach ($item_list as $item_id => $item_name) {
251 251
         $form->addItem($item_id, $myts->displayTarea($item_name));
252 252
     }
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 }
256 256
 
257 257
 if (!empty($_POST['submit'])) {
258
-    include __DIR__ . '/mygroupperm.php';
258
+    include __DIR__.'/mygroupperm.php';
259 259
     require_once "$xoops_system_path/language/$language/admin.php";
260
-    redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/admin/myblocksadmin.php', 1, _AM_DBUPDATED);
260
+    redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/admin/myblocksadmin.php', 1, _AM_DBUPDATED);
261 261
 }
262 262
 
263 263
 xoops_cp_header();
264 264
 if (file_exists('./mymenu.php')) {
265
-    include __DIR__ . '/mymenu.php';
265
+    include __DIR__.'/mymenu.php';
266 266
 }
267 267
 
268 268
 list_blocks();
Please login to merge, or discard this patch.
admin/faq.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -548,11 +548,11 @@
 block discarded – undo
548 548
             $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
549 549
             xoops_cp_header();
550 550
             xoops_confirm([
551
-                              'op'      => 'del',
552
-                              'faqid'   => $faqObj->faqid(),
553
-                              'confirm' => 1,
554
-                              'name'    => $faqObj->question()
555
-                          ], 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
551
+                                'op'      => 'del',
552
+                                'faqid'   => $faqObj->faqid(),
553
+                                'confirm' => 1,
554
+                                'name'    => $faqObj->question()
555
+                            ], 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
556 556
             xoops_cp_footer();
557 557
         }
558 558
 
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-require_once __DIR__ . '/admin_header.php';
9
+require_once __DIR__.'/admin_header.php';
10 10
 
11 11
 // Creating the faq handler object
12 12
 $faqHandler = sf_gethandler('faq');
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 }
27 27
 
28 28
 // Where shall we start?
29
-$startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0;
29
+$startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0;
30 30
 
31 31
 /**
32 32
  * @param bool $showmenu
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 {
39 39
     global $answerHandler, $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts;
40 40
 
41
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
41
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
42 42
     // If there is a parameter, and the id exists, retrieve data: we're editing a faq
43 43
     if ($faqid != -1) {
44 44
         // Creating the FAQ object
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 
141 141
         echo "<br>\n";
142 142
         sf_collapsableBar('bottomtable', 'bottomtableicon');
143
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . $collapsableBar_title . '</h3>';
143
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".$collapsableBar_title.'</h3>';
144 144
         echo "<div id='bottomtable'>";
145
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>';
145
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>';
146 146
     } else {
147 147
         // there's no parameter, so we're adding a faq
148 148
         $faqObj = $faqHandler->create();
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         $button_caption     = _AM_SF_CREATE;
157 157
 
158 158
         sf_collapsableBar('bottomtable', 'bottomtableicon');
159
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CREATESMARTFAQ . '</h3>';
159
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CREATESMARTFAQ.'</h3>';
160 160
         echo "<div id='bottomtable'>";
161 161
     }
162 162
     $sform = new XoopsThemeForm(_AM_SF_SMARTFAQ, 'op', xoops_getenv('PHP_SELF'), 'post', true);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
     // ANSWER
189 189
     if ($merge) {
190
-        $theanswer = $originalAnswerObj->answer('e') . "\n\n" . sprintf(_AM_SF_NEW_CONTRIBUTION, sf_getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), $answerObj->answer('e'));
190
+        $theanswer = $originalAnswerObj->answer('e')."\n\n".sprintf(_AM_SF_NEW_CONTRIBUTION, sf_getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), $answerObj->answer('e'));
191 191
     } else {
192 192
         $theanswer = $answerObj->answer('e');
193 193
     }
@@ -236,14 +236,14 @@  discard block
 block discarded – undo
236 236
     $sform->addElement(new XoopsFormText(_AM_SF_SPECIFIC_URL, 'contextpage', 50, 60, $faqObj->contextpage()), false);
237 237
 
238 238
     // EXACT URL?
239
-    $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
239
+    $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
240 240
     $sform->addElement($excaturl_radio);
241 241
     // WEIGHT
242 242
     $sform->addElement(new XoopsFormText(_AM_SF_WEIGHT, 'weight', 5, 5, $faqObj->weight()), true);
243 243
 
244 244
     // COMMENTS
245 245
     // Code to allow comments
246
-    $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
246
+    $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
247 247
     $sform->addElement($addcomments_radio);
248 248
 
249 249
     // PER ITEM PERMISSIONS
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     }
258 258
     $sform->addElement($groups_checkbox);
259 259
 
260
-    $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
260
+    $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
261 261
     $sform->addElement($partial_view);
262 262
 
263 263
     // VARIOUS OPTIONS
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     // OFFLINE
281 281
     if ($faqObj->status() == _SF_STATUS_OFFLINE) {
282 282
         // Back OnLine
283
-        $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
283
+        $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
284 284
         $sform->addElement($offline_radio);
285 285
     }
286 286
 
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         }
355 355
 
356 356
         xoops_cp_header();
357
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
357
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
358 358
 
359 359
         editfaq(true, $faqid, $answerid, true);
360 360
         break;
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
         xoops_cp_header();
376 376
 
377 377
         $adminObject->displayNavigation(basename(__FILE__));
378
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
378
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
379 379
 
380 380
         editfaq(true, $faqid, $answerid);
381 381
         break;
@@ -383,9 +383,9 @@  discard block
 block discarded – undo
383 383
     case 'addfaq':
384 384
         global $xoopsUser;
385 385
 
386
-        $faqid         = isset($_POST['faqid']) ? (int)$_POST['faqid'] : -1;
387
-        $requester_uid = isset($_POST['requester_uid']) ? (int)$_POST['requester_uid'] : 0;
388
-        $answerer_uid  = isset($_POST['answerer_uid']) ? (int)$_POST['answerer_uid'] : 0;
386
+        $faqid         = isset($_POST['faqid']) ? (int) $_POST['faqid'] : -1;
387
+        $requester_uid = isset($_POST['requester_uid']) ? (int) $_POST['requester_uid'] : 0;
388
+        $answerer_uid  = isset($_POST['answerer_uid']) ? (int) $_POST['answerer_uid'] : 0;
389 389
 
390 390
         // Creating the FAQ and answer objects
391 391
         if ($faqid != -1) {
@@ -406,23 +406,23 @@  discard block
 block discarded – undo
406 406
         } else {
407 407
             $faqObj->setGroups_read();
408 408
         }
409
-        $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0);
409
+        $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0);
410 410
         $faqObj->setVar('question', $_POST['question']);
411 411
         $faqObj->setVar('howdoi', $_POST['howdoi']);
412 412
         $faqObj->setVar('diduno', $_POST['diduno']);
413 413
 
414
-        $faqObj->setVar('status', isset($_POST['status']) ? (int)$_POST['status'] : _SF_STATUS_ASKED);
414
+        $faqObj->setVar('status', isset($_POST['status']) ? (int) $_POST['status'] : _SF_STATUS_ASKED);
415 415
 
416 416
         // If this SmartFAQ is offline and the user set this option to No
417 417
         $offline = isset($_POST['offline']) ? $_POST['offline'] : 1;
418 418
         if ((0 == $offline) && ($faqObj->status() == _SF_STATUS_OFFLINE)) {
419 419
             $faqObj->setVar('status', _SF_STATUS_PUBLISHED);
420 420
         }
421
-        $faqObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : $faqObj->weight());
422
-        $faqObj->setVar('html', isset($_POST['html']) ? (int)$_POST['html'] : 0);
423
-        $faqObj->setVar('smiley', isset($_POST['smiley']) ? (int)$_POST['smiley'] : 0);
424
-        $faqObj->setVar('xcodes', isset($_POST['xcodes']) ? (int)$_POST['xcodes'] : 0);
425
-        $faqObj->setVar('cancomment', isset($_POST['cancomment']) ? (int)$_POST['cancomment'] : 0);
421
+        $faqObj->setVar('weight', isset($_POST['weight']) ? (int) $_POST['weight'] : $faqObj->weight());
422
+        $faqObj->setVar('html', isset($_POST['html']) ? (int) $_POST['html'] : 0);
423
+        $faqObj->setVar('smiley', isset($_POST['smiley']) ? (int) $_POST['smiley'] : 0);
424
+        $faqObj->setVar('xcodes', isset($_POST['xcodes']) ? (int) $_POST['xcodes'] : 0);
425
+        $faqObj->setVar('cancomment', isset($_POST['cancomment']) ? (int) $_POST['cancomment'] : 0);
426 426
         $faqObj->setVar('modulelink', $_POST['modulelink']);
427 427
         $faqObj->setVar('contextpage', $_POST['contextpage']);
428 428
         $faqObj->setVar('exacturl', $_POST['exacturl']);
@@ -506,13 +506,13 @@  discard block
 block discarded – undo
506 506
 
507 507
         // Storing the FAQ
508 508
         if (!$faqObj->store()) {
509
-            redirect_header('javascript:history.go(-1)', 3, $error_msg . sf_formatErrors($faqObj->getErrors()));
509
+            redirect_header('javascript:history.go(-1)', 3, $error_msg.sf_formatErrors($faqObj->getErrors()));
510 510
         }
511 511
 
512 512
         // Storing the answer
513 513
         $answerObj->setVar('faqid', $faqObj->faqid());
514 514
         if (!$answerObj->store()) {
515
-            redirect_header('javascript:history.go(-1)', 3, $error_msg . sf_formatErrors($answerObj->getErrors()));
515
+            redirect_header('javascript:history.go(-1)', 3, $error_msg.sf_formatErrors($answerObj->getErrors()));
516 516
         }
517 517
 
518 518
         // Send notifications
@@ -529,8 +529,8 @@  discard block
 block discarded – undo
529 529
         $module_id    = $xoopsModule->getVar('mid');
530 530
         $gpermHandler = xoops_getHandler('groupperm');
531 531
 
532
-        $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0;
533
-        $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : $faqid;
532
+        $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : 0;
533
+        $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : $faqid;
534 534
 
535 535
         $faqObj = new sfFaq($faqid);
536 536
 
@@ -539,20 +539,20 @@  discard block
 block discarded – undo
539 539
 
540 540
         if ($confirm) {
541 541
             if (!$faqHandler->delete($faqObj)) {
542
-                redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR . sf_formatErrors($faqObj->getErrors()));
542
+                redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR.sf_formatErrors($faqObj->getErrors()));
543 543
             }
544 544
 
545 545
             redirect_header('faq.php', 2, sprintf(_AM_SF_ARTISDELETED, $faqObj->question()));
546 546
         } else {
547 547
             // no confirm: show deletion condition
548
-            $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
548
+            $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0;
549 549
             xoops_cp_header();
550 550
             xoops_confirm([
551 551
                               'op'      => 'del',
552 552
                               'faqid'   => $faqObj->faqid(),
553 553
                               'confirm' => 1,
554 554
                               'name'    => $faqObj->question()
555
-                          ], 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
555
+                          ], 'faq.php', _AM_SF_DELETETHISARTICLE." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE);
556 556
             xoops_cp_footer();
557 557
         }
558 558
 
@@ -566,10 +566,10 @@  discard block
 block discarded – undo
566 566
 
567 567
         $adminObject->displayNavigation(basename(__FILE__));
568 568
 
569
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
570
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
569
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
570
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
571 571
 
572
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php';
572
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php';
573 573
 
574 574
         $totalcategories = $categoryHandler->getCategoriesCount(-1);
575 575
         if ($totalcategories > 0) {
@@ -579,4 +579,4 @@  discard block
 block discarded – undo
579 579
         break;
580 580
 }
581 581
 
582
-require_once __DIR__ . '/admin_footer.php';
582
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/mygrouppermform.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 
25 25
 // defined('XOOPS_ROOT_PATH') || exit('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
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     {
81 81
         //      $this->XoopsForm($title, 'groupperm_form', XOOPS_URL.'/modules/system/admin/groupperm.php', 'post'); GIJ
82 82
         parent::__construct($title, 'groupperm_form', '', 'post');
83
-        $this->_modid    = (int)$modid;
83
+        $this->_modid    = (int) $modid;
84 84
         $this->_permName = $permname;
85 85
         $this->_permDesc = $permdesc;
86 86
         $this->addElement(new XoopsFormHidden('modid', $this->_modid));
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
         }
160 160
         $gpermHandler  = xoops_getHandler('groupperm');
161 161
         $memberHandler = xoops_getHandler('member');
162
-        $glist         =& $memberHandler->getGroupList();
162
+        $glist         = & $memberHandler->getGroupList();
163 163
         foreach (array_keys($glist) as $i) {
164 164
             // get selected item id(s) for each group
165 165
             $selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid);
166
-            $ele      = new MyXoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
166
+            $ele      = new MyXoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected);
167 167
             $ele->setOptionTree($this->_itemTree);
168 168
 
169 169
             foreach ($this->_appendix as $key => $append) {
@@ -190,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/wffaq.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  *
11 11
  */
12 12
 
13
-require_once __DIR__ . '/admin_header.php';
13
+require_once __DIR__.'/admin_header.php';
14 14
 
15 15
 $importFromModuleName = 'WF-FAQ';
16 16
 $scriptname           = 'wffaq.php';
@@ -22,33 +22,33 @@  discard block
 block discarded – undo
22 22
 }
23 23
 
24 24
 if ($op === 'start') {
25
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
25
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
26 26
     xoops_cp_header();
27
-    $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('faqcategories'));
27
+    $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('faqcategories'));
28 28
     list($totalCat) = $xoopsDB->fetchRow($result);
29 29
 
30 30
     sf_collapsableBar('bottomtable', 'bottomtableicon');
31
-    echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>';
31
+    echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>';
32 32
     echo "<div id='bottomtable'>";
33 33
 
34 34
     if ($totalCat == 0) {
35
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_NO_CATEGORY . '</span>';
35
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_NO_CATEGORY.'</span>';
36 36
     } else {
37
-        require_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
37
+        require_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
38 38
 
39
-        $result = $xoopsDB->queryF('SELECT count(*) FROM ' . $xoopsDB->prefix('faqtopics'));
39
+        $result = $xoopsDB->queryF('SELECT count(*) FROM '.$xoopsDB->prefix('faqtopics'));
40 40
         list($totalFAQ) = $xoopsDB->fetchRow($result);
41 41
 
42 42
         if ($totalFAQ == 0) {
43
-            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat) . '</span>';
43
+            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.sprintf(_AM_SF_IMPORT_MODULE_FOUND_NO_FAQ, $importFromModuleName, $totalCat).'</span>';
44 44
         } else {
45
-            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . sprintf(_AM_SF_IMPORT_MODULE_FOUND, $importFromModuleName, $totalCat, $totalFAQ) . '</span>';
45
+            echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.sprintf(_AM_SF_IMPORT_MODULE_FOUND, $importFromModuleName, $totalCat, $totalFAQ).'</span>';
46 46
 
47
-            $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL . '/modules/smartfaq/admin/' . $scriptname);
47
+            $form = new XoopsThemeForm(_AM_SF_IMPORT_SETTINGS, 'import_form', XOOPS_URL.'/modules/smartfaq/admin/'.$scriptname);
48 48
 
49 49
             // Categories to be imported
50 50
             $cat_cbox = new XoopsFormCheckBox(sprintf(_AM_SF_IMPORT_CATEGORIES, $importFromModuleName), 'import_category', -1);
51
-            $result   = $xoopsDB->queryF('SELECT c.catID, c.name, count(t.topicID) FROM ' . $xoopsDB->prefix('faqcategories') . ' AS c, ' . $xoopsDB->prefix('faqtopics') . ' AS t WHERE c.catID=t.catID GROUP BY t.catID ORDER BY c.weight');
51
+            $result   = $xoopsDB->queryF('SELECT c.catID, c.name, count(t.topicID) FROM '.$xoopsDB->prefix('faqcategories').' AS c, '.$xoopsDB->prefix('faqtopics').' AS t WHERE c.catID=t.catID GROUP BY t.catID ORDER BY c.weight');
52 52
             while (list($cid, $cat_title, $count) = $xoopsDB->fetchRow($result)) {
53 53
                 $cat_cbox->addOption($cid, "$cat_title ($count)<br\>");
54 54
             }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             ob_end_clean();
63 63
 
64 64
             // Auto-Approve
65
-            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''));
65
+            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_AUTOAPPROVE, 'autoaprove', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''));
66 66
 
67 67
             // Submitted and answered by
68 68
             $memberHandler = xoops_getHandler('member');
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             $form->addElement($user_select);
76 76
 
77 77
             // Q&As can be commented?
78
-            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''));
78
+            $form->addElement(new XoopsFormRadioYN(_AM_SF_IMPORT_ALLOWCOMMENTS, 'cancomment', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''));
79 79
             $group_list      = $memberHandler->getGroupList();
80 80
             $groups_selected = [];
81 81
             $groups_checkbox = new XoopsFormCheckBox(_AM_SF_IMPORT_PERMISSIONS, 'groups_read');
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
         redirect_header($scriptname, 2, _AM_SF_NOCATSELECTED);
105 105
     }
106 106
 
107
-    require_once __DIR__ . '/admin_header.php';
107
+    require_once __DIR__.'/admin_header.php';
108 108
     xoops_cp_header();
109 109
 
110 110
     sf_collapsableBar('bottomtable', 'bottomtableicon');
111
-    echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName) . '</h3>';
111
+    echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".sprintf(_AM_SF_IMPORT_FROM, $importFromModuleName).'</h3>';
112 112
     echo "<div id='bottomtable'>";
113
-    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_IMPORT_RESULT . '</span>';
113
+    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_IMPORT_RESULT.'</span>';
114 114
 
115 115
     $cnt_imported_cat = 0;
116 116
     $cnt_imported_faq = 0;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     echo "Can Comment: $cancomment<br>";
139 139
     echo "Auto aprove: $autoaprove<br>";*/
140 140
 
141
-    $resultCat = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('faqcategories') . " where catID in ($import_category_list) order by weight");
141
+    $resultCat = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('faqcategories')." where catID in ($import_category_list) order by weight");
142 142
 
143 143
     while ($arrCat = $xoopsDB->fetchArray($resultCat)) {
144 144
         extract($arrCat, EXTR_PREFIX_ALL, 'wfc');
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         $categoryObj->setVar('description', $wfc_description);
154 154
 
155 155
         if (!$categoryObj->store(false)) {
156
-            echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name) . '<br>';
156
+            echo sprintf(_AM_SF_IMPORT_CATEGORY_ERROR, $xcat_name).'<br>';
157 157
             continue;
158 158
         }
159 159
 
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
 
162 162
         ++$cnt_imported_cat;
163 163
 
164
-        echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $wfc_name) . "<br\>";
164
+        echo sprintf(_AM_SF_IMPORT_CATEGORY_SUCCESS, $wfc_name)."<br\>";
165 165
 
166
-        $resultFAQ = $xoopsDB->queryF('select * from ' . $xoopsDB->prefix('faqtopics') . " where catID=$wfc_catID order by weight");
166
+        $resultFAQ = $xoopsDB->queryF('select * from '.$xoopsDB->prefix('faqtopics')." where catID=$wfc_catID order by weight");
167 167
         while ($arrFAQ = $xoopsDB->fetchArray($resultFAQ)) {
168 168
             extract($arrFAQ, EXTR_PREFIX_ALL, 'wft');
169 169
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             $faqObj->setVar('exacturl', 0);
196 196
 
197 197
             if (!$faqObj->store(false)) {
198
-                echo sprintf('  ' . _AM_SF_IMPORT_FAQ_ERROR, $wft_question) . '<br>';
198
+                echo sprintf('  '._AM_SF_IMPORT_FAQ_ERROR, $wft_question).'<br>';
199 199
                 continue;
200 200
             } else {
201 201
                 $answerObj->setVar('faqid', $faqObj->faqid());
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
                 $answerObj->setVar('status', _SF_AN_STATUS_APPROVED);
205 205
 
206 206
                 if (!$answerObj->store()) {
207
-                    echo sprintf('  ' . _AM_SF_IMPORT_FAQ_ERROR) . '<br>';
207
+                    echo sprintf('  '._AM_SF_IMPORT_FAQ_ERROR).'<br>';
208 208
                     continue;
209 209
                 } else {
210
-                    echo '&nbsp;&nbsp;' . sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)) . '<br>';
210
+                    echo '&nbsp;&nbsp;'.sprintf(_AM_SF_IMPORTED_QUESTION, $faqObj->question(50)).'<br>';
211 211
                     ++$cnt_imported_faq;
212 212
                 }
213 213
             }
@@ -217,8 +217,8 @@  discard block
 block discarded – undo
217 217
     }
218 218
 
219 219
     echo 'Done.<br>';
220
-    echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat) . '<br>';
221
-    echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq) . '<br>';
220
+    echo sprintf(_AM_SF_IMPORTED_CATEGORIES, $cnt_imported_cat).'<br>';
221
+    echo sprintf(_AM_SF_IMPORTED_QUESTIONS, $cnt_imported_faq).'<br>';
222 222
 
223 223
     exit();
224 224
 }
Please login to merge, or discard this patch.