Index: trunk/extensions/GlobalUsage/GlobalUsageImagePageHooks.php |
— | — | @@ -71,8 +71,11 @@ |
72 | 72 | * Show a link to the global image links in the TOC if there are any results available. |
73 | 73 | */ |
74 | 74 | 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 | + } |
77 | 80 | return true; |
78 | 81 | } |
79 | 82 | |