r68234 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68233‎ | r68234 | r68235 >
Date:19:53, 18 June 2010
Author:btongminh
Status:ok
Tags:
Comment:
(bug 23931) Put GlobalUsage link in the proper position in the filetoc
Modified paths:
  • /trunk/extensions/GlobalUsage/GlobalUsageImagePageHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GlobalUsage/GlobalUsageImagePageHooks.php
@@ -71,8 +71,11 @@
7272 * Show a link to the global image links in the TOC if there are any results available.
7373 */
7474 public static function onImagePageShowTOC( $imagePage, &$toc ) {
75 - if ( self::hasResults( $imagePage ) )
76 - $toc[] = '<li><a href="#globalusage">' . wfMsgHtml( 'globalusage' ) . '</a></li>';
 75+ if ( self::hasResults( $imagePage ) ) {
 76+ # Insert a link after the 3rd entry in the TOC
 77+ array_splice( $toc, 3, 0, '<li><a href="#globalusage">'
 78+ . wfMsgHtml( 'globalusage' ) . '</a></li>');
 79+ }
7780 return true;
7881 }
7982

Status & tagging log