/**
* Get a ThumbnailImage which is the same size as the source
*/
- function getUnscaledThumb( $page = false ) {
+ function getUnscaledThumb( $handlerParams = array() ) {
+ $hp =& $handlerParams;
+ $page = isset( $hp['page'] ) ? $hp['page'] : false;
$width = $this->getWidth( $page );
if ( !$width ) {
return $this->iconThumb();
}
- if ( $page ) {
- $params = array(
- 'page' => $page,
- 'width' => $this->getWidth( $page )
- );
- } else {
- $params = array( 'width' => $this->getWidth() );
- }
- return $this->transform( $params );
+ $hp['width'] = $width;
+ return $this->transform( $hp );
}
/**
return null;
}
$extension = $this->getExtension();
- list( $thumbExt, $thumbMime ) = $this->handler->getThumbType( $extension, $this->getMimeType() );
+ list( $thumbExt, $thumbMime ) = $this->handler->getThumbType( $extension, $this->getMimeType(), $params );
$thumbName = $this->handler->makeParamString( $params ) . '-' . $this->getName();
if ( $thumbExt != $extension ) {
$thumbName .= ".$thumbExt";
/**
* As createThumb, but returns a ThumbnailImage object. This can
* provide access to the actual file, the real size of the thumb,
- * and can produce a convenient <img> tag for you.
+ * and can produce a convenient \<img\> tag for you.
*
* For non-image formats, this may return a filetype-specific icon.
*
/**
* Move or copy a file to its public location. If a file exists at the
- * destination, move it to an archive. Returns the archive name on success
- * or an empty string if it was a new file, and a wikitext-formatted
- * WikiError object on failure.
+ * destination, move it to an archive. Returns a FileRepoStatus object with
+ * the archive name in the "value" member on success.
*
* The archive name should be passed through to recordUpload for database
* registration.
*
- * @param $sourcePath String: local filesystem path to the source image
+ * @param $srcPath String: local filesystem path to the source image
* @param $flags Integer: a bitwise combination of:
* File::DELETE_SOURCE Delete the source file, i.e. move
* rather than copy
- * @return The archive name on success or an empty string if it was a new
- * file, and a wikitext-formatted WikiError object on failure.
+ * @return FileRepoStatus object. On success, the value member contains the
+ * archive name, or an empty string if it was a new file.
*
* STUB
* Overridden by LocalFile
$encName = $db->addQuotes( $this->getName() );
$res = $db->select( array( 'page', 'imagelinks'),
- array( 'page_namespace', 'page_title', 'page_id', 'page_len', 'page_is_redirect' ),
+ array( 'page_namespace', 'page_title', 'page_id', 'page_len', 'page_is_redirect', 'page_latest' ),
array( 'page_id' => 'il_from', 'il_to' => $encName ),
__METHOD__,
$options );
if ( $db->numRows( $res ) ) {
while ( $row = $db->fetchObject( $res ) ) {
if ( $titleObj = Title::newFromRow( $row ) ) {
- $linkCache->addGoodLinkObj( $row->page_id, $titleObj, $row->page_len, $row->page_is_redirect );
+ $linkCache->addGoodLinkObj( $row->page_id, $titleObj, $row->page_len, $row->page_is_redirect, $row->page_latest );
$retVal[] = $titleObj;
}
}
* @return bool
*/
function isLocal() {
- return $this->getRepoName() == 'local';
+ $repo = $this->getRepo();
+ return $repo && $repo->isLocal();
}
/**
}
/**
- * Get an image size array like that returned by getimagesize(), or false if it
+ * Get an image size array like that returned by getImageSize(), or false if it
* can't be determined.
*
* @param $fileName String: The filename