45 # Previous parameters:
46 # $file, $url, $width, $height, $path = false, $page = false
54 $actualParams = $parameters + $defaults;
56 # Using old format, should convert. Later a warning could be added here.
60 'height' => $parameters,
70 # These should be integers when they get here.
71 # If not, there's a bug somewhere. But let's at
72 # least produce valid HTML code regardless.
73 $this->
width =
round( $actualParams[
'width'] );
74 $this->height =
round( $actualParams[
'height'] );
76 $this->page = $actualParams[
'page'];
77 $this->lang = $actualParams[
'lang'];
116 throw new MWException( __METHOD__ .
' called in the old style' );
126 'decoding' =>
'async',
129 $elementTimingName =
'thumbnail';
132 && !self::$firstNonIconImageRendered
133 && $this->
width * $this->height > 100 * 100 ) {
134 self::$firstNonIconImageRendered =
true;
137 $elementTimingName =
'thumbnail-high';
144 if ( !empty(
$options[
'custom-url-link'] ) ) {
145 $linkAttribs = [
'href' =>
$options[
'custom-url-link'] ];
146 if ( !empty(
$options[
'title'] ) ) {
147 $linkAttribs[
'title'] =
$options[
'title'];
149 if ( !empty(
$options[
'custom-target-link'] ) ) {
150 $linkAttribs[
'target'] =
$options[
'custom-target-link'];
152 $linkAttribs[
'target'] =
$options[
'parser-extlink-target'];
154 if ( !empty(
$options[
'parser-extlink-rel'] ) ) {
155 $linkAttribs[
'rel'] =
$options[
'parser-extlink-rel'];
159 $title =
$options[
'custom-title-link'];
161 'href' => $title->getLinkURL(),
162 'title' => empty(
$options[
'title'] ) ? $title->getFullText() :
$options[
'title']
170 $linkAttribs = [
'href' => $this->file->getUrl() ];
172 $linkAttribs =
false;
173 if ( !empty(
$options[
'title'] ) ) {
178 if ( empty(
$options[
'no-dimensions'] ) ) {
182 if ( !empty(
$options[
'valign'] ) ) {
183 $attribs[
'style'] =
"vertical-align: {$options['valign']}";
185 if ( !empty(
$options[
'img-class'] ) ) {
202 Hooks::run(
'ThumbnailBeforeProduceHTML', [ $this, &
$attribs, &$linkAttribs ] );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
bool $wgPriorityHints
Enable client-side Priority Hints.
bool $wgElementTiming
Enable Element Timing.
Media transform output for images.
__construct( $file, $url, $path=false, $parameters=[])
Get a thumbnail object from a file and parameters.
toHtml( $options=[])
Return HTML.
static $firstNonIconImageRendered
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
processing should stop and the error should be shown to the user * false