2007-04-20 12:31:36 +00:00
|
|
|
<?php
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
/**
|
2010-08-15 17:27:41 +00:00
|
|
|
* Base class for the output of file transformation methods.
|
|
|
|
|
*
|
2012-05-03 20:13:10 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @file
|
|
|
|
|
* @ingroup Media
|
|
|
|
|
*/
|
2007-04-20 12:31:36 +00:00
|
|
|
|
|
|
|
|
/**
|
2007-05-30 21:02:32 +00:00
|
|
|
* Base class for the output of MediaHandler::doTransform() and File::transform().
|
2007-04-24 06:53:31 +00:00
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Media
|
2007-04-20 12:31:36 +00:00
|
|
|
*/
|
|
|
|
|
abstract class MediaTransformOutput {
|
2011-02-18 23:34:24 +00:00
|
|
|
/**
|
|
|
|
|
* @var File
|
|
|
|
|
*/
|
|
|
|
|
var $file;
|
|
|
|
|
|
|
|
|
|
var $width, $height, $url, $page, $path;
|
2012-01-05 01:58:05 +00:00
|
|
|
protected $storagePath = false;
|
2007-08-31 02:51:23 +00:00
|
|
|
|
2007-04-20 12:31:36 +00:00
|
|
|
/**
|
|
|
|
|
* Get the width of the output box
|
|
|
|
|
*/
|
2011-12-20 03:52:06 +00:00
|
|
|
public function getWidth() {
|
2007-04-20 12:31:36 +00:00
|
|
|
return $this->width;
|
2008-04-14 07:45:50 +00:00
|
|
|
}
|
2007-04-20 12:31:36 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the height of the output box
|
|
|
|
|
*/
|
2011-12-20 03:52:06 +00:00
|
|
|
public function getHeight() {
|
2007-04-20 12:31:36 +00:00
|
|
|
return $this->height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string The thumbnail URL
|
|
|
|
|
*/
|
2011-12-20 03:52:06 +00:00
|
|
|
public function getUrl() {
|
2007-04-20 12:31:36 +00:00
|
|
|
return $this->url;
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-05 01:58:05 +00:00
|
|
|
/**
|
2012-02-09 17:41:50 +00:00
|
|
|
* @return string|bool The permanent thumbnail storage path
|
2012-01-05 01:58:05 +00:00
|
|
|
*/
|
|
|
|
|
public function getStoragePath() {
|
|
|
|
|
return $this->storagePath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param $storagePath string The permanent storage path
|
2012-01-12 19:41:18 +00:00
|
|
|
* @return void
|
2012-01-05 01:58:05 +00:00
|
|
|
*/
|
|
|
|
|
public function setStoragePath( $storagePath ) {
|
|
|
|
|
$this->storagePath = $storagePath;
|
|
|
|
|
}
|
|
|
|
|
|
2007-04-20 12:31:36 +00:00
|
|
|
/**
|
|
|
|
|
* Fetch HTML for this transform output
|
2007-08-31 02:51:23 +00:00
|
|
|
*
|
2011-05-28 18:59:42 +00:00
|
|
|
* @param $options array Associative array of options. Boolean options
|
2008-04-14 07:45:50 +00:00
|
|
|
* should be indicated with a value of true for true, and false or
|
2007-08-31 02:51:23 +00:00
|
|
|
* absent for false.
|
|
|
|
|
*
|
|
|
|
|
* alt Alternate text or caption
|
|
|
|
|
* desc-link Boolean, show a description link
|
|
|
|
|
* file-link Boolean, show a file download link
|
2008-10-06 05:55:27 +00:00
|
|
|
* custom-url-link Custom URL to link to
|
|
|
|
|
* custom-title-link Custom Title object to link to
|
2007-08-31 02:51:23 +00:00
|
|
|
* valign vertical-align property, if the output is an inline element
|
|
|
|
|
* img-class Class applied to the <img> tag, if there is such a tag
|
|
|
|
|
*
|
2008-04-14 07:45:50 +00:00
|
|
|
* For images, desc-link and file-link are implemented as a click-through. For
|
|
|
|
|
* sounds and videos, they may be displayed in other ways.
|
2007-08-31 02:51:23 +00:00
|
|
|
*
|
|
|
|
|
* @return string
|
2007-04-20 12:31:36 +00:00
|
|
|
*/
|
2011-12-20 03:52:06 +00:00
|
|
|
abstract public function toHtml( $options = array() );
|
2007-04-20 12:31:36 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This will be overridden to return true in error classes
|
2012-02-09 21:35:05 +00:00
|
|
|
* @return bool
|
2007-04-20 12:31:36 +00:00
|
|
|
*/
|
2011-12-20 03:52:06 +00:00
|
|
|
public function isError() {
|
2007-04-20 12:31:36 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2011-12-20 03:52:06 +00:00
|
|
|
/**
|
2012-02-01 04:44:08 +00:00
|
|
|
* Check if an output thumbnail file actually exists.
|
2011-12-20 03:52:06 +00:00
|
|
|
* This will return false if there was an error, the
|
2012-02-01 04:44:08 +00:00
|
|
|
* thumbnail is to be handled client-side only, or if
|
2011-12-20 03:52:06 +00:00
|
|
|
* transformation was deferred via TRANSFORM_LATER.
|
2012-02-01 04:44:08 +00:00
|
|
|
*
|
2011-12-20 03:52:06 +00:00
|
|
|
* @return Bool
|
|
|
|
|
*/
|
|
|
|
|
public function hasFile() {
|
2012-02-01 04:44:08 +00:00
|
|
|
// If TRANSFORM_LATER, $this->path will be false.
|
|
|
|
|
// Note: a null path means "use the source file".
|
|
|
|
|
return ( !$this->isError() && ( $this->path || $this->path === null ) );
|
2011-12-20 03:52:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-02-01 04:44:08 +00:00
|
|
|
* Check if the output thumbnail is the same as the source.
|
2011-12-20 03:52:06 +00:00
|
|
|
* This can occur if the requested width was bigger than the source.
|
|
|
|
|
*
|
|
|
|
|
* @return Bool
|
|
|
|
|
*/
|
|
|
|
|
public function fileIsSource() {
|
2012-02-01 04:44:08 +00:00
|
|
|
return ( !$this->isError() && $this->path === null );
|
2011-12-20 03:52:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-02-01 04:44:08 +00:00
|
|
|
* Get the path of a file system copy of the thumbnail.
|
|
|
|
|
* Callers should never write to this path.
|
2011-12-20 03:52:06 +00:00
|
|
|
*
|
2012-02-09 17:41:50 +00:00
|
|
|
* @return string|bool Returns false if there isn't one
|
2011-12-20 03:52:06 +00:00
|
|
|
*/
|
|
|
|
|
public function getLocalCopyPath() {
|
2012-02-01 04:44:08 +00:00
|
|
|
if ( $this->isError() ) {
|
|
|
|
|
return false;
|
|
|
|
|
} elseif ( $this->path === null ) {
|
|
|
|
|
return $this->file->getLocalRefPath();
|
|
|
|
|
} else {
|
|
|
|
|
return $this->path; // may return false
|
|
|
|
|
}
|
2011-12-20 03:52:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Stream the file if there were no errors
|
|
|
|
|
*
|
|
|
|
|
* @param $headers Array Additional HTTP headers to send on success
|
|
|
|
|
* @return Bool success
|
|
|
|
|
*/
|
|
|
|
|
public function streamFile( $headers = array() ) {
|
2012-02-01 04:44:08 +00:00
|
|
|
return $this->path && StreamFile::stream( $this->getLocalCopyPath(), $headers );
|
2011-12-20 03:52:06 +00:00
|
|
|
}
|
|
|
|
|
|
2007-04-20 12:31:36 +00:00
|
|
|
/**
|
|
|
|
|
* Wrap some XHTML text in an anchor tag with the given attributes
|
2011-05-28 18:59:42 +00:00
|
|
|
*
|
|
|
|
|
* @param $linkAttribs array
|
|
|
|
|
* @param $contents string
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
2007-04-20 12:31:36 +00:00
|
|
|
*/
|
|
|
|
|
protected function linkWrap( $linkAttribs, $contents ) {
|
|
|
|
|
if ( $linkAttribs ) {
|
|
|
|
|
return Xml::tags( 'a', $linkAttribs, $contents );
|
|
|
|
|
} else {
|
|
|
|
|
return $contents;
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-08-31 02:51:23 +00:00
|
|
|
|
2011-05-28 18:59:42 +00:00
|
|
|
/**
|
|
|
|
|
* @param $title string
|
|
|
|
|
* @param $params array
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
2011-12-20 03:52:06 +00:00
|
|
|
public function getDescLinkAttribs( $title = null, $params = '' ) {
|
2007-08-31 02:51:23 +00:00
|
|
|
$query = $this->page ? ( 'page=' . urlencode( $this->page ) ) : '';
|
2008-05-19 18:55:48 +00:00
|
|
|
if( $params ) {
|
|
|
|
|
$query .= $query ? '&'.$params : $params;
|
|
|
|
|
}
|
2009-07-11 04:47:12 +00:00
|
|
|
$attribs = array(
|
2007-08-31 02:51:23 +00:00
|
|
|
'href' => $this->file->getTitle()->getLocalURL( $query ),
|
|
|
|
|
'class' => 'image',
|
|
|
|
|
);
|
2009-07-11 04:47:12 +00:00
|
|
|
if ( $title ) {
|
|
|
|
|
$attribs['title'] = $title;
|
|
|
|
|
}
|
|
|
|
|
return $attribs;
|
2007-08-31 02:51:23 +00:00
|
|
|
}
|
2007-04-20 12:31:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Media transform output for images
|
2007-04-24 06:53:31 +00:00
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Media
|
2007-04-20 12:31:36 +00:00
|
|
|
*/
|
|
|
|
|
class ThumbnailImage extends MediaTransformOutput {
|
|
|
|
|
/**
|
2012-02-01 04:44:08 +00:00
|
|
|
* Get a thumbnail object from a file and parameters.
|
|
|
|
|
* If $path is set to null, the output file is treated as a source copy.
|
|
|
|
|
* If $path is set to false, no output file will be created.
|
|
|
|
|
*
|
2010-03-27 20:57:32 +00:00
|
|
|
* @param $file File object
|
|
|
|
|
* @param $url String: URL path to the thumb
|
|
|
|
|
* @param $width Integer: file's width
|
|
|
|
|
* @param $height Integer: file's height
|
2012-02-09 17:41:50 +00:00
|
|
|
* @param $path String|bool|null: filesystem path to the thumb
|
2010-03-27 20:57:32 +00:00
|
|
|
* @param $page Integer: page number, for multipage files
|
2007-04-20 12:31:36 +00:00
|
|
|
* @private
|
|
|
|
|
*/
|
2010-08-30 16:52:51 +00:00
|
|
|
function __construct( $file, $url, $width, $height, $path = false, $page = false ) {
|
2007-08-31 02:51:23 +00:00
|
|
|
$this->file = $file;
|
2007-04-20 12:31:36 +00:00
|
|
|
$this->url = $url;
|
|
|
|
|
# These should be integers when they get here.
|
|
|
|
|
# If not, there's a bug somewhere. But let's at
|
|
|
|
|
# least produce valid HTML code regardless.
|
|
|
|
|
$this->width = round( $width );
|
|
|
|
|
$this->height = round( $height );
|
|
|
|
|
$this->path = $path;
|
2007-08-31 02:51:23 +00:00
|
|
|
$this->page = $page;
|
2007-04-20 12:31:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return HTML <img ... /> tag for the thumbnail, will include
|
|
|
|
|
* width and height attributes and a blank alt text (as required).
|
2008-04-14 07:45:50 +00:00
|
|
|
*
|
2011-05-28 18:59:42 +00:00
|
|
|
* @param $options array Associative array of options. Boolean options
|
2008-04-14 07:45:50 +00:00
|
|
|
* should be indicated with a value of true for true, and false or
|
2007-08-31 02:51:23 +00:00
|
|
|
* absent for false.
|
2007-04-20 12:31:36 +00:00
|
|
|
*
|
2008-10-08 16:33:36 +00:00
|
|
|
* alt HTML alt attribute
|
|
|
|
|
* title HTML title attribute
|
2007-08-31 02:51:23 +00:00
|
|
|
* desc-link Boolean, show a description link
|
|
|
|
|
* file-link Boolean, show a file download link
|
|
|
|
|
* valign vertical-align property, if the output is an inline element
|
2010-03-27 20:57:32 +00:00
|
|
|
* img-class Class applied to the \<img\> tag, if there is such a tag
|
2008-05-19 18:55:48 +00:00
|
|
|
* desc-query String, description link query params
|
2008-10-06 05:55:27 +00:00
|
|
|
* custom-url-link Custom URL to link to
|
|
|
|
|
* custom-title-link Custom Title object to link to
|
2010-11-09 12:25:57 +00:00
|
|
|
* custom target-link Value of the target attribute, for custom-target-link
|
2007-04-20 12:31:36 +00:00
|
|
|
*
|
2008-04-14 07:45:50 +00:00
|
|
|
* For images, desc-link and file-link are implemented as a click-through. For
|
|
|
|
|
* sounds and videos, they may be displayed in other ways.
|
2007-04-20 12:31:36 +00:00
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2007-08-31 02:51:23 +00:00
|
|
|
function toHtml( $options = array() ) {
|
|
|
|
|
if ( count( func_get_args() ) == 2 ) {
|
|
|
|
|
throw new MWException( __METHOD__ .' called in the old style' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$alt = empty( $options['alt'] ) ? '' : $options['alt'];
|
2009-07-11 04:47:12 +00:00
|
|
|
|
|
|
|
|
$query = empty( $options['desc-query'] ) ? '' : $options['desc-query'];
|
2008-10-08 16:33:36 +00:00
|
|
|
|
2008-10-06 05:55:27 +00:00
|
|
|
if ( !empty( $options['custom-url-link'] ) ) {
|
|
|
|
|
$linkAttribs = array( 'href' => $options['custom-url-link'] );
|
2009-07-11 04:47:12 +00:00
|
|
|
if ( !empty( $options['title'] ) ) {
|
|
|
|
|
$linkAttribs['title'] = $options['title'];
|
2009-05-15 19:43:09 +00:00
|
|
|
}
|
2010-11-09 12:25:57 +00:00
|
|
|
if ( !empty( $options['custom-target-link'] ) ) {
|
|
|
|
|
$linkAttribs['target'] = $options['custom-target-link'];
|
|
|
|
|
}
|
2008-10-06 05:55:27 +00:00
|
|
|
} elseif ( !empty( $options['custom-title-link'] ) ) {
|
|
|
|
|
$title = $options['custom-title-link'];
|
2009-07-11 04:47:12 +00:00
|
|
|
$linkAttribs = array(
|
2011-11-10 03:27:55 +00:00
|
|
|
'href' => $title->getLinkURL(),
|
2009-07-11 04:47:12 +00:00
|
|
|
'title' => empty( $options['title'] ) ? $title->getFullText() : $options['title']
|
|
|
|
|
);
|
2008-10-06 05:55:27 +00:00
|
|
|
} elseif ( !empty( $options['desc-link'] ) ) {
|
2009-07-11 04:47:12 +00:00
|
|
|
$linkAttribs = $this->getDescLinkAttribs( empty( $options['title'] ) ? null : $options['title'], $query );
|
2007-08-31 02:51:23 +00:00
|
|
|
} elseif ( !empty( $options['file-link'] ) ) {
|
|
|
|
|
$linkAttribs = array( 'href' => $this->file->getURL() );
|
|
|
|
|
} else {
|
|
|
|
|
$linkAttribs = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$attribs = array(
|
|
|
|
|
'alt' => $alt,
|
|
|
|
|
'src' => $this->url,
|
|
|
|
|
'width' => $this->width,
|
|
|
|
|
'height' => $this->height,
|
|
|
|
|
);
|
|
|
|
|
if ( !empty( $options['valign'] ) ) {
|
|
|
|
|
$attribs['style'] = "vertical-align: {$options['valign']}";
|
|
|
|
|
}
|
|
|
|
|
if ( !empty( $options['img-class'] ) ) {
|
|
|
|
|
$attribs['class'] = $options['img-class'];
|
|
|
|
|
}
|
2007-04-20 12:31:36 +00:00
|
|
|
return $this->linkWrap( $linkAttribs, Xml::element( 'img', $attribs ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Basic media transform error class
|
2007-04-24 06:53:31 +00:00
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Media
|
2007-04-20 12:31:36 +00:00
|
|
|
*/
|
|
|
|
|
class MediaTransformError extends MediaTransformOutput {
|
|
|
|
|
var $htmlMsg, $textMsg, $width, $height, $url, $path;
|
|
|
|
|
|
|
|
|
|
function __construct( $msg, $width, $height /*, ... */ ) {
|
|
|
|
|
$args = array_slice( func_get_args(), 3 );
|
|
|
|
|
$htmlArgs = array_map( 'htmlspecialchars', $args );
|
|
|
|
|
$htmlArgs = array_map( 'nl2br', $htmlArgs );
|
|
|
|
|
|
2011-02-04 16:52:26 +00:00
|
|
|
$this->htmlMsg = wfMessage( $msg )->rawParams( $htmlArgs )->escaped();
|
|
|
|
|
$this->textMsg = wfMessage( $msg )->rawParams( $htmlArgs )->text();
|
2007-04-20 12:31:36 +00:00
|
|
|
$this->width = intval( $width );
|
|
|
|
|
$this->height = intval( $height );
|
|
|
|
|
$this->url = false;
|
|
|
|
|
$this->path = false;
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-31 02:51:23 +00:00
|
|
|
function toHtml( $options = array() ) {
|
2010-04-20 22:49:50 +00:00
|
|
|
return "<div class=\"MediaTransformError\" style=\"" .
|
|
|
|
|
"width: {$this->width}px; height: {$this->height}px; display:inline-block;\">" .
|
2007-04-20 12:31:36 +00:00
|
|
|
$this->htmlMsg .
|
2010-04-20 22:49:50 +00:00
|
|
|
"</div>";
|
2007-04-20 12:31:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toText() {
|
|
|
|
|
return $this->textMsg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getHtmlMsg() {
|
|
|
|
|
return $this->htmlMsg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isError() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Shortcut class for parameter validation errors
|
2007-04-24 06:53:31 +00:00
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Media
|
2007-04-20 12:31:36 +00:00
|
|
|
*/
|
|
|
|
|
class TransformParameterError extends MediaTransformError {
|
|
|
|
|
function __construct( $params ) {
|
2008-04-14 07:45:50 +00:00
|
|
|
parent::__construct( 'thumbnail_error',
|
2010-04-20 22:49:50 +00:00
|
|
|
max( isset( $params['width'] ) ? $params['width'] : 0, 120 ),
|
|
|
|
|
max( isset( $params['height'] ) ? $params['height'] : 0, 120 ),
|
2007-04-20 12:31:36 +00:00
|
|
|
wfMsg( 'thumbnail_invalid_params' ) );
|
|
|
|
|
}
|
|
|
|
|
}
|