85 return Xml::element(
'h2', [
'id' =>
'filehistory' ], $this->
msg(
'filehist' )->
text() )
87 .
"<div id=\"mw-imagepage-section-filehistory\">\n"
88 . $this->
msg(
'filehist-help' )->parseAsBlock()
90 . Xml::openElement(
'table', [
'class' =>
'wikitable filehistory' ] ) .
"\n"
92 . ( $this->current->isLocal()
93 && ( $this->
getUser()->isAllowedAny(
'delete',
'deletedhistory' ) ) ?
'<th></th>' :
'' )
94 .
'<th>' . $this->
msg(
'filehist-datetime' )->escaped() .
'</th>'
95 . ( $this->showThumb ?
'<th>' . $this->
msg(
'filehist-thumb' )->escaped() .
'</th>' :
'' )
96 .
'<th>' . $this->
msg(
'filehist-dimensions' )->escaped() .
'</th>'
97 .
'<th>' . $this->
msg(
'filehist-user' )->escaped() .
'</th>'
98 .
'<th>' . $this->
msg(
'filehist-comment' )->escaped() .
'</th>'
107 return "</table>\n$navLinks\n</div>\n";
118 $timestamp =
wfTimestamp( TS_MW, $file->getTimestamp() );
119 $img = $iscur ? $file->
getName() : $file->getArchiveName();
120 $userId = $file->getUser(
'id' );
121 $userText = $file->getUser(
'text' );
124 $local = $this->current->isLocal();
125 $row = $selected =
'';
128 if ( $local && ( $user->isAllowedAny(
'delete',
'deletedhistory' ) ) ) {
130 # Link to remove from history
131 if ( $user->isAllowed(
'delete' ) ) {
132 $q = [
'action' =>
'delete' ];
134 $q[
'oldimage'] =
$img;
138 $this->
msg( $iscur ?
'filehist-deleteall' :
'filehist-deleteone' )->escaped(),
142 # Link to hide content. Don't show useless link to people who cannot hide revisions.
143 $canHide = $user->isAllowed(
'deleterevision' );
144 if ( $canHide || ( $user->isAllowed(
'deletedhistory' ) && $file->getVisibility() ) ) {
145 if ( $user->isAllowed(
'delete' ) ) {
152 list( $ts, ) = explode(
'!',
$img, 2 );
154 'type' =>
'oldimage',
155 'target' => $this->title->getPrefixedText(),
169 $row .= $this->
msg(
'filehist-current' )->escaped();
170 } elseif ( $local && $this->title->quickUserCan(
'edit', $user )
171 && $this->title->quickUserCan(
'upload', $user )
174 $row .= $this->
msg(
'filehist-revert' )->escaped();
178 $this->
msg(
'filehist-revert' )->escaped(),
181 'action' =>
'revert',
190 if ( $file->getTimestamp() === $this->img->getTimestamp() ) {
191 $selected =
"class='filehistory-selected'";
193 $row .=
"<td $selected style='white-space: nowrap;'>";
195 # Don't link to unviewable files
196 $row .=
'<span class="history-deleted">'
197 .
$lang->userTimeAndDate( $timestamp, $user ) .
'</span>';
201 $revdel = SpecialPage::getTitleFor(
'Revisiondelete' );
202 # Make a link to review the image
205 $lang->userTimeAndDate( $timestamp, $user ),
208 'target' => $this->title->getPrefixedText(),
210 'token' => $user->getEditToken(
$img )
214 $url =
$lang->userTimeAndDate( $timestamp, $user );
216 $row .=
'<span class="history-deleted">' . $url .
'</span>';
217 } elseif ( !$file->exists() ) {
218 $row .=
'<span class="mw-file-missing">'
219 .
$lang->userTimeAndDate( $timestamp, $user ) .
'</span>';
221 $url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl(
$img );
222 $row .= Xml::element(
225 $lang->userTimeAndDate( $timestamp, $user )
231 if ( $this->showThumb ) {
237 $row .= htmlspecialchars( $file->getDimensionsString() );
238 $row .= $this->
msg(
'word-separator' )->escaped();
239 $row .=
'<span style="white-space: nowrap;">';
240 $row .= $this->
msg(
'parentheses' )->sizeParams( $file->getSize() )->escaped();
248 $row .=
'<span class="history-deleted">'
249 . $this->
msg(
'rev-deleted-user' )->escaped() .
'</span>';
253 $row .=
'<span style="white-space: nowrap;">';
257 $row .= htmlspecialchars( $userText );
264 $row .=
'<td><span class="history-deleted">' .
265 $this->
msg(
'rev-deleted-comment' )->escaped() .
'</span></td>';
268 '<td dir="' . MediaWikiServices::getInstance()->getContentLanguage()->getDir() .
273 Hooks::run(
'ImagePageFileHistoryLine', [ $this, $file, &$row, &$rowClass ] );
274 $classAttr = $rowClass ?
" class='$rowClass'" :
'';
276 return "<tr{$classAttr}>{$row}</tr>\n";
293 $timestamp =
wfTimestamp( TS_MW, $file->getTimestamp() );
295 $thumbnail = $file->transform(
$params );
297 'alt' => $this->
msg(
'filehist-thumbtext',
298 $lang->userTimeAndDate( $timestamp, $user ),
299 $lang->userDate( $timestamp, $user ),
300 $lang->userTime( $timestamp, $user ) )->text(),
305 return $this->
msg(
'filehist-nothumb' )->escaped();
308 return $thumbnail->toHtml(
$options );
310 return $this->
msg(
'filehist-nothumb' )->escaped();
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
$wgShowArchiveThumbnails
Show thumbnails for old images on the image description page.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
getContext()
Gets the context this Article is executed in.
getTitle()
Get the title object of the article.
getPage()
Get the WikiPage object of this instance.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
setContext(IContextSource $context)
Implements some public methods and some protected utility functions which are required by multiple ch...
getName()
Return the name of this file.
Builds the image revision log shown on image pages.
endImageHistoryList( $navLinks='')
beginImageHistoryList( $navLinks='')
preventClickjacking( $enable=true)
imageHistoryLine( $iscur, $file)
Class for viewing MediaWiki file description pages.
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
static linkKnown( $target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
static revDeleteLinkDisabled( $delete=true)
Creates a dead (show/hide) link for deleting revisions/log entries.
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
static revDeleteLink( $query=[], $restricted=false, $delete=true)
Creates a (show/hide) link for deleting revisions/log entries.
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Represents a title within MediaWiki.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
if(!isset( $args[0])) $lang