From 2287d50007af2fac8ec1057a383794034ad196d4 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Sat, 4 Dec 2010 18:37:05 +0000 Subject: [PATCH] Take the footerlinks from vector and monobook and make them skin generic. --- includes/SkinTemplate.php | 15 +++++++++++++++ skins/MonoBook.php | 9 +++++---- skins/Vector.php | 23 ++++------------------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 1a713fdc88..5a78f909f3 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -411,6 +411,21 @@ class SkinTemplate extends Skin { $tpl->set( 'privacy', $this->privacyLink() ); $tpl->set( 'about', $this->aboutLink() ); + $tpl->set( 'footerlinks', array( + 'info' => array( + 'lastmod', + 'viewcount', + 'numberofwatchingusers', + 'credits', + 'copyright', + ), + 'places' => array( + 'privacy', + 'about', + 'disclaimer', + ), + ) ); + if ( $wgDebugComments ) { $tpl->setRef( 'debug', $out->mDebugtext ); } else { diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 24ae2eafc8..663279aca8 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -70,6 +70,11 @@ class MonoBookTemplate extends QuickTemplate { // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); + // Generate additional footer links + $footerlinks = $this->data["footerlinks"]; + // fold footerlinks into a single array using a bit of trickery + $footerlinks = call_user_func_array('array_merge', array_values($footerlinks)); + $this->html( 'headelement' ); ?>
html("specialpageattributes") ?>> @@ -175,10 +180,6 @@ if($this->data['copyrightico']) { ?> data[$aLink] ) && $this->data[$aLink] ) { diff --git a/skins/Vector.php b/skins/Vector.php index edad705b79..b57432e0cd 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -412,25 +412,10 @@ class VectorTemplate extends QuickTemplate { } // Generate additional footer links - $footerlinks = array( - 'info' => array( - 'lastmod', - 'viewcount', - 'numberofwatchingusers', - 'credits', - 'copyright', - 'tagline', - ), - 'places' => array( - 'privacy', - 'about', - 'disclaimer', - ), - 'icons' => array( - 'poweredbyico', - 'copyrightico', - ), - ); + $footerlinks = $this->data["footerlinks"]; + // footerlinks doesn't include icons for now, so we'll just append the default + $footerlinks["icons"] = array( 'poweredbyico', 'copyrightico', ); + $footerlinksClasses = array( 'icons' => array( 'noprint' ) ); -- 2.20.1