r85356 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85355‎ | r85356 | r85357 >
Date:18:41, 4 April 2011
Author:nikola
Status:deferred (Comments)
Tags:
Comment:
- rv r85232
- SkinTemplate::makeListItem() change to support additional HTML before
and after links.
Modified paths:
  • /branches/nikola/phase3/includes/SkinTemplate.php (modified) (history)
  • /branches/nikola/phase3/skins/MonoBook.php (modified) (history)
  • /branches/nikola/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: branches/nikola/phase3/skins/Vector.php
@@ -263,7 +263,7 @@
264264 break;
265265 case 'LANGUAGES':
266266 if ( $this->data['language_urls'] ) {
267 - $this->renderPortal("lang", $this->data['language_urls'], "otherlanguages", "SkinTemplateLanguageBoxEnd");
 267+ $this->renderPortal("lang", $this->data['language_urls'], "otherlanguages");
268268 }
269269 break;
270270 default:
Index: branches/nikola/phase3/skins/MonoBook.php
@@ -268,10 +268,7 @@
269269 <?php foreach($this->data['language_urls'] as $key => $langlink) { ?>
270270 <?php echo $this->makeListItem($key, $langlink); ?>
271271
272 -<?php
273 - }
274 - wfRunHooks( 'SkinTemplateLanguageBoxEnd', array( &$this ) );
275 -?>
 272+<?php } ?>
276273 </ul>
277274 </div>
278275 </div>
Index: branches/nikola/phase3/includes/SkinTemplate.php
@@ -1577,6 +1577,8 @@
15781578 * (however the link will still support a tooltip and accesskey from it)
15791579 * If you need an id or class on a single link you should include a "links"
15801580 * array with just one link item inside of it.
 1581+ * You can also include "before" and/or "after" keys for HTML
 1582+ * that will come before or after the link.
15811583 */
15821584 function makeListItem( $key, $item, $options = array() ) {
15831585 if ( isset( $item['links'] ) ) {
@@ -1600,6 +1602,9 @@
16011603 $html = $this->makeLink( $key, $link );
16021604 }
16031605
 1606+ if( isset( $item['before'] ) ) $html = $item['before'] . $html;
 1607+ if( isset( $item['after'] ) ) $html .= $item['after'];
 1608+
16041609 $attrs = array();
16051610 foreach ( array( 'id', 'class' ) as $attr ) {
16061611 if ( isset( $item[$attr] ) ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85232New hook SkinTemplateLanguageBoxEndnikola07:48, 3 April 2011

Comments

#Comment by Hashar (talk | contribs)   14:52, 16 November 2011

I did not merge this revision to trunk.

#Comment by Nikola Smolenski (talk | contribs)   15:00, 16 November 2011

It's OK, this has been given up on.

Status & tagging log