&$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 <li> 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
* @return string
*/
protected function showTOC( $metadata ) {
- global $wgLang;
- $r = '<ul id="filetoc">
- <li><a href="#file">' . wfMsgHtml( 'file-anchor-link' ) . '</a></li>
- <li><a href="#filehistory">' . wfMsgHtml( 'filehist' ) . '</a></li>
- <li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . "</a></li>\n" .
- ($metadata ? ' <li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . "
- </ul>\n";
- return $r;
+ $r = array(
+ '<li><a href="#file">' . wfMsgHtml( 'file-anchor-link' ) . '</a></li>',
+ '<li><a href="#filehistory">' . wfMsgHtml( 'filehist' ) . '</a></li>',
+ '<li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . '</a></li>',
+ );
+ if ( $metadata ) {
+ $r[] = '<li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>';
+ }
+
+ wfRunHooks( 'ImagePageShowTOC', array( $this, &$r ) );
+
+ return '<ul id="filetoc">' . implode( "\n", $r ) . '</ul>';
}
/**