/**
* 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 );
<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
} ?>