Index: trunk/extensions/ConditionalShowSection/ConditionalShowSection.php |
— | — | @@ -72,24 +72,30 @@ |
73 | 73 | |
74 | 74 | # Extract the parameters passed |
75 | 75 | # the parser lowers the case of all the parameters passed... |
76 | | - if ( isset( $argv["logged"] ) ) |
77 | | - { |
| 76 | + if ( isset( $argv["logged"] ) ) { |
78 | 77 | $userReqLogged = $argv["logged"]; |
79 | 78 | |
80 | | - if ( $userReqLogged === "1" && ( $wgUser->isLoggedIn() === true ) ) |
| 79 | + if ( $userReqLogged === "1" && ( $wgUser->isLoggedIn() === true ) ) { |
81 | 80 | $cond1 = true; |
| 81 | + } |
82 | 82 | |
83 | | - if ( $userReqLogged === "0" && ( $wgUser->isLoggedIn() === false ) ) |
| 83 | + if ( $userReqLogged === "0" && ( $wgUser->isLoggedIn() === false ) ) { |
84 | 84 | $cond1 = true; |
85 | | - } else $cond1 = true; |
86 | | - if ( isset( $argv["ingroup"] ) ) |
87 | | - { |
| 85 | + } |
| 86 | + } else { |
| 87 | + $cond1 = true; |
| 88 | + } |
| 89 | + |
| 90 | + if ( isset( $argv["ingroup"] ) ) { |
88 | 91 | $userReqGroup = explode( ',', $argv["ingroup"] ); |
89 | 92 | # which groups is the user part of? |
90 | 93 | $ugroups = $wgUser->getEffectiveGroups(); // changed in v1.4 |
91 | | - if ( array_intersect( $userReqGroup, $ugroups ) ) |
| 94 | + if ( array_intersect( $userReqGroup, $ugroups ) ) { |
92 | 95 | $cond2 = true; |
93 | | - } else $cond1 = true; |
| 96 | + } |
| 97 | + } else { |
| 98 | + $cond1 = true; |
| 99 | + } |
94 | 100 | # if both conditions are met, then SHOW else HIDE |
95 | 101 | if ( ( $cond1 === true ) and ( $cond2 === true ) ) { |
96 | 102 | $output = $parser->recursiveTagParse( $input ); |