Add hook ImagePageAfterImageLinks for showing extra information on the image page...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 7 Nov 2009 09:31:16 +0000 (09:31 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 7 Nov 2009 09:31:16 +0000 (09:31 +0000)
docs/hooks.txt
includes/ImagePage.php

index 3ce13b4..cbf84d7 100644 (file)
@@ -834,6 +834,11 @@ $title: Title object, pages linked to this title are purged.
 $imagePage: ImagePage object ($this)
 $output: $wgOut
 
+'ImagePageAfterImageLinks': called after the image links section on an image 
+       page is built
+$imagePage: ImagePage object ($this)
+&$html: HTML for the hook to add
+
 'ImagePageFileHistoryLine': called when a file history line is contructed
 $file: the file
 $line: the HTML of the history line
index d1fa75c..c42c736 100644 (file)
@@ -132,6 +132,12 @@ class ImagePage extends Article {
                # Yet we return metadata about the target. Definitely an issue in the FileRepo
                $this->imageRedirects();
                $this->imageLinks();
+               
+               # Allow extensions to add something after the image links
+               $html = '';
+               wfRunHooks( 'ImagePageAfterImageLinks', array( $this, &$html ) );
+               if ( $html)
+                       $wgOut->addHTML( $html );
 
                if( $showmeta ) {
                        global $wgStylePath, $wgStyleVersion;