Index: trunk/phase3/skins/Vector.php |
— | — | @@ -545,26 +545,13 @@ |
546 | 546 | <?php endif; ?> |
547 | 547 | <?php endforeach; ?> |
548 | 548 | <?php if ( count( $footericons ) > 0 ): ?> |
549 | | - <ul id="footer-icons"> |
| 549 | + <ul id="footer-icons" class="noprint"> |
550 | 550 | <?php foreach ( $footericons as $blockName => $footerIcons ): ?> |
551 | | - <li id="footer-<?php echo htmlspecialchars($blockName); ?>ico" class="noprint"> |
552 | | -<?php foreach ( $footerIcons as $icon ): |
553 | | - if ( is_string($icon) ) { |
554 | | - $html = $icon; |
555 | | - } else { |
556 | | - $url = $icon["url"]; |
557 | | - unset($icon["url"]); |
558 | | - if ( isset($icon["src"]) ) { |
559 | | - $html = Html::element( 'img', $icon ); // do this the lazy way, just pass icon data as an attribute array |
560 | | - } else { |
561 | | - $html = htmlspecialchars($icon["alt"]); |
562 | | - } |
563 | | - if ( $url ) { |
564 | | - $html = Html::rawElement( 'a', array( "href" => $url ), $html ); |
565 | | - } |
566 | | - } |
567 | | - echo " $html\n"; |
568 | | - endforeach; ?> |
| 551 | + <li id="footer-<?php echo htmlspecialchars($blockName); ?>ico"> |
| 552 | +<?php foreach ( $footerIcons as $icon ): ?> |
| 553 | + <?php echo $this->skin->makeFooterIcon( $icon ); ?> |
| 554 | + |
| 555 | +<?php endforeach; ?> |
569 | 556 | </li> |
570 | 557 | <?php endforeach; ?> |
571 | 558 | </ul> |
Index: trunk/phase3/skins/MonoBook.php |
— | — | @@ -189,23 +189,11 @@ |
190 | 190 | <div id="footer"<?php $this->html('userlangattributes') ?>> |
191 | 191 | <?php foreach ( $footericons as $blockName => $footerIcons ) { ?> |
192 | 192 | <div id="f-<?php echo htmlspecialchars($blockName); ?>ico"> |
193 | | -<?php foreach ( $footerIcons as $icon ) { |
194 | | - if ( is_string($icon) ) { |
195 | | - $html = $icon; |
196 | | - } else { |
197 | | - $url = $icon["url"]; |
198 | | - unset($icon["url"]); |
199 | | - if ( isset($icon["src"]) ) { |
200 | | - $html = Html::element( 'img', $icon ); // do this the lazy way, just pass icon data as an attribute array |
201 | | - } else { |
202 | | - $html = htmlspecialchars($icon["alt"]); |
203 | | - } |
204 | | - if ( $url ) { |
205 | | - $html = Html::rawElement( 'a', array( "href" => $url ), $html ); |
206 | | - } |
207 | | - } |
208 | | - echo " $html\n"; |
209 | | - } ?> |
| 193 | +<?php foreach ( $footerIcons as $icon ) { ?> |
| 194 | + <?php echo $this->skin->makeFooterIcon( $icon ); ?> |
| 195 | + |
| 196 | +<?php } |
| 197 | +?> |
210 | 198 | </div> |
211 | 199 | <?php } |
212 | 200 | |
Index: trunk/phase3/skins/Modern.php |
— | — | @@ -194,16 +194,10 @@ |
195 | 195 | foreach ( $footericons as $blockName => $footerIcons ) { ?> |
196 | 196 | <div id="mw_<?php echo htmlspecialchars($blockName); ?>"> |
197 | 197 | <?php |
198 | | - foreach ( $footerIcons as $icon ) { |
199 | | - if ( is_string($icon) ) { |
200 | | - $html = $icon; |
201 | | - } else { |
202 | | - $html = htmlspecialchars($icon["alt"]); |
203 | | - if ( $icon["url"] ) { |
204 | | - $html = Html::element( 'a', array( "href" => $icon["url"] ), $html ); |
205 | | - } |
206 | | - } |
207 | | - echo " $html\n"; |
| 198 | + foreach ( $footerIcons as $icon ) { ?> |
| 199 | + <?php echo $this->skin->makeFooterIcon( $icon, false ); ?> |
| 200 | + |
| 201 | +<?php |
208 | 202 | } ?> |
209 | 203 | </div> |
210 | 204 | <?php |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -1631,6 +1631,29 @@ |
1632 | 1632 | } |
1633 | 1633 | |
1634 | 1634 | /** |
| 1635 | + * Renders a $wgFooterIcons icon acording to the method's arguments |
| 1636 | + * @param $icon Array: The icon to build the html for |
| 1637 | + * @param $useImg Boolean: Whether to use the icon's image or output a text-only footericon |
| 1638 | + */ |
| 1639 | + function makeFooterIcon( $icon, $useImg = true ) { |
| 1640 | + if ( is_string($icon) ) { |
| 1641 | + $html = $icon; |
| 1642 | + } else { |
| 1643 | + $url = $icon["url"]; |
| 1644 | + unset($icon["url"]); |
| 1645 | + if ( isset($icon["src"]) && $useImg ) { |
| 1646 | + $html = Html::element( 'img', $icon ); // do this the lazy way, just pass icon data as an attribute array |
| 1647 | + } else { |
| 1648 | + $html = htmlspecialchars($icon["alt"]); |
| 1649 | + } |
| 1650 | + if ( $url ) { |
| 1651 | + $html = Html::rawElement( 'a', array( "href" => $url ), $html ); |
| 1652 | + } |
| 1653 | + } |
| 1654 | + return $html; |
| 1655 | + } |
| 1656 | + |
| 1657 | + /** |
1635 | 1658 | * Gets the link to the wiki's main page. |
1636 | 1659 | * @return string |
1637 | 1660 | */ |