Index: trunk/extensions/OggHandler/OggHandler_body.php |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | return array( |
26 | 26 | 'img_width' => 'width', |
27 | 27 | 'ogg_noplayer' => 'noplayer', |
| 28 | + 'ogg_noicon' => 'noicon', |
28 | 29 | 'ogg_thumbtime' => 'thumbtime', |
29 | 30 | ); |
30 | 31 | } |
— | — | @@ -178,6 +179,7 @@ |
179 | 180 | $height = $srcWidth == 0 ? $srcHeight : $width * $srcHeight / $srcWidth; |
180 | 181 | $length = $this->getLength( $file ); |
181 | 182 | $noPlayer = isset( $params['noplayer'] ); |
| 183 | + $noIcon = isset( $params['noicon'] ); |
182 | 184 | |
183 | 185 | if ( !$noPlayer ) { |
184 | 186 | // Hack for miscellaneous callers |
— | — | @@ -204,7 +206,7 @@ |
205 | 207 | } else { |
206 | 208 | $width = $params['width']; |
207 | 209 | } |
208 | | - return new OggAudioDisplay( $file, $file->getURL(), $width, $height, $length, $dstPath ); |
| 210 | + return new OggAudioDisplay( $file, $file->getURL(), $width, $height, $length, $dstPath, $noIcon ); |
209 | 211 | } |
210 | 212 | |
211 | 213 | // Video thumbnail only |
— | — | @@ -450,7 +452,9 @@ |
451 | 453 | class OggTransformOutput extends MediaTransformOutput { |
452 | 454 | static $serial = 0; |
453 | 455 | |
454 | | - function __construct( $file, $videoUrl, $thumbUrl, $width, $height, $length, $isVideo, $path ) { |
| 456 | + function __construct( $file, $videoUrl, $thumbUrl, $width, $height, $length, $isVideo, |
| 457 | + $path, $noIcon = false ) |
| 458 | + { |
455 | 459 | $this->file = $file; |
456 | 460 | $this->videoUrl = $videoUrl; |
457 | 461 | $this->url = $thumbUrl; |
— | — | @@ -459,6 +463,7 @@ |
460 | 464 | $this->length = round( $length ); |
461 | 465 | $this->isVideo = $isVideo; |
462 | 466 | $this->path = $path; |
| 467 | + $this->noIcon = $noIcon; |
463 | 468 | } |
464 | 469 | |
465 | 470 | function toHtml( $options = array() ) { |
— | — | @@ -502,7 +507,7 @@ |
503 | 508 | } else { |
504 | 509 | // make an icon later if necessary |
505 | 510 | $imgAttribs = false; |
506 | | - $showDescIcon = true; |
| 511 | + $showDescIcon = !$this->noIcon; |
507 | 512 | //$thumbDivAttribs = array( 'style' => 'text-align: right;' ); |
508 | 513 | } |
509 | 514 | $msgStartPlayer = wfMsg( 'ogg-play-sound' ); |
— | — | @@ -525,9 +530,11 @@ |
526 | 531 | $descIcon = Xml::tags( 'a', $linkAttribs, |
527 | 532 | Xml::element( 'img', $imgAttribs, null ) ); |
528 | 533 | $thumb = ''; |
529 | | - } else { |
| 534 | + } elseif ( $imgAttribs ) { |
530 | 535 | $thumb = Xml::tags( 'a', $linkAttribs, |
531 | 536 | Xml::element( 'img', $imgAttribs, null ) ); |
| 537 | + } else { |
| 538 | + $thumb = ''; |
532 | 539 | } |
533 | 540 | $linkUrl = $linkAttribs['href']; |
534 | 541 | } else { |
— | — | @@ -582,13 +589,13 @@ |
583 | 590 | |
584 | 591 | class OggVideoDisplay extends OggTransformOutput { |
585 | 592 | function __construct( $file, $videoUrl, $thumbUrl, $width, $height, $length, $path ) { |
586 | | - parent::__construct( $file, $videoUrl, $thumbUrl, $width, $height, $length, true, $path ); |
| 593 | + parent::__construct( $file, $videoUrl, $thumbUrl, $width, $height, $length, true, $path, false ); |
587 | 594 | } |
588 | 595 | } |
589 | 596 | |
590 | 597 | class OggAudioDisplay extends OggTransformOutput { |
591 | | - function __construct( $file, $videoUrl, $width, $height, $length, $path ) { |
592 | | - parent::__construct( $file, $videoUrl, false, $width, $height, $length, false, $path ); |
| 598 | + function __construct( $file, $videoUrl, $width, $height, $length, $path, $noIcon = false ) { |
| 599 | + parent::__construct( $file, $videoUrl, false, $width, $height, $length, false, $path, $noIcon ); |
593 | 600 | } |
594 | 601 | } |
595 | 602 | |
Index: trunk/extensions/OggHandler/OggHandler.i18n.php |
— | — | @@ -266,6 +266,7 @@ |
267 | 267 | $magicWords = array( |
268 | 268 | 'en' => array( |
269 | 269 | 'ogg_noplayer' => array( 0, 'noplayer' ), |
| 270 | + 'ogg_noicon' => array( 0, 'noicon' ), |
270 | 271 | 'ogg_thumbtime' => array( 0, 'thumbtime=$1' ), |
271 | 272 | ), |
272 | 273 | ); |