Index: trunk/phase3/skins/MonoBook.php |
— | — | @@ -126,21 +126,7 @@ |
127 | 127 | </div> |
128 | 128 | <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script> |
129 | 129 | <?php |
130 | | - $sidebar = $this->data['sidebar']; |
131 | | - if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; |
132 | | - if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; |
133 | | - if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; |
134 | | - foreach ($sidebar as $boxName => $cont) { |
135 | | - if ( $boxName == 'SEARCH' ) { |
136 | | - $this->searchBox(); |
137 | | - } elseif ( $boxName == 'TOOLBOX' ) { |
138 | | - $this->toolbox(); |
139 | | - } elseif ( $boxName == 'LANGUAGES' ) { |
140 | | - $this->languageBox(); |
141 | | - } else { |
142 | | - $this->customBox( $boxName, $cont ); |
143 | | - } |
144 | | - } |
| 130 | + $this->renderPortals( $this->data['sidebar'] ); |
145 | 131 | ?> |
146 | 132 | </div><!-- end of the left (by default at least) column --> |
147 | 133 | <div class="visualClear"></div> |
— | — | @@ -187,6 +173,25 @@ |
188 | 174 | } // end of execute() method |
189 | 175 | |
190 | 176 | /*************************************************************************************************/ |
| 177 | + |
| 178 | + protected function renderPortals( $sidebar ) { |
| 179 | + if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; |
| 180 | + if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; |
| 181 | + if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; |
| 182 | + |
| 183 | + foreach ($sidebar as $boxName => $cont) { |
| 184 | + if ( $boxName == 'SEARCH' ) { |
| 185 | + $this->searchBox(); |
| 186 | + } elseif ( $boxName == 'TOOLBOX' ) { |
| 187 | + $this->toolbox(); |
| 188 | + } elseif ( $boxName == 'LANGUAGES' ) { |
| 189 | + $this->languageBox(); |
| 190 | + } else { |
| 191 | + $this->customBox( $boxName, $cont ); |
| 192 | + } |
| 193 | + } |
| 194 | + } |
| 195 | + |
191 | 196 | function searchBox() { |
192 | 197 | global $wgUseTwoButtonsSearchForm; |
193 | 198 | ?> |
Index: trunk/phase3/skins/Modern.php |
— | — | @@ -100,25 +100,8 @@ |
101 | 101 | <div id="mw_portlets"<?php $this->html("userlangattributes") ?>> |
102 | 102 | |
103 | 103 | <!-- portlets --> |
104 | | - <?php |
105 | | - $sidebar = $this->data['sidebar']; |
106 | | - if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; |
107 | | - if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; |
108 | | - if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; |
| 104 | + <?php $this->renderPortals( $this->data['sidebar'] ); ?> |
109 | 105 | |
110 | | - foreach ($sidebar as $boxName => $cont) { |
111 | | - if ( $boxName == 'SEARCH' ) { |
112 | | - $this->searchBox(); |
113 | | - } elseif ( $boxName == 'TOOLBOX' ) { |
114 | | - $this->toolbox(); |
115 | | - } elseif ( $boxName == 'LANGUAGES' ) { |
116 | | - $this->languageBox(); |
117 | | - } else { |
118 | | - $this->customBox( $boxName, $cont ); |
119 | | - } |
120 | | - } |
121 | | - ?> |
122 | | - |
123 | 106 | </div><!-- mw_portlets --> |
124 | 107 | |
125 | 108 | |