Follow-up r77763, get rid of boolean param and whitespace fixes
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sun, 5 Dec 2010 10:41:58 +0000 (10:41 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sun, 5 Dec 2010 10:41:58 +0000 (10:41 +0000)
includes/Skin.php
skins/Modern.php

index 11a4651..1aefb1b 100644 (file)
@@ -1633,18 +1633,18 @@ class Skin extends Linker {
        /**
         * Renders a $wgFooterIcons icon acording to the method's arguments
         * @param $icon Array: The icon to build the html for
-        * @param $useImg Boolean: Whether to use the icon's image or output a text-only footericon
+        * @param $withImage Boolean: Whether to use the icon's image or output a text-only footericon
         */
-       function makeFooterIcon( $icon, $useImg = true ) {
-               if ( is_string($icon) ) {
+       function makeFooterIcon( $icon, $withImage = 'withImage' ) {
+               if ( is_string( $icon ) ) {
                        $html = $icon;
-               } else {
+               } else { // Assuming array
                        $url = $icon["url"];
-                       unset($icon["url"]);
-                       if ( isset($icon["src"]) && $useImg ) {
+                       unset( $icon["url"] );
+                       if ( isset( $icon["src"] ) && $withImage === 'withImage' ) {
                                $html = Html::element( 'img', $icon ); // do this the lazy way, just pass icon data as an attribute array
                        } else {
-                               $html = htmlspecialchars($icon["alt"]);
+                               $html = htmlspecialchars( $icon["alt"] );
                        }
                        if ( $url ) {
                                $html = Html::rawElement( 'a', array( "href" => $url ), $html );
index 27f958e..752d0de 100644 (file)
@@ -195,7 +195,7 @@ class ModernTemplate extends MonoBookTemplate {
                        <div id="mw_<?php echo htmlspecialchars($blockName); ?>">
 <?php
                        foreach ( $footerIcons as $icon ) { ?>
-                               <?php echo $this->skin->makeFooterIcon( $icon, false ); ?>
+                               <?php echo $this->skin->makeFooterIcon( $icon, 'withoutImage' ); ?>
 
 <?php
                        } ?>