r59215 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59214‎ | r59215 | r59216 >
Date:21:06, 18 November 2009
Author:churchofemacs
Status:ok
Tags:
Comment:
Make adding sidebar elements easier for extensions (e.g. Extension:GroupsSidebar)
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -2044,7 +2044,22 @@
20452045 }
20462046
20472047 $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 ) );
20492064 $heading = '';
20502065 foreach( $lines as $line ) {
20512066 if( strpos( $line, '*' ) !== 0 )
@@ -2086,10 +2101,6 @@
20872102 } else { continue; }
20882103 }
20892104 }
2090 - wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) );
2091 - if ( $wgEnableSidebarCache ) $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry );
2092 - wfProfileOut( __METHOD__ );
2093 - return $bar;
20942105 }
20952106
20962107 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r59216New Extension:GroupsSidebar. More information about this extension in mediawi...churchofemacs21:07, 18 November 2009
r66835Follow up r62958. addToSidebar() was added in r59215, we still can redesign i...platonides16:38, 24 May 2010

Status & tagging log