Also fix the location of the noprint class meant to be on footer-icons in vector.
return $s;
}
+ /**
+ * 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
+ */
+ function makeFooterIcon( $icon, $useImg = true ) {
+ if ( is_string($icon) ) {
+ $html = $icon;
+ } else {
+ $url = $icon["url"];
+ unset($icon["url"]);
+ if ( isset($icon["src"]) && $useImg ) {
+ $html = Html::element( 'img', $icon ); // do this the lazy way, just pass icon data as an attribute array
+ } else {
+ $html = htmlspecialchars($icon["alt"]);
+ }
+ if ( $url ) {
+ $html = Html::rawElement( 'a', array( "href" => $url ), $html );
+ }
+ }
+ return $html;
+ }
+
/**
* Gets the link to the wiki's main page.
* @return string
foreach ( $footericons as $blockName => $footerIcons ) { ?>
<div id="mw_<?php echo htmlspecialchars($blockName); ?>">
<?php
- foreach ( $footerIcons as $icon ) {
- if ( is_string($icon) ) {
- $html = $icon;
- } else {
- $html = htmlspecialchars($icon["alt"]);
- if ( $icon["url"] ) {
- $html = Html::element( 'a', array( "href" => $icon["url"] ), $html );
- }
- }
- echo " $html\n";
+ foreach ( $footerIcons as $icon ) { ?>
+ <?php echo $this->skin->makeFooterIcon( $icon, false ); ?>
+
+<?php
} ?>
</div>
<?php
<div id="footer"<?php $this->html('userlangattributes') ?>>
<?php foreach ( $footericons as $blockName => $footerIcons ) { ?>
<div id="f-<?php echo htmlspecialchars($blockName); ?>ico">
-<?php foreach ( $footerIcons as $icon ) {
- if ( is_string($icon) ) {
- $html = $icon;
- } else {
- $url = $icon["url"];
- unset($icon["url"]);
- if ( isset($icon["src"]) ) {
- $html = Html::element( 'img', $icon ); // do this the lazy way, just pass icon data as an attribute array
- } else {
- $html = htmlspecialchars($icon["alt"]);
- }
- if ( $url ) {
- $html = Html::rawElement( 'a', array( "href" => $url ), $html );
- }
- }
- echo " $html\n";
- } ?>
+<?php foreach ( $footerIcons as $icon ) { ?>
+ <?php echo $this->skin->makeFooterIcon( $icon ); ?>
+
+<?php }
+?>
</div>
<?php }
<?php endif; ?>
<?php endforeach; ?>
<?php if ( count( $footericons ) > 0 ): ?>
- <ul id="footer-icons">
+ <ul id="footer-icons" class="noprint">
<?php foreach ( $footericons as $blockName => $footerIcons ): ?>
- <li id="footer-<?php echo htmlspecialchars($blockName); ?>ico" class="noprint">
-<?php foreach ( $footerIcons as $icon ):
- if ( is_string($icon) ) {
- $html = $icon;
- } else {
- $url = $icon["url"];
- unset($icon["url"]);
- if ( isset($icon["src"]) ) {
- $html = Html::element( 'img', $icon ); // do this the lazy way, just pass icon data as an attribute array
- } else {
- $html = htmlspecialchars($icon["alt"]);
- }
- if ( $url ) {
- $html = Html::rawElement( 'a', array( "href" => $url ), $html );
- }
- }
- echo " $html\n";
- endforeach; ?>
+ <li id="footer-<?php echo htmlspecialchars($blockName); ?>ico">
+<?php foreach ( $footerIcons as $icon ): ?>
+ <?php echo $this->skin->makeFooterIcon( $icon ); ?>
+
+<?php endforeach; ?>
</li>
<?php endforeach; ?>
</ul>