9 if( !defined( 'MEDIAWIKI' ) )
12 require_once( 'Image.php' );
15 * Special handling for image description pages
18 class ImagePage
extends Article
{
20 /* private */ var $img; // Image object this page is shown for
21 var $mExtraDescription = false;
24 * Handler for action=render
25 * Include body text only; none of the image extras
29 $wgOut->setArticleBodyOnly( true );
30 $wgOut->addSecondaryWikitext( $this->getContent() );
34 global $wgOut, $wgShowEXIF;
36 $this->img
= new Image( $this->mTitle
);
38 if( $this->mTitle
->getNamespace() == NS_IMAGE
) {
39 if ($wgShowEXIF && $this->img
->exists()) {
40 $exif = $this->img
->getExifData();
41 $showmeta = count($exif) ?
true : false;
47 if ($this->img
->exists())
48 $wgOut->addHTML($this->showTOC($showmeta));
50 $this->openShowImage();
52 # No need to display noarticletext, we use our own message, output in openShowImage()
53 if( $this->getID() ) {
56 # Just need to set the right headers
57 $wgOut->setArticleFlag( true );
58 $wgOut->setRobotpolicy( 'index,follow' );
59 $wgOut->setPageTitle( $this->mTitle
->getPrefixedText() );
63 # Show shared description, if needed
64 if( $this->mExtraDescription
) {
65 $fol = wfMsg( 'shareddescriptionfollows' );
67 $wgOut->addWikiText( $fol );
69 $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription
. '</div>' );
72 $this->closeShowImage();
73 $this->imageHistory();
77 $expand = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-expand' ) ) );
78 $collapse = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-collapse' ) ) );
79 $wgOut->addHTML( "<h2 id=\"metadata\">" . wfMsgHtml( 'metadata' ) . "</h2>\n" );
80 $wgOut->addWikiText( $this->makeMetadataTable( $exif ) );
82 "<script type=\"text/javascript\" src=\"$wgStylePath/common/metadata.js\"></script>\n" .
83 "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" );
95 * @param bool $metadata Whether or not to show the metadata link
98 function showTOC( $metadata ) {
100 $r = '<ul id="filetoc">
101 <li><a href="#file">' . $wgLang->getNsText( NS_IMAGE
) . '</a></li>
102 <li><a href="#filehistory">' . wfMsgHtml( 'imghistory' ) . '</a></li>
103 <li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . '</a></li>' .
104 ($metadata ?
'<li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . '
110 * Make a table with metadata to be shown in the output page.
114 * @param array $exif The array containing the EXIF data
117 function makeMetadataTable( $exif ) {
118 $r = wfMsg( 'metadata-help' ) . "\n\n";
119 $r .= "{| id=mw_metadata class=mw_metadata\n";
120 $visibleFields = $this->visibleMetadataFields();
121 foreach( $exif as $k => $v ) {
122 $tag = strtolower( $k );
123 $msg = wfMsg( "exif-$tag" );
124 $class = "exif-$tag";
125 if( !in_array( $tag, $visibleFields ) ) {
126 $class .= ' collapsable';
128 $r .= "|- class=\"$class\"\n";
137 * Get a list of EXIF metadata items which should be displayed when
138 * the metadata table is collapsed.
140 * @return array of strings
143 function visibleMetadataFields() {
145 $lines = explode( "\n", wfMsgForContent( 'metadata-fields' ) );
146 foreach( $lines as $line ) {
147 if( preg_match( '/^\\*\s*(.*?)\s*$/', $line, $matches ) ) {
148 $fields[] = $matches[1];
155 * Overloading Article's getContent method.
157 * Omit noarticletext if sharedupload; text will be fetched from the
158 * shared upload server if possible.
160 function getContent() {
161 if( $this->img
&& $this->img
->fromSharedDirectory
&& 0 == $this->getID() ) {
164 return Article
::getContent();
167 function openShowImage() {
168 global $wgOut, $wgUser, $wgImageLimits, $wgRequest;
169 global $wgUseImageResize, $wgGenerateThumbnailOnParse;
171 $full_url = $this->img
->getURL();
175 if( $wgUser->getOption( 'imagesize' ) == '' ) {
176 $sizeSel = User
::getDefaultOption( 'imagesize' );
178 $sizeSel = intval( $wgUser->getOption( 'imagesize' ) );
180 if( !isset( $wgImageLimits[$sizeSel] ) ) {
181 $sizeSel = User
::getDefaultOption( 'imagesize' );
183 $max = $wgImageLimits[$sizeSel];
185 $maxHeight = $max[1];
186 $sk = $wgUser->getSkin();
188 if ( $this->img
->exists() ) {
190 $page = $wgRequest->getIntOrNull( 'page' );
191 if ( ! is_null( $page ) ) {
192 $this->img
->selectPage( $page );
196 $width = $this->img
->getWidth();
197 $height = $this->img
->getHeight();
200 if ( $this->img
->allowInlineDisplay() and $width and $height) {
203 # "Download high res version" link below the image
204 $msg = wfMsgHtml('showbigimage', $width, $height, intval( $this->img
->getSize()/1024 ) );
206 # We'll show a thumbnail of this image
207 if ( $width > $maxWidth ||
$height > $maxHeight ) {
208 # Calculate the thumbnail size.
209 # First case, the limiting factor is the width, not the height.
210 if ( $width / $height >= $maxWidth / $maxHeight ) {
211 $height = round( $height * $maxWidth / $width);
213 # Note that $height <= $maxHeight now.
215 $newwidth = floor( $width * $maxHeight / $height);
216 $height = round( $height * $newwidth / $width );
218 # Note that $height <= $maxHeight now, but might not be identical
219 # because of rounding.
222 if( $wgUseImageResize ) {
223 $thumbnail = $this->img
->getThumbnail( $width, -1, $wgGenerateThumbnailOnParse );
224 if ( $thumbnail == null ) {
225 $url = $this->img
->getViewURL();
227 $url = $thumbnail->getURL();
230 # No resize ability? Show the full image, but scale
231 # it down in the browser so it fits on the page.
232 $url = $this->img
->getViewURL();
234 $anchoropen = "<a href=\"{$full_url}\">";
235 $anchorclose = "</a><br />";
236 if( $this->img
->mustRender() ) {
239 $anchorclose .= "\n$anchoropen{$msg}</a>";
242 $url = $this->img
->getViewURL();
246 if ( $this->img
->isMultipage() ) {
247 $wgOut->addHTML( '<table class="multipageimage"><tr><td>' );
250 $wgOut->addHTML( '<div class="fullImageLink" id="file">' . $anchoropen .
251 "<img border=\"0\" src=\"{$url}\" width=\"{$width}\" height=\"{$height}\" alt=\"" .
252 htmlspecialchars( $wgRequest->getVal( 'image' ) ).'" />' . $anchorclose . '</div>' );
254 if ( $this->img
->isMultipage() ) {
255 $count = $this->img
->pageCount();
258 $label = $wgOut->parse( wfMsg( 'imgmultipageprev' ), false );
259 $link = $sk->makeLinkObj( $this->mTitle
, $label, 'page='. ($page-1) );
260 $this->img
->selectPage( $page - 1 );
261 $thumb1 = $sk->makeThumbLinkObj( $this->img
, $link, $label, 'none' );
266 if ( $page < $count ) {
267 $label = wfMsg( 'imgmultipagenext' );
268 $this->img
->selectPage( $page +
1 );
269 $link = $sk->makeLinkObj( $this->mTitle
, $label, 'page='. ($page+
1) );
270 $thumb2 = $sk->makeThumbLinkObj( $this->img
, $link, $label, 'none' );
275 $select = '<form name="pageselector" action="' . $this->img
->getEscapeLocalUrl( '' ) . '" method="GET" onchange="document.pageselector.submit();">' ;
276 $select .= $wgOut->parse( wfMsg( 'imgmultigotopre' ), false ) .
277 ' <select id="pageselector" name="page">';
278 for ( $i=1; $i <= $count; $i++
) {
279 $select .= Xml
::option( $wgLang->formatNum( $i ), $i,
282 $select .= '</select>' . $wgOut->parse( wfMsg( 'imgmultigotopost' ), false ) .
283 '<input type="submit" value="' .
284 htmlspecialchars( wfMsg( 'imgmultigo' ) ) . '"></form>';
286 $wgOut->addHTML( '</td><td><div class="multipageimagenavbox">' .
287 "$select<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>" );
290 #if direct link is allowed but it's not a renderable image, show an icon.
291 if ($this->img
->isSafeFile()) {
292 $icon= $this->img
->iconThumb();
294 $wgOut->addHTML( '<div class="fullImageLink" id="file"><a href="' . $full_url . '">' .
304 $filename = wfEscapeWikiText( $this->img
->getName() );
305 $info = wfMsg( 'fileinfo',
306 ceil($this->img
->getSize()/1024.0),
307 $this->img
->getMimeType() );
310 $dirmark = $wgContLang->getDirMark();
311 if (!$this->img
->isSafeFile()) {
312 $warning = wfMsg( 'mediawarning' );
313 $wgOut->addWikiText( <<<END
314 <div class="fullMedia">
315 <span class="dangerousLink">[[Media:$filename|$filename]]</span>$dirmark
316 <span class="fileInfo"> ($info)</span>
319 <div class="mediaWarning">$warning</div>
323 $wgOut->addWikiText( <<<END
324 <div class="fullMedia">
325 [[Media:$filename|$filename]]$dirmark <span class="fileInfo"> ($info)</span>
332 if($this->img
->fromSharedDirectory
) {
333 $this->printSharedImageText();
336 # Image does not exist
338 $title = Title
::makeTitle( NS_SPECIAL
, 'Upload' );
339 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
340 'wpDestFile=' . urlencode( $this->img
->getName() ) );
341 $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) );
345 function printSharedImageText() {
346 global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut, $wgUser;
348 $url = $wgRepositoryBaseUrl . urlencode($this->mTitle
->getDBkey());
349 $sharedtext = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml("sharedupload");
350 if ($wgRepositoryBaseUrl && !$wgFetchCommonsDescriptions) {
352 $sk = $wgUser->getSkin();
353 $title = Title
::makeTitle( NS_SPECIAL
, 'Upload' );
354 $link = $sk->makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'),
355 array( 'wpDestFile' => urlencode( $this->img
->getName() )));
356 $sharedtext .= " " . wfMsgWikiHtml('shareduploadwiki', $link);
358 $sharedtext .= "</div>";
359 $wgOut->addHTML($sharedtext);
361 if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) {
362 require_once("HttpFunctions.php");
363 $ur = ini_set('allow_url_fopen', true);
364 $text = wfGetHTTP($url . '?action=render');
365 ini_set('allow_url_fopen', $ur);
367 $this->mExtraDescription
= $text;
371 function getUploadUrl() {
373 $uploadTitle = Title
::makeTitle( NS_SPECIAL
, 'Upload' );
374 return $wgServer . $uploadTitle->getLocalUrl( 'wpDestFile=' . urlencode( $this->img
->getName() ) );
378 * Print out the various links at the bottom of the image page, e.g. reupload,
379 * external editing (and instructions link) etc.
381 function uploadLinksBox() {
382 global $wgUser, $wgOut;
384 if( $this->img
->fromSharedDirectory
)
387 $sk = $wgUser->getSkin();
389 $wgOut->addHtml( '<br /><ul>' );
391 # "Upload a new version of this file" link
392 if( $wgUser->isAllowed( 'reupload' ) ) {
393 $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
394 $wgOut->addHtml( "<li><div>{$ulink}</div></li>" );
397 # External editing link
398 $elink = $sk->makeKnownLinkObj( $this->mTitle
, wfMsg( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
399 $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
401 $wgOut->addHtml( '</ul>' );
404 function closeShowImage()
411 * If the page we've just displayed is in the "Image" namespace,
412 * we follow it with an upload history of the image and its usage.
414 function imageHistory()
416 global $wgUser, $wgOut, $wgUseExternalEditor;
418 $sk = $wgUser->getSkin();
420 $line = $this->img
->nextHistoryLine();
423 $list = new ImageHistoryList( $sk );
424 $s = $list->beginImageHistoryList() .
425 $list->imageHistoryLine( true, wfTimestamp(TS_MW
, $line->img_timestamp
),
426 $this->mTitle
->getDBkey(), $line->img_user
,
427 $line->img_user_text
, $line->img_size
, $line->img_description
,
428 $line->img_width
, $line->img_height
431 while ( $line = $this->img
->nextHistoryLine() ) {
432 $s .= $list->imageHistoryLine( false, $line->img_timestamp
,
433 $line->oi_archive_name
, $line->img_user
,
434 $line->img_user_text
, $line->img_size
, $line->img_description
,
435 $line->img_width
, $line->img_height
438 $s .= $list->endImageHistoryList();
440 $wgOut->addHTML( $s );
442 # Exist check because we don't want to show this on pages where an image
443 # doesn't exist along with the noimage message, that would suck. -ævar
444 if( $wgUseExternalEditor && $this->img
->exists() ) {
445 $this->uploadLinksBox();
450 function imageLinks()
452 global $wgUser, $wgOut;
454 $wgOut->addHTML( '<h2 id="filelinks">' . wfMsg( 'imagelinks' ) . "</h2>\n" );
456 $dbr =& wfGetDB( DB_SLAVE
);
457 $page = $dbr->tableName( 'page' );
458 $imagelinks = $dbr->tableName( 'imagelinks' );
460 $sql = "SELECT page_namespace,page_title FROM $imagelinks,$page WHERE il_to=" .
461 $dbr->addQuotes( $this->mTitle
->getDBkey() ) . " AND il_from=page_id";
462 $sql = $dbr->limitResult($sql, 500, 0);
463 $res = $dbr->query( $sql, "ImagePage::imageLinks" );
465 if ( 0 == $dbr->numRows( $res ) ) {
466 $wgOut->addHtml( '<p>' . wfMsg( "nolinkstoimage" ) . "</p>\n" );
469 $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) . "</p>\n<ul>" );
471 $sk = $wgUser->getSkin();
472 while ( $s = $dbr->fetchObject( $res ) ) {
473 $name = Title
::MakeTitle( $s->page_namespace
, $s->page_title
);
474 $link = $sk->makeKnownLinkObj( $name, "" );
475 $wgOut->addHTML( "<li>{$link}</li>\n" );
477 $wgOut->addHTML( "</ul>\n" );
482 global $wgUser, $wgOut, $wgRequest;
484 $confirm = $wgRequest->wasPosted();
485 $reason = $wgRequest->getVal( 'wpReason' );
486 $image = $wgRequest->getVal( 'image' );
487 $oldimage = $wgRequest->getVal( 'oldimage' );
489 # Only sysops can delete images. Previously ordinary users could delete
490 # old revisions, but this is no longer the case.
491 if ( !$wgUser->isAllowed('delete') ) {
492 $wgOut->permissionRequired( 'delete' );
495 if ( $wgUser->isBlocked() ) {
496 return $this->blockedIPpage();
498 if ( wfReadOnly() ) {
499 $wgOut->readOnlyPage();
503 # Better double-check that it hasn't been deleted yet!
504 $wgOut->setPagetitle( wfMsg( 'confirmdelete' ) );
505 if ( ( !is_null( $image ) )
506 && ( '' == trim( $image ) ) ) {
507 $wgOut->showFatalError( wfMsg( 'cannotdelete' ) );
511 $this->img
= new Image( $this->mTitle
);
513 # Deleting old images doesn't require confirmation
514 if ( !is_null( $oldimage ) ||
$confirm ) {
515 if( $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
516 $this->doDelete( $reason );
518 $wgOut->showFatalError( wfMsg( 'sessionfailure' ) );
523 if ( !is_null( $image ) ) {
524 $q = '&image=' . urlencode( $image );
525 } else if ( !is_null( $oldimage ) ) {
526 $q = '&oldimage=' . urlencode( $oldimage );
530 return $this->confirmDelete( $q, $wgRequest->getText( 'wpReason' ) );
535 * @param $reason User provided reason for deletion.
537 function doDelete( $reason ) {
538 global $wgOut, $wgRequest, $wgUseSquid;
539 global $wgPostCommitUpdateList;
541 $fname = 'ImagePage::doDelete';
543 $oldimage = $wgRequest->getVal( 'oldimage' );
545 $dbw =& wfGetDB( DB_MASTER
);
547 if ( !is_null( $oldimage ) ) {
548 if ( strlen( $oldimage ) < 16 ) {
549 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
552 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
553 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
556 if ( !$this->doDeleteOldImage( $oldimage ) ) {
559 $deleted = $oldimage;
561 $ok = $this->img
->delete( $reason );
563 # If the deletion operation actually failed, bug out:
564 $wgOut->showFileDeleteError( $this->img
->getName() );
568 # Image itself is now gone, and database is cleaned.
569 # Now we remove the image description page.
571 $article = new Article( $this->mTitle
);
572 $article->doDeleteArticle( $reason ); # ignore errors
574 $deleted = $this->img
->getName();
577 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
578 $wgOut->setRobotpolicy( 'noindex,nofollow' );
580 $loglink = '[[Special:Log/delete|' . wfMsg( 'deletionlog' ) . ']]';
581 $text = wfMsg( 'deletedtext', $deleted, $loglink );
583 $wgOut->addWikiText( $text );
585 $wgOut->returnToMain( false, $this->mTitle
->getPrefixedText() );
591 function doDeleteOldImage( $oldimage )
595 $ok = $this->img
->deleteOld( $oldimage, '' );
597 # If we actually have a file and can't delete it, throw an error.
598 # Something went awry...
599 $wgOut->showFileDeleteError( "$oldimage" );
602 $log = new LogPage( 'delete' );
603 $log->addEntry( 'delete', $this->mTitle
, wfMsg('deletedrevision',$oldimage) );
609 global $wgOut, $wgRequest, $wgUser;
611 $oldimage = $wgRequest->getText( 'oldimage' );
612 if ( strlen( $oldimage ) < 16 ) {
613 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
616 if ( strstr( $oldimage, "/" ) ||
strstr( $oldimage, "\\" ) ) {
617 $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) );
621 if ( wfReadOnly() ) {
622 $wgOut->readOnlyPage();
625 if( $wgUser->isAnon() ) {
626 $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
629 if ( ! $this->mTitle
->userCanEdit() ) {
630 $wgOut->readOnlyPage( $this->getContent(), true );
633 if ( $wgUser->isBlocked() ) {
634 return $this->blockedIPpage();
636 if( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ), $oldimage ) ) {
637 $wgOut->showErrorPage( 'internalerror', 'sessionfailure' );
640 $name = substr( $oldimage, 15 );
642 $dest = wfImageDir( $name );
643 $archive = wfImageArchiveDir( $name );
644 $curfile = "{$dest}/{$name}";
646 if ( !is_dir( $dest ) ) wfMkdirParents( $dest );
647 if ( !is_dir( $archive ) ) wfMkdirParents( $archive );
649 if ( ! is_file( $curfile ) ) {
650 $wgOut->showFileNotFoundError( htmlspecialchars( $curfile ) );
653 $oldver = wfTimestampNow() . "!{$name}";
655 $dbr =& wfGetDB( DB_SLAVE
);
656 $size = $dbr->selectField( 'oldimage', 'oi_size', array( 'oi_archive_name' => $oldimage ) );
658 if ( ! rename( $curfile, "${archive}/{$oldver}" ) ) {
659 $wgOut->showFileRenameError( $curfile, "${archive}/{$oldver}" );
662 if ( ! copy( "{$archive}/{$oldimage}", $curfile ) ) {
663 $wgOut->showFileCopyError( "${archive}/{$oldimage}", $curfile );
667 # Record upload and update metadata cache
668 $img = Image
::newFromName( $name );
669 $img->recordUpload( $oldver, wfMsg( "reverted" ) );
671 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
672 $wgOut->setRobotpolicy( 'noindex,nofollow' );
673 $wgOut->addHTML( wfMsg( 'imagereverted' ) );
675 $descTitle = $img->getTitle();
676 $wgOut->returnToMain( false, $descTitle->getPrefixedText() );
679 function blockedIPpage() {
680 $edit = new EditPage( $this );
681 return $edit->blockedIPpage();
685 * Override handling of action=purge
688 $this->img
= new Image( $this->mTitle
);
689 if( $this->img
->exists() ) {
690 wfDebug( "ImagePage::doPurge purging " . $this->img
->getName() . "\n" );
691 $update = new HTMLCacheUpdate( $this->mTitle
, 'imagelinks' );
693 $this->img
->purgeCache();
695 wfDebug( "ImagePage::doPurge no image\n" );
706 class ImageHistoryList
{
707 function ImageHistoryList( &$skin ) {
708 $this->skin
=& $skin;
711 function beginImageHistoryList() {
712 $s = "\n<h2 id=\"filehistory\">" . wfMsg( 'imghistory' ) . "</h2>\n" .
713 "<p>" . wfMsg( 'imghistlegend' ) . "</p>\n".'<ul class="special">';
717 function endImageHistoryList() {
722 function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description, $width, $height ) {
723 global $wgUser, $wgLang, $wgTitle, $wgContLang;
725 $datetime = $wgLang->timeanddate( $timestamp, true );
726 $del = wfMsg( 'deleteimg' );
727 $delall = wfMsg( 'deleteimgcompletely' );
728 $cur = wfMsg( 'cur' );
731 $url = Image
::imageUrl( $img );
733 if ( $wgUser->isAllowed('delete') ) {
734 $link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() .
736 $style = $this->skin
->getInternalLinkAttributes( $link, $delall );
738 $dlink = '<a href="'.$link.'"'.$style.'>'.$delall.'</a>';
743 $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
744 if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
745 $token = urlencode( $wgUser->editToken( $img ) );
746 $rlink = $this->skin
->makeKnownLinkObj( $wgTitle,
747 wfMsg( 'revertimg' ), 'action=revert&oldimage=' .
748 urlencode( $img ) . "&wpEditToken=$token" );
749 $dlink = $this->skin
->makeKnownLinkObj( $wgTitle,
750 $del, 'action=delete&oldimage=' . urlencode( $img ) .
751 "&wpEditToken=$token" );
753 # Having live active links for non-logged in users
754 # means that bots and spiders crawling our site can
755 # inadvertently change content. Baaaad idea.
756 $rlink = wfMsg( 'revertimg' );
761 $userlink = $this->skin
->userLink( $user, $usertext ) . $this->skin
->userToolLinks( $user, $usertext );
762 $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
763 $wgLang->formatNum( $size ) );
764 $widthheight = wfMsg( 'widthheight', $width, $height );
765 $style = $this->skin
->getInternalLinkAttributes( $url, $datetime );
767 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a> . . {$userlink} . . {$widthheight} ({$nbytes})";
769 $s .= $this->skin
->commentBlock( $description, $wgTitle );