* @param boolean $thumb shows image as thumbnail in a frame
* @param string $manualthumb image name for the manual thumbnail
* @param string $valign vertical alignment: baseline, sub, super, top, text-top, middle, bottom, text-bottom
+ * @param string $time, timestamp of the file, set as false for current
* @return string
*/
function makeImageLinkObj( $title, $label, $alt, $align = '', $handlerParams = array(), $framed = false,
$frameParams['valign'] = $valign;
}
$file = wfFindFile( $title, $time );
- return $this->makeImageLink2( $title, $file, $frameParams, $handlerParams );
+ return $this->makeImageLink2( $title, $file, $frameParams, $handlerParams, $time );
}
/**
*
* @param array $handlerParams Associative array of media handler parameters, to be passed
* to transform(). Typical keys are "width" and "page".
+ * @param string $time, timestamp of the file, set as false for current
*/
- function makeImageLink2( Title $title, $file, $frameParams = array(), $handlerParams = array() ) {
+ function makeImageLink2( Title $title, $file, $frameParams = array(), $handlerParams = array(), $time = false ) {
global $wgContLang, $wgUser, $wgThumbLimits, $wgThumbUpright;
if ( $file && !$file->allowInlineDisplay() ) {
wfDebug( __METHOD__.': '.$title->getPrefixedDBkey()." does not allow inline display\n" );
if ( $fp['align'] == '' ) {
$fp['align'] = $wgContLang->isRTL() ? 'left' : 'right';
}
- return $prefix.$this->makeThumbLink2( $title, $file, $fp, $hp ).$postfix;
+ return $prefix.$this->makeThumbLink2( $title, $file, $fp, $hp, $time ).$postfix;
}
if ( $file && isset( $fp['frameless'] ) ) {
}
if ( !$thumb ) {
- $s = $this->makeBrokenImageLinkObj( $title );
+ $s = $this->makeBrokenImageLinkObj( $title, '', '', '', '', $time==true );
} else {
$s = $thumb->toHtml( array(
'desc-link' => true,
return $this->makeThumbLink2( $title, $file, $frameParams, $params );
}
- function makeThumbLink2( Title $title, $file, $frameParams = array(), $handlerParams = array() ) {
+ function makeThumbLink2( Title $title, $file, $frameParams = array(), $handlerParams = array(), $time = false ) {
global $wgStylePath, $wgContLang;
$exists = $file && $file->exists();
$s = "<div class=\"thumb t{$fp['align']}\"><div class=\"thumbinner\" style=\"width:{$outerWidth}px;\">";
if( !$exists ) {
- $s .= $this->makeBrokenImageLinkObj( $title );
+ $s .= $this->makeBrokenImageLinkObj( $title, '', '', '', '', $time==true );
$zoomicon = '';
} elseif ( !$thumb ) {
$s .= htmlspecialchars( wfMsg( 'thumbnail_error', '' ) );
* @param string $query Query string
* @param string $trail Link trail
* @param string $prefix Link prefix
+ * @param bool $time, a file of a certain timestamp was requested
* @return string
*/
- public function makeBrokenImageLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '' ) {
+ public function makeBrokenImageLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '', $time = false ) {
global $wgEnableUploads;
if( $title instanceof Title ) {
wfProfileIn( __METHOD__ );
- $currentFile = wfFindFile( $title );
- if( $wgEnableUploads && !$currentFile ) {
+ $currentExists = $time ? ( wfFindFile( $title ) != false ) : false;
+ if( $wgEnableUploads && !$currentExists ) {
$upload = SpecialPage::getTitleFor( 'Upload' );
if( $text == '' )
$text = htmlspecialchars( $title->getPrefixedText() );