From bd53f5998470582495b938dff2a1e4e9ace8f0fe Mon Sep 17 00:00:00 2001 From: Platonides Date: Wed, 29 Jun 2011 17:11:38 +0000 Subject: [PATCH] Create renderPortals() function for MonoBook (same interface as Vector one). Changed Modern to call that function instead of duplicating the code with Modern. --- skins/Modern.php | 19 +------------------ skins/MonoBook.php | 35 ++++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/skins/Modern.php b/skins/Modern.php index da902d1147..9b85064f3b 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -100,24 +100,7 @@ class ModernTemplate extends MonoBookTemplate {
html("userlangattributes") ?>> - data['sidebar']; - if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; - if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; - if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; - - foreach ($sidebar as $boxName => $cont) { - if ( $boxName == 'SEARCH' ) { - $this->searchBox(); - } elseif ( $boxName == 'TOOLBOX' ) { - $this->toolbox(); - } elseif ( $boxName == 'LANGUAGES' ) { - $this->languageBox(); - } else { - $this->customBox( $boxName, $cont ); - } - } - ?> + renderPortals( $this->data['sidebar'] ); ?>
diff --git a/skins/MonoBook.php b/skins/MonoBook.php index a766e949c6..61e086d344 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -126,21 +126,7 @@ class MonoBookTemplate extends BaseTemplate { data['sidebar']; - if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; - if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; - if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; - foreach ($sidebar as $boxName => $cont) { - if ( $boxName == 'SEARCH' ) { - $this->searchBox(); - } elseif ( $boxName == 'TOOLBOX' ) { - $this->toolbox(); - } elseif ( $boxName == 'LANGUAGES' ) { - $this->languageBox(); - } else { - $this->customBox( $boxName, $cont ); - } - } + $this->renderPortals( $this->data['sidebar'] ); ?>
@@ -187,6 +173,25 @@ echo $footerEnd; } // end of execute() method /*************************************************************************************************/ + + protected function renderPortals( $sidebar ) { + if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true; + if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true; + if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = true; + + foreach ($sidebar as $boxName => $cont) { + if ( $boxName == 'SEARCH' ) { + $this->searchBox(); + } elseif ( $boxName == 'TOOLBOX' ) { + $this->toolbox(); + } elseif ( $boxName == 'LANGUAGES' ) { + $this->languageBox(); + } else { + $this->customBox( $boxName, $cont ); + } + } + } + function searchBox() { global $wgUseTwoButtonsSearchForm; ?> -- 2.20.1