MediaWiki REL1_34
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}
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
if( $line===false) $args
Definition cdb.php:64
Basic media transform error class.
__construct( $msg, $width, $height,... $args)
toHtml( $options=[])
Fetch HTML for this transform output.
isError()
This will be overridden to return true in error classes.
Base class for the output of MediaHandler::doTransform() and File::transform().
The Message class provides methods which fulfil two basic services:
Definition Message.php:162