* (bug 25248) API: paraminfo errors with certain modules
[lhc/web/wiklou.git] / includes / ImagePage.php
index 001d84d..91fd25d 100644 (file)
@@ -66,7 +66,7 @@ class ImagePage extends Article {
                $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
 
                if ( $this->mTitle->getNamespace() != NS_FILE || ( isset( $diff ) && $diffOnly ) ) {
-                       return Article::view();
+                       return parent::view();
                }
                        
                $this->loadFile();
@@ -76,7 +76,7 @@ class ImagePage extends Article {
                                // mTitle is the same as the redirect target so ask Article
                                // to perform the redirect for us.
                                $wgRequest->setVal( 'diffonly', 'true' );
-                               return Article::view();
+                               return parent::view();
                        } else {
                                // mTitle is not the same as the redirect target so it is 
                                // probably the redirect page itself. Fake the redirect symbol
@@ -106,7 +106,7 @@ class ImagePage extends Article {
 
                # No need to display noarticletext, we use our own message, output in openShowImage()
                if ( $this->getID() ) {
-                       Article::view();
+                       parent::view();
                } else {
                        # Just need to set the right headers
                        $wgOut->setArticleFlag( true );
@@ -143,12 +143,11 @@ class ImagePage extends Article {
                        $wgOut->addHTML( $html );
 
                if ( $showmeta ) {
-                       global $wgStylePath, $wgStyleVersion;
                        $expand = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-expand' ) ) );
                        $collapse = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-collapse' ) ) );
                        $wgOut->addHTML( Xml::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ) . "\n" );
                        $wgOut->addWikiText( $this->makeMetadataTable( $formattedMetadata ) );
-                       $wgOut->addScriptFile( 'metadata.js' );
+                       $wgOut->addModules( array( 'mediawiki.legacy.metadata' ) );
                        $wgOut->addHTML(
                                "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" );
                }
@@ -234,8 +233,8 @@ class ImagePage extends Article {
        /**
         * Create the TOC
         *
-        * @param bool $metadata Whether or not to show the metadata link
-        * @return string
+        * @param $metadata Boolean: whether or not to show the metadata link
+        * @return String
         */
        protected function showTOC( $metadata ) {
                $r = array(
@@ -257,8 +256,8 @@ class ImagePage extends Article {
         *
         * FIXME: bad interface, see note on MediaHandler::formatMetadata().
         *
-        * @param array $exif The array containing the EXIF data
-        * @return string
+        * @param $metadata Array: the array containing the EXIF data
+        * @return String
         */
        protected function makeMetadataTable( $metadata ) {
                $r = "<div class=\"mw-imagepage-section-metadata\">";
@@ -328,9 +327,9 @@ class ImagePage extends Article {
                        } else {
                                $params = array( 'page' => $page );
                        }
-                       $width_orig = $this->displayImg->getWidth();
+                       $width_orig = $this->displayImg->getWidth( $page );
                        $width = $width_orig;
-                       $height_orig = $this->displayImg->getHeight();
+                       $height_orig = $this->displayImg->getHeight( $page );
                        $height = $height_orig;
                        $mime = $this->displayImg->getMimeType();
                        $showLink = false;
@@ -438,7 +437,6 @@ class ImagePage extends Article {
                                                'onchange' => 'document.pageselector.submit();',
                                        );
 
-                                       $option = array();
                                        for ( $i = 1; $i <= $count; $i++ ) {
                                                $options[] = Xml::option( $wgLang->formatNum( $i ), $i, $i == $page );
                                        }
@@ -531,7 +529,6 @@ EOT
                $wrap = "<div class=\"sharedUploadNotice\">\n$1\n</div>\n";
                $repo = $this->img->getRepo()->getDisplayName();
 
-               $msg = '';
                if ( $descUrl && $descText && wfMsgNoTrans( 'sharedupload-desc-here' ) !== '-'  ) {
                        $wgOut->wrapWikiMsg( $wrap, array( 'sharedupload-desc-here', $repo, $descUrl ) );
                } elseif ( $descUrl && wfMsgNoTrans( 'sharedupload-desc-there' ) !== '-' ) {
@@ -761,7 +758,7 @@ EOT
                $this->loadFile();
                if ( !$this->img->exists() || !$this->img->isLocal() || $this->img->getRedirected() ) {
                        // Standard article deletion
-                       Article::delete();
+                       parent::delete();
                        return;
                }
                $deleter = new FileDeleteForm( $this->img );
@@ -880,7 +877,7 @@ class ImageHistoryList {
        }
 
        public function imageHistoryLine( $iscur, $file ) {
-               global $wgUser, $wgLang, $wgContLang;
+               global $wgUser, $wgLang;
 
                $timestamp = wfTimestamp( TS_MW, $file->getTimestamp() );
                $img = $iscur ? $file->getName() : $file->getArchiveName();
@@ -889,7 +886,7 @@ class ImageHistoryList {
                $description = $file->getDescription();
 
                $local = $this->current->isLocal();
-               $row = $css = $selected = '';
+               $row = $selected = '';
 
                // Deletion link
                if ( $local && ( $wgUser->isAllowed( 'delete' ) || $wgUser->isAllowed( 'deletedhistory' ) ) ) {