* @ingroup Media
*/
abstract class MediaTransformOutput {
- var $file, $width, $height, $url, $page, $path;
+ /**
+ * @var File
+ */
+ var $file;
+
+ var $width, $height, $url, $page, $path;
/**
* Get the width of the output box
* @param $page Integer: page number, for multipage files
* @private
*/
- function ThumbnailImage( $file, $url, $width, $height, $path = false, $page = false ) {
+ function __construct( $file, $url, $width, $height, $path = false, $page = false ) {
$this->file = $file;
$this->url = $url;
# These should be integers when they get here.
* desc-query String, description link query params
* custom-url-link Custom URL to link to
* custom-title-link Custom Title object to link to
+ * custom target-link Value of the target attribute, for custom-target-link
*
* For images, desc-link and file-link are implemented as a click-through. For
* sounds and videos, they may be displayed in other ways.
if ( !empty( $options['title'] ) ) {
$linkAttribs['title'] = $options['title'];
}
+ if ( !empty( $options['custom-target-link'] ) ) {
+ $linkAttribs['target'] = $options['custom-target-link'];
+ }
} elseif ( !empty( $options['custom-title-link'] ) ) {
$title = $options['custom-title-link'];
$linkAttribs = array(
$htmlArgs = array_map( 'htmlspecialchars', $args );
$htmlArgs = array_map( 'nl2br', $htmlArgs );
- $this->htmlMsg = wfMsgReplaceArgs( htmlspecialchars( wfMsgGetKey( $msg, true ) ), $htmlArgs );
- $this->textMsg = wfMsgReal( $msg, $args );
+ $this->htmlMsg = wfMessage( $msg )->rawParams( $htmlArgs )->escaped();
+ $this->textMsg = wfMessage( $msg )->rawParams( $htmlArgs )->text();
$this->width = intval( $width );
$this->height = intval( $height );
$this->url = false;