Fixed some doxygen warnings
[lhc/web/wiklou.git] / includes / ImagePage.php
index 0401e1d..dd2c2ab 100644 (file)
@@ -329,7 +329,7 @@ class ImagePage extends Article {
                        $linkAttribs = array( 'href' => $full_url );
                        $longDesc = $this->displayImg->getLongDesc();
 
-                       wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this , &$wgOut ) )       ;
+                       wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this, &$wgOut ) );
 
                        if( $this->displayImg->allowInlineDisplay() ) {
                                # image
@@ -374,7 +374,8 @@ class ImagePage extends Article {
                                                '<br />' . Xml::tags( 'a', $linkAttribs,  $msgbig ) . "$dirmark " . $longDesc;
                                }
 
-                               if( $this->displayImg->isMultipage() ) {
+                               $isMulti = $this->displayImg->isMultipage() && $this->displayImg->pageCount() > 1;
+                               if( $isMulti ) {
                                        $wgOut->addHTML( '<table class="multipageimage"><tr><td>' );
                                }
 
@@ -388,7 +389,7 @@ class ImagePage extends Article {
                                                $anchorclose . "</div>\n" );
                                }
 
-                               if( $this->displayImg->isMultipage() ) {
+                               if( $isMulti ) {
                                        $count = $this->displayImg->pageCount();
 
                                        if( $page > 1 ) {
@@ -550,7 +551,7 @@ EOT
         * external editing (and instructions link) etc.
         */
        protected function uploadLinksBox() {
-               global $wgUser, $wgOut, $wgEnableUploads;
+               global $wgUser, $wgOut, $wgEnableUploads, $wgUseExternalEditor;
 
                if( !$wgEnableUploads ) { return; }
 
@@ -569,18 +570,20 @@ EOT
                }
 
                # External editing link
-               $elink = $sk->link(
-                       $this->mTitle,
-                       wfMsgHtml( 'edit-externally' ),
-                       array(),
-                       array(
-                               'action' => 'edit',
-                               'externaledit' => 'true',
-                               'mode' => 'file'
-                       ),
-                       array( 'known', 'noclasses' )
-               );
-               $wgOut->addHTML( '<li id="mw-imagepage-edit-external">' . $elink . ' <small>' . wfMsgExt( 'edit-externally-help', array( 'parseinline' ) ) . "</small></li>\n" );
+               if ( $wgUseExternalEditor ) {
+                       $elink = $sk->link(
+                               $this->mTitle,
+                               wfMsgHtml( 'edit-externally' ),
+                               array(),
+                               array(
+                                       'action' => 'edit',
+                                       'externaledit' => 'true',
+                                       'mode' => 'file'
+                               ),
+                               array( 'known', 'noclasses' )
+                       );
+                       $wgOut->addHTML( '<li id="mw-imagepage-edit-external">' . $elink . ' <small>' . wfMsgExt( 'edit-externally-help', array( 'parseinline' ) ) . "</small></li>\n" );
+               }
 
                $wgOut->addHTML( "</ul>\n" );
        }
@@ -592,7 +595,7 @@ EOT
         * we follow it with an upload history of the image and its usage.
         */
        protected function imageHistory() {
-               global $wgOut, $wgUseExternalEditor;
+               global $wgOut;
 
                $this->loadFile();
                $pager = new ImageHistoryPseudoPager( $this );
@@ -602,7 +605,7 @@ EOT
 
                # Exist check because we don't want to show this on pages where an image
                # doesn't exist along with the noimage message, that would suck. -ævar
-               if( $wgUseExternalEditor && $this->img->exists() ) {
+               if( $this->img->exists() ) {
                        $this->uploadLinksBox();
                }
        }
@@ -874,7 +877,7 @@ class ImageHistoryList {
                        $canHide = $wgUser->isAllowed( 'deleterevision' );
                        if( $canHide || ($wgUser->isAllowed('deletedhistory') && $file->getVisibility()) ) {
                                if( $wgUser->isAllowed('delete') ) {
-                                       $row .= '<br/>';
+                                       $row .= '<br />';
                                }
                                // If file is top revision or locked from this user, don't link
                                if( $iscur || !$file->userCan(File::DELETED_RESTRICTED) ) {
@@ -1020,7 +1023,7 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
                $this->mImagePage = $imagePage;
                $this->mTitle = clone( $imagePage->getTitle() );
                $this->mTitle->setFragment( '#filehistory' );
-               $this->mImg = NULL;
+               $this->mImg = null;
                $this->mHist = array();
                $this->mRange = array( 0, 0 ); // display range
        }