r75499 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75498‎ | r75499 | r75500 >
Date:01:50, 27 October 2010
Author:hartman
Status:resolved (Comments)
Tags:
Comment:
Make the image page more consistent. Now all pages will have the fullMedia div. (with link, and file description)
Perhaps we should move the "Size of this preview:" and "No higher resolution available" markers into that div as well ? Feedback welcome.
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -364,20 +364,15 @@
365365 );
366366 } else {
367367 # Image is small enough to show full size on image page
368 - $msgbig = htmlspecialchars( $this->displayImg->getName() );
369368 $msgsmall = wfMsgExt( 'file-nohires', array( 'parseinline' ) );
370369 }
371370
372371 $params['width'] = $width;
373372 $thumbnail = $this->displayImg->transform( $params );
374373
375 - $anchorclose = "<br />";
376 - if ( $this->displayImg->mustRender() ) {
377 - $showLink = true;
378 - } else {
379 - $anchorclose .=
380 - $msgsmall .
381 - '<br />' . Xml::tags( 'a', $linkAttribs, $msgbig ) . "$dirmark " . $longDesc;
 374+ $showLink = true;
 375+ if ( !$this->displayImg->mustRender() ) {
 376+ $anchorclose = "<br />" . $msgsmall;
382377 }
383378
384379 $isMulti = $this->displayImg->isMultipage() && $this->displayImg->pageCount() > 1;
@@ -469,7 +464,11 @@
470465
471466 if ( $showLink ) {
472467 $filename = wfEscapeWikiText( $this->displayImg->getName() );
473 - $medialink = "[[Media:$filename|$filename]]";
 468+ $linktext = $filename;
 469+ if ( isset( $msgbig ) ) {
 470+ $linktext = wfEscapeWikiText( $msgbig );
 471+ }
 472+ $medialink = "[[Media:$filename|$linktext]]";
474473
475474 if ( !$this->displayImg->isSafeFile() ) {
476475 $warning = wfMsgNoTrans( 'mediawarning' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r75513Follow-up r75499: initialise $anchorclose to prevent PHP Notice: Undefined va...siebrand11:18, 27 October 2010

Comments

#Comment by Reedy (talk | contribs)   11:13, 27 October 2010

-rakkaus/#mediawiki-i18n- [27-Oct-2010 11:12:00] PHP Notice: Undefined variable: anchorclose in /www/w/includes/ImagePage.php on line 390

Status & tagging log