*
*/
if( !defined( 'MEDIAWIKI' ) )
- die();
+ die( -1 );
require_once( 'Image.php' );
/* private */ var $img; // Image object this page is shown for
var $mExtraDescription = false;
+ /**
+ * Handler for action=render
+ * Include body text only; none of the image extras
+ */
function render() {
global $wgOut;
- $wgOut->setArticleBodyOnly(true);
- $wgOut->addWikitext($this->getContent(true));
+ $wgOut->setArticleBodyOnly( true );
+ $wgOut->addSecondaryWikitext( $this->getContent() );
}
function view() {
$wgOut->setArticleFlag( true );
$wgOut->setRobotpolicy( 'index,follow' );
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
- $wgOut->addMetaTags();
$this->viewUpdates();
}
- if ($this->mExtraDescription) {
- $fol = wfMsg('shareddescriptionfollows');
- if ($fol != '-')
- $wgOut->addWikiText(wfMsg('shareddescriptionfollows'));
- $wgOut->addHTML($this->mExtraDescription);
+ # Show shared description, if needed
+ if( $this->mExtraDescription ) {
+ $fol = wfMsg( 'shareddescriptionfollows' );
+ if( $fol != '-' ) {
+ $wgOut->addWikiText( $fol );
+ }
+ $wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription . '</div>' );
}
$this->closeShowImage();
$r .= '|}';
return $r;
}
-
+
/**
* Get a list of EXIF metadata items which should be displayed when
* the metadata table is collapsed.
/**
* Overloading Article's getContent method.
- * Omit noarticletext if sharedupload
- *
- * @param $noredir If true, do not follow redirects
+ *
+ * Omit noarticletext if sharedupload; text will be fetched from the
+ * shared upload server if possible.
*/
- function getContent( $noredir )
- {
- if ( $this->img && $this->img->fromSharedDirectory && 0 == $this->getID() ) {
+ function getContent() {
+ if( $this->img && $this->img->fromSharedDirectory && 0 == $this->getID() ) {
return '';
}
- return Article::getContent( $noredir );
+ return Article::getContent();
}
function openShowImage() {
$icon->toHtml() .
'</a></div>' );
}
-
+
$showLink = true;
}
$info = wfMsg( 'fileinfo',
ceil($this->img->getSize()/1024.0),
$this->img->getMimeType() );
-
+
if (!$this->img->isSafeFile()) {
$warning = wfMsg( 'mediawarning' );
$wgOut->addWikiText( <<<END
$sk = $wgUser->getSkin();
$wgOut->addHTML( '<br /><ul>' );
- if( $wgUser->isAllowed( 'reupload' ) ) {
+ if( $wgUser->isAllowed( 'reupload' ) ) {
$wgOut->addWikiText( "<li>\n<div>". wfMsg( 'uploadnewversion', $this->getUploadUrl() ) ."</div>\n</li>\n" );
}
$wgOut->addHTML( '<li>' );
function doDelete() {
global $wgOut, $wgUser, $wgRequest, $wgUseSquid, $wgInternalServer;
global $wgPostCommitUpdateList;
-
+
$fname = 'ImagePage::doDelete';
$reason = $wgRequest->getVal( 'wpReason' );