var $mExtraDescription = false;
+ /**
+ * @param $title Title
+ * @return WikiFilePage
+ */
protected function newPage( Title $title ) {
// Overload mPage with a file-specific page
return new WikiFilePage( $title );
$wgOut->addModuleStyles( 'filepage' );
}
+ /**
+ * @return File
+ */
public function getDisplayedFile() {
$this->loadFile();
return $this->displayImg;
*
* Omit noarticletext if sharedupload; text will be fetched from the
* shared upload server if possible.
+ * @return string
*/
public function getContent() {
$this->loadFile();
rawParams( $this->makeSizeLink( $params, $width, $height ) )->
parse() . ' ' .
Html::rawElement( 'span', array( 'class' => 'mw-filepage-other-resolutions' ),
- wfMessage( 'show-big-image-other' )->
- rawParams( $wgLang->pipeList( $otherSizes ), count( $otherSizes ) )->parse()
+ wfMessage( 'show-big-image-other' )->rawParams( $wgLang->pipeList( $otherSizes ) )->
+ params( count( $otherSizes ) )->parse()
);
+ } elseif ( $width == 0 && $height == 0 ){
+ # Some sort of audio file that doesn't have dimensions
+ # Don't output a no hi res message for such a file
+ $msgsmall = '';
} else {
# Image is small enough to show full size on image page
$msgsmall = wfMessage( 'file-nohires' )->parse();
'action' => $wgScript,
'onchange' => 'document.pageselector.submit();',
);
-
+ $options = array();
for ( $i = 1; $i <= $count; $i++ ) {
$options[] = Xml::option( $wgLang->formatNum( $i ), $i, $i == $page );
}
wfMsgExt( 'imgmultigoto', array( 'parseinline', 'replaceafter' ), $select ) .
Xml::submitButton( wfMsg( 'imgmultigo' ) ) .
Xml::closeElement( 'form' ) .
- "<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>"
+ "<hr />$thumb1\n$thumb2<br style=\"clear: both\" /></div></td></tr></table>"
);
}
} else {
/**
* Creates an thumbnail of specified size and returns an HTML link to it
- * @param array $params Scaler parameters
- * @param int $width
- * @param int $height
+ * @param $params array Scaler parameters
+ * @param $width int
+ * @param $height int
+ * @return string
*/
private function makeSizeLink( $params, $width, $height ) {
$params['width'] = $width;
}
}
+ /**
+ * @param $target
+ * @param $limit
+ * @return ResultWrapper
+ */
protected function queryImageLinks( $target, $limit ) {
$dbr = wfGetDB( DB_SLAVE );
);
$wgOut->addHTML( "<ul class='mw-imagepage-duplicates'>\n" );
+ /**
+ * @var $file File
+ */
foreach ( $dupes as $file ) {
$fromSrc = '';
if ( $file->isLocal() ) {
* Delete the file, or an earlier version of it
*/
public function delete() {
- global $wgUploadMaintenance;
- if ( $wgUploadMaintenance && $this->getTitle() && $this->getTitle()->getNamespace() == NS_FILE ) {
- global $wgOut;
- $wgOut->wrapWikiMsg( "<div class='error'>\n$1\n</div>\n", array( 'filedelete-maintenance' ) );
- return;
- }
-
- $this->loadFile();
- if ( !$this->mPage->getFile()->exists() || !$this->mPage->getFile()->isLocal() || $this->mPage->getFile()->getRedirected() ) {
+ $file = $this->mPage->getFile();
+ if ( !$file->exists() || !$file->isLocal() || $file->getRedirected() ) {
// Standard article deletion
parent::delete();
return;
}
- $deleter = new FileDeleteForm( $this->mPage->getFile() );
+
+ $deleter = new FileDeleteForm( $file );
$deleter->execute();
}
*/
function showError( $description ) {
global $wgOut;
- $wgOut->setPageTitle( wfMsg( 'internalerror' ) );
+ $wgOut->setPageTitle( wfMessage( 'internalerror' ) );
$wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setArticleRelated( false );
$wgOut->enableClientCache( false );
*/
protected $imagePage;
+ /**
+ * @var File
+ */
+ protected $current;
+
protected $repo, $showThumb;
protected $preventClickjacking = false;
$this->showThumb = $wgShowArchiveThumbnails && $this->img->canRender();
}
+ /**
+ * @return ImagePage
+ */
public function getImagePage() {
return $this->imagePage;
}
+ /**
+ * @return File
+ */
public function getFile() {
return $this->img;
}
+ /**
+ * @param $navLinks string
+ * @return string
+ */
public function beginImageHistoryList( $navLinks = '' ) {
global $wgOut, $wgUser;
return Xml::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'filehist' ) ) . "\n"
. "</tr>\n";
}
+ /**
+ * @param $navLinks string
+ * @return string
+ */
public function endImageHistoryList( $navLinks = '' ) {
return "</table>\n$navLinks\n</div>\n";
}
array(
'action' => 'revert',
'oldimage' => $img,
- 'wpEditToken' => $wgUser->editToken( $img )
+ 'wpEditToken' => $wgUser->getEditToken( $img )
),
array( 'known', 'noclasses' )
);
array(
'target' => $this->title->getPrefixedText(),
'file' => $img,
- 'token' => $wgUser->editToken( $img )
+ 'token' => $wgUser->getEditToken( $img )
),
array( 'known', 'noclasses' )
);
if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
$row .= '<td><span class="history-deleted">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span></td>';
} else {
- $row .= '<td dir="' . $wgContLang->getDir() . '">' . Linker::commentBlock( $description, $this->title ) . '</td>';
+ $row .= '<td dir="' . $wgContLang->getDir() . '">' . Linker::formatComment( $description, $this->title ) . '</td>';
}
$rowClass = null;
}
}
+ /**
+ * @param $enable bool
+ */
protected function preventClickjacking( $enable = true ) {
$this->preventClickjacking = $enable;
}
+ /**
+ * @return bool
+ */
public function getPreventClickjacking() {
return $this->preventClickjacking;
}
$this->mRange = array( 0, 0 ); // display range
}
+ /**
+ * @return Title
+ */
function getTitle() {
return $this->mTitle;
}
return false;
}
+ /**
+ * @return string
+ */
function getIndexField() {
return '';
}
+ /**
+ * @return string
+ */
function formatRow( $row ) {
return '';
}
+ /**
+ * @return string
+ */
function getBody() {
$s = '';
$this->doQuery();
$this->mQueryDone = true;
}
+ /**
+ * @param $enable bool
+ */
protected function preventClickjacking( $enable = true ) {
$this->preventClickjacking = $enable;
}
+ /**
+ * @return bool
+ */
public function getPreventClickjacking() {
return $this->preventClickjacking;
}