r68707 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68706‎ | r68707 | r68708 >
Date:06:39, 29 June 2010
Author:tstarling
Status:ok
Tags:
Comment:
Revert r66835, r66846: it's too late to break interfaces in 1.16.
Modified paths:
  • /trunk/extensions/DynamicSidebar/DynamicSidebar.body.php (modified) (history)
  • /trunk/extensions/GroupsSidebar/GroupsSidebar.body.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -2107,7 +2107,7 @@
21082108 }
21092109
21102110 $bar = array();
2111 - $this->addToSidebar( $bar, wfMsgForContentNoTrans( 'sidebar' ) );
 2111+ $this->addToSidebar( $bar, 'sidebar' );
21122112
21132113 wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) );
21142114 if ( $wgEnableSidebarCache ) {
@@ -2116,16 +2116,26 @@
21172117 wfProfileOut( __METHOD__ );
21182118 return $bar;
21192119 }
 2120+ /**
 2121+ * Add content from a sidebar system message
 2122+ * Currently only used for MediaWiki:Sidebar (but may be used by Extensions)
 2123+ *
 2124+ * This is just a wrapper around addToSidebarPlain() for backwards compatibility
 2125+ *
 2126+ * @param &$bar array
 2127+ * @param $message String
 2128+ */
 2129+ function addToSidebar( &$bar, $message ) {
 2130+ $this->addToSidebarPlain( $bar, wfMsgForContent( $message ) );
 2131+ }
21202132
21212133 /**
2122 - * Add content to the sidebar from text
2123 - * @since 1.16
 2134+ * Add content from plain text
 2135+ * @since 1.17
21242136 * @param &$bar array
21252137 * @param $text string
2126 - *
2127 - * @return array
21282138 */
2129 - function addToSidebar( &$bar, $text ) {
 2139+ function addToSidebarPlain( &$bar, $text ) {
21302140 $lines = explode( "\n", $text );
21312141 $wikiBar = array(); # We need to handle the wikitext on a different variable, to avoid trying to do an array operation on text, which would be a fatal error.
21322142
@@ -2142,9 +2152,6 @@
21432153 } else {
21442154 $line = trim( $line, '* ' );
21452155 if( strpos( $line, '|' ) !== false ) { // sanity check
2146 - global $wgMessageCache;
2147 - $line = $wgMessageCache->transform( $line );
2148 -
21492156 $line = array_map( 'trim', explode( '|', $line, 2 ) );
21502157 $link = wfMsgForContent( $line[0] );
21512158 if( $link == '-' ) {
Index: trunk/extensions/DynamicSidebar/DynamicSidebar.body.php
@@ -32,15 +32,15 @@
3333 $catSB = array();
3434 if ( $wgDynamicSidebarUseGroups && isset( $sidebar['GROUP-SIDEBAR'] ) ) {
3535 self::printDebug( "Using group sidebar" );
36 - $skin->addToSidebar( $groupSB, self::doGroupSidebar() );
 36+ $skin->addToSidebarPlain( $groupSB, self::doGroupSidebar() );
3737 }
3838 if ( $wgDynamicSidebarUseUserpages && isset( $sidebar['USER-SIDEBAR'] ) ) {
3939 self::printDebug( "Using user sidebar" );
40 - $skin->addToSidebar( $userSB, self::doUserSidebar() );
 40+ $skin->addToSidebarPlain( $userSB, self::doUserSidebar() );
4141 }
4242 if ( $wgDynamicSidebarUseCategories && isset( $sidebar['CATEGORY-SIDEBAR'] ) ) {
4343 self::printDebug( "Using category sidebar" );
44 - $skin->addToSidebar( $catSB, self::doCategorySidebar() );
 44+ $skin->addToSidebarPlain( $catSB, self::doCategorySidebar() );
4545 }
4646
4747 $sidebar_copy = array();
Index: trunk/extensions/GroupsSidebar/GroupsSidebar.body.php
@@ -11,7 +11,7 @@
1212 foreach ( $wgGroupsSidebar as $group => $sectiontitle ) {
1313 if (in_array($group, $wgUser->getEffectiveGroups())) {
1414 $message = 'sidebar-'.$sectiontitle;
15 - $skin->addToSidebar( $bar, wfMsgForContentNoTrans( $message ) );
 15+ $skin->addToSidebar( &$bar, $message );
1616 }
1717 }
1818 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r68708Revert r66836, r66846 (equivalent to MFT r68707): it's too late to break inte...tstarling06:43, 29 June 2010
r82452* Use $this->mTitle instead of $wgTitle...ialex13:39, 19 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66835Follow up r62958. addToSidebar() was added in r59215, we still can redesign i...platonides16:38, 24 May 2010
r66846Follow up r66835. Some people use direct urls in MediaWiki:Sidebar instead of...platonides20:01, 24 May 2010

Status & tagging log