@@ -22,7 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | // language files |
24 | 24 | $language = $xoopsConfig['language'] ; |
25 | -if (!file_exists("$xoops_system_path/language/$language/admin/blocksadmin.php")) $language = 'english'; |
|
25 | +if (!file_exists("$xoops_system_path/language/$language/admin/blocksadmin.php")) { |
|
26 | + $language = 'english'; |
|
27 | +} |
|
26 | 28 | |
27 | 29 | // to prevent from notice that constants already defined |
28 | 30 | $error_reporting_level = error_reporting(0); |
@@ -34,15 +36,21 @@ discard block |
||
34 | 36 | |
35 | 37 | $group_defs = file( "$xoops_system_path/language/$language/admin/groups.php" ) ; |
36 | 38 | foreach ($group_defs as $def) { |
37 | - if ( strstr( $def , '_AM_ACCESSRIGHTS' ) || strstr( $def , '_AM_ACTIVERIGHTS' ) ) eval( $def ) ; |
|
38 | -} |
|
39 | + if ( strstr( $def , '_AM_ACCESSRIGHTS' ) || strstr( $def , '_AM_ACTIVERIGHTS' ) ) { |
|
40 | + eval( $def ) ; |
|
41 | + } |
|
42 | + } |
|
39 | 43 | |
40 | 44 | // check $xoopsModule |
41 | -if ( ! is_object( $xoopsModule ) ) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ; |
|
45 | +if ( ! is_object( $xoopsModule ) ) { |
|
46 | + redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ; |
|
47 | +} |
|
42 | 48 | |
43 | 49 | // check access right (needs system_admin of BLOCK) |
44 | 50 | $sysperm_handler =& xoops_gethandler('groupperm'); |
45 | -if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ; |
|
51 | +if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) { |
|
52 | + redirect_header( XOOPS_URL.'/user.php' , 1 , _NOPERM ) ; |
|
53 | +} |
|
46 | 54 | |
47 | 55 | // get blocks owned by the module |
48 | 56 | $block_arr =& XoopsBlock::getByModule( $xoopsModule->mid() ) ; |
@@ -86,10 +94,12 @@ discard block |
||
86 | 94 | // visible and side |
87 | 95 | if ( $block_arr[$i]->getVar("visible") != 1 ) { |
88 | 96 | $sseln = " checked='checked' style='background-color:#FF0000;'"; |
89 | - } else switch ( $block_arr[$i]->getVar("side") ) { |
|
97 | + } else { |
|
98 | + switch ( $block_arr[$i]->getVar("side") ) { |
|
90 | 99 | default : |
91 | 100 | case XOOPS_SIDEBLOCK_LEFT : |
92 | 101 | $ssel0 = " checked='checked' style='background-color:#00FF00;'"; |
102 | + } |
|
93 | 103 | break ; |
94 | 104 | case XOOPS_SIDEBLOCK_RIGHT : |
95 | 105 | $ssel1 = " checked='checked' style='background-color:#00FF00;'"; |
@@ -217,7 +227,9 @@ discard block |
||
217 | 227 | } |
218 | 228 | |
219 | 229 | xoops_cp_header() ; |
220 | -if (file_exists('./mymenu.php')) include('./mymenu.php'); |
|
230 | +if (file_exists('./mymenu.php')) { |
|
231 | + include('./mymenu.php'); |
|
232 | +} |
|
221 | 233 | //sf_adminMenu(5, _AM_SF_BLOCKSANDGROUPS); |
222 | 234 | |
223 | 235 | list_blocks() ; |
@@ -376,8 +376,10 @@ |
||
376 | 376 | $tree .= ' checked="checked"'; |
377 | 377 | } |
378 | 378 | $tree .= " />".$option['name']."<input type=\"hidden\" name=\"".$this->getName()."[parents][".$option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\"".$this->getName()."[itemname][".$option['id']."]\" value=\"".htmlspecialchars($option['name'])."\" /><br />\n"; |
379 | - if ( isset( $option['children'] ) ) foreach ($option['children'] as $child) { |
|
379 | + if ( isset( $option['children'] ) ) { |
|
380 | + foreach ($option['children'] as $child) { |
|
380 | 381 | array_push($parentIds, $option['id']); |
382 | + } |
|
381 | 383 | $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
382 | 384 | } |
383 | 385 | } |
@@ -50,7 +50,9 @@ |
||
50 | 50 | // var_dump( $HTTP_POST_VARS['perms'] ) ; |
51 | 51 | // exit ; |
52 | 52 | if (false != myDeleteByModule($gperm_handler->db,$modid,$perm_name,$item_id)) { |
53 | - if ( empty( $perm_data['groups'] ) ) continue ; |
|
53 | + if ( empty( $perm_data['groups'] ) ) { |
|
54 | + continue ; |
|
55 | + } |
|
54 | 56 | foreach ($perm_data['groups'] as $group_id => $item_ids) { |
55 | 57 | // foreach ($item_ids as $item_id => $selected) { |
56 | 58 | $selected = isset( $item_ids[ $item_id ] )? $item_ids[ $item_id ] : 0 ; |
@@ -11,8 +11,12 @@ |
||
11 | 11 | |
12 | 12 | $op='none'; |
13 | 13 | |
14 | -if (isset($_GET['op'])) $op = $_GET['op']; |
|
15 | -if (isset($_POST['op'])) $op = $_POST['op']; |
|
14 | +if (isset($_GET['op'])) { |
|
15 | + $op = $_GET['op']; |
|
16 | +} |
|
17 | +if (isset($_POST['op'])) { |
|
18 | + $op = $_POST['op']; |
|
19 | +} |
|
16 | 20 | |
17 | 21 | global $xoopsDB; |
18 | 22 |
@@ -36,8 +36,12 @@ |
||
36 | 36 | |
37 | 37 | $op = ''; |
38 | 38 | |
39 | -if (isset($_GET['op'])) $op = $_GET['op']; |
|
40 | -if (isset($_POST['op'])) $op = $_POST['op']; |
|
39 | +if (isset($_GET['op'])) { |
|
40 | + $op = $_GET['op']; |
|
41 | +} |
|
42 | +if (isset($_POST['op'])) { |
|
43 | + $op = $_POST['op']; |
|
44 | +} |
|
41 | 45 | |
42 | 46 | switch ($op) { |
43 | 47 | case 'post': |