MediaWiki  REL1_19
MediaTransformOutput Class Reference

Base class for the output of MediaHandler::doTransform() and File::transform(). More...

Inheritance diagram for MediaTransformOutput:

List of all members.

Public Member Functions

 fileIsSource ()
 Check if the output thumbnail is the same as the source.
 getDescLinkAttribs ($title=null, $params= '')
 getHeight ()
 Get the height of the output box.
 getLocalCopyPath ()
 Get the path of a file system copy of the thumbnail.
 getStoragePath ()
 getUrl ()
 getWidth ()
 Get the width of the output box.
 hasFile ()
 Check if an output thumbnail file actually exists.
 isError ()
 This will be overridden to return true in error classes.
 setStoragePath ($storagePath)
 streamFile ($headers=array())
 Stream the file if there were no errors.
 toHtml ($options=array())
 Fetch HTML for this transform output.

Public Attributes

 $file
 $height
 $page
 $path
 $url
 $width

Protected Member Functions

 linkWrap ($linkAttribs, $contents)
 Wrap some XHTML text in an anchor tag with the given attributes.

Protected Attributes

 $storagePath = false

Detailed Description

Base class for the output of MediaHandler::doTransform() and File::transform().

Definition at line 14 of file MediaTransformOutput.php.


Member Function Documentation

Check if the output thumbnail is the same as the source.

This can occur if the requested width was bigger than the source.

Returns:
Bool

Definition at line 108 of file MediaTransformOutput.php.

References isError().

Here is the call graph for this function:

MediaTransformOutput::getDescLinkAttribs ( title = null,
params = '' 
)
Parameters:
$titlestring
$paramsarray
Returns:
array

Definition at line 159 of file MediaTransformOutput.php.

References $title.

Referenced by ThumbnailImage\toHtml().

Here is the caller graph for this function:

Get the height of the output box.

Definition at line 33 of file MediaTransformOutput.php.

Get the path of a file system copy of the thumbnail.

Callers should never write to this path.

Returns:
string|false Returns false if there isn't one

Definition at line 118 of file MediaTransformOutput.php.

References isError().

Referenced by streamFile().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
string|false The permanent thumbnail storage path

Definition at line 47 of file MediaTransformOutput.php.

Returns:
string The thumbnail URL

Definition at line 40 of file MediaTransformOutput.php.

Get the width of the output box.

Definition at line 26 of file MediaTransformOutput.php.

Check if an output thumbnail file actually exists.

This will return false if there was an error, the thumbnail is to be handled client-side only, or if transformation was deferred via TRANSFORM_LATER.

Returns:
Bool

Definition at line 96 of file MediaTransformOutput.php.

References isError().

Here is the call graph for this function:

This will be overridden to return true in error classes.

Reimplemented in MediaTransformError.

Definition at line 84 of file MediaTransformOutput.php.

Referenced by fileIsSource(), getLocalCopyPath(), and hasFile().

Here is the caller graph for this function:

MediaTransformOutput::linkWrap ( linkAttribs,
contents 
) [protected]

Wrap some XHTML text in an anchor tag with the given attributes.

Parameters:
$linkAttribsarray
$contentsstring
Returns:
string

Definition at line 146 of file MediaTransformOutput.php.

References Xml\tags().

Referenced by ThumbnailImage\toHtml().

Here is the call graph for this function:

Here is the caller graph for this function:

Parameters:
$storagePathstring The permanent storage path
Returns:
void

Definition at line 55 of file MediaTransformOutput.php.

References $storagePath.

MediaTransformOutput::streamFile ( headers = array())

Stream the file if there were no errors.

Parameters:
$headersArray Additional HTTP headers to send on success
Returns:
Bool success

Definition at line 134 of file MediaTransformOutput.php.

References getLocalCopyPath(), and StreamFile\stream().

Here is the call graph for this function:

MediaTransformOutput::toHtml ( options = array()) [abstract]

Fetch HTML for this transform output.

Parameters:
$optionsarray Associative array of options. Boolean options should be indicated with a value of true for true, and false or absent for false.

alt Alternate text or caption desc-link Boolean, show a description link file-link Boolean, show a file download link custom-url-link Custom URL to link to custom-title-link Custom Title object to link to valign vertical-align property, if the output is an inline element img-class Class applied to the tag, if there is such a tag

For images, desc-link and file-link are implemented as a click-through. For sounds and videos, they may be displayed in other ways.

Returns:
string

Reimplemented in MediaTransformError, and ThumbnailImage.


Member Data Documentation

MediaTransformOutput::$file

Definition at line 18 of file MediaTransformOutput.php.

Referenced by ThumbnailImage\__construct().

MediaTransformOutput::$height

Reimplemented in MediaTransformError.

Definition at line 20 of file MediaTransformOutput.php.

Referenced by ThumbnailImage\__construct().

MediaTransformOutput::$page

Definition at line 20 of file MediaTransformOutput.php.

Referenced by ThumbnailImage\__construct().

MediaTransformOutput::$path

Reimplemented in MediaTransformError.

Definition at line 20 of file MediaTransformOutput.php.

Referenced by ThumbnailImage\__construct().

MediaTransformOutput::$storagePath = false [protected]

Definition at line 21 of file MediaTransformOutput.php.

Referenced by setStoragePath().

MediaTransformOutput::$url

Reimplemented in MediaTransformError.

Definition at line 20 of file MediaTransformOutput.php.

Referenced by ThumbnailImage\__construct().

MediaTransformOutput::$width

Reimplemented in MediaTransformError.

Definition at line 20 of file MediaTransformOutput.php.

Referenced by ThumbnailImage\__construct().


The documentation for this class was generated from the following file: