r24929 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24928‎ | r24929 | r24930 >
Date:02:14, 20 August 2007
Author:robchurch
Status:old
Tags:
Comment:
Fix captions when size specified
Modified paths:
  • /trunk/extensions/RandomImage/RandomImage.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RandomImage/RandomImage.class.php
@@ -10,7 +10,7 @@
1111
1212 private $parser = null;
1313
14 - private $width = 'thumb';
 14+ private $width = false;
1515 private $float = false;
1616 private $caption = '';
1717
@@ -38,7 +38,7 @@
3939 if( isset( $options['size'] ) ) {
4040 $size = intval( $options['size'] );
4141 if( $size > 0 )
42 - $this->width = "{$size}px";
 42+ $this->width = $size;
4343 }
4444 if( isset( $options['float'] ) ) {
4545 $float = strtolower( $options['float'] );
@@ -83,6 +83,12 @@
8484 */
8585 protected function buildMarkup( $image ) {
8686 $parts[] = $image->getTitle()->getPrefixedText();
 87+ if( $this->width !== false ) {
 88+ $parts[] = "{$this->width}px";
 89+ $parts[] = 'frame';
 90+ } else {
 91+ $parts[] = 'thumb';
 92+ }
8793 $parts[] = $this->width;
8894 if( $this->float )
8995 $parts[] = $this->float;

Status & tagging log