MediaWiki  master
MediaTransformError.php
Go to the documentation of this file.
1 <?php
31  private $msg;
32 
33  function __construct( $msg, $width, $height, ...$args ) {
34  $this->msg = wfMessage( $msg )->params( $args );
35  $this->width = intval( $width );
36  $this->height = intval( $height );
37  $this->url = false;
38  $this->path = false;
39  }
40 
41  function toHtml( $options = [] ) {
42  return "<div class=\"MediaTransformError\" style=\"" .
43  "width: {$this->width}px; height: {$this->height}px; display:inline-block;\">" .
44  $this->getHtmlMsg() .
45  "</div>";
46  }
47 
48  function toText() {
49  return $this->msg->text();
50  }
51 
52  function getHtmlMsg() {
53  return $this->msg->escaped();
54  }
55 
56  function getMsg() {
57  return $this->msg;
58  }
59 
60  function isError() {
61  return true;
62  }
63 
64  function getHttpStatusCode() {
65  return 500;
66  }
67 }
MediaTransformError\isError
isError()
This will be overridden to return true in error classes.
Definition: MediaTransformError.php:60
MediaTransformError
Basic media transform error class.
Definition: MediaTransformError.php:29
MediaTransformError\$msg
Message $msg
Definition: MediaTransformError.php:31
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition: GlobalFunctions.php:1263
MediaTransformError\__construct
__construct( $msg, $width, $height,... $args)
Definition: MediaTransformError.php:33
Message
MediaTransformError\getHtmlMsg
getHtmlMsg()
Definition: MediaTransformError.php:52
$args
if( $line===false) $args
Definition: mcc.php:124
MediaTransformError\toHtml
toHtml( $options=[])
Fetch HTML for this transform output.
Definition: MediaTransformError.php:41
MediaTransformOutput\$height
int $height
Image height.
Definition: MediaTransformOutput.php:42
MediaTransformError\getMsg
getMsg()
Definition: MediaTransformError.php:56
MediaTransformOutput
Base class for the output of MediaHandler::doTransform() and File::transform().
Definition: MediaTransformOutput.php:29
MediaTransformError\toText
toText()
Definition: MediaTransformError.php:48
MediaTransformError\getHttpStatusCode
getHttpStatusCode()
Definition: MediaTransformError.php:64
MediaTransformOutput\$width
int $width
Image width.
Definition: MediaTransformOutput.php:39