r62958 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62957‎ | r62958 | r62959 >
Date:15:58, 25 February 2010
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Rename Skin::addToSidebar() to Skin::addToSidebarPlain() and have it take plain text instead of a message key so it's actually useful to extensions that want to modify the sidebar in a non-message-based way (like DynamicSidebar). Kept addToSidebar() as a wrapper for backwards compatibility
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -2095,11 +2095,22 @@
20962096 * Add content from a sidebar system message
20972097 * Currently only used for MediaWiki:Sidebar (but may be used by Extensions)
20982098 *
 2099+ * This is just a wrapper around addToSidebarPlain() for backwards compatibility
 2100+ *
20992101 * @param &$bar array
21002102 * @param $message String
21012103 */
21022104 function addToSidebar( &$bar, $message ) {
2103 - $lines = explode( "\n", wfMsgForContent( $message ) );
 2105+ $this->addToSidebarPlain( $bar, wfMsgForContent( $message ) );
 2106+ }
 2107+
 2108+ /**
 2109+ * Add content from plain text
 2110+ * @param &$bar array
 2111+ * @param $text string
 2112+ */
 2113+ function addToSidebarPlain( &$bar, $text ) {
 2114+ $lines = explode( "\n", $text );
21042115 $heading = '';
21052116 foreach( $lines as $line ) {
21062117 if( strpos( $line, '*' ) !== 0 ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r62959DynamicSidebar: Convert to using the existing SkinBuildSidebar hook, so addin...catrope16:00, 25 February 2010
r66835Follow up r62958. addToSidebar() was added in r59215, we still can redesign i...platonides16:38, 24 May 2010

Comments

#Comment by Raymond (talk | contribs)   10:05, 26 February 2010

Is it a candidate for backporting to 1.16? In this case the new extension DynamicSidebar can be used in 1.16 production systems instead of waiting for release of 1.17...

#Comment by Catrope (talk | contribs)   10:49, 26 February 2010

I'll backport it in a few hours, it's a minor change anyway.

Status & tagging log