Run the ImagePageShowTOC hook before adding the 'metadata' link
authorRicordisamoa <ricordisamoa@openmailbox.org>
Mon, 29 Dec 2014 15:02:45 +0000 (16:02 +0100)
committerRicordisamoa <ricordisamoa@openmailbox.org>
Mon, 29 Dec 2014 15:06:08 +0000 (16:06 +0100)
For consistency with the ImagePageAfterImageLinks hook,
which places the content before the 'metadata' section.

Change-Id: Ibcffdd803ed0a6169558ea247e6ec812c356444d

includes/page/ImagePage.php

index b4409c3..b8f67c2 100644 (file)
@@ -241,12 +241,13 @@ class ImagePage extends Article {
                        '<li><a href="#filehistory">' . $this->getContext()->msg( 'filehist' )->escaped() . '</a></li>',
                        '<li><a href="#filelinks">' . $this->getContext()->msg( 'imagelinks' )->escaped() . '</a></li>',
                );
+
+               Hooks::run( 'ImagePageShowTOC', array( $this, &$r ) );
+
                if ( $metadata ) {
                        $r[] = '<li><a href="#metadata">' . $this->getContext()->msg( 'metadata' )->escaped() . '</a></li>';
                }
 
-               Hooks::run( 'ImagePageShowTOC', array( $this, &$r ) );
-
                return '<ul id="filetoc">' . implode( "\n", $r ) . '</ul>';
        }