r58692 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58691‎ | r58692 | r58693 >
Date:09:31, 7 November 2009
Author:btongminh
Status:ok
Tags:
Comment:
Add hook ImagePageAfterImageLinks for showing extra information on the image page after the imagelinks
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -834,6 +834,11 @@
835835 $imagePage: ImagePage object ($this)
836836 $output: $wgOut
837837
 838+'ImagePageAfterImageLinks': called after the image links section on an image
 839+ page is built
 840+$imagePage: ImagePage object ($this)
 841+&$html: HTML for the hook to add
 842+
838843 'ImagePageFileHistoryLine': called when a file history line is contructed
839844 $file: the file
840845 $line: the HTML of the history line
Index: trunk/phase3/includes/ImagePage.php
@@ -132,6 +132,12 @@
133133 # Yet we return metadata about the target. Definitely an issue in the FileRepo
134134 $this->imageRedirects();
135135 $this->imageLinks();
 136+
 137+ # Allow extensions to add something after the image links
 138+ $html = '';
 139+ wfRunHooks( 'ImagePageAfterImageLinks', array( $this, &$html ) );
 140+ if ( $html)
 141+ $wgOut->addHTML( $html );
136142
137143 if( $showmeta ) {
138144 global $wgStylePath, $wgStyleVersion;

Follow-up revisions

RevisionCommit summaryAuthorDate
r58741Merge r58692werdna09:26, 8 November 2009

Status & tagging log