From 9d64bbc404103ffb497fb675e302880eb698b1d5 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sun, 8 Nov 2009 11:09:20 +0000 Subject: [PATCH] * Add globalusage link to the file toc * Add thumb of the file to Special:GlobalUsage --- docs/hooks.txt | 4 ++++ includes/ImagePage.php | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index a139a8e5f9..f184b47bac 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -849,6 +849,10 @@ $page: ImagePage object &$file: File object &$displayFile: displayed File object +'ImagePageShowTOC': called when the file toc on an image page is generated +$page: ImagePage object +&$toc: Array of
  • strings + 'ImgAuthBeforeStream': executed before file is streamed to user, but only when using img_auth.php &$title: the Title object of the file as it would appear for the upload page diff --git a/includes/ImagePage.php b/includes/ImagePage.php index c42c736a77..0401e1d7d4 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -230,14 +230,18 @@ class ImagePage extends Article { * @return string */ protected function showTOC( $metadata ) { - global $wgLang; - $r = '\n"; - return $r; + $r = array( + '
  • ' . wfMsgHtml( 'file-anchor-link' ) . '
  • ', + '
  • ' . wfMsgHtml( 'filehist' ) . '
  • ', + '
  • ' . wfMsgHtml( 'imagelinks' ) . '
  • ', + ); + if ( $metadata ) { + $r[] = '
  • ' . wfMsgHtml( 'metadata' ) . '
  • '; + } + + wfRunHooks( 'ImagePageShowTOC', array( $this, &$r ) ); + + return ''; } /** -- 2.20.1