X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FImageHistoryList.php;h=bb8ed2420b2e29990b0524b02930330545a5fadb;hb=43ee1abaca625261f5caae501bf9b10b54bc2e30;hp=32638a5db1442192be23ef3629ea279c9d11125c;hpb=b85192c7a7cd5f2b5c03c55c1627c14510ef6a1a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/ImageHistoryList.php b/includes/page/ImageHistoryList.php index 32638a5db1..bb8ed2420b 100644 --- a/includes/page/ImageHistoryList.php +++ b/includes/page/ImageHistoryList.php @@ -53,7 +53,7 @@ class ImageHistoryList extends ContextSource { */ public function __construct( $imagePage ) { global $wgShowArchiveThumbnails; - $this->current = $imagePage->getFile(); + $this->current = $imagePage->getPage()->getFile(); $this->img = $imagePage->getDisplayedFile(); $this->title = $imagePage->getTitle(); $this->imagePage = $imagePage; @@ -80,12 +80,12 @@ class ImageHistoryList extends ContextSource { * @return string */ public function beginImageHistoryList( $navLinks = '' ) { - return Xml::element( 'h2', array( 'id' => 'filehistory' ), $this->msg( 'filehist' )->text() ) + return Xml::element( 'h2', [ 'id' => 'filehistory' ], $this->msg( 'filehist' )->text() ) . "\n" . "
\n" . $this->msg( 'filehist-help' )->parseAsBlock() . $navLinks . "\n" - . Xml::openElement( 'table', array( 'class' => 'wikitable filehistory' ) ) . "\n" + . Xml::openElement( 'table', [ 'class' => 'wikitable filehistory' ] ) . "\n" . '' . ( $this->current->isLocal() && ( $this->getUser()->isAllowedAny( 'delete', 'deletedhistory' ) ) ? '' : '' ) @@ -129,14 +129,14 @@ class ImageHistoryList extends ContextSource { $row .= ''; # Link to remove from history if ( $user->isAllowed( 'delete' ) ) { - $q = array( 'action' => 'delete' ); + $q = [ 'action' => 'delete' ]; if ( !$iscur ) { $q['oldimage'] = $img; } $row .= Linker::linkKnown( $this->title, $this->msg( $iscur ? 'filehist-deleteall' : 'filehist-deleteone' )->escaped(), - array(), $q + [], $q ); } # Link to hide content. Don't show useless link to people who cannot hide revisions. @@ -150,11 +150,11 @@ class ImageHistoryList extends ContextSource { $del = Linker::revDeleteLinkDisabled( $canHide ); } else { list( $ts, ) = explode( '!', $img, 2 ); - $query = array( + $query = [ 'type' => 'oldimage', 'target' => $this->title->getPrefixedText(), 'ids' => $ts, - ); + ]; $del = Linker::revDeleteLink( $query, $file->isDeleted( File::DELETED_RESTRICTED ), $canHide ); } @@ -176,12 +176,11 @@ class ImageHistoryList extends ContextSource { $row .= Linker::linkKnown( $this->title, $this->msg( 'filehist-revert' )->escaped(), - array(), - array( + [], + [ 'action' => 'revert', 'oldimage' => $img, - 'wpEditToken' => $user->getEditToken( $img ) - ) + ] ); } } @@ -204,12 +203,12 @@ class ImageHistoryList extends ContextSource { $url = Linker::linkKnown( $revdel, $lang->userTimeAndDate( $timestamp, $user ), - array(), - array( + [], + [ 'target' => $this->title->getPrefixedText(), 'file' => $img, 'token' => $user->getEditToken( $img ) - ) + ] ); } else { $url = $lang->userTimeAndDate( $timestamp, $user ); @@ -222,7 +221,7 @@ class ImageHistoryList extends ContextSource { $url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl( $img ); $row .= Xml::element( 'a', - array( 'href' => $url ), + [ 'href' => $url ], $lang->userTimeAndDate( $timestamp, $user ) ); } @@ -270,7 +269,7 @@ class ImageHistoryList extends ContextSource { } $rowClass = null; - Hooks::run( 'ImagePageFileHistoryLine', array( $this, $file, &$row, &$rowClass ) ); + Hooks::run( 'ImagePageFileHistoryLine', [ $this, $file, &$row, &$rowClass ] ); $classAttr = $rowClass ? " class='$rowClass'" : ''; return "{$row}\n"; @@ -286,20 +285,20 @@ class ImageHistoryList extends ContextSource { if ( $file->allowInlineDisplay() && $file->userCan( File::DELETED_FILE, $user ) && !$file->isDeleted( File::DELETED_FILE ) ) { - $params = array( + $params = [ 'width' => '120', 'height' => '120', - ); + ]; $timestamp = wfTimestamp( TS_MW, $file->getTimestamp() ); $thumbnail = $file->transform( $params ); - $options = array( + $options = [ 'alt' => $this->msg( 'filehist-thumbtext', $lang->userTimeAndDate( $timestamp, $user ), $lang->userDate( $timestamp, $user ), $lang->userTime( $timestamp, $user ) )->text(), 'file-link' => true, - ); + ]; if ( !$thumbnail ) { return $this->msg( 'filehist-nothumb' )->escaped();