r91079 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91078‎ | r91079 | r91080 >
Date:17:11, 29 June 2011
Author:platonides
Status:ok
Tags:
Comment:
Create renderPortals() function for MonoBook (same interface as Vector one).
Changed Modern to call that function instead of duplicating the code with Modern.
Modified paths:
  • /trunk/phase3/skins/Modern.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/MonoBook.php
@@ -126,21 +126,7 @@
127127 </div>
128128 <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
129129 <?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'] );
145131 ?>
146132 </div><!-- end of the left (by default at least) column -->
147133 <div class="visualClear"></div>
@@ -187,6 +173,25 @@
188174 } // end of execute() method
189175
190176 /*************************************************************************************************/
 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+
191196 function searchBox() {
192197 global $wgUseTwoButtonsSearchForm;
193198 ?>
Index: trunk/phase3/skins/Modern.php
@@ -100,25 +100,8 @@
101101 <div id="mw_portlets"<?php $this->html("userlangattributes") ?>>
102102
103103 <!-- 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'] ); ?>
109105
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 -
123106 </div><!-- mw_portlets -->
124107
125108

Status & tagging log