Index: trunk/phase3/includes/Skin.php |
— | — | @@ -2044,7 +2044,22 @@ |
2045 | 2045 | } |
2046 | 2046 | |
2047 | 2047 | $bar = array(); |
2048 | | - $lines = explode( "\n", wfMsgForContent( 'sidebar' ) ); |
| 2048 | + $this->addToSidebar( &$bar, 'sidebar' ); |
| 2049 | + |
| 2050 | + wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) ); |
| 2051 | + if ( $wgEnableSidebarCache ) $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry ); |
| 2052 | + wfProfileOut( __METHOD__ ); |
| 2053 | + return $bar; |
| 2054 | + } |
| 2055 | + /** |
| 2056 | + * Add content from a sidebar system message |
| 2057 | + * Currently only used for MediaWiki:Sidebar (but may be used by Extensions) |
| 2058 | + * |
| 2059 | + * @param &$bar array |
| 2060 | + * @param $message String |
| 2061 | + */ |
| 2062 | + function addToSidebar( &$bar, $message ) { |
| 2063 | + $lines = explode( "\n", wfMsgForContent( $message ) ); |
2049 | 2064 | $heading = ''; |
2050 | 2065 | foreach( $lines as $line ) { |
2051 | 2066 | if( strpos( $line, '*' ) !== 0 ) |
— | — | @@ -2086,10 +2101,6 @@ |
2087 | 2102 | } else { continue; } |
2088 | 2103 | } |
2089 | 2104 | } |
2090 | | - wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) ); |
2091 | | - if ( $wgEnableSidebarCache ) $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry ); |
2092 | | - wfProfileOut( __METHOD__ ); |
2093 | | - return $bar; |
2094 | 2105 | } |
2095 | 2106 | |
2096 | 2107 | /** |