From: Tim Starling Date: Mon, 7 Jul 2008 06:58:44 +0000 (+0000) Subject: Allow the search box, toolbox and languages box in the Monobook sidebar to be moved... X-Git-Tag: 1.31.0-rc.0~46671 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=6ec0c4fbdaad4ca545440581ecec77fe5ba24b49;p=lhc%2Fweb%2Fwiklou.git Allow the search box, toolbox and languages box in the Monobook sidebar to be moved around arbitrarily using special sections in [[MediaWiki:Sidebar]]: SEARCH, TOOLBOX and LANGUAGES --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6236654fe2..822a81aed5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -179,7 +179,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Added blank special page Special:BlankPage for benchmarking, etc. * Foreign repo file descriptions and thumbnails are now cached. * (bug 11732) Allow localisation of edit button images - +* Allow the search box, toolbox and languages box in the Monobook sidebar to be + moved around arbitrarily using special sections in [[MediaWiki:Sidebar]]: + SEARCH, TOOLBOX and LANGUAGES + + === Bug fixes in 1.13 === * (bug 10677) Add link to the file description page on the shared repository diff --git a/includes/Skin.php b/includes/Skin.php index 176f4490b0..a9e44ab4d9 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1677,7 +1677,12 @@ END; continue; if (strpos($line, '**') !== 0) { $line = trim($line, '* '); - $heading = $line; + if ( $line == 'SEARCH' || $line == 'TOOLBOX' || $line == 'LANGUAGES' ) { + # Special box type + $bar[$line] = array(); + } else { + $heading = $line; + } } else { if (strpos($line, '|') !== false) { // sanity check $line = array_map('trim', explode( '|' , trim($line, '* '), 2 ) ); diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index b57c13d74b..29addfc935 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -178,6 +178,9 @@ class SkinCologneBlue extends Skin { # Use the first heading from the Monobook sidebar as the "browse" section $bar = $this->buildSidebar(); + unset( $bar['SEARCH'] ); + unset( $bar['LANGUAGES'] ); + unset( $bar['TOOLBOX'] ); $browseLinks = reset( $bar ); foreach ( $browseLinks as $link ) { diff --git a/skins/Modern.php b/skins/Modern.php index 0d96f64085..e75e4ae829 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -38,6 +38,7 @@ class SkinModern extends SkinTemplate { * @ingroup Skins */ class ModernTemplate extends QuickTemplate { + var $skin; /** * Template filter callback for Modern skin. * Takes an associative array of data set from a SkinTemplate-based @@ -48,7 +49,7 @@ class ModernTemplate extends QuickTemplate { */ function execute() { global $wgUser; - $skin = $wgUser->getSkin(); + $this->skin = $skin = $wgUser->getSkin(); // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); @@ -149,42 +150,103 @@ class ModernTemplate extends QuickTemplate {
- - data['sidebar'] as $bar => $cont) { ?> -
tooltip('p-'.$bar) ?>> -
-
- + + 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 ); + } + } + ?> + +
+ + +
+ +
+ + +
+
msg('personaltools') ?>
+
- +
+ + + + -
- + + html("poweredbyico"); ?> +
+ html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> +html('reporttime') ?> +data['debug'] ): ?> + + + + +
msg('toolbox') ?>
@@ -194,23 +256,23 @@ class ModernTemplate extends QuickTemplate { if($this->data['notspecialpage']) { ?>
  • tooltipAndAccesskey('t-whatlinkshere') ?>>msg('whatlinkshere') ?>
  • + ?>"skin->tooltipAndAccesskey('t-whatlinkshere') ?>>msg('whatlinkshere') ?> data['nav_urls']['recentchangeslinked'] ) { ?>
  • tooltipAndAccesskey('t-recentchangeslinked') ?>>msg('recentchangeslinked') ?>
  • + ?>"skin->tooltipAndAccesskey('t-recentchangeslinked') ?>>msg('recentchangeslinked') ?> data['nav_urls']['trackbacklink'])) { ?> + ?>"skin->tooltipAndAccesskey('t-trackbacklink') ?>>msg('trackbacklink') ?> data['feeds']) { ?> data['nav_urls'][$special]) { ?>
  • tooltipAndAccesskey('t-'.$special) ?>>msg($special) ?>
  • + ?>"skin->tooltipAndAccesskey('t-'.$special) ?>>msg($special) ?> data['nav_urls']['print']['href'])) { ?>
  • tooltipAndAccesskey('t-print') ?>>msg('printableversion') ?>
  • "skin->tooltipAndAccesskey('t-print') ?>>msg('printableversion') ?>data['nav_urls']['permalink']['href'])) { ?> "skin->tooltipAndAccesskey('t-permalink') ?>>msg('permalink') ?>data['nav_urls']['permalink']['href'] === '') { ?> - skin->tooltip('t-ispermalink') ?>>msg('permalink') ?>
    + data['language_urls'] ) { ?> @@ -253,61 +320,33 @@ class ModernTemplate extends QuickTemplate { - - - - - - - -
    + -
    -
    msg('personaltools') ?>
    -
    + /*************************************************************************************************/ + function customBox( $bar, $cont ) { +?> +
    skin->tooltip('p-'.$bar) ?>> +
    +
    + -
    -
    - - - - - - html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> -html('reporttime') ?> -data['debug'] ): ?> - - - +
    +
    diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 5d7012435d..bfd94d5cc0 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -36,6 +36,7 @@ class SkinMonoBook extends SkinTemplate { * @ingroup Skins */ class MonoBookTemplate extends QuickTemplate { + var $skin; /** * Template filter callback for MonoBook skin. * Takes an associative array of data set from a SkinTemplate-based @@ -46,7 +47,7 @@ class MonoBookTemplate extends QuickTemplate { */ function execute() { global $wgUser; - $skin = $wgUser->getSkin(); + $this->skin = $skin = $wgUser->getSkin(); // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); @@ -152,38 +153,85 @@ class MonoBookTemplate extends QuickTemplate { echo $skin->tooltipAndAccesskey('n-mainpage') ?>> - data['sidebar'] as $bar => $cont) { ?> -
    tooltip('p-'.$bar) ?>> -
    -
    - - -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 ); + } + } +?> +
    +
    + -
    - + +html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> +html('reporttime') ?> +data['debug'] ): ?> + + + + +
    msg('toolbox') ?>
    @@ -192,23 +240,23 @@ class MonoBookTemplate extends QuickTemplate { if($this->data['notspecialpage']) { ?>
  • tooltipAndAccesskey('t-whatlinkshere') ?>>msg('whatlinkshere') ?>
  • + ?>"skin->tooltipAndAccesskey('t-whatlinkshere') ?>>msg('whatlinkshere') ?> data['nav_urls']['recentchangeslinked'] ) { ?>
  • tooltipAndAccesskey('t-recentchangeslinked') ?>>msg('recentchangeslinked') ?>
  • + ?>"skin->tooltipAndAccesskey('t-recentchangeslinked') ?>>msg('recentchangeslinked') ?> data['nav_urls']['trackbacklink'])) { ?> + ?>"skin->tooltipAndAccesskey('t-trackbacklink') ?>>msg('trackbacklink') ?> data['feeds']) { ?> data['nav_urls'][$special]) { ?>
  • tooltipAndAccesskey('t-'.$special) ?>>msg($special) ?>
  • + ?>"skin->tooltipAndAccesskey('t-'.$special) ?>>msg($special) ?> data['nav_urls']['print']['href'])) { ?>
  • tooltipAndAccesskey('t-print') ?>>msg('printableversion') ?>
  • "skin->tooltipAndAccesskey('t-print') ?>>msg('printableversion') ?>data['nav_urls']['permalink']['href'])) { ?> "skin->tooltipAndAccesskey('t-permalink') ?>>msg('permalink') ?>data['nav_urls']['permalink']['href'] === '') { ?> - skin->tooltip('t-ispermalink') ?>>msg('permalink') ?>
    data['language_urls'] ) { ?> + } + + /*************************************************************************************************/ + function languageBox() { + if( $this->data['language_urls'] ) { +?>
    msg('otherlanguages') ?>
    @@ -251,45 +304,34 @@ class MonoBookTemplate extends QuickTemplate {
    - -
    -
    - - -html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> -html('reporttime') ?> -data['debug'] ): ?> - - - + buildSidebar(); + unset( $bar['SEARCH'] ); + unset( $bar['LANGUAGES'] ); + unset( $bar['TOOLBOX'] ); $browseLinks = reset( $bar ); foreach ( $browseLinks as $link ) {