@@ -6,7 +6,7 @@ discard block |
||
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 |
||
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,7 +33,7 @@ discard block |
||
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 | 39 | $modify = "<a href='category.php?op=mod&categoryid=" |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | . "/modules/smartfaq/assets/images/icon/subcat.gif' alt='' /> " |
77 | 77 | . $categoryObj->name() |
78 | 78 | . '</a></td>'; |
79 | - echo "<td class='even' align='left'>" . $description . '</td>'; |
|
80 | - echo "<td class='even' align='center'>" . $categoryObj->weight() . '</td>'; |
|
79 | + echo "<td class='even' align='left'>".$description.'</td>'; |
|
80 | + echo "<td class='even' align='center'>".$categoryObj->weight().'</td>'; |
|
81 | 81 | echo "<td class='even' align='center'> $modify $delete </td>"; |
82 | 82 | echo '</tr>'; |
83 | 83 | $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | { |
99 | 99 | //$moderators = array(); // just to define the variable |
100 | 100 | //$allmods = array(); |
101 | - $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
|
101 | + $startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0; |
|
102 | 102 | global $categoryHandler, $xoopsUser, $xoopsUser, $myts, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $_GET; |
103 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
103 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
104 | 104 | |
105 | 105 | // Creating the faq handler object |
106 | 106 | $faqHandler = sf_gethandler('faq'); |
@@ -122,13 +122,13 @@ discard block |
||
122 | 122 | redirect_header('category.php', 1, _AM_SF_NOCOLTOEDIT); |
123 | 123 | } |
124 | 124 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
125 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_EDITCOL . '</h3>'; |
|
125 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_EDITCOL.'</h3>'; |
|
126 | 126 | echo "<div id='bottomtable'>"; |
127 | 127 | } else { |
128 | 128 | $categoryObj = $categoryHandler->create(); |
129 | 129 | echo "<br>\n"; |
130 | 130 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
131 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_CATEGORY_CREATE . '</h3>'; |
|
131 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_CATEGORY_CREATE.'</h3>'; |
|
132 | 132 | echo "<div id='bottomtable'>"; |
133 | 133 | } |
134 | 134 | // Start category form |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } |
174 | 174 | $sform->addElement($groups_read_checkbox); |
175 | 175 | // Apply permissions on all faqs |
176 | - $addapplyall_radio = new XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
176 | + $addapplyall_radio = new XoopsFormRadioYN(_AM_SF_PERMISSIONS_APPLY_ON_FAQS, 'applyall', 0, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
177 | 177 | $sform->addElement($addapplyall_radio); |
178 | 178 | // MODERATORS |
179 | 179 | //$moderators_tray = new XoopsFormElementTray(_AM_SF_MODERATORS_DEF, ''); |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | echo '</div>'; |
239 | 239 | |
240 | 240 | if ($categoryid) { |
241 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php'; |
|
241 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php'; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | unset($hidden); |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | |
247 | 247 | switch ($op) { |
248 | 248 | case 'mod': |
249 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
249 | + $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
250 | 250 | $destList = isset($_POST['destList']) ? $_POST['destList'] : ''; |
251 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
251 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
252 | 252 | xoops_cp_header(); |
253 | 253 | |
254 | 254 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | case 'addcategory': |
259 | 259 | global $_POST, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $modify, $myts, $categoryid; |
260 | 260 | |
261 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
261 | + $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0; |
|
262 | 262 | |
263 | 263 | if ($categoryid != 0) { |
264 | 264 | $categoryObj = new sfCategory($categoryid); |
@@ -269,9 +269,9 @@ discard block |
||
269 | 269 | //if (isset($_POST['allmods'])) $allmods = $_POST['allmods']; |
270 | 270 | //if (isset($_POST['moderators'])) $moderators = $_POST['moderators']; |
271 | 271 | |
272 | - $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int)$_POST['parentid'] : 0); |
|
273 | - $applyall = isset($_POST['applyall']) ? (int)$_POST['applyall'] : 0; |
|
274 | - $categoryObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : 1); |
|
272 | + $categoryObj->setVar('parentid', isset($_POST['parentid']) ? (int) $_POST['parentid'] : 0); |
|
273 | + $applyall = isset($_POST['applyall']) ? (int) $_POST['applyall'] : 0; |
|
274 | + $categoryObj->setVar('weight', isset($_POST['weight']) ? (int) $_POST['weight'] : 1); |
|
275 | 275 | |
276 | 276 | // Groups and permissions |
277 | 277 | if (isset($_POST['groups_read'])) { |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | |
296 | 296 | if (!$categoryObj->store()) { |
297 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR . sf_formatErrors($categoryObj->getErrors())); |
|
297 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_CATEGORY_SAVE_ERROR.sf_formatErrors($categoryObj->getErrors())); |
|
298 | 298 | } |
299 | 299 | // TODO : put this function in the category class |
300 | 300 | sf_saveCategory_Permissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | $module_id = $xoopsModule->getVar('mid'); |
315 | 315 | $gpermHandler = xoops_getHandler('groupperm'); |
316 | 316 | |
317 | - $categoryid = isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0; |
|
318 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : $categoryid; |
|
317 | + $categoryid = isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0; |
|
318 | + $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : $categoryid; |
|
319 | 319 | |
320 | 320 | $categoryObj = new sfCategory($categoryid); |
321 | 321 | |
@@ -329,14 +329,14 @@ discard block |
||
329 | 329 | redirect_header('category.php', 1, sprintf(_AM_SF_COLISDELETED, $name)); |
330 | 330 | } else { |
331 | 331 | // no confirm: show deletion condition |
332 | - $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
332 | + $categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
333 | 333 | xoops_cp_header(); |
334 | 334 | xoops_confirm(array( |
335 | 335 | 'op' => 'del', |
336 | 336 | 'categoryid' => $categoryObj->categoryid(), |
337 | 337 | 'confirm' => 1, |
338 | 338 | 'name' => $categoryObj->name() |
339 | - ), 'category.php', _AM_SF_DELETECOL . " '" . $categoryObj->name() . "'. <br> <br>" . _AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
339 | + ), 'category.php', _AM_SF_DELETECOL." '".$categoryObj->name()."'. <br> <br>"._AM_SF_DELETE_CAT_CONFIRM, _AM_SF_DELETE); |
|
340 | 340 | xoops_cp_footer(); |
341 | 341 | } |
342 | 342 | exit(); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | break; |
348 | 348 | case 'default': |
349 | 349 | default: |
350 | - $adminObject = \Xmf\Module\Admin::getInstance(); |
|
350 | + $adminObject = \Xmf\Module\Admin::getInstance(); |
|
351 | 351 | xoops_cp_header(); |
352 | 352 | |
353 | 353 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -357,16 +357,16 @@ discard block |
||
357 | 357 | $categoriesObj = $categoryHandler->getCategories($xoopsModuleConfig['perpage'], $startcategory, 0); |
358 | 358 | |
359 | 359 | sf_collapsableBar('toptable', 'toptableicon'); |
360 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_CATEGORIES_TITLE . '</h3>'; |
|
360 | + echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_CATEGORIES_TITLE.'</h3>'; |
|
361 | 361 | echo "<div id='toptable'>"; |
362 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_CATEGORIES_DSC . '</span>'; |
|
362 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_CATEGORIES_DSC.'</span>'; |
|
363 | 363 | |
364 | 364 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
365 | 365 | echo '<tr>'; |
366 | - echo "<th width='35%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
367 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_DESCRIP . '</b></td>'; |
|
368 | - echo "<th class='bg3' width='65' align='center'><b>" . _AM_SF_WEIGHT . '</b></td>'; |
|
369 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
366 | + echo "<th width='35%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
367 | + echo "<th class='bg3' align='left'><b>"._AM_SF_DESCRIP.'</b></td>'; |
|
368 | + echo "<th class='bg3' width='65' align='center'><b>"._AM_SF_WEIGHT.'</b></td>'; |
|
369 | + echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
370 | 370 | echo '</tr>'; |
371 | 371 | $totalCategories = $categoryHandler->getCategoriesCount(0); |
372 | 372 | if (count($categoriesObj) > 0) { |
@@ -375,14 +375,14 @@ discard block |
||
375 | 375 | } |
376 | 376 | } else { |
377 | 377 | echo '<tr>'; |
378 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOCAT . '</td>'; |
|
378 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOCAT.'</td>'; |
|
379 | 379 | echo '</tr>'; |
380 | 380 | $categoryid = '0'; |
381 | 381 | } |
382 | 382 | echo "</table>\n"; |
383 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
383 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
384 | 384 | $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['perpage'], $startcategory, 'startcategory'); |
385 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
385 | + echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
386 | 386 | echo '</div>'; |
387 | 387 | |
388 | 388 | editcat(false); |
@@ -390,4 +390,4 @@ discard block |
||
390 | 390 | break; |
391 | 391 | } |
392 | 392 | |
393 | -require_once __DIR__ . '/admin_footer.php'; |
|
393 | +require_once __DIR__.'/admin_footer.php'; |
@@ -28,47 +28,47 @@ discard block |
||
28 | 28 | if (empty($fct)) { |
29 | 29 | $fct = 'preferences'; |
30 | 30 | } |
31 | -include __DIR__ . '/../../../mainfile.php'; |
|
32 | -include XOOPS_ROOT_PATH . '/include/cp_functions.php'; |
|
31 | +include __DIR__.'/../../../mainfile.php'; |
|
32 | +include XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
33 | 33 | |
34 | -include_once XOOPS_ROOT_PATH . '/kernel/module.php'; |
|
34 | +include_once XOOPS_ROOT_PATH.'/kernel/module.php'; |
|
35 | 35 | |
36 | 36 | $admintest = 0; |
37 | 37 | |
38 | 38 | if (is_object($xoopsUser)) { |
39 | 39 | $xoopsModule = XoopsModule::getByDirname('system'); |
40 | 40 | if (!$xoopsUser->isAdmin($xoopsModule->mid())) { |
41 | - redirect_header(XOOPS_URL . '/user.php', 3, _NOPERM); |
|
41 | + redirect_header(XOOPS_URL.'/user.php', 3, _NOPERM); |
|
42 | 42 | } |
43 | 43 | $admintest = 1; |
44 | 44 | } else { |
45 | - redirect_header(XOOPS_URL . '/user.php', 3, _NOPERM); |
|
45 | + redirect_header(XOOPS_URL.'/user.php', 3, _NOPERM); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | // include system category definitions |
49 | -include_once XOOPS_ROOT_PATH . '/modules/system/constants.php'; |
|
49 | +include_once XOOPS_ROOT_PATH.'/modules/system/constants.php'; |
|
50 | 50 | $error = false; |
51 | 51 | if ($admintest != 0) { |
52 | 52 | if (isset($fct) && $fct != '') { |
53 | - if (file_exists(XOOPS_ROOT_PATH . '/modules/system/admin/' . $fct . '/xoops_version.php')) { |
|
54 | - include_once XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin.php'; |
|
53 | + if (file_exists(XOOPS_ROOT_PATH.'/modules/system/admin/'.$fct.'/xoops_version.php')) { |
|
54 | + include_once XOOPS_ROOT_PATH.'/modules/system/language/'.$xoopsConfig['language'].'/admin.php'; |
|
55 | 55 | |
56 | - if (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/' . $fct . '.php')) { |
|
57 | - include XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/' . $fct . '.php'; |
|
58 | - } elseif (file_exists(XOOPS_ROOT_PATH . '/modules/system/language/english/admin/' . $fct . '.php')) { |
|
59 | - include XOOPS_ROOT_PATH . '/modules/system/language/english/admin/' . $fct . '.php'; |
|
56 | + if (file_exists(XOOPS_ROOT_PATH.'/modules/system/language/'.$xoopsConfig['language'].'/admin/'.$fct.'.php')) { |
|
57 | + include XOOPS_ROOT_PATH.'/modules/system/language/'.$xoopsConfig['language'].'/admin/'.$fct.'.php'; |
|
58 | + } elseif (file_exists(XOOPS_ROOT_PATH.'/modules/system/language/english/admin/'.$fct.'.php')) { |
|
59 | + include XOOPS_ROOT_PATH.'/modules/system/language/english/admin/'.$fct.'.php'; |
|
60 | 60 | } |
61 | - include XOOPS_ROOT_PATH . '/modules/system/admin/' . $fct . '/xoops_version.php'; |
|
61 | + include XOOPS_ROOT_PATH.'/modules/system/admin/'.$fct.'/xoops_version.php'; |
|
62 | 62 | $syspermHandler = xoops_getHandler('groupperm'); |
63 | - $category = !empty($modversion['category']) ? (int)$modversion['category'] : 0; |
|
63 | + $category = !empty($modversion['category']) ? (int) $modversion['category'] : 0; |
|
64 | 64 | unset($modversion); |
65 | 65 | if ($category > 0) { |
66 | - $groups =& $xoopsUser->getGroups(); |
|
66 | + $groups = & $xoopsUser->getGroups(); |
|
67 | 67 | if (in_array(XOOPS_GROUP_ADMIN, $groups) |
68 | 68 | || false !== $syspermHandler->checkRight('system_admin', $category, $groups, $xoopsModule->getVar('mid')) |
69 | 69 | ) { |
70 | 70 | if (file_exists("../include/{$fct}.inc.php")) { |
71 | - include_once __DIR__ . "/../include/{$fct}.inc.php"; |
|
71 | + include_once __DIR__."/../include/{$fct}.inc.php"; |
|
72 | 72 | } else { |
73 | 73 | $error = true; |
74 | 74 | } |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | $error = true; |
77 | 77 | } |
78 | 78 | } elseif ($fct === 'version') { |
79 | - if (file_exists(XOOPS_ROOT_PATH . '/modules/system/admin/version/main.php')) { |
|
80 | - include_once XOOPS_ROOT_PATH . '/modules/system/admin/version/main.php'; |
|
79 | + if (file_exists(XOOPS_ROOT_PATH.'/modules/system/admin/version/main.php')) { |
|
80 | + include_once XOOPS_ROOT_PATH.'/modules/system/admin/version/main.php'; |
|
81 | 81 | } else { |
82 | 82 | $error = true; |
83 | 83 | } |
@@ -101,22 +101,22 @@ discard block |
||
101 | 101 | $all_ok = false; |
102 | 102 | if (!in_array(XOOPS_GROUP_ADMIN, $groups)) { |
103 | 103 | $syspermHandler = xoops_getHandler('groupperm'); |
104 | - $ok_syscats =& $syspermHandler->getItemIds('system_admin', $groups); |
|
104 | + $ok_syscats = & $syspermHandler->getItemIds('system_admin', $groups); |
|
105 | 105 | } else { |
106 | 106 | $all_ok = true; |
107 | 107 | } |
108 | - $admin_dir = XOOPS_ROOT_PATH . '/modules/system/admin'; |
|
108 | + $admin_dir = XOOPS_ROOT_PATH.'/modules/system/admin'; |
|
109 | 109 | $handle = opendir($admin_dir); |
110 | 110 | $counter = 0; |
111 | 111 | $class = 'even'; |
112 | 112 | while ($file = readdir($handle)) { |
113 | - if (strtolower($file) !== 'cvs' && !preg_match('/[.]/', $file) && is_dir($admin_dir . '/' . $file)) { |
|
114 | - include $admin_dir . '/' . $file . '/xoops_version.php'; |
|
113 | + if (strtolower($file) !== 'cvs' && !preg_match('/[.]/', $file) && is_dir($admin_dir.'/'.$file)) { |
|
114 | + include $admin_dir.'/'.$file.'/xoops_version.php'; |
|
115 | 115 | if ($modversion['hasAdmin']) { |
116 | - $category = isset($modversion['category']) ? (int)$modversion['category'] : 0; |
|
116 | + $category = isset($modversion['category']) ? (int) $modversion['category'] : 0; |
|
117 | 117 | if (false !== $all_ok || in_array($modversion['category'], $ok_syscats)) { |
118 | 118 | echo "<td class='$class' align='center' valign='bottom' width='19%'>"; |
119 | - echo "<a href='" . XOOPS_URL . '/modules/system/admin.php?fct=' . $file . "'><b>" . trim($modversion['name']) . "</b></a>\n"; |
|
119 | + echo "<a href='".XOOPS_URL.'/modules/system/admin.php?fct='.$file."'><b>".trim($modversion['name'])."</b></a>\n"; |
|
120 | 120 | echo '</td>'; |
121 | 121 | ++$counter; |
122 | 122 | $class = ($class === 'even') ? 'odd' : 'even'; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | } |
133 | 133 | while ($counter < 5) { |
134 | - echo '<td class="' . $class . '"> </td>'; |
|
134 | + echo '<td class="'.$class.'"> </td>'; |
|
135 | 135 | $class = ($class === 'even') ? 'odd' : 'even'; |
136 | 136 | ++$counter; |
137 | 137 | } |