Completed
Push — master ( 1b2f30...7ddb60 )
by Michael
05:43 queued 01:48
created
admin/category.php 2 patches
Switch Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -215,144 +215,144 @@
 block discarded – undo
215 215
 }
216 216
 
217 217
 switch ($op) {
218
-    case 'mod':
219
-        $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
220
-        $destList   = isset($_POST['destList']) ? $_POST['destList'] : '';
221
-        $indexAdmin = new ModuleAdmin();
222
-        xoops_cp_header();
218
+        case 'mod':
219
+            $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
220
+            $destList   = isset($_POST['destList']) ? $_POST['destList'] : '';
221
+            $indexAdmin = new ModuleAdmin();
222
+            xoops_cp_header();
223 223
 
224
-        echo $indexAdmin->addNavigation(basename(__FILE__));
225
-        editcat(true, $categoryid);
226
-        break;
224
+            echo $indexAdmin->addNavigation(basename(__FILE__));
225
+            editcat(true, $categoryid);
226
+            break;
227 227
 
228
-    case 'addcategory':
229
-        global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid;
228
+        case 'addcategory':
229
+            global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid;
230 230
 
231
-        $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
231
+            $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
232 232
 
233
-        if ($categoryid != 0) {
234
-            $categoryObj = new sfCategory($categoryid);
235
-        } else {
236
-            $categoryObj = $categoryHandler->create();
237
-        }
233
+            if ($categoryid != 0) {
234
+                $categoryObj = new sfCategory($categoryid);
235
+            } else {
236
+                $categoryObj = $categoryHandler->create();
237
+            }
238 238
 
239
-        //if (isset($_POST['allmods'])) $allmods = $_POST['allmods'];
240
-        //if (isset($_POST['moderators'])) $moderators = $_POST['moderators'];
239
+            //if (isset($_POST['allmods'])) $allmods = $_POST['allmods'];
240
+            //if (isset($_POST['moderators'])) $moderators = $_POST['moderators'];
241 241
 
242
-        $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0);
243
-        $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0;
244
-        $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1);
242
+            $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0);
243
+            $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0;
244
+            $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1);
245 245
 
246
-        // Groups and permissions
247
-        if (isset($_POST['groups_read'])) {
248
-            $categoryObj->setGroups_read($_POST['groups_read']);
249
-        } else {
250
-            $categoryObj->setGroups_read();
251
-        }
252
-        //  $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array();
253
-        //  $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array();
254
-
255
-        $categoryObj->setVar('name', $_POST['name']);
256
-
257
-        $categoryObj->setVar('description', $_POST['description']);
258
-        if ($categoryObj->isNew()) {
259
-            $redirect_msg = _AM_SF_CATCREATED;
260
-            $redirect_to  = 'category.php?op=mod';
261
-        } else {
262
-            $redirect_msg = _AM_SF_COLMODIFIED;
263
-            $redirect_to  = 'category.php';
264
-        }
265
-
266
-        if (!$categoryObj->store()) {
267
-            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors()));
268
-        }
269
-        // TODO : put this function in the category class
270
-        sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read');
271
-        //sf_saveCategory_Permissions($groups_admin, $categoriesObj->categoryid(), 'category_admin');
246
+            // Groups and permissions
247
+            if (isset($_POST['groups_read'])) {
248
+                $categoryObj->setGroups_read($_POST['groups_read']);
249
+            } else {
250
+                $categoryObj->setGroups_read();
251
+            }
252
+            //  $groups_admin = isset($_POST['groups_admin'])? $_POST['groups_admin'] : array();
253
+            //  $mod_perms = isset($_POST['mod_perms'])? $_POST['mod_perms'] : array();
254
+
255
+            $categoryObj->setVar('name', $_POST['name']);
256
+
257
+            $categoryObj->setVar('description', $_POST['description']);
258
+            if ($categoryObj->isNew()) {
259
+                $redirect_msg = _AM_SF_CATCREATED;
260
+                $redirect_to  = 'category.php?op=mod';
261
+            } else {
262
+                $redirect_msg = _AM_SF_COLMODIFIED;
263
+                $redirect_to  = 'category.php';
264
+            }
272 265
 
273
-        if ($applyall) {
266
+            if (!$categoryObj->store()) {
267
+                redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors()));
268
+            }
274 269
             // TODO : put this function in the category class
275
-            sf_overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid());
276
-        }
270
+            sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read');
271
+            //sf_saveCategory_Permissions($groups_admin, $categoriesObj->categoryid(), 'category_admin');
277 272
 
278
-        redirect_header($redirect_to, 2, $redirect_msg);
279
-        break;
273
+            if ($applyall) {
274
+                // TODO : put this function in the category class
275
+                sf_overrideFaqsPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid());
276
+            }
280 277
 
281
-    case 'del':
282
-        global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET;
278
+            redirect_header($redirect_to, 2, $redirect_msg);
279
+            break;
283 280
 
284
-        $module_id    = $xoopsModule->getVar('mid');
285
-        $gpermHandler = xoops_getHandler('groupperm');
281
+        case 'del':
282
+            global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET;
286 283
 
287
-        $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
288
-        $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid;
284
+            $module_id    = $xoopsModule->getVar('mid');
285
+            $gpermHandler = xoops_getHandler('groupperm');
289 286
 
290
-        $categoryObj = new sfCategory($categoryid);
287
+            $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
288
+            $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid;
291 289
 
292
-        $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
293
-        $name    = isset($_POST['name']) ? $_POST['name'] : '';
290
+            $categoryObj = new sfCategory($categoryid);
294 291
 
295
-        if ($confirm) {
296
-            if (!$categoryHandler->delete($categoryObj)) {
297
-                redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR);
292
+            $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0;
293
+            $name    = isset($_POST['name']) ? $_POST['name'] : '';
294
+
295
+            if ($confirm) {
296
+                if (!$categoryHandler->delete($categoryObj)) {
297
+                    redirect_header('category.php', 1, _AM_SF_DELETE_CAT_ERROR);
298
+                }
299
+                redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name));
300
+            } else {
301
+                // no confirm: show deletion condition
302
+                $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
303
+                xoops_cp_header();
304
+                xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br /> <br />" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
305
+                xoops_cp_footer();
298 306
             }
299
-            redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name));
300
-        } else {
301
-            // no confirm: show deletion condition
302
-            $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
307
+            exit();
308
+            break;
309
+
310
+        case 'cancel':
311
+            redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, ''));
312
+            break;
313
+        case 'default':
314
+        default:
315
+            $indexAdmin = new ModuleAdmin();
303 316
             xoops_cp_header();
304
-            xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br /> <br />" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
305
-            xoops_cp_footer();
306
-        }
307
-        exit();
308
-        break;
309
-
310
-    case 'cancel':
311
-        redirect_header('category.php', 1, sprintf(_AM_SF_BACK2IDX, ''));
312
-        break;
313
-    case 'default':
314
-    default:
315
-        $indexAdmin = new ModuleAdmin();
316
-        xoops_cp_header();
317
-
318
-        echo $indexAdmin->addNavigation(basename(__FILE__));
319
-        echo "<br />\n";
320 317
 
321
-        // Creating the objects for top categories
322
-        $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0);
323
-
324
-        sf_collapsableBar('toptable', 'toptableicon');
325
-        echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SF_CATEGORIES_TITLE . '</h3>';
326
-        echo "<div id='toptable'>";
327
-        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_SF_CATEGORIES_DSC . '</span>';
328
-
329
-        echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
330
-        echo '<tr>';
331
-        echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
332
-        echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>';
333
-        echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>';
334
-        echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
335
-        echo '</tr>';
336
-        $totalCategories = $categoryHandler->getCategoriesCount(0);
337
-        if (count($categoriesObj) > 0) {
338
-            foreach ($categoriesObj as $key => $thiscat) {
339
-                displayCategory($thiscat);
340
-            }
341
-        } else {
318
+            echo $indexAdmin->addNavigation(basename(__FILE__));
319
+            echo "<br />\n";
320
+
321
+            // Creating the objects for top categories
322
+            $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0);
323
+
324
+            sf_collapsableBar('toptable', 'toptableicon');
325
+            echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SF_CATEGORIES_TITLE . '</h3>';
326
+            echo "<div id='toptable'>";
327
+            echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_SF_CATEGORIES_DSC . '</span>';
328
+
329
+            echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
342 330
             echo '<tr>';
343
-            echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>';
331
+            echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
332
+            echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>';
333
+            echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>';
334
+            echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
344 335
             echo '</tr>';
345
-            $categoryid = '0';
346
-        }
347
-        echo "</table>\n";
348
-        include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
349
-        $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory');
350
-        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
351
-        echo '</div>';
336
+            $totalCategories = $categoryHandler->getCategoriesCount(0);
337
+            if (count($categoriesObj) > 0) {
338
+                foreach ($categoriesObj as $key => $thiscat) {
339
+                    displayCategory($thiscat);
340
+                }
341
+            } else {
342
+                echo '<tr>';
343
+                echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>';
344
+                echo '</tr>';
345
+                $categoryid = '0';
346
+            }
347
+            echo "</table>\n";
348
+            include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
349
+            $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory');
350
+            echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
351
+            echo '</div>';
352 352
 
353
-        editcat(false);
353
+            editcat(false);
354 354
 
355
-        break;
355
+            break;
356 356
 }
357 357
 
358 358
 include_once __DIR__ . '/admin_footer.php';
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
-include_once __DIR__ . '/admin_header.php';
9
+include_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     $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) {
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
     }
46 46
 
47 47
     echo '<tr>';
48
-    echo "<td class='even' align='lefet'>" . $spaces . "<a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/category.php?categoryid=' . $categoryObj->categoryid() . "'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/icon/subcat.gif' alt='' />&nbsp;" . $categoryObj->name() . '</a></td>';
49
-    echo "<td class='even' align='left'>" . $description . '</td>';
50
-    echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>';
48
+    echo "<td class='even' align='lefet'>".$spaces."<a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/category.php?categoryid='.$categoryObj->categoryid()."'><img src='".XOOPS_URL."/modules/smartfaq/assets/images/icon/subcat.gif' alt='' />&nbsp;".$categoryObj->name().'</a></td>';
49
+    echo "<td class='even' align='left'>".$description.'</td>';
50
+    echo "<td class='even' align='center'>".$categoryObj->weight().'</td>';
51 51
     echo "<td class='even' align='center'> $modify $delete </td>";
52 52
     echo '</tr>';
53 53
     $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 {
69 69
     //$moderators = array(); // just to define the variable
70 70
     //$allmods = array();
71
-    $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0;
71
+    $startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0;
72 72
     global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $_GET;
73
-    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
73
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
74 74
 
75 75
     // Creating the faq handler object
76 76
     $faqHandler = sf_gethandler('faq');
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
             redirect_header('category.php', 1, _AM_SF_NOCOLTOEDIT);
93 93
         }
94 94
         sf_collapsableBar('bottomtable', 'bottomtableicon');
95
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SF_EDITCOL . '</h3>';
95
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;"._AM_SF_EDITCOL.'</h3>';
96 96
         echo "<div id='bottomtable'>";
97 97
     } else {
98 98
         $categoryObj = $categoryHandler->create();
99 99
         echo "<br />\n";
100 100
         sf_collapsableBar('bottomtable', 'bottomtableicon');
101
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SF_CATEGORY_CREATE . '</h3>';
101
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;"._AM_SF_CATEGORY_CREATE.'</h3>';
102 102
         echo "<div id='bottomtable'>";
103 103
     }
104 104
     // Start category form
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
     }
144 144
     $sform->addElement($groups_read_checkbox);
145 145
     // Apply permissions on all faqs
146
-    $addapplyall_radio = new XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . '');
146
+    $addapplyall_radio = new XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' '._AM_SF_YES.'', ' '._AM_SF_NO.'');
147 147
     $sform->addElement($addapplyall_radio);
148 148
     // MODERATORS
149 149
     //$moderators_tray = new XoopsFormElementTray(_AM_SF_MODERATORS_DEF, '');
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
     echo '</div>';
209 209
 
210 210
     if ($categoryid) {
211
-        include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php';
211
+        include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php';
212 212
     }
213 213
 
214 214
     unset($hidden);
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
 switch ($op) {
218 218
     case 'mod':
219
-        $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
219
+        $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0;
220 220
         $destList   = isset($_POST['destList']) ? $_POST['destList'] : '';
221 221
         $indexAdmin = new ModuleAdmin();
222 222
         xoops_cp_header();
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     case 'addcategory':
229 229
         global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid;
230 230
 
231
-        $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
231
+        $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0;
232 232
 
233 233
         if ($categoryid != 0) {
234 234
             $categoryObj = new sfCategory($categoryid);
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
         //if (isset($_POST['allmods'])) $allmods = $_POST['allmods'];
240 240
         //if (isset($_POST['moderators'])) $moderators = $_POST['moderators'];
241 241
 
242
-        $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0);
243
-        $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0;
244
-        $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1);
242
+        $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int) $_POST['parentid'] : 0);
243
+        $applyall = isset($_POST['applyall']) ? (int) $_POST['applyall'] : 0;
244
+        $categoryObj->setVar('weight', isset($_POST['weight']) ? (int) $_POST['weight'] : 1);
245 245
 
246 246
         // Groups and permissions
247 247
         if (isset($_POST['groups_read'])) {
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         }
265 265
 
266 266
         if (!$categoryObj->store()) {
267
-            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors()));
267
+            redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR.sf_formatErrors($categoryObj->getErrors()));
268 268
         }
269 269
         // TODO : put this function in the category class
270 270
         sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read');
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
         $module_id    = $xoopsModule->getVar('mid');
285 285
         $gpermHandler = xoops_getHandler('groupperm');
286 286
 
287
-        $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0;
288
-        $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid;
287
+        $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0;
288
+        $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : $categoryid;
289 289
 
290 290
         $categoryObj = new sfCategory($categoryid);
291 291
 
@@ -299,9 +299,9 @@  discard block
 block discarded – undo
299 299
             redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name));
300 300
         } else {
301 301
             // no confirm: show deletion condition
302
-            $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
302
+            $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0;
303 303
             xoops_cp_header();
304
-            xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br /> <br />" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
304
+            xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_SF_DELETECOL." '".$categoryObj->name()."'. <br /> <br />"._AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE);
305 305
             xoops_cp_footer();
306 306
         }
307 307
         exit();
@@ -322,16 +322,16 @@  discard block
 block discarded – undo
322 322
         $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0);
323 323
 
324 324
         sf_collapsableBar('toptable', 'toptableicon');
325
-        echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SF_CATEGORIES_TITLE . '</h3>';
325
+        echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;"._AM_SF_CATEGORIES_TITLE.'</h3>';
326 326
         echo "<div id='toptable'>";
327
-        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_SF_CATEGORIES_DSC . '</span>';
327
+        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">"._AM_SF_CATEGORIES_DSC.'</span>';
328 328
 
329 329
         echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
330 330
         echo '<tr>';
331
-        echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
332
-        echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>';
333
-        echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>';
334
-        echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
331
+        echo "<th width='35%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
332
+        echo "<th class='bg3' align='left'><b>"._AM_SF_DESCRIP.'</b></td>';
333
+        echo "<th class='bg3' width='65' align='center'><b>"._AM_SF_WEIGHT.'</b></td>';
334
+        echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
335 335
         echo '</tr>';
336 336
         $totalCategories = $categoryHandler->getCategoriesCount(0);
337 337
         if (count($categoriesObj) > 0) {
@@ -340,14 +340,14 @@  discard block
 block discarded – undo
340 340
             }
341 341
         } else {
342 342
             echo '<tr>';
343
-            echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>';
343
+            echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOCAT.'</td>';
344 344
             echo '</tr>';
345 345
             $categoryid = '0';
346 346
         }
347 347
         echo "</table>\n";
348
-        include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
348
+        include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
349 349
         $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory');
350
-        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
350
+        echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
351 351
         echo '</div>';
352 352
 
353 353
         editcat(false);
@@ -355,4 +355,4 @@  discard block
 block discarded – undo
355 355
         break;
356 356
 }
357 357
 
358
-include_once __DIR__ . '/admin_footer.php';
358
+include_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
-include_once __DIR__ . '/admin_header.php';
14
+include_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
-    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
27
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
28 28
 
29
-    $result = $xoopsDB->query('select count(*) from ' . $xoopsDB->prefix('xoopsfaq_categories'));
29
+    $result = $xoopsDB->query('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
-        include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
39
+        include_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
40 40
 
41
-        $result = $xoopsDB->query('select count(*) from ' . $xoopsDB->prefix('xoopsfaq_contents'));
41
+        $result = $xoopsDB->query('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->query('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->query('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 = array();
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 }
103 103
 
104 104
 if ($op === 'go') {
105
-    include_once __DIR__ . '/admin_header.php';
105
+    include_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->query('select * from ' . $xoopsDB->prefix('xoopsfaq_categories') . " where category_id in ($import_category_list) order by category_order");
145
+    $resultCat = $xoopsDB->query('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->query('select * from ' . $xoopsDB->prefix('xoopsfaq_contents') . " where category_id=$xcat_category_id order by contents_order");
169
+        $resultFAQ = $xoopsDB->query('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/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
-include_once __DIR__ . '/admin_header.php';
13
+include_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
-    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
25
+    include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
26 26
     xoops_cp_header();
27
-    $result = $xoopsDB->query('select count(*) from ' . $xoopsDB->prefix('faqcategories'));
27
+    $result = $xoopsDB->query('select count(*) from '.$xoopsDB->prefix('faqcategories'));
28 28
     list($totalCat) = $xoopsDB->fetchRow($result);
29 29
 
30 30
     sf_collapsableBar('bottomtable', 'bottomtableicon');
31
-    echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . sprintf(_AM_SF_IMPORT_FROM, $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
-        include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
37
+        include_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
38 38
 
39
-        $result = $xoopsDB->query('select count(*) from ' . $xoopsDB->prefix('faqtopics'));
39
+        $result = $xoopsDB->query('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->query('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->query('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 = array();
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
-    include_once __DIR__ . '/admin_header.php';
107
+    include_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->query('select * from ' . $xoopsDB->prefix('faqcategories') . " where catID in ($import_category_list) order by weight");
141
+    $resultCat = $xoopsDB->query('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->query('select * from ' . $xoopsDB->prefix('faqtopics') . " where catID=$wfc_catID order by weight");
166
+        $resultFAQ = $xoopsDB->query('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.
submit.php 2 patches
Switch Indentation   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -42,152 +42,152 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 switch ($op) {
45
-    case 'preview':
45
+        case 'preview':
46 46
 
47
-        global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
47
+            global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
48 48
 
49
-        $faqObj      = $faqHandler->create();
50
-        $answerObj   = $answerHandler->create();
51
-        $categoryObj = $categoryHandler->get($_POST['categoryid']);
49
+            $faqObj      = $faqHandler->create();
50
+            $answerObj   = $answerHandler->create();
51
+            $categoryObj = $categoryHandler->get($_POST['categoryid']);
52 52
 
53
-        if (!$xoopsUser) {
54
-            if ($xoopsModuleConfig['anonpost'] == 1) {
55
-                $uid = 0;
53
+            if (!$xoopsUser) {
54
+                if ($xoopsModuleConfig['anonpost'] == 1) {
55
+                    $uid = 0;
56
+                } else {
57
+                    redirect_header('index.php', 3, _NOPERM);
58
+                }
56 59
             } else {
57
-                redirect_header('index.php', 3, _NOPERM);
60
+                $uid = $xoopsUser->uid();
58 61
             }
59
-        } else {
60
-            $uid = $xoopsUser->uid();
61
-        }
62 62
 
63
-        $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
63
+            $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
64 64
 
65
-        // Putting the values about the FAQ in the FAQ object
66
-        $faqObj->setVar('categoryid', $_POST['categoryid']);
67
-        $faqObj->setVar('uid', $uid);
68
-        $faqObj->setVar('question', $_POST['question']);
69
-        $faqObj->setVar('howdoi', $_POST['howdoi']);
70
-        $faqObj->setVar('diduno', $_POST['diduno']);
71
-        $faqObj->setVar('datesub', time());
65
+            // Putting the values about the FAQ in the FAQ object
66
+            $faqObj->setVar('categoryid', $_POST['categoryid']);
67
+            $faqObj->setVar('uid', $uid);
68
+            $faqObj->setVar('question', $_POST['question']);
69
+            $faqObj->setVar('howdoi', $_POST['howdoi']);
70
+            $faqObj->setVar('diduno', $_POST['diduno']);
71
+            $faqObj->setVar('datesub', time());
72 72
 
73
-        // Putting the values in the answer object
74
-        $answerObj->setVar('status', _SF_AN_STATUS_APPROVED);
75
-        $answerObj->setVar('faqid', $faqObj->faqid());
76
-        $answerObj->setVar('answer', $_POST['answer']);
77
-        $answerObj->setVar('uid', $uid);
73
+            // Putting the values in the answer object
74
+            $answerObj->setVar('status', _SF_AN_STATUS_APPROVED);
75
+            $answerObj->setVar('faqid', $faqObj->faqid());
76
+            $answerObj->setVar('answer', $_POST['answer']);
77
+            $answerObj->setVar('uid', $uid);
78 78
 
79
-        global $xoopsUser, $myts;
79
+            global $xoopsUser, $myts;
80 80
 
81
-        $xoopsOption['template_main'] = 'smartfaq_submit.tpl';
82
-        include_once(XOOPS_ROOT_PATH . '/header.php');
83
-        include_once __DIR__ . '/footer.php';
81
+            $xoopsOption['template_main'] = 'smartfaq_submit.tpl';
82
+            include_once(XOOPS_ROOT_PATH . '/header.php');
83
+            include_once __DIR__ . '/footer.php';
84 84
 
85
-        $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
85
+            $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
86 86
 
87
-        $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
88
-        $faq                 = $faqObj->toArray(null, $categoryObj, false);
89
-        $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
90
-        $faq['answer']       = $answerObj->answer();
91
-        $faq['who_when']     = $faqObj->getWhoAndWhen();
87
+            $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
88
+            $faq                 = $faqObj->toArray(null, $categoryObj, false);
89
+            $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
90
+            $faq['answer']       = $answerObj->answer();
91
+            $faq['who_when']     = $faqObj->getWhoAndWhen();
92 92
 
93
-        $faq['comments'] = -1;
94
-        $xoopsTpl->assign('faq', $faq);
95
-        $xoopsTpl->assign('op', 'preview');
96
-        $xoopsTpl->assign('whereInSection', $moduleName);
97
-        $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
93
+            $faq['comments'] = -1;
94
+            $xoopsTpl->assign('faq', $faq);
95
+            $xoopsTpl->assign('op', 'preview');
96
+            $xoopsTpl->assign('whereInSection', $moduleName);
97
+            $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
98 98
 
99
-        $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
100
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
99
+            $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
100
+            $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
101 101
 
102
-        include_once 'include/submit.inc.php';
102
+            include_once 'include/submit.inc.php';
103 103
 
104
-        include_once XOOPS_ROOT_PATH . '/footer.php';
104
+            include_once XOOPS_ROOT_PATH . '/footer.php';
105 105
 
106
-        exit();
107
-        break;
106
+            exit();
107
+            break;
108 108
 
109
-    case 'post':
109
+        case 'post':
110 110
 
111
-        global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
111
+            global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
112 112
 
113
-        $newFaqObj    = $faqHandler->create();
114
-        $newAnswerObj = $answerHandler->create();
113
+            $newFaqObj    = $faqHandler->create();
114
+            $newAnswerObj = $answerHandler->create();
115 115
 
116
-        if (!$xoopsUser) {
117
-            if ($xoopsModuleConfig['anonpost'] == 1) {
118
-                $uid = 0;
116
+            if (!$xoopsUser) {
117
+                if ($xoopsModuleConfig['anonpost'] == 1) {
118
+                    $uid = 0;
119
+                } else {
120
+                    redirect_header('index.php', 3, _NOPERM);
121
+                }
119 122
             } else {
120
-                redirect_header('index.php', 3, _NOPERM);
123
+                $uid = $xoopsUser->uid();
121 124
             }
122
-        } else {
123
-            $uid = $xoopsUser->uid();
124
-        }
125
-
126
-        $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
127
-
128
-        // Putting the values about the FAQ in the FAQ object
129
-        $newFaqObj->setVar('categoryid', $_POST['categoryid']);
130
-        $newFaqObj->setVar('uid', $uid);
131
-        $newFaqObj->setVar('question', $_POST['question']);
132
-        $newFaqObj->setVar('howdoi', $_POST['howdoi']);
133
-        $newFaqObj->setVar('diduno', $_POST['diduno']);
134
-        $newFaqObj->setVar('notifypub', $notifypub);
135
-        //$newFaqObj->setVar('modulelink', $_POST['modulelink']);
136
-        //$newFaqObj->setVar('contextpage', $_POST['contextpage']);
137 125
 
138
-        // Setting the status of the FAQ
139
-
140
-        // if user is admin, FAQ are automatically published
141
-        $isAdmin = sf_userIsAdmin();
142
-        if ($isAdmin) {
143
-            $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED);
144
-        } elseif ($xoopsModuleConfig['autoapprove_submitted_faq'] == 1) {
145
-            $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED);
146
-        } else {
147
-            $newFaqObj->setVar('status', _SF_STATUS_SUBMITTED);
148
-        }
126
+            $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
127
+
128
+            // Putting the values about the FAQ in the FAQ object
129
+            $newFaqObj->setVar('categoryid', $_POST['categoryid']);
130
+            $newFaqObj->setVar('uid', $uid);
131
+            $newFaqObj->setVar('question', $_POST['question']);
132
+            $newFaqObj->setVar('howdoi', $_POST['howdoi']);
133
+            $newFaqObj->setVar('diduno', $_POST['diduno']);
134
+            $newFaqObj->setVar('notifypub', $notifypub);
135
+            //$newFaqObj->setVar('modulelink', $_POST['modulelink']);
136
+            //$newFaqObj->setVar('contextpage', $_POST['contextpage']);
137
+
138
+            // Setting the status of the FAQ
139
+
140
+            // if user is admin, FAQ are automatically published
141
+            $isAdmin = sf_userIsAdmin();
142
+            if ($isAdmin) {
143
+                $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED);
144
+            } elseif ($xoopsModuleConfig['autoapprove_submitted_faq'] == 1) {
145
+                $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED);
146
+            } else {
147
+                $newFaqObj->setVar('status', _SF_STATUS_SUBMITTED);
148
+            }
149 149
 
150
-        // Storing the FAQ object in the database
151
-        if (!$newFaqObj->store()) {
152
-            redirect_header('javascript:history.go(-1)', 2, _MD_SF_SUBMIT_ERROR);
153
-        }
150
+            // Storing the FAQ object in the database
151
+            if (!$newFaqObj->store()) {
152
+                redirect_header('javascript:history.go(-1)', 2, _MD_SF_SUBMIT_ERROR);
153
+            }
154 154
 
155
-        // Putting the values in the answer object
156
-        $newAnswerObj->setVar('status', _SF_AN_STATUS_APPROVED);
157
-        $newAnswerObj->setVar('faqid', $newFaqObj->faqid());
158
-        $newAnswerObj->setVar('answer', $_POST['answer']);
159
-        $newAnswerObj->setVar('uid', $uid);
160
-
161
-        //====================================================================================
162
-        //TODO post Attachment
163
-        $attachments_tmp = array();
164
-        if (!empty($_POST['attachments_tmp'])) {
165
-            $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
166
-            if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
167
-                foreach ($_POST['delete_tmp'] as $key) {
168
-                    unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
169
-                    unset($attachments_tmp[$key]);
155
+            // Putting the values in the answer object
156
+            $newAnswerObj->setVar('status', _SF_AN_STATUS_APPROVED);
157
+            $newAnswerObj->setVar('faqid', $newFaqObj->faqid());
158
+            $newAnswerObj->setVar('answer', $_POST['answer']);
159
+            $newAnswerObj->setVar('uid', $uid);
160
+
161
+            //====================================================================================
162
+            //TODO post Attachment
163
+            $attachments_tmp = array();
164
+            if (!empty($_POST['attachments_tmp'])) {
165
+                $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
166
+                if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
167
+                    foreach ($_POST['delete_tmp'] as $key) {
168
+                        unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
169
+                        unset($attachments_tmp[$key]);
170
+                    }
170 171
                 }
171 172
             }
172
-        }
173
-        if (count($attachments_tmp)) {
174
-            foreach ($attachments_tmp as $key => $attach) {
175
-                if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
176
-                    $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
173
+            if (count($attachments_tmp)) {
174
+                foreach ($attachments_tmp as $key => $attach) {
175
+                    if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
176
+                        $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
177
+                    }
177 178
                 }
178 179
             }
179
-        }
180
-        $error_upload = '';
180
+            $error_upload = '';
181 181
 
182
-        if (isset($_FILES['userfile']['name']) && $_FILES['userfile']['name'] != '' && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
183
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
184
-            $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
185
-            $uploaddir   = XOOPS_CACHE_PATH;
182
+            if (isset($_FILES['userfile']['name']) && $_FILES['userfile']['name'] != '' && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
183
+                require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
184
+                $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
185
+                $uploaddir   = XOOPS_CACHE_PATH;
186 186
 
187
-            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
187
+                $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
188 188
 
189
-            if ($_FILES['userfile']['error'] > 0) {
190
-                switch ($_FILES['userfile']['error']) {
189
+                if ($_FILES['userfile']['error'] > 0) {
190
+                    switch ($_FILES['userfile']['error']) {
191 191
                     case 1:
192 192
                         $error_message[] = _MD_NEWBB_MAXUPLOADFILEINI;
193 193
                         break;
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                     default:
198 198
                         $error_message[] = _MD_NEWBB_UPLOAD_ERRNODEF;
199 199
                         break;
200
-                }
200
+                    }
201 201
             } else {
202 202
                 $uploader->setCheckMediaTypeByExt();
203 203
 
@@ -260,30 +260,30 @@  discard block
 block discarded – undo
260 260
         redirect_header('index.php', 2, $redirect_msg);
261 261
         break;
262 262
 
263
-    case 'form':
264
-    default:
263
+        case 'form':
264
+        default:
265 265
 
266
-        global $xoopsUser, $myts;
266
+            global $xoopsUser, $myts;
267 267
 
268
-        $faqObj      = $faqHandler->create();
269
-        $answerObj   = $answerHandler->create();
270
-        $categoryObj = $categoryHandler->create();
268
+            $faqObj      = $faqHandler->create();
269
+            $answerObj   = $answerHandler->create();
270
+            $categoryObj = $categoryHandler->create();
271 271
 
272
-        $xoopsOption['template_main'] = 'smartfaq_submit.html';
273
-        include_once(XOOPS_ROOT_PATH . '/header.php');
274
-        include_once __DIR__ . '/footer.php';
272
+            $xoopsOption['template_main'] = 'smartfaq_submit.html';
273
+            include_once(XOOPS_ROOT_PATH . '/header.php');
274
+            include_once __DIR__ . '/footer.php';
275 275
 
276
-        $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
277
-        $notifypub  = 1;
278
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
279
-        $xoopsTpl->assign('whereInSection', $moduleName);
280
-        $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
276
+            $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
277
+            $notifypub  = 1;
278
+            $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
279
+            $xoopsTpl->assign('whereInSection', $moduleName);
280
+            $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
281 281
 
282
-        $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
283
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
282
+            $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
283
+            $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
284 284
 
285
-        include_once 'include/submit.inc.php';
285
+            include_once 'include/submit.inc.php';
286 286
 
287
-        include_once XOOPS_ROOT_PATH . '/footer.php';
288
-        break;
287
+            include_once XOOPS_ROOT_PATH . '/footer.php';
288
+            break;
289 289
 }
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 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
-include_once __DIR__ . '/header.php';
9
+include_once __DIR__.'/header.php';
10 10
 
11 11
 global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
12 12
 
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
         global $xoopsUser, $myts;
80 80
 
81 81
         $xoopsOption['template_main'] = 'smartfaq_submit.tpl';
82
-        include_once(XOOPS_ROOT_PATH . '/header.php');
83
-        include_once __DIR__ . '/footer.php';
82
+        include_once(XOOPS_ROOT_PATH.'/header.php');
83
+        include_once __DIR__.'/footer.php';
84 84
 
85 85
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
86 86
 
87
-        $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
87
+        $moduleName          = & $myts->displayTarea($xoopsModule->getVar('name'));
88 88
         $faq                 = $faqObj->toArray(null, $categoryObj, false);
89 89
         $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
90 90
         $faq['answer']       = $answerObj->answer();
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
98 98
 
99 99
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
100
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
100
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
101 101
 
102 102
         include_once 'include/submit.inc.php';
103 103
 
104
-        include_once XOOPS_ROOT_PATH . '/footer.php';
104
+        include_once XOOPS_ROOT_PATH.'/footer.php';
105 105
 
106 106
         exit();
107 107
         break;
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
             $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
166 166
             if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
167 167
                 foreach ($_POST['delete_tmp'] as $key) {
168
-                    unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
168
+                    unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0]);
169 169
                     unset($attachments_tmp[$key]);
170 170
                 }
171 171
             }
172 172
         }
173 173
         if (count($attachments_tmp)) {
174 174
             foreach ($attachments_tmp as $key => $attach) {
175
-                if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
175
+                if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0])) {
176 176
                     $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
177 177
                 }
178 178
             }
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
         $error_upload = '';
181 181
 
182 182
         if (isset($_FILES['userfile']['name']) && $_FILES['userfile']['name'] != '' && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
183
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
183
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php';
184 184
             $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
185 185
             $uploaddir   = XOOPS_CACHE_PATH;
186 186
 
187
-            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
187
+            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int) $maxfilesize, (int) $xoopsModuleConfig['max_img_width'], (int) $xoopsModuleConfig['max_img_height']);
188 188
 
189 189
             if ($_FILES['userfile']['error'] > 0) {
190 190
                 switch ($_FILES['userfile']['error']) {
@@ -202,13 +202,13 @@  discard block
 block discarded – undo
202 202
                 $uploader->setCheckMediaTypeByExt();
203 203
 
204 204
                 if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
205
-                    $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid() . '_' : 'newbb_';
205
+                    $prefix = is_object($xoopsUser) ? (string) $xoopsUser->uid().'_' : 'newbb_';
206 206
                     $uploader->setPrefix($prefix);
207 207
                     if (!$uploader->upload()) {
208 208
                         $error_message[] = $error_upload = $uploader->getErrors();
209 209
                     } else {
210 210
                         if (is_file($uploader->getSavedDestination())) {
211
-                            if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $uploader->getSavedFileName())) {
211
+                            if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$uploader->getSavedFileName())) {
212 212
                                 $post_obj->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType());
213 213
                             }
214 214
                         }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         }
228 228
 
229 229
         // Get the cateopry object related to that FAQ
230
-        $categoryObj =& $newFaqObj->category();
230
+        $categoryObj = & $newFaqObj->category();
231 231
 
232 232
         // If autoapprove_submitted_faq
233 233
         if ($isAdmin) {
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
         } else {
248 248
             // Subscribe the user to On Published notification, if requested
249 249
             if ($notifypub == 1) {
250
-                include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
250
+                include_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
251 251
                 $notificationHandler = xoops_getHandler('notification');
252 252
                 $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
253 253
             }
@@ -270,20 +270,20 @@  discard block
 block discarded – undo
270 270
         $categoryObj = $categoryHandler->create();
271 271
 
272 272
         $xoopsOption['template_main'] = 'smartfaq_submit.html';
273
-        include_once(XOOPS_ROOT_PATH . '/header.php');
274
-        include_once __DIR__ . '/footer.php';
273
+        include_once(XOOPS_ROOT_PATH.'/header.php');
274
+        include_once __DIR__.'/footer.php';
275 275
 
276 276
         $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
277 277
         $notifypub  = 1;
278
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
278
+        $moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
279 279
         $xoopsTpl->assign('whereInSection', $moduleName);
280 280
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
281 281
 
282 282
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
283
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
283
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
284 284
 
285 285
         include_once 'include/submit.inc.php';
286 286
 
287
-        include_once XOOPS_ROOT_PATH . '/footer.php';
287
+        include_once XOOPS_ROOT_PATH.'/footer.php';
288 288
         break;
289 289
 }
Please login to merge, or discard this patch.
include/answer.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 
10 10
 global $_POST;
11 11
 
12
-include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
13
-include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
14
-include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
12
+include_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
13
+include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
14
+include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
15 15
 
16 16
 $form = new XoopsThemeForm(_MD_SF_REQUEST, 'form', xoops_getenv('PHP_SELF'));
17 17
 // CATEGORY
Please login to merge, or discard this patch.
blocks/faqs_random_faq.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 function b_faqs_random_diduno_show()
11 11
 {
12
-    include_once(XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php');
12
+    include_once(XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php');
13 13
 
14 14
     $block = array();
15 15
 
Please login to merge, or discard this patch.
blocks/faqs_random_how.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 function b_faqs_random_diduno_show()
11 11
 {
12
-    include_once(XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php');
12
+    include_once(XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php');
13 13
 
14 14
     $block = array();
15 15
 
Please login to merge, or discard this patch.