function openShowImage()
{
global $wgOut, $wgUser,$wgRequest;
- $name = $this->mTitle->getText();
- $path = wfImagePath( $name );
- $url = wfImageUrl( $name );
+ $img = Image::newFromTitle( $this->mTitle );
+ $url = $img->getUrl();
- if ( file_exists( $path ) ) {
- list($width, $height, $type, $attr) = getimagesize( $path );
+ if ( $img->exists() ) {
$sk = $wgUser->getSkin();
- if ( $type != "" ) {
+ if ( $img->getType() != "" ) {
# image
- $s = "<span style=\"text-align: center\"><img src=\"{$url}\" width=\"{$width}\" height=\"{$height}\"".
- "alt=\"".$wgRequest->getVal( 'image' )."\" /></span>";
+ $s = "<div class=\"fullImage\">" .
+ "<img src=\"{$url}\" width=\"" . $img->getWidth() . "\" height=\"" . $img->getHeight() .
+ "\" alt=\"".$wgRequest->getVal( 'image' )."\" /></div>";
} else {
- $s = "<span style=\"text-align: center\">".$sk->makeMediaLink($name,"")."</span>";
+ $s = "<div class=\"fullMedia\">".$sk->makeMediaLink($img->getName(),"")."</div>";
}
$wgOut->addHTML( $s );
}