Update Skin.php to not call the now-separate Linker methods via $this->foo().
[lhc/web/wiklou.git] / includes / media / MediaTransformOutput.php
index 927db92..b729dd1 100644 (file)
  * @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
@@ -115,7 +120,7 @@ class ThumbnailImage extends MediaTransformOutput {
         * @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.
@@ -144,6 +149,7 @@ class ThumbnailImage extends MediaTransformOutput {
         *     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.
@@ -164,6 +170,9 @@ class ThumbnailImage extends MediaTransformOutput {
                        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(
@@ -208,8 +217,8 @@ class MediaTransformError extends MediaTransformOutput {
                $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;