$out->addHTML( Xml::openElement( 'div', array( 'id' => 'mw-imagepage-content',
'lang' => $pageLang->getHtmlCode(), 'dir' => $pageLang->getDir(),
'class' => 'mw-content-'.$pageLang->getDir() ) ) );
+
parent::view();
+
$out->addHTML( Xml::closeElement( 'div' ) );
} else {
# Just need to set the right headers
}
/**
- * Overloading Article's getContent method.
+ * Overloading Article's getContentObject method.
*
* Omit noarticletext if sharedupload; text will be fetched from the
* shared upload server if possible.
* @return string
*/
- public function getContent() {
+ public function getContentObject() {
$this->loadFile();
if ( $this->mPage->getFile() && !$this->mPage->getFile()->isLocal() && 0 == $this->getID() ) {
- return '';
+ return null;
}
- return parent::getContent();
+ return parent::getContentObject();
}
protected function openShowImage() {
if ( $width > $maxWidth || $height > $maxHeight ) {
# Calculate the thumbnail size.
# First case, the limiting factor is the width, not the height.
- if ( $width / $height >= $maxWidth / $maxHeight ) {
- $height = round( $height * $maxWidth / $width );
+ if ( $width / $height >= $maxWidth / $maxHeight ) { // FIXME: Possible divison by 0. bug 36911
+ $height = round( $height * $maxWidth / $width ); // FIXME: Possible divison by 0. bug 36911
$width = $maxWidth;
# Note that $height <= $maxHeight now.
} else {
- $newwidth = floor( $width * $maxHeight / $height );
- $height = round( $height * $newwidth / $width );
+ $newwidth = floor( $width * $maxHeight / $height ); // FIXME: Possible divison by 0. bug 36911
+ $height = round( $height * $newwidth / $width ); // FIXME: Possible divison by 0. bug 36911
$width = $newwidth;
# Note that $height <= $maxHeight now, but might not be identical
# because of rounding.
* @param ImagePage $imagePage
*/
function __construct( $imagePage ) {
- parent::__construct();
+ parent::__construct( $imagePage->getContext() );
$this->mImagePage = $imagePage;
$this->mTitle = clone ( $imagePage->getTitle() );
$this->mTitle->setFragment( '#filehistory' );