Index: trunk/phase3/includes/Skin.php |
— | — | @@ -2107,7 +2107,7 @@ |
2108 | 2108 | } |
2109 | 2109 | |
2110 | 2110 | $bar = array(); |
2111 | | - $this->addToSidebar( $bar, wfMsgForContentNoTrans( 'sidebar' ) ); |
| 2111 | + $this->addToSidebar( $bar, 'sidebar' ); |
2112 | 2112 | |
2113 | 2113 | wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) ); |
2114 | 2114 | if ( $wgEnableSidebarCache ) { |
— | — | @@ -2116,16 +2116,26 @@ |
2117 | 2117 | wfProfileOut( __METHOD__ ); |
2118 | 2118 | return $bar; |
2119 | 2119 | } |
| 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 | + } |
2120 | 2132 | |
2121 | 2133 | /** |
2122 | | - * Add content to the sidebar from text |
2123 | | - * @since 1.16 |
| 2134 | + * Add content from plain text |
| 2135 | + * @since 1.17 |
2124 | 2136 | * @param &$bar array |
2125 | 2137 | * @param $text string |
2126 | | - * |
2127 | | - * @return array |
2128 | 2138 | */ |
2129 | | - function addToSidebar( &$bar, $text ) { |
| 2139 | + function addToSidebarPlain( &$bar, $text ) { |
2130 | 2140 | $lines = explode( "\n", $text ); |
2131 | 2141 | $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. |
2132 | 2142 | |
— | — | @@ -2142,9 +2152,6 @@ |
2143 | 2153 | } else { |
2144 | 2154 | $line = trim( $line, '* ' ); |
2145 | 2155 | if( strpos( $line, '|' ) !== false ) { // sanity check |
2146 | | - global $wgMessageCache; |
2147 | | - $line = $wgMessageCache->transform( $line ); |
2148 | | - |
2149 | 2156 | $line = array_map( 'trim', explode( '|', $line, 2 ) ); |
2150 | 2157 | $link = wfMsgForContent( $line[0] ); |
2151 | 2158 | if( $link == '-' ) { |
Index: trunk/extensions/DynamicSidebar/DynamicSidebar.body.php |
— | — | @@ -32,15 +32,15 @@ |
33 | 33 | $catSB = array(); |
34 | 34 | if ( $wgDynamicSidebarUseGroups && isset( $sidebar['GROUP-SIDEBAR'] ) ) { |
35 | 35 | self::printDebug( "Using group sidebar" ); |
36 | | - $skin->addToSidebar( $groupSB, self::doGroupSidebar() ); |
| 36 | + $skin->addToSidebarPlain( $groupSB, self::doGroupSidebar() ); |
37 | 37 | } |
38 | 38 | if ( $wgDynamicSidebarUseUserpages && isset( $sidebar['USER-SIDEBAR'] ) ) { |
39 | 39 | self::printDebug( "Using user sidebar" ); |
40 | | - $skin->addToSidebar( $userSB, self::doUserSidebar() ); |
| 40 | + $skin->addToSidebarPlain( $userSB, self::doUserSidebar() ); |
41 | 41 | } |
42 | 42 | if ( $wgDynamicSidebarUseCategories && isset( $sidebar['CATEGORY-SIDEBAR'] ) ) { |
43 | 43 | self::printDebug( "Using category sidebar" ); |
44 | | - $skin->addToSidebar( $catSB, self::doCategorySidebar() ); |
| 44 | + $skin->addToSidebarPlain( $catSB, self::doCategorySidebar() ); |
45 | 45 | } |
46 | 46 | |
47 | 47 | $sidebar_copy = array(); |
Index: trunk/extensions/GroupsSidebar/GroupsSidebar.body.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | foreach ( $wgGroupsSidebar as $group => $sectiontitle ) { |
13 | 13 | if (in_array($group, $wgUser->getEffectiveGroups())) { |
14 | 14 | $message = 'sidebar-'.$sectiontitle; |
15 | | - $skin->addToSidebar( $bar, wfMsgForContentNoTrans( $message ) ); |
| 15 | + $skin->addToSidebar( &$bar, $message ); |
16 | 16 | } |
17 | 17 | } |
18 | 18 | return true; |