r77732 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77731‎ | r77732 | r77733 >
Date:18:37, 4 December 2010
Author:dantman
Status:ok (Comments)
Tags:
Comment:
Take the footerlinks from vector and monobook and make them skin generic.
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -412,25 +412,10 @@
413413 }
414414
415415 // Generate additional footer links
416 - $footerlinks = array(
417 - 'info' => array(
418 - 'lastmod',
419 - 'viewcount',
420 - 'numberofwatchingusers',
421 - 'credits',
422 - 'copyright',
423 - 'tagline',
424 - ),
425 - 'places' => array(
426 - 'privacy',
427 - 'about',
428 - 'disclaimer',
429 - ),
430 - 'icons' => array(
431 - 'poweredbyico',
432 - 'copyrightico',
433 - ),
434 - );
 416+ $footerlinks = $this->data["footerlinks"];
 417+ // footerlinks doesn't include icons for now, so we'll just append the default
 418+ $footerlinks["icons"] = array( 'poweredbyico', 'copyrightico', );
 419+
435420 $footerlinksClasses = array(
436421 'icons' => array( 'noprint' )
437422 );
Index: trunk/phase3/skins/MonoBook.php
@@ -70,6 +70,11 @@
7171 // Suppress warnings to prevent notices about missing indexes in $this->data
7272 wfSuppressWarnings();
7373
 74+ // Generate additional footer links
 75+ $footerlinks = $this->data["footerlinks"];
 76+ // fold footerlinks into a single array using a bit of trickery
 77+ $footerlinks = call_user_func_array('array_merge', array_values($footerlinks));
 78+
7479 $this->html( 'headelement' );
7580 ?><div id="globalWrapper">
7681 <div id="column-content"><div id="content"<?php $this->html("specialpageattributes") ?>>
@@ -175,10 +180,6 @@
176181 <?php }
177182
178183 // Generate additional footer links
179 - $footerlinks = array(
180 - 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
181 - 'privacy', 'about', 'disclaimer', 'tagline',
182 - );
183184 $validFooterLinks = array();
184185 foreach( $footerlinks as $aLink ) {
185186 if( isset( $this->data[$aLink] ) && $this->data[$aLink] ) {
Index: trunk/phase3/includes/SkinTemplate.php
@@ -411,6 +411,21 @@
412412 $tpl->set( 'privacy', $this->privacyLink() );
413413 $tpl->set( 'about', $this->aboutLink() );
414414
 415+ $tpl->set( 'footerlinks', array(
 416+ 'info' => array(
 417+ 'lastmod',
 418+ 'viewcount',
 419+ 'numberofwatchingusers',
 420+ 'credits',
 421+ 'copyright',
 422+ ),
 423+ 'places' => array(
 424+ 'privacy',
 425+ 'about',
 426+ 'disclaimer',
 427+ ),
 428+ ) );
 429+
415430 if ( $wgDebugComments ) {
416431 $tpl->setRef( 'debug', $out->mDebugtext );
417432 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r77781Follow up for r77732 and r77741, add the missing RELEASE-NOTES which I forgot.dantman06:59, 5 December 2010
r77794Make footerLink a public method, this method is useful for hooks now that r77...dantman11:01, 5 December 2010

Comments

#Comment by Dantman (talk | contribs)   18:39, 4 December 2010

Side note, tagline in footerlinks was never used in any skin because SkinTemplate never added it, so I dropped it from the list.

Status & tagging log