http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66835
Revision: 66835 Author: platonides Date: 2010-05-24 16:38:08 +0000 (Mon, 24 May 2010) Log Message: ----------- Follow up r62958. addToSidebar() was added in r59215, we still can redesign it and avoid legacy functions. Modified Paths: -------------- trunk/extensions/DynamicSidebar/DynamicSidebar.body.php trunk/extensions/GroupsSidebar/GroupsSidebar.body.php trunk/phase3/includes/Skin.php Modified: trunk/extensions/DynamicSidebar/DynamicSidebar.body.php =================================================================== --- trunk/extensions/DynamicSidebar/DynamicSidebar.body.php 2010-05-24 16:35:23 UTC (rev 66834) +++ trunk/extensions/DynamicSidebar/DynamicSidebar.body.php 2010-05-24 16:38:08 UTC (rev 66835) @@ -32,15 +32,15 @@ $catSB = array(); if ( $wgDynamicSidebarUseGroups && isset( $sidebar['GROUP-SIDEBAR'] ) ) { self::printDebug( "Using group sidebar" ); - $skin->addToSidebarPlain( $groupSB, self::doGroupSidebar() ); + $skin->addToSidebar( $groupSB, self::doGroupSidebar() ); } if ( $wgDynamicSidebarUseUserpages && isset( $sidebar['USER-SIDEBAR'] ) ) { self::printDebug( "Using user sidebar" ); - $skin->addToSidebarPlain( $userSB, self::doUserSidebar() ); + $skin->addToSidebar( $userSB, self::doUserSidebar() ); } if ( $wgDynamicSidebarUseCategories && isset( $sidebar['CATEGORY-SIDEBAR'] ) ) { self::printDebug( "Using category sidebar" ); - $skin->addToSidebarPlain( $catSB, self::doCategorySidebar() ); + $skin->addToSidebar( $catSB, self::doCategorySidebar() ); } $sidebar_copy = array(); Modified: trunk/extensions/GroupsSidebar/GroupsSidebar.body.php =================================================================== --- trunk/extensions/GroupsSidebar/GroupsSidebar.body.php 2010-05-24 16:35:23 UTC (rev 66834) +++ trunk/extensions/GroupsSidebar/GroupsSidebar.body.php 2010-05-24 16:38:08 UTC (rev 66835) @@ -11,7 +11,7 @@ foreach ( $wgGroupsSidebar as $group => $sectiontitle ) { if (in_array($group, $wgUser->getEffectiveGroups())) { $message = 'sidebar-'.$sectiontitle; - $skin->addToSidebar( &$bar, $message ); + $skin->addToSidebar( $bar, wfMsgForContentNoTrans( $message ) ); } } return true; Modified: trunk/phase3/includes/Skin.php =================================================================== --- trunk/phase3/includes/Skin.php 2010-05-24 16:35:23 UTC (rev 66834) +++ trunk/phase3/includes/Skin.php 2010-05-24 16:38:08 UTC (rev 66835) @@ -2104,7 +2104,7 @@ } $bar = array(); - $this->addToSidebar( $bar, 'sidebar' ); + $this->addToSidebar( $bar, wfMsgForContentNoTrans( 'sidebar' ) ); wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) ); if ( $wgEnableSidebarCache ) { @@ -2113,26 +2113,16 @@ wfProfileOut( __METHOD__ ); return $bar; } - /** - * Add content from a sidebar system message - * Currently only used for MediaWiki:Sidebar (but may be used by Extensions) - * - * This is just a wrapper around addToSidebarPlain() for backwards compatibility - * - * @param &$bar array - * @param $message String - */ - function addToSidebar( &$bar, $message ) { - $this->addToSidebarPlain( $bar, wfMsgForContent( $message ) ); - } /** - * Add content from plain text - * @since 1.17 + * Add content to the sidebar from text + * @since 1.16 * @param &$bar array * @param $text string + * + * @return array */ - function addToSidebarPlain( &$bar, $text ) { + function addToSidebar( &$bar, $text ) { $lines = explode( "\n", $text ); $heading = ''; foreach( $lines as $line ) { _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs