8 if( !defined( 'MEDIAWIKI' ) )
12 * Special handling for image description pages
16 class ImagePage
extends Article
{
18 /* private */ var $img; // Image object this page is shown for
19 var $mExtraDescription = false;
21 function __construct( $title ) {
22 parent
::__construct( $title );
23 $this->img
= wfFindFile( $this->mTitle
);
25 $this->img
= wfLocalFile( $this->mTitle
);
30 * Handler for action=render
31 * Include body text only; none of the image extras
35 $wgOut->setArticleBodyOnly( true );
36 $wgOut->addSecondaryWikitext( $this->getContent() );
40 global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
42 $diff = $wgRequest->getVal( 'diff' );
43 $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
45 if ( $this->mTitle
->getNamespace() != NS_IMAGE ||
( isset( $diff ) && $diffOnly ) )
46 return Article
::view();
48 if ($wgShowEXIF && $this->img
->exists()) {
49 $exif = $this->img
->getExifData();
50 $showmeta = count($exif) ?
true : false;
56 if ($this->img
->exists())
57 $wgOut->addHTML($this->showTOC($showmeta));
59 $this->openShowImage();
61 # No need to display noarticletext, we use our own message, output in openShowImage()
62 if ( $this->getID() ) {
65 # Just need to set the right headers
66 $wgOut->setArticleFlag( true );
67 $wgOut->setRobotpolicy( 'index,follow' );
68 $wgOut->setPageTitle( $this->mTitle
->getPrefixedText() );
72 # Show shared description, if needed
73 if ( $this->mExtraDescription
) {
74 $fol = wfMsg( 'shareddescriptionfollows' );
75 if( $fol != '-' && !wfEmptyMsg( 'shareddescriptionfollows', $fol ) ) {
76 $wgOut->addWikiText( $fol );
78 $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription
. '</div>' );
81 $this->closeShowImage();
82 $this->imageHistory();
86 global $wgStylePath, $wgStyleVersion;
87 $expand = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-expand' ) ) );
88 $collapse = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-collapse' ) ) );
89 $wgOut->addHTML( Xml
::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ). "\n" );
90 $wgOut->addWikiText( $this->makeMetadataTable( $exif ) );
92 "<script type=\"text/javascript\" src=\"$wgStylePath/common/metadata.js?$wgStyleVersion\"></script>\n" .
93 "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" );
102 * @param bool $metadata Whether or not to show the metadata link
105 function showTOC( $metadata ) {
107 $r = '<ul id="filetoc">
108 <li><a href="#file">' . $wgLang->getNsText( NS_IMAGE
) . '</a></li>
109 <li><a href="#filehistory">' . wfMsgHtml( 'imghistory' ) . '</a></li>
110 <li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . '</a></li>' .
111 ($metadata ?
'<li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . '
117 * Make a table with metadata to be shown in the output page.
121 * @param array $exif The array containing the EXIF data
124 function makeMetadataTable( $exif ) {
125 $r = wfMsg( 'metadata-help' ) . "\n\n";
126 $r .= "{| id=mw_metadata class=mw_metadata\n";
127 $visibleFields = $this->visibleMetadataFields();
128 foreach( $exif as $k => $v ) {
129 $tag = strtolower( $k );
130 $msg = wfMsg( "exif-$tag" );
131 $class = "exif-$tag";
132 if( !in_array( $tag, $visibleFields ) ) {
133 $class .= ' collapsable';
135 $r .= "|- class=\"$class\"\n";
144 * Get a list of EXIF metadata items which should be displayed when
145 * the metadata table is collapsed.
147 * @return array of strings
150 function visibleMetadataFields() {
152 $lines = explode( "\n", wfMsgForContent( 'metadata-fields' ) );
153 foreach( $lines as $line ) {
155 if( preg_match( '/^\\*\s*(.*?)\s*$/', $line, $matches ) ) {
156 $fields[] = $matches[1];
163 * Overloading Article's getContent method.
165 * Omit noarticletext if sharedupload; text will be fetched from the
166 * shared upload server if possible.
168 function getContent() {
169 if( $this->img
&& !$this->img
->isLocal() && 0 == $this->getID() ) {
172 return Article
::getContent();
175 function openShowImage() {
176 global $wgOut, $wgUser, $wgImageLimits, $wgRequest, $wgLang;
178 $full_url = $this->img
->getURL();
179 $linkAttribs = false;
180 $sizeSel = intval( $wgUser->getOption( 'imagesize') );
181 if( !isset( $wgImageLimits[$sizeSel] ) ) {
182 $sizeSel = User
::getDefaultOption( 'imagesize' );
184 // The user offset might still be incorrect, specially if
185 // $wgImageLimits got changed (see bug #8858).
186 if( !isset( $wgImageLimits[$sizeSel] ) ) {
187 // Default to the first offset in $wgImageLimits
191 $max = $wgImageLimits[$sizeSel];
193 $maxHeight = $max[1];
194 $sk = $wgUser->getSkin();
196 if ( $this->img
->exists() ) {
198 $page = $wgRequest->getIntOrNull( 'page' );
199 if ( is_null( $page ) ) {
203 $params = array( 'page' => $page );
205 $width_orig = $this->img
->getWidth();
206 $width = $width_orig;
207 $height_orig = $this->img
->getHeight();
208 $height = $height_orig;
209 $mime = $this->img
->getMimeType();
211 $linkAttribs = array( 'href' => $full_url );
213 wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this , &$wgOut ) ) ;
215 if ( $this->img
->allowInlineDisplay() and $width and $height) {
218 # "Download high res version" link below the image
219 $msgsize = wfMsgHtml('file-info-size', $width_orig, $height_orig, $sk->formatSize( $this->img
->getSize() ), $mime );
220 # We'll show a thumbnail of this image
221 if ( $width > $maxWidth ||
$height > $maxHeight ) {
222 # Calculate the thumbnail size.
223 # First case, the limiting factor is the width, not the height.
224 if ( $width / $height >= $maxWidth / $maxHeight ) {
225 $height = round( $height * $maxWidth / $width);
227 # Note that $height <= $maxHeight now.
229 $newwidth = floor( $width * $maxHeight / $height);
230 $height = round( $height * $newwidth / $width );
232 # Note that $height <= $maxHeight now, but might not be identical
233 # because of rounding.
235 $msgbig = wfMsgHtml( 'show-big-image' );
236 $msgsmall = wfMsgExt( 'show-big-image-thumb',
237 array( 'parseinline' ), $width, $height );
239 # Image is small enough to show full size on image page
240 $msgbig = htmlspecialchars( $this->img
->getName() );
241 $msgsmall = wfMsgExt( 'file-nohires', array( 'parseinline' ) );
244 $params['width'] = $width;
245 $thumbnail = $this->img
->transform( $params );
247 $anchorclose = "<br />";
248 if( $this->img
->mustRender() ) {
253 '<br />' . Xml
::tags( 'a', $linkAttribs, $msgbig ) . ' ' . $msgsize;
256 if ( $this->img
->isMultipage() ) {
257 $wgOut->addHTML( '<table class="multipageimage"><tr><td>' );
262 'alt' => $this->img
->getTitle()->getPrefixedText()
266 $wgOut->addHTML( '<div class="fullImageLink" id="file">' .
267 $thumbnail->toHtml( $imgAttribs, $linkAttribs ) .
268 $anchorclose . '</div>' );
271 if ( $this->img
->isMultipage() ) {
272 $count = $this->img
->pageCount();
275 $label = $wgOut->parse( wfMsg( 'imgmultipageprev' ), false );
276 $link = $sk->makeKnownLinkObj( $this->mTitle
, $label, 'page='. ($page-1) );
277 $thumb1 = $sk->makeThumbLinkObj( $this->mTitle
, $this->img
, $link, $label, 'none',
278 array( 'page' => $page - 1 ) );
283 if ( $page < $count ) {
284 $label = wfMsg( 'imgmultipagenext' );
285 $link = $sk->makeKnownLinkObj( $this->mTitle
, $label, 'page='. ($page+
1) );
286 $thumb2 = $sk->makeThumbLinkObj( $this->mTitle
, $this->img
, $link, $label, 'none',
287 array( 'page' => $page +
1 ) );
293 $select = '<form name="pageselector" action="' .
294 htmlspecialchars( $wgScript ) .
295 '" method="get" onchange="document.pageselector.submit();">' .
296 Xml
::hidden( 'title', $this->getTitle()->getPrefixedDbKey() );
297 $select .= $wgOut->parse( wfMsg( 'imgmultigotopre' ), false ) .
298 ' <select id="pageselector" name="page">';
299 for ( $i=1; $i <= $count; $i++
) {
300 $select .= Xml
::option( $wgLang->formatNum( $i ), $i,
303 $select .= '</select>' . $wgOut->parse( wfMsg( 'imgmultigotopost' ), false ) .
304 '<input type="submit" value="' .
305 htmlspecialchars( wfMsg( 'imgmultigo' ) ) . '"></form>';
307 $wgOut->addHTML( '</td><td><div class="multipageimagenavbox">' .
308 "$select<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>" );
311 #if direct link is allowed but it's not a renderable image, show an icon.
312 if ($this->img
->isSafeFile()) {
313 $icon= $this->img
->iconThumb();
315 $wgOut->addHTML( '<div class="fullImageLink" id="file"><a href="' . $full_url . '">' .
325 // Workaround for incorrect MIME type on SVGs uploaded in previous versions
326 if ($mime == 'image/svg') $mime = 'image/svg+xml';
328 $filename = wfEscapeWikiText( $this->img
->getName() );
329 $info = wfMsg( 'file-info', $sk->formatSize( $this->img
->getSize() ), $mime );
332 // Check for MIME type. Other types may have more information in the future.
333 if (substr($mime,0,9) == 'image/svg' ) {
334 $infores = wfMsg('file-svg', $width_orig, $height_orig ) . '<br />';
338 $dirmark = $wgContLang->getDirMark();
339 if (!$this->img
->isSafeFile()) {
340 $warning = wfMsg( 'mediawarning' );
341 $wgOut->addWikiText( <<<EOT
342 <div class="fullMedia">$infores
343 <span class="dangerousLink">[[Media:$filename|$filename]]</span>$dirmark
344 <span class="fileInfo"> $info</span>
347 <div class="mediaWarning">$warning</div>
351 $wgOut->addWikiText( <<<EOT
352 <div class="fullMedia">$infores
353 [[Media:$filename|$filename]]$dirmark <span class="fileInfo"> $info</span>
360 if(!$this->img
->isLocal()) {
361 $this->printSharedImageText();
364 # Image does not exist
366 $title = SpecialPage
::getTitleFor( 'Upload' );
367 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
368 'wpDestFile=' . urlencode( $this->img
->getName() ) );
369 $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) );
373 function printSharedImageText() {
374 global $wgOut, $wgUser;
376 $descUrl = $this->img
->getDescriptionUrl();
377 $descText = $this->img
->getDescriptionText();
378 $s = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml("sharedupload");
379 if ( $descUrl && !$descText) {
380 $sk = $wgUser->getSkin();
381 $link = $sk->makeExternalLink( $descUrl, wfMsg('shareduploadwiki-linktext') );
382 $s .= " " . wfMsgWikiHtml('shareduploadwiki', $link);
388 $this->mExtraDescription
= $descText;
392 function getUploadUrl() {
394 $uploadTitle = SpecialPage
::getTitleFor( 'Upload' );
395 return $wgServer . $uploadTitle->getLocalUrl( 'wpDestFile=' . urlencode( $this->img
->getName() ) );
399 * Print out the various links at the bottom of the image page, e.g. reupload,
400 * external editing (and instructions link) etc.
402 function uploadLinksBox() {
403 global $wgUser, $wgOut;
405 if( !$this->img
->isLocal() )
408 $sk = $wgUser->getSkin();
410 $wgOut->addHtml( '<br /><ul>' );
412 # "Upload a new version of this file" link
413 if( UploadForm
::userCanReUpload($wgUser,$this->img
->name
) ) {
414 $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
415 $wgOut->addHtml( "<li><div class='plainlinks'>{$ulink}</div></li>" );
418 # External editing link
419 $elink = $sk->makeKnownLinkObj( $this->mTitle
, wfMsgHtml( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
420 $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
422 $wgOut->addHtml( '</ul>' );
425 function closeShowImage()
432 * If the page we've just displayed is in the "Image" namespace,
433 * we follow it with an upload history of the image and its usage.
435 function imageHistory()
437 global $wgUser, $wgOut, $wgUseExternalEditor;
439 $sk = $wgUser->getSkin();
441 $line = $this->img
->nextHistoryLine();
444 $list = new ImageHistoryList( $sk, $this->img
);
445 $s = $list->beginImageHistoryList() .
446 $list->imageHistoryLine( true, wfTimestamp(TS_MW
, $line->img_timestamp
),
447 $this->mTitle
->getDBkey(), $line->img_user
,
448 $line->img_user_text
, $line->img_size
, $line->img_description
,
449 $line->img_width
, $line->img_height
452 while ( $line = $this->img
->nextHistoryLine() ) {
453 $s .= $list->imageHistoryLine( false, $line->img_timestamp
,
454 $line->oi_archive_name
, $line->img_user
,
455 $line->img_user_text
, $line->img_size
, $line->img_description
,
456 $line->img_width
, $line->img_height
459 $s .= $list->endImageHistoryList();
461 $wgOut->addHTML( $s );
463 # Exist check because we don't want to show this on pages where an image
464 # doesn't exist along with the noimage message, that would suck. -ævar
465 if( $wgUseExternalEditor && $this->img
->exists() ) {
466 $this->uploadLinksBox();
471 function imageLinks()
473 global $wgUser, $wgOut;
475 $wgOut->addHTML( Xml
::element( 'h2', array( 'id' => 'filelinks' ), wfMsg( 'imagelinks' ) ) . "\n" );
477 $dbr = wfGetDB( DB_SLAVE
);
478 $page = $dbr->tableName( 'page' );
479 $imagelinks = $dbr->tableName( 'imagelinks' );
481 $sql = "SELECT page_namespace,page_title FROM $imagelinks,$page WHERE il_to=" .
482 $dbr->addQuotes( $this->mTitle
->getDBkey() ) . " AND il_from=page_id";
483 $sql = $dbr->limitResult($sql, 500, 0);
484 $res = $dbr->query( $sql, "ImagePage::imageLinks" );
486 if ( 0 == $dbr->numRows( $res ) ) {
487 $wgOut->addHtml( '<p>' . wfMsg( "nolinkstoimage" ) . "</p>\n" );
490 $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) . "</p>\n<ul>" );
492 $sk = $wgUser->getSkin();
493 while ( $s = $dbr->fetchObject( $res ) ) {
494 $name = Title
::MakeTitle( $s->page_namespace
, $s->page_title
);
495 $link = $sk->makeKnownLinkObj( $name, "" );
496 $wgOut->addHTML( "<li>{$link}</li>\n" );
498 $wgOut->addHTML( "</ul>\n" );
503 global $wgUser, $wgOut, $wgRequest;
505 if ( !$this->img
->exists() ||
!$this->img
->isLocal() ) {
506 # Use standard article deletion
511 $confirm = $wgRequest->wasPosted();
512 $reason = $wgRequest->getVal( 'wpReason' );
513 $image = $wgRequest->getVal( 'image' );
514 $oldimage = $wgRequest->getVal( 'oldimage' );
516 # Only sysops can delete images. Previously ordinary users could delete
517 # old revisions, but this is no longer the case.
518 if ( !$wgUser->isAllowed('delete') ) {
519 $wgOut->permissionRequired( 'delete' );
522 if ( $wgUser->isBlocked() ) {
523 $wgOut->blockedPage();
526 if ( wfReadOnly() ) {
527 $wgOut->readOnlyPage();
531 # Better double-check that it hasn't been deleted yet!
532 $wgOut->setPagetitle( wfMsg( 'confirmdelete' ) );
533 if ( ( !is_null( $image ) )
534 && ( '' == trim( $image ) ) ) {
535 $wgOut->showFatalError( wfMsg( 'cannotdelete' ) );
539 # Deleting old images doesn't require confirmation
540 if ( !is_null( $oldimage ) ||
$confirm ) {
541 if( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
542 $this->doDeleteImage( $reason );
544 $wgOut->showFatalError( wfMsg( 'sessionfailure' ) );
549 if ( !is_null( $image ) ) {
550 $q = '&image=' . urlencode( $image );
551 } else if ( !is_null( $oldimage ) ) {
552 $q = '&oldimage=' . urlencode( $oldimage );
556 return $this->confirmDelete( $q, $wgRequest->getText( 'wpReason' ) );
561 * Called doDeleteImage() not doDelete() so that Article::delete() doesn't
564 * @param $reason User provided reason for deletion.
566 function doDeleteImage( $reason ) {
567 global $wgOut, $wgRequest;
569 $oldimage = $wgRequest->getVal( 'oldimage' );
571 if ( !is_null( $oldimage ) ) {
572 if ( strlen( $oldimage ) < 16 ) {
573 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
576 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
577 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
580 if ( !$this->doDeleteOldImage( $oldimage ) ) {
583 $deleted = $oldimage;
585 $ok = $this->img
->delete( $reason );
587 # If the deletion operation actually failed, bug out:
588 $wgOut->showFileDeleteError( $this->img
->getName() );
592 # Image itself is now gone, and database is cleaned.
593 # Now we remove the image description page.
595 $article = new Article( $this->mTitle
);
596 $article->doDeleteArticle( $reason ); # ignore errors
598 $deleted = $this->img
->getName();
601 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
602 $wgOut->setRobotpolicy( 'noindex,nofollow' );
604 $loglink = '[[Special:Log/delete|' . wfMsg( 'deletionlog' ) . ']]';
605 $text = wfMsg( 'deletedtext', $deleted, $loglink );
607 $wgOut->addWikiText( $text );
609 $wgOut->returnToMain( false, $this->mTitle
->getPrefixedText() );
615 function doDeleteOldImage( $oldimage )
619 $ok = $this->img
->deleteOld( $oldimage, '' );
621 # If we actually have a file and can't delete it, throw an error.
622 # Something went awry...
623 $wgOut->showFileDeleteError( "$oldimage" );
626 $log = new LogPage( 'delete' );
627 $log->addEntry( 'delete', $this->mTitle
, wfMsg('deletedrevision',$oldimage) );
633 global $wgOut, $wgRequest, $wgUser;
635 $oldimage = $wgRequest->getText( 'oldimage' );
636 if ( strlen( $oldimage ) < 16 ) {
637 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
640 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
641 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
645 if ( wfReadOnly() ) {
646 $wgOut->readOnlyPage();
649 if( $wgUser->isAnon() ) {
650 $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
653 if ( ! $this->mTitle
->userCan( 'edit' ) ) {
654 $wgOut->readOnlyPage( $this->getContent(), true );
657 if ( $wgUser->isBlocked() ) {
658 $wgOut->blockedPage();
661 if( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
662 $wgOut->showErrorPage( 'internalerror', 'sessionfailure' );
666 $sourcePath = $this->img
->getArchiveVirtualUrl( $oldimage );
667 $comment = wfMsg( "reverted" );
668 $result = $this->img
->upload( $sourcePath, $comment, $comment );
670 if ( WikiError
::isError( $result ) ) {
671 $this->showError( $result );
675 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
676 $wgOut->setRobotpolicy( 'noindex,nofollow' );
677 $wgOut->addHTML( wfMsg( 'imagereverted' ) );
679 $descTitle = $this->img
->getTitle();
680 $wgOut->returnToMain( false, $descTitle->getPrefixedText() );
684 * Override handling of action=purge
687 if( $this->img
->exists() ) {
688 wfDebug( "ImagePage::doPurge purging " . $this->img
->getName() . "\n" );
689 $update = new HTMLCacheUpdate( $this->mTitle
, 'imagelinks' );
691 $this->img
->upgradeRow();
692 $this->img
->purgeCache();
694 wfDebug( "ImagePage::doPurge no image\n" );
700 * Display an error from a wikitext-formatted WikiError object
702 function showError( WikiError
$error ) {
704 $wgOut->setPageTitle( wfMsg( "internalerror" ) );
705 $wgOut->setRobotpolicy( "noindex,nofollow" );
706 $wgOut->setArticleRelated( false );
707 $wgOut->enableClientCache( false );
708 $wgOut->addWikiText( $error->getMessage() );
717 class ImageHistoryList
{
719 function ImageHistoryList( $skin, $img ) {
724 function beginImageHistoryList() {
726 Xml
::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'imghistory' ) ) .
727 "\n<p>" . wfMsg( 'imghistlegend' ) . "</p>\n".'<ul class="special">';
731 function endImageHistoryList() {
736 function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description, $width, $height ) {
737 global $wgUser, $wgLang, $wgTitle, $wgContLang;
739 $datetime = $wgLang->timeanddate( $timestamp, true );
740 $del = wfMsgHtml( 'deleteimg' );
741 $delall = wfMsgHtml( 'deleteimgcompletely' );
742 $cur = wfMsgHtml( 'cur' );
743 $local = $this->img
->isLocal();
746 $url = htmlspecialchars( $this->img
->getURL() );
748 if ( $local && $wgUser->isAllowed('delete') ) {
749 $link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() .
751 $style = $this->skin
->getInternalLinkAttributes( $link, $delall );
753 $dlink = '<a href="'.$link.'"'.$style.'>'.$delall.'</a>';
758 $url = htmlspecialchars( $this->img
->getArchiveUrl( $img ) );
759 if( $local && $wgUser->getID() != 0 && $wgTitle->userCan( 'edit' ) ) {
760 $token = urlencode( $wgUser->editToken( $img ) );
761 $rlink = $this->skin
->makeKnownLinkObj( $wgTitle,
762 wfMsgHtml( 'revertimg' ), 'action=revert&oldimage=' .
763 urlencode( $img ) . "&wpEditToken=$token" );
764 $dlink = $this->skin
->makeKnownLinkObj( $wgTitle,
765 $del, 'action=delete&oldimage=' . urlencode( $img ) .
766 "&wpEditToken=$token" );
768 # Having live active links for non-logged in users
769 # means that bots and spiders crawling our site can
770 # inadvertently change content. Baaaad idea.
771 $rlink = wfMsgHtml( 'revertimg' );
777 $userlink = $this->skin
->userLink( $user, $usertext ) . $this->skin
->userToolLinks( $user, $usertext );
779 $userlink = htmlspecialchars( $usertext );
781 $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
782 $wgLang->formatNum( $size ) );
783 $widthheight = wfMsgHtml( 'widthheight', $width, $height );
784 $style = $this->skin
->getInternalLinkAttributes( $url, $datetime );
786 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a> . . {$userlink} . . {$widthheight} ({$nbytes})";
788 $s .= $this->skin
->commentBlock( $description, $wgTitle );