Go to the documentation of this file.
152 return ( !$this->
isError() && ( $this->path || $this->path ===
null ) );
162 return ( !$this->
isError() && $this->path ===
null );
174 } elseif ( $this->path ===
null ) {
175 return $this->
file->getLocalRefPath();
177 $be = $this->
file->getRepo()->getBackend();
179 $fsFile = $be->getLocalReference(
array(
'src' => $this->path ) );
181 return $fsFile ? $fsFile->getPath() :
false;
194 if ( !$this->path ) {
197 $be = $this->
file->getRepo()->getBackend();
199 return $be->streamFile(
array(
'src' => $this->path,
'headers' => $headers ) )->isOK();
212 protected function linkWrap( $linkAttribs, $contents ) {
213 if ( $linkAttribs ) {
214 return Xml::tags(
'a', $linkAttribs, $contents );
231 if ( $this->
page && $this->
page !== 1 ) {
243 'href' => $this->
file->getTitle()->getLocalURL(
$query ),
273 # Previous parameters:
274 # $file, $url, $width, $height, $path = false, $page = false
281 if ( is_array( $parameters ) ) {
282 $actualParams = $parameters + $defaults;
284 # Using old format, should convert. Later a warning could be added here.
285 $numArgs = func_num_args();
286 $actualParams =
array(
288 'height' => $parameters,
289 'page' => ( $numArgs > 5 ) ? func_get_arg( 5 ) :
false
291 $path = ( $numArgs > 4 ) ? func_get_arg( 4 ) :
false;
298 # These should be integers when they get here.
299 # If not, there's a bug somewhere. But let's at
300 # least produce valid HTML code regardless.
301 $this->width = round( $actualParams[
'width'] );
302 $this->height = round( $actualParams[
'height'] );
304 $this->
page = $actualParams[
'page'];
305 $this->lang = $actualParams[
'lang'];
341 if ( count( func_get_args() ) == 2 ) {
342 throw new MWException( __METHOD__ .
' called in the old style' );
349 if ( !empty(
$options[
'custom-url-link'] ) ) {
350 $linkAttribs =
array(
'href' =>
$options[
'custom-url-link'] );
351 if ( !empty(
$options[
'title'] ) ) {
352 $linkAttribs[
'title'] =
$options[
'title'];
354 if ( !empty(
$options[
'custom-target-link'] ) ) {
355 $linkAttribs[
'target'] =
$options[
'custom-target-link'];
356 } elseif ( !empty(
$options[
'parser-extlink-target'] ) ) {
357 $linkAttribs[
'target'] =
$options[
'parser-extlink-target'];
359 if ( !empty(
$options[
'parser-extlink-rel'] ) ) {
360 $linkAttribs[
'rel'] =
$options[
'parser-extlink-rel'];
362 } elseif ( !empty(
$options[
'custom-title-link'] ) ) {
365 $linkAttribs =
array(
366 'href' =>
$title->getLinkURL(),
369 } elseif ( !empty(
$options[
'desc-link'] ) ) {
374 } elseif ( !empty(
$options[
'file-link'] ) ) {
375 $linkAttribs =
array(
'href' => $this->
file->getURL() );
377 $linkAttribs =
false;
385 if ( empty(
$options[
'no-dimensions'] ) ) {
389 if ( !empty(
$options[
'valign'] ) ) {
390 $attribs[
'style'] =
"vertical-align: {$options['valign']}";
392 if ( !empty(
$options[
'img-class'] ) ) {
395 if ( isset(
$options[
'override-height'] ) ) {
398 if ( isset(
$options[
'override-width'] ) ) {
403 if ( !empty( $this->responsiveUrls ) ) {
426 $args = array_slice( func_get_args(), 3 );
427 $htmlArgs = array_map(
'htmlspecialchars',
$args );
428 $htmlArgs = array_map(
'nl2br', $htmlArgs );
430 $this->htmlMsg =
wfMessage( $msg )->rawParams( $htmlArgs )->escaped();
431 $this->textMsg =
wfMessage( $msg )->rawParams( $htmlArgs )->text();
432 $this->width = intval(
$width );
433 $this->height = intval(
$height );
439 return "<div class=\"MediaTransformError\" style=\"" .
440 "width: {$this->width}px; height: {$this->height}px; display:inline-block;\">" .
465 parent::__construct(
'thumbnail_error',
static srcSet( $urls)
Generate a srcset attribute value from an array mapping pixel densities to URLs.
Media transform output for images.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
toHtml( $options=array())
Return HTML.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing we can concentrate it all in an extension file
static stream( $fname, $headers=array(), $sendErrors=true)
Stream a file to the browser, adding all the headings and fun stuff.
Implements some public methods and some protected utility functions which are required by multiple ch...
static isStoragePath( $path)
Check if a given path is a "mwstore://" path.
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 after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
processing should stop and the error should be shown to the user * false
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
presenting them properly to the user as errors is done by the caller $title
__construct( $file, $url, $path=false, $parameters=array())
Get a thumbnail object from a file and parameters.
static extensionFromPath( $path)
Get the final extension from a storage or FS path.
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
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
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values my talk page
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes two arrays as input, and returns a CGI-style string, e.g.