From a1f9401982d22b77186e4648c4b70c588bdae9f9 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 19 May 2008 15:21:29 +0000 Subject: [PATCH] *Remove extra space *Make revisiondelete links more compact *Make user links clearer --- includes/ImagePage.php | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 590f091baf..86ba8cb747 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -739,7 +739,14 @@ class ImageHistoryList { global $wgOut, $wgUser; return Xml::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'filehist' ) ) . $wgOut->parse( wfMsgNoTrans( 'filehist-help' ) ) - . Xml::openElement( 'table', array( 'class' => 'filehistory' ) ) . "\n"; + . Xml::openElement( 'table', array( 'class' => 'filehistory' ) ) . "\n" + . '' + . ( $this->img->isLocal() && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deleterevision') ) ? '' : '' ) + . '' . wfMsgHtml( 'filehist-datetime' ) . '' + . '' . wfMsgHtml( 'filehist-dimensions' ) . '' + . '' . wfMsgHtml( 'filehist-user' ) . '' + . '' . wfMsgHtml( 'filehist-comment' ) . '' + . "\n"; } public function endImageHistoryList() { @@ -763,21 +770,24 @@ class ImageHistoryList { // Deletion link if( $local && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deleterevision') ) ) { + $row .= ''; # Link to remove from history if( $wgUser->isAllowed( 'delete' ) ) { $q = array(); $q[] = 'action=delete'; if( !$iscur ) $q[] = 'oldimage=' . urlencode( $img ); - $row .= '' . $this->skin->makeKnownLinkObj( + $row .= $this->skin->makeKnownLinkObj( $this->title, wfMsgHtml( $iscur ? 'filehist-deleteall' : 'filehist-deleteone' ), implode( '&', $q ) ); - $row .= ''; } # Link to hide content if( $wgUser->isAllowed( 'deleterevision' ) ) { + if( $wgUser->isAllowed('delete') ) { + $row .= '
'; + } $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); // If file is top revision or locked from this user, don't link if( $iscur || !$file->userCan(File::DELETED_RESTRICTED) ) { @@ -792,8 +802,9 @@ class ImageHistoryList { if( $file->isDeleted(File::DELETED_RESTRICTED) ) $del = "$del"; } - $row .= "$del"; + $row .= "$del"; } + $row .= ''; } // Reversion link/current indicator @@ -834,7 +845,7 @@ class ImageHistoryList { $row .= ""; // Image dimensions - $row .= ' ' . htmlspecialchars( $dims ); + $row .= htmlspecialchars( $dims ); // File size $row .= " (" . $this->skin->formatSize( $size ) . ')'; @@ -843,20 +854,22 @@ class ImageHistoryList { $row .= ''; if( $local ) { // Hide deleted usernames - if( $file->isDeleted(File::DELETED_USER) ) + if( $file->isDeleted(File::DELETED_USER) ) { $row .= '' . wfMsgHtml( 'rev-deleted-user' ) . ''; - else - $row .= $this->skin->userLink( $user, $usertext ) . - $this->skin->userToolLinks( $user, $usertext ); + } else { + $row .= $this->skin->userLink( $user, $usertext ) . " " . + $this->skin->userToolLinks( $user, $usertext ) . ""; + } } else { $row .= htmlspecialchars( $usertext ); } + $row .= ''; // Don't show deleted descriptions if ( $file->isDeleted(File::DELETED_COMMENT) ) { - $row .= ' ' . wfMsgHtml('rev-deleted-comment') . ''; + $row .= '' . wfMsgHtml('rev-deleted-comment') . ''; } else { - $row .= ' ' . $this->skin->commentBlock( $description, $this->title ); + $row .= $this->skin->commentBlock( $description, $this->title ); } $row .= ''; -- 2.20.1