2004-02-18 02:15:00 +00:00
|
|
|
<?php
|
2003-09-01 09:59:53 +00:00
|
|
|
|
2004-12-03 10:57:19 +00:00
|
|
|
if( !defined( 'MEDIAWIKI' ) )
|
2006-06-07 06:40:24 +00:00
|
|
|
die( 1 );
|
2004-12-03 10:57:19 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
|
|
|
|
* Special handling for image description pages
|
2007-04-24 06:53:31 +00:00
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Media
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2003-09-01 09:59:53 +00:00
|
|
|
class ImagePage extends Article {
|
|
|
|
|
|
2008-05-21 21:23:04 +00:00
|
|
|
/* private */ var $img; // Image object
|
|
|
|
|
/* private */ var $displayImg;
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
/* private */ var $repo;
|
2008-05-20 03:26:59 +00:00
|
|
|
/* private */ var $fileLoaded;
|
2005-07-04 02:59:23 +00:00
|
|
|
var $mExtraDescription = false;
|
2008-05-15 19:17:21 +00:00
|
|
|
var $dupes;
|
2005-07-03 04:40:07 +00:00
|
|
|
|
2008-05-23 09:03:49 +00:00
|
|
|
function __construct( $title ) {
|
2007-05-30 21:02:32 +00:00
|
|
|
parent::__construct( $title );
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->dupes = null;
|
|
|
|
|
$this->repo = null;
|
|
|
|
|
}
|
2008-12-15 23:51:28 +00:00
|
|
|
|
|
|
|
|
public function setFile( $file ) {
|
|
|
|
|
$this->displayImg = $file;
|
|
|
|
|
$this->img = $file;
|
|
|
|
|
$this->fileLoaded = true;
|
|
|
|
|
}
|
2008-05-23 09:03:49 +00:00
|
|
|
|
2008-05-20 03:26:59 +00:00
|
|
|
protected function loadFile() {
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->fileLoaded ) {
|
2008-05-20 03:26:59 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
2008-05-23 09:03:49 +00:00
|
|
|
$this->fileLoaded = true;
|
|
|
|
|
|
|
|
|
|
$this->displayImg = $this->img = false;
|
|
|
|
|
wfRunHooks( 'ImagePageFindFile', array( $this, &$this->img, &$this->displayImg ) );
|
2008-11-28 14:29:25 +00:00
|
|
|
if( !$this->img ) {
|
2008-05-23 09:03:49 +00:00
|
|
|
$this->img = wfFindFile( $this->mTitle );
|
2008-11-28 14:29:25 +00:00
|
|
|
if( !$this->img ) {
|
2008-05-23 09:03:49 +00:00
|
|
|
$this->img = wfLocalFile( $this->mTitle );
|
2008-05-21 22:20:07 +00:00
|
|
|
}
|
2008-05-23 09:03:49 +00:00
|
|
|
}
|
2008-11-28 14:29:25 +00:00
|
|
|
if( !$this->displayImg ) {
|
2008-05-23 09:03:49 +00:00
|
|
|
$this->displayImg = $this->img;
|
2007-05-30 21:02:32 +00:00
|
|
|
}
|
2008-05-15 19:17:21 +00:00
|
|
|
$this->repo = $this->img->getRepo();
|
2007-05-30 21:02:32 +00:00
|
|
|
}
|
|
|
|
|
|
2006-01-13 00:29:20 +00:00
|
|
|
/**
|
|
|
|
|
* Handler for action=render
|
|
|
|
|
* Include body text only; none of the image extras
|
|
|
|
|
*/
|
2008-11-28 14:29:25 +00:00
|
|
|
public function render() {
|
2005-07-03 04:56:53 +00:00
|
|
|
global $wgOut;
|
2006-01-13 00:29:20 +00:00
|
|
|
$wgOut->setArticleBodyOnly( true );
|
2008-04-09 22:42:29 +00:00
|
|
|
parent::view();
|
2005-07-03 04:56:53 +00:00
|
|
|
}
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
public function view() {
|
2007-01-17 05:01:54 +00:00
|
|
|
global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2004-01-12 00:55:01 +00:00
|
|
|
|
2008-12-01 17:14:30 +00:00
|
|
|
if( $this->mTitle->getNamespace() == NS_FILE && $this->img->getRedirected() ) {
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->mTitle->getDBkey() == $this->img->getName() ) {
|
2008-05-14 11:52:59 +00:00
|
|
|
// mTitle is the same as the redirect target so ask Article
|
|
|
|
|
// to perform the redirect for us.
|
2008-05-11 19:49:08 +00:00
|
|
|
return Article::view();
|
|
|
|
|
} else {
|
2008-05-14 11:52:59 +00:00
|
|
|
// mTitle is not the same as the redirect target so it is
|
|
|
|
|
// probably the redirect page itself. Fake the redirect symbol
|
2008-05-11 19:49:08 +00:00
|
|
|
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
|
2008-12-01 17:14:30 +00:00
|
|
|
$wgOut->addHTML( $this->viewRedirect( Title::makeTitle( NS_FILE, $this->img->getName() ),
|
2008-08-02 02:39:09 +00:00
|
|
|
/* $appendSubtitle */ true, /* $forceKnown */ true ) );
|
2008-05-11 19:49:08 +00:00
|
|
|
$this->viewUpdates();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-05-08 20:55:13 +00:00
|
|
|
|
2007-01-17 05:01:54 +00:00
|
|
|
$diff = $wgRequest->getVal( 'diff' );
|
|
|
|
|
$diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
|
2005-05-05 02:39:21 +00:00
|
|
|
|
2008-12-01 17:14:30 +00:00
|
|
|
if( $this->mTitle->getNamespace() != NS_FILE || ( isset( $diff ) && $diffOnly ) )
|
2007-01-17 05:01:54 +00:00
|
|
|
return Article::view();
|
2009-09-24 20:46:31 +00:00
|
|
|
|
|
|
|
|
$this->showRedirectedFromHeader();
|
2005-05-05 02:39:21 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $wgShowEXIF && $this->displayImg->exists() ) {
|
2008-04-14 07:45:50 +00:00
|
|
|
// FIXME: bad interface, see note on MediaHandler::formatMetadata().
|
2008-05-21 21:33:58 +00:00
|
|
|
$formattedMetadata = $this->displayImg->formatMetadata();
|
2007-07-28 01:15:35 +00:00
|
|
|
$showmeta = $formattedMetadata !== false;
|
2007-01-17 05:01:54 +00:00
|
|
|
} else {
|
|
|
|
|
$showmeta = false;
|
|
|
|
|
}
|
2005-07-03 04:40:07 +00:00
|
|
|
|
2009-01-02 19:11:34 +00:00
|
|
|
if( !$diff && $this->displayImg->exists() )
|
2008-05-21 21:33:58 +00:00
|
|
|
$wgOut->addHTML( $this->showTOC($showmeta) );
|
2005-07-03 04:40:07 +00:00
|
|
|
|
2009-01-02 19:11:34 +00:00
|
|
|
if( !$diff )
|
|
|
|
|
$this->openShowImage();
|
2005-07-04 02:59:23 +00:00
|
|
|
|
2007-01-17 05:01:54 +00:00
|
|
|
# No need to display noarticletext, we use our own message, output in openShowImage()
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->getID() ) {
|
2005-04-17 08:30:15 +00:00
|
|
|
Article::view();
|
2007-01-17 05:01:54 +00:00
|
|
|
} else {
|
|
|
|
|
# Just need to set the right headers
|
|
|
|
|
$wgOut->setArticleFlag( true );
|
|
|
|
|
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
|
|
|
|
|
$this->viewUpdates();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Show shared description, if needed
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->mExtraDescription ) {
|
2008-02-18 07:25:35 +00:00
|
|
|
$fol = wfMsgNoTrans( 'shareddescriptionfollows' );
|
2007-03-18 03:44:32 +00:00
|
|
|
if( $fol != '-' && !wfEmptyMsg( 'shareddescriptionfollows', $fol ) ) {
|
2008-02-18 07:47:46 +00:00
|
|
|
$wgOut->addWikiText( $fol );
|
2007-01-17 05:01:54 +00:00
|
|
|
}
|
2009-03-28 16:41:00 +00:00
|
|
|
$wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription . "</div>\n" );
|
2007-01-17 05:01:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->closeShowImage();
|
|
|
|
|
$this->imageHistory();
|
2008-05-14 15:11:48 +00:00
|
|
|
// TODO: Cleanup the following
|
2008-05-15 19:17:21 +00:00
|
|
|
|
2008-08-08 21:31:38 +00:00
|
|
|
$wgOut->addHTML( Xml::element( 'h2',
|
|
|
|
|
array( 'id' => 'filelinks' ),
|
2008-05-15 19:17:21 +00:00
|
|
|
wfMsg( 'imagelinks' ) ) . "\n" );
|
2008-05-14 15:11:48 +00:00
|
|
|
$this->imageDupes();
|
2009-02-25 22:18:44 +00:00
|
|
|
# TODO! FIXME! For some freaky reason, we can't redirect to foreign images.
|
|
|
|
|
# Yet we return metadata about the target. Definitely an issue in the FileRepo
|
2009-01-30 19:59:38 +00:00
|
|
|
$this->imageRedirects();
|
2008-05-15 19:17:21 +00:00
|
|
|
$this->imageLinks();
|
2007-01-17 05:01:54 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $showmeta ) {
|
2007-01-17 05:01:54 +00:00
|
|
|
global $wgStylePath, $wgStyleVersion;
|
2008-12-14 19:14:21 +00:00
|
|
|
$expand = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-expand' ) ) );
|
|
|
|
|
$collapse = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-collapse' ) ) );
|
2009-03-28 16:41:00 +00:00
|
|
|
$wgOut->addHTML( Xml::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ) . "\n" );
|
2007-07-28 01:15:35 +00:00
|
|
|
$wgOut->addWikiText( $this->makeMetadataTable( $formattedMetadata ) );
|
2008-05-10 11:21:16 +00:00
|
|
|
$wgOut->addScriptFile( 'metadata.js' );
|
2007-01-17 05:01:54 +00:00
|
|
|
$wgOut->addHTML(
|
|
|
|
|
"<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" );
|
2003-09-01 09:59:53 +00:00
|
|
|
}
|
|
|
|
|
}
|
2008-05-08 20:55:13 +00:00
|
|
|
|
|
|
|
|
public function getRedirectTarget() {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->img->isLocal() ) {
|
2008-05-08 20:55:13 +00:00
|
|
|
return parent::getRedirectTarget();
|
2008-05-20 03:26:59 +00:00
|
|
|
}
|
2008-05-08 20:55:13 +00:00
|
|
|
// Foreign image page
|
|
|
|
|
$from = $this->img->getRedirected();
|
2008-05-10 11:12:53 +00:00
|
|
|
$to = $this->img->getName();
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $from == $to ) {
|
2008-05-20 03:26:59 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
2008-12-01 17:14:30 +00:00
|
|
|
return $this->mRedirectTarget = Title::makeTitle( NS_FILE, $to );
|
2008-05-08 20:55:13 +00:00
|
|
|
}
|
2008-05-08 21:25:12 +00:00
|
|
|
public function followRedirect() {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->img->isLocal() ) {
|
2008-05-08 21:25:12 +00:00
|
|
|
return parent::followRedirect();
|
2008-05-20 03:26:59 +00:00
|
|
|
}
|
2008-05-08 21:25:12 +00:00
|
|
|
$from = $this->img->getRedirected();
|
2008-05-10 11:12:53 +00:00
|
|
|
$to = $this->img->getName();
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $from == $to ) {
|
2008-05-20 03:26:59 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
2008-12-01 17:14:30 +00:00
|
|
|
return Title::makeTitle( NS_FILE, $to );
|
2008-05-08 21:25:12 +00:00
|
|
|
}
|
2008-05-09 19:48:32 +00:00
|
|
|
public function isRedirect( $text = false ) {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->img->isLocal() )
|
2008-05-09 19:48:32 +00:00
|
|
|
return parent::isRedirect( $text );
|
2008-05-09 10:42:49 +00:00
|
|
|
|
|
|
|
|
return (bool)$this->img->getRedirected();
|
|
|
|
|
}
|
2008-05-10 11:12:53 +00:00
|
|
|
|
|
|
|
|
public function isLocal() {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2008-05-10 11:12:53 +00:00
|
|
|
return $this->img->isLocal();
|
|
|
|
|
}
|
2008-05-10 14:19:25 +00:00
|
|
|
|
|
|
|
|
public function getFile() {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2008-05-10 14:19:25 +00:00
|
|
|
return $this->img;
|
|
|
|
|
}
|
2008-05-15 19:17:21 +00:00
|
|
|
|
2008-05-21 21:33:58 +00:00
|
|
|
public function getDisplayedFile() {
|
|
|
|
|
$this->loadFile();
|
|
|
|
|
return $this->displayImg;
|
|
|
|
|
}
|
|
|
|
|
|
2008-05-15 19:17:21 +00:00
|
|
|
public function getDuplicates() {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2008-11-28 14:29:25 +00:00
|
|
|
if( !is_null($this->dupes) ) {
|
2008-05-20 03:26:59 +00:00
|
|
|
return $this->dupes;
|
|
|
|
|
}
|
2008-11-28 14:29:25 +00:00
|
|
|
if( !( $hash = $this->img->getSha1() ) ) {
|
2008-05-15 19:17:21 +00:00
|
|
|
return $this->dupes = array();
|
2008-05-20 03:26:59 +00:00
|
|
|
}
|
2008-05-15 19:17:21 +00:00
|
|
|
$dupes = RepoGroup::singleton()->findBySha1( $hash );
|
|
|
|
|
// Remove duplicates with self and non matching file sizes
|
|
|
|
|
$self = $this->img->getRepoName().':'.$this->img->getName();
|
|
|
|
|
$size = $this->img->getSize();
|
|
|
|
|
foreach ( $dupes as $index => $file ) {
|
|
|
|
|
$key = $file->getRepoName().':'.$file->getName();
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $key == $self )
|
2008-05-15 19:17:21 +00:00
|
|
|
unset( $dupes[$index] );
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $file->getSize() != $size )
|
2008-05-15 19:17:21 +00:00
|
|
|
unset( $dupes[$index] );
|
|
|
|
|
}
|
|
|
|
|
return $this->dupes = $dupes;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2005-04-29 19:45:49 +00:00
|
|
|
|
2005-05-05 02:39:21 +00:00
|
|
|
/**
|
|
|
|
|
* Create the TOC
|
|
|
|
|
*
|
|
|
|
|
* @param bool $metadata Whether or not to show the metadata link
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function showTOC( $metadata ) {
|
2005-05-05 02:39:21 +00:00
|
|
|
global $wgLang;
|
2005-05-05 01:44:17 +00:00
|
|
|
$r = '<ul id="filetoc">
|
2009-05-30 09:24:20 +00:00
|
|
|
<li><a href="#file">' . wfMsgHtml( 'file-anchor-link' ) . '</a></li>
|
2007-07-29 18:51:36 +00:00
|
|
|
<li><a href="#filehistory">' . wfMsgHtml( 'filehist' ) . '</a></li>
|
2009-03-28 16:41:00 +00:00
|
|
|
<li><a href="#filelinks">' . wfMsgHtml( 'imagelinks' ) . "</a></li>\n" .
|
|
|
|
|
($metadata ? ' <li><a href="#metadata">' . wfMsgHtml( 'metadata' ) . '</a></li>' : '') . "
|
|
|
|
|
</ul>\n";
|
2005-05-05 02:39:21 +00:00
|
|
|
return $r;
|
2005-04-29 19:45:49 +00:00
|
|
|
}
|
2005-04-21 11:28:56 +00:00
|
|
|
|
2005-05-05 02:39:21 +00:00
|
|
|
/**
|
|
|
|
|
* Make a table with metadata to be shown in the output page.
|
|
|
|
|
*
|
2008-04-14 07:45:50 +00:00
|
|
|
* FIXME: bad interface, see note on MediaHandler::formatMetadata().
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
*
|
2005-05-05 02:39:21 +00:00
|
|
|
* @param array $exif The array containing the EXIF data
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function makeMetadataTable( $metadata ) {
|
2009-05-25 14:02:54 +00:00
|
|
|
$r = "<div class=\"mw-imagepage-section-metadata\">";
|
|
|
|
|
$r .= wfMsgNoTrans( 'metadata-help' );
|
2009-03-28 16:41:00 +00:00
|
|
|
$r .= "<table id=\"mw_metadata\" class=\"mw_metadata\">\n";
|
2007-07-28 01:15:35 +00:00
|
|
|
foreach ( $metadata as $type => $stuff ) {
|
2007-08-21 03:57:54 +00:00
|
|
|
foreach ( $stuff as $v ) {
|
2008-12-30 00:22:14 +00:00
|
|
|
# FIXME, why is this using escapeId for a class?!
|
2007-07-28 01:15:35 +00:00
|
|
|
$class = Sanitizer::escapeId( $v['id'] );
|
|
|
|
|
if( $type == 'collapsed' ) {
|
|
|
|
|
$class .= ' collapsable';
|
|
|
|
|
}
|
2009-03-28 16:41:00 +00:00
|
|
|
$r .= "<tr class=\"$class\">\n";
|
|
|
|
|
$r .= "<th>{$v['name']}</th>\n";
|
|
|
|
|
$r .= "<td>{$v['value']}</td>\n</tr>";
|
2005-11-28 23:56:35 +00:00
|
|
|
}
|
|
|
|
|
}
|
2009-03-28 16:41:00 +00:00
|
|
|
$r .= "</table>\n</div>\n";
|
2005-11-28 23:56:35 +00:00
|
|
|
return $r;
|
|
|
|
|
}
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2005-05-20 22:41:17 +00:00
|
|
|
/**
|
|
|
|
|
* Overloading Article's getContent method.
|
2008-04-14 07:45:50 +00:00
|
|
|
*
|
2006-01-13 00:29:20 +00:00
|
|
|
* Omit noarticletext if sharedupload; text will be fetched from the
|
|
|
|
|
* shared upload server if possible.
|
2005-05-20 22:41:17 +00:00
|
|
|
*/
|
2008-11-28 14:29:25 +00:00
|
|
|
public function getContent() {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2007-05-30 21:02:32 +00:00
|
|
|
if( $this->img && !$this->img->isLocal() && 0 == $this->getID() ) {
|
2005-05-20 22:41:17 +00:00
|
|
|
return '';
|
|
|
|
|
}
|
2006-01-13 00:29:20 +00:00
|
|
|
return Article::getContent();
|
2005-05-20 22:41:17 +00:00
|
|
|
}
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function openShowImage() {
|
2009-05-24 20:45:31 +00:00
|
|
|
global $wgOut, $wgUser, $wgImageLimits, $wgRequest,
|
|
|
|
|
$wgLang, $wgContLang, $wgEnableUploads;
|
2005-12-04 18:27:59 +00:00
|
|
|
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
|
|
|
|
|
2008-05-21 21:33:58 +00:00
|
|
|
$full_url = $this->displayImg->getURL();
|
2007-04-20 12:31:36 +00:00
|
|
|
$linkAttribs = false;
|
2006-12-14 20:28:38 +00:00
|
|
|
$sizeSel = intval( $wgUser->getOption( 'imagesize') );
|
2004-12-21 03:21:41 +00:00
|
|
|
if( !isset( $wgImageLimits[$sizeSel] ) ) {
|
|
|
|
|
$sizeSel = User::getDefaultOption( 'imagesize' );
|
2007-02-02 16:22:22 +00:00
|
|
|
|
|
|
|
|
// The user offset might still be incorrect, specially if
|
|
|
|
|
// $wgImageLimits got changed (see bug #8858).
|
|
|
|
|
if( !isset( $wgImageLimits[$sizeSel] ) ) {
|
|
|
|
|
// Default to the first offset in $wgImageLimits
|
|
|
|
|
$sizeSel = 0;
|
|
|
|
|
}
|
2004-09-10 00:53:31 +00:00
|
|
|
}
|
2004-12-21 03:21:41 +00:00
|
|
|
$max = $wgImageLimits[$sizeSel];
|
|
|
|
|
$maxWidth = $max[0];
|
|
|
|
|
$maxHeight = $max[1];
|
2006-11-08 07:12:03 +00:00
|
|
|
$sk = $wgUser->getSkin();
|
2007-10-30 09:40:35 +00:00
|
|
|
$dirmark = $wgContLang->getDirMark();
|
2004-01-12 00:55:01 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->displayImg->exists() ) {
|
2005-05-21 07:46:17 +00:00
|
|
|
# image
|
2006-08-13 17:34:48 +00:00
|
|
|
$page = $wgRequest->getIntOrNull( 'page' );
|
2008-11-28 14:29:25 +00:00
|
|
|
if( is_null( $page ) ) {
|
2007-04-20 12:31:36 +00:00
|
|
|
$params = array();
|
2006-08-13 17:34:48 +00:00
|
|
|
$page = 1;
|
2007-04-20 12:31:36 +00:00
|
|
|
} else {
|
|
|
|
|
$params = array( 'page' => $page );
|
2006-08-13 17:34:48 +00:00
|
|
|
}
|
2008-05-21 21:33:58 +00:00
|
|
|
$width_orig = $this->displayImg->getWidth();
|
2007-02-27 18:27:11 +00:00
|
|
|
$width = $width_orig;
|
2008-05-21 21:33:58 +00:00
|
|
|
$height_orig = $this->displayImg->getHeight();
|
2007-02-27 18:27:11 +00:00
|
|
|
$height = $height_orig;
|
2008-05-21 21:33:58 +00:00
|
|
|
$mime = $this->displayImg->getMimeType();
|
2005-05-21 07:46:17 +00:00
|
|
|
$showLink = false;
|
2007-04-20 12:31:36 +00:00
|
|
|
$linkAttribs = array( 'href' => $full_url );
|
2008-05-21 21:33:58 +00:00
|
|
|
$longDesc = $this->displayImg->getLongDesc();
|
2005-07-03 04:40:07 +00:00
|
|
|
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this , &$wgOut ) ) ;
|
2007-05-16 19:52:22 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->displayImg->allowInlineDisplay() ) {
|
2004-01-16 18:11:47 +00:00
|
|
|
# image
|
2005-07-03 04:40:07 +00:00
|
|
|
|
2005-04-29 19:45:49 +00:00
|
|
|
# "Download high res version" link below the image
|
2008-05-21 21:33:58 +00:00
|
|
|
#$msgsize = wfMsgHtml('file-info-size', $width_orig, $height_orig, $sk->formatSize( $this->displayImg->getSize() ), $mime );
|
2005-12-04 08:52:01 +00:00
|
|
|
# We'll show a thumbnail of this image
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $width > $maxWidth || $height > $maxHeight ) {
|
2005-12-04 08:52:01 +00:00
|
|
|
# Calculate the thumbnail size.
|
|
|
|
|
# First case, the limiting factor is the width, not the height.
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $width / $height >= $maxWidth / $maxHeight ) {
|
2005-12-04 08:52:01 +00:00
|
|
|
$height = round( $height * $maxWidth / $width);
|
|
|
|
|
$width = $maxWidth;
|
|
|
|
|
# Note that $height <= $maxHeight now.
|
|
|
|
|
} else {
|
|
|
|
|
$newwidth = floor( $width * $maxHeight / $height);
|
|
|
|
|
$height = round( $height * $newwidth / $width );
|
|
|
|
|
$width = $newwidth;
|
|
|
|
|
# Note that $height <= $maxHeight now, but might not be identical
|
|
|
|
|
# because of rounding.
|
|
|
|
|
}
|
2007-04-30 17:41:12 +00:00
|
|
|
$msgbig = wfMsgHtml( 'show-big-image' );
|
2008-08-08 21:31:38 +00:00
|
|
|
$msgsmall = wfMsgExt( 'show-big-image-thumb', 'parseinline',
|
|
|
|
|
$wgLang->formatNum( $width ),
|
|
|
|
|
$wgLang->formatNum( $height )
|
|
|
|
|
);
|
2007-04-27 22:04:01 +00:00
|
|
|
} else {
|
|
|
|
|
# Image is small enough to show full size on image page
|
2008-05-21 21:33:58 +00:00
|
|
|
$msgbig = htmlspecialchars( $this->displayImg->getName() );
|
2007-04-30 17:41:12 +00:00
|
|
|
$msgsmall = wfMsgExt( 'file-nohires', array( 'parseinline' ) );
|
2007-04-20 12:31:36 +00:00
|
|
|
}
|
2007-04-27 22:04:01 +00:00
|
|
|
|
2007-04-20 12:31:36 +00:00
|
|
|
$params['width'] = $width;
|
2008-05-21 21:33:58 +00:00
|
|
|
$thumbnail = $this->displayImg->transform( $params );
|
2005-12-04 08:52:01 +00:00
|
|
|
|
2007-04-20 12:31:36 +00:00
|
|
|
$anchorclose = "<br />";
|
2008-05-21 21:33:58 +00:00
|
|
|
if( $this->displayImg->mustRender() ) {
|
2005-09-13 01:27:21 +00:00
|
|
|
$showLink = true;
|
2007-04-20 12:31:36 +00:00
|
|
|
} else {
|
2008-04-14 07:45:50 +00:00
|
|
|
$anchorclose .=
|
2007-04-27 22:04:01 +00:00
|
|
|
$msgsmall .
|
2007-10-30 09:40:35 +00:00
|
|
|
'<br />' . Xml::tags( 'a', $linkAttribs, $msgbig ) . "$dirmark " . $longDesc;
|
2004-08-17 21:07:14 +00:00
|
|
|
}
|
2006-08-13 17:34:48 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->displayImg->isMultipage() ) {
|
2006-08-13 17:34:48 +00:00
|
|
|
$wgOut->addHTML( '<table class="multipageimage"><tr><td>' );
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $thumbnail ) {
|
2008-04-14 07:45:50 +00:00
|
|
|
$options = array(
|
2008-05-21 21:33:58 +00:00
|
|
|
'alt' => $this->displayImg->getTitle()->getPrefixedText(),
|
2007-08-31 02:51:23 +00:00
|
|
|
'file-link' => true,
|
|
|
|
|
);
|
2008-04-14 07:45:50 +00:00
|
|
|
$wgOut->addHTML( '<div class="fullImageLink" id="file">' .
|
2007-08-31 02:51:23 +00:00
|
|
|
$thumbnail->toHtml( $options ) .
|
2009-03-28 16:41:00 +00:00
|
|
|
$anchorclose . "</div>\n" );
|
2007-04-20 12:31:36 +00:00
|
|
|
}
|
2006-08-13 17:34:48 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->displayImg->isMultipage() ) {
|
2008-05-21 21:33:58 +00:00
|
|
|
$count = $this->displayImg->pageCount();
|
2007-01-26 12:00:04 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $page > 1 ) {
|
2007-01-26 12:00:04 +00:00
|
|
|
$label = $wgOut->parse( wfMsg( 'imgmultipageprev' ), false );
|
2009-06-06 22:42:48 +00:00
|
|
|
$link = $sk->link(
|
|
|
|
|
$this->mTitle,
|
|
|
|
|
$label,
|
|
|
|
|
array(),
|
|
|
|
|
array( 'page' => $page - 1 ),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
2008-05-21 21:33:58 +00:00
|
|
|
$thumb1 = $sk->makeThumbLinkObj( $this->mTitle, $this->displayImg, $link, $label, 'none',
|
2007-04-20 12:31:36 +00:00
|
|
|
array( 'page' => $page - 1 ) );
|
2007-01-26 12:00:04 +00:00
|
|
|
} else {
|
|
|
|
|
$thumb1 = '';
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $page < $count ) {
|
2007-01-26 12:00:04 +00:00
|
|
|
$label = wfMsg( 'imgmultipagenext' );
|
2009-06-06 22:42:48 +00:00
|
|
|
$link = $sk->link(
|
|
|
|
|
$this->mTitle,
|
|
|
|
|
$label,
|
|
|
|
|
array(),
|
|
|
|
|
array( 'page' => $page + 1 ),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
2008-05-21 21:33:58 +00:00
|
|
|
$thumb2 = $sk->makeThumbLinkObj( $this->mTitle, $this->displayImg, $link, $label, 'none',
|
2007-04-20 12:31:36 +00:00
|
|
|
array( 'page' => $page + 1 ) );
|
2007-01-26 12:00:04 +00:00
|
|
|
} else {
|
|
|
|
|
$thumb2 = '';
|
2006-08-13 17:34:48 +00:00
|
|
|
}
|
2007-01-26 12:00:04 +00:00
|
|
|
|
2007-01-26 12:10:06 +00:00
|
|
|
global $wgScript;
|
2008-05-10 11:56:02 +00:00
|
|
|
|
|
|
|
|
$formParams = array(
|
|
|
|
|
'name' => 'pageselector',
|
|
|
|
|
'action' => $wgScript,
|
|
|
|
|
'onchange' => 'document.pageselector.submit();',
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$option = array();
|
2007-01-26 12:00:04 +00:00
|
|
|
for ( $i=1; $i <= $count; $i++ ) {
|
2008-05-10 11:56:02 +00:00
|
|
|
$options[] = Xml::option( $wgLang->formatNum($i), $i, $i == $page );
|
2007-01-26 12:00:04 +00:00
|
|
|
}
|
2008-05-10 11:56:02 +00:00
|
|
|
$select = Xml::tags( 'select',
|
|
|
|
|
array( 'id' => 'pageselector', 'name' => 'page' ),
|
|
|
|
|
implode( "\n", $options ) );
|
|
|
|
|
|
|
|
|
|
$wgOut->addHTML(
|
|
|
|
|
'</td><td><div class="multipageimagenavbox">' .
|
|
|
|
|
Xml::openElement( 'form', $formParams ) .
|
|
|
|
|
Xml::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) .
|
|
|
|
|
wfMsgExt( 'imgmultigoto', array( 'parseinline', 'replaceafter' ), $select ) .
|
|
|
|
|
Xml::submitButton( wfMsg( 'imgmultigo' ) ) .
|
|
|
|
|
Xml::closeElement( 'form' ) .
|
|
|
|
|
"<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>"
|
|
|
|
|
);
|
2006-08-13 17:34:48 +00:00
|
|
|
}
|
2004-01-16 18:11:47 +00:00
|
|
|
} else {
|
2005-05-21 07:46:17 +00:00
|
|
|
#if direct link is allowed but it's not a renderable image, show an icon.
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $this->displayImg->isSafeFile() ) {
|
2008-05-21 21:33:58 +00:00
|
|
|
$icon= $this->displayImg->iconThumb();
|
2005-07-03 04:40:07 +00:00
|
|
|
|
2007-08-31 02:51:23 +00:00
|
|
|
$wgOut->addHTML( '<div class="fullImageLink" id="file">' .
|
2009-09-26 09:25:15 +00:00
|
|
|
$icon->toHtml( array( 'file-link' => true ) ) .
|
2009-03-28 16:41:00 +00:00
|
|
|
"</div>\n" );
|
2005-05-21 07:46:17 +00:00
|
|
|
}
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2005-05-21 07:46:17 +00:00
|
|
|
$showLink = true;
|
2004-01-16 18:11:47 +00:00
|
|
|
}
|
2005-07-03 04:40:07 +00:00
|
|
|
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if($showLink) {
|
2008-05-21 21:33:58 +00:00
|
|
|
$filename = wfEscapeWikiText( $this->displayImg->getName() );
|
2009-06-16 01:06:13 +00:00
|
|
|
$medialink = "[[Media:$filename|$filename]]";
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( !$this->displayImg->isSafeFile() ) {
|
2008-02-18 07:25:35 +00:00
|
|
|
$warning = wfMsgNoTrans( 'mediawarning' );
|
2007-05-30 21:02:32 +00:00
|
|
|
$wgOut->addWikiText( <<<EOT
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
<div class="fullMedia">
|
2009-04-26 11:12:39 +00:00
|
|
|
<span class="dangerousLink">{$medialink}</span>$dirmark
|
2009-03-28 16:41:00 +00:00
|
|
|
<span class="fileInfo">$longDesc</span>
|
2005-08-12 04:44:43 +00:00
|
|
|
</div>
|
|
|
|
|
<div class="mediaWarning">$warning</div>
|
2007-05-30 21:02:32 +00:00
|
|
|
EOT
|
2005-08-12 04:44:43 +00:00
|
|
|
);
|
2005-05-21 07:46:17 +00:00
|
|
|
} else {
|
2007-05-30 21:02:32 +00:00
|
|
|
$wgOut->addWikiText( <<<EOT
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
<div class="fullMedia">
|
2009-04-26 11:12:39 +00:00
|
|
|
{$medialink}{$dirmark}
|
2009-03-28 16:41:00 +00:00
|
|
|
<span class="fileInfo">$longDesc</span>
|
2005-08-12 04:44:43 +00:00
|
|
|
</div>
|
2007-05-30 21:02:32 +00:00
|
|
|
EOT
|
2009-05-25 13:53:48 +00:00
|
|
|
);
|
2005-05-21 07:46:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
2005-07-03 04:40:07 +00:00
|
|
|
|
2008-05-21 21:33:58 +00:00
|
|
|
if( !$this->displayImg->isLocal() ) {
|
2005-07-03 04:40:07 +00:00
|
|
|
$this->printSharedImageText();
|
2004-10-21 05:04:14 +00:00
|
|
|
}
|
2005-04-17 08:30:15 +00:00
|
|
|
} else {
|
|
|
|
|
# Image does not exist
|
2009-05-24 20:45:31 +00:00
|
|
|
if ( $wgEnableUploads && $wgUser->isAllowed( 'upload' ) ) {
|
|
|
|
|
// Only show an upload link if the user can upload
|
2009-05-25 13:53:48 +00:00
|
|
|
$uploadTitle = SpecialPage::getTitleFor( 'Upload' );
|
2009-06-15 13:20:40 +00:00
|
|
|
$nofile = array(
|
2009-05-25 13:53:48 +00:00
|
|
|
'filepage-nofile-link',
|
2009-05-25 14:02:54 +00:00
|
|
|
$uploadTitle->getFullUrl( array( 'wpDestFile' => $this->img->getName() ) )
|
2009-05-25 13:53:48 +00:00
|
|
|
);
|
2009-05-25 13:42:47 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2009-06-15 13:20:40 +00:00
|
|
|
$nofile = 'filepage-nofile';
|
2009-05-24 20:45:31 +00:00
|
|
|
}
|
2009-02-26 20:10:48 +00:00
|
|
|
$wgOut->setRobotPolicy( 'noindex,nofollow' );
|
2009-06-25 05:38:54 +00:00
|
|
|
$wgOut->wrapWikiMsg( "<div id='mw-imagepage-nofile' class='plainlinks'>\n$1\n</div>", $nofile );
|
2004-01-12 00:55:01 +00:00
|
|
|
}
|
|
|
|
|
}
|
2005-07-03 04:40:07 +00:00
|
|
|
|
2008-02-19 16:29:28 +00:00
|
|
|
/**
|
|
|
|
|
* Show a notice that the file is from a shared repository
|
|
|
|
|
*/
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function printSharedImageText() {
|
2009-04-28 03:03:48 +00:00
|
|
|
global $wgOut;
|
2006-11-08 07:12:03 +00:00
|
|
|
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
|
|
|
|
|
2007-05-30 21:02:32 +00:00
|
|
|
$descUrl = $this->img->getDescriptionUrl();
|
|
|
|
|
$descText = $this->img->getDescriptionText();
|
2009-03-28 08:21:29 +00:00
|
|
|
|
2009-03-28 16:41:00 +00:00
|
|
|
$wrap = "<div class=\"sharedUploadNotice\">\n$1\n</div>\n";
|
2009-03-28 08:21:29 +00:00
|
|
|
$repo = $this->img->getRepo()->getDisplayName();
|
|
|
|
|
|
2009-02-17 23:18:40 +00:00
|
|
|
$msg = '';
|
2009-03-28 08:21:29 +00:00
|
|
|
if( $descUrl && $descText && wfMsgNoTrans( 'sharedupload-desc-here' ) !== '-' ) {
|
|
|
|
|
$wgOut->wrapWikiMsg( $wrap, array( 'sharedupload-desc-here', $repo, $descUrl ) );
|
|
|
|
|
} elseif ( $descUrl && wfMsgNoTrans( 'sharedupload-desc-there' ) !== '-' ) {
|
|
|
|
|
$wgOut->wrapWikiMsg( $wrap, array( 'sharedupload-desc-there', $repo, $descUrl ) );
|
|
|
|
|
} else {
|
|
|
|
|
$wgOut->wrapWikiMsg( $wrap, array( 'sharedupload', $repo ), ''/*BACKCOMPAT*/ );
|
2005-07-03 04:40:07 +00:00
|
|
|
}
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $descText ) {
|
2007-05-30 21:02:32 +00:00
|
|
|
$this->mExtraDescription = $descText;
|
2005-07-03 04:40:07 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
public function getUploadUrl() {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2006-10-30 06:25:31 +00:00
|
|
|
$uploadTitle = SpecialPage::getTitleFor( 'Upload' );
|
2009-05-25 13:53:48 +00:00
|
|
|
return $uploadTitle->getFullUrl( array(
|
2009-05-25 14:02:54 +00:00
|
|
|
'wpDestFile' => $this->img->getName(),
|
2009-05-25 13:53:48 +00:00
|
|
|
'wpForReUpload' => 1
|
|
|
|
|
) );
|
2005-04-17 08:30:15 +00:00
|
|
|
}
|
|
|
|
|
|
2006-05-22 09:28:03 +00:00
|
|
|
/**
|
|
|
|
|
* Print out the various links at the bottom of the image page, e.g. reupload,
|
|
|
|
|
* external editing (and instructions link) etc.
|
|
|
|
|
*/
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function uploadLinksBox() {
|
2009-05-24 20:45:31 +00:00
|
|
|
global $wgUser, $wgOut, $wgEnableUploads;
|
|
|
|
|
|
|
|
|
|
if( !$wgEnableUploads ) { return; }
|
2005-07-03 05:21:06 +00:00
|
|
|
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2007-05-30 21:02:32 +00:00
|
|
|
if( !$this->img->isLocal() )
|
2005-07-03 05:21:06 +00:00
|
|
|
return;
|
|
|
|
|
|
2006-11-08 07:12:03 +00:00
|
|
|
$sk = $wgUser->getSkin();
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2009-03-28 16:41:00 +00:00
|
|
|
$wgOut->addHTML( "<br /><ul>\n" );
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-05-22 09:28:03 +00:00
|
|
|
# "Upload a new version of this file" link
|
2009-07-17 10:34:03 +00:00
|
|
|
if( UploadBase::userCanReUpload($wgUser,$this->img->name) ) {
|
2006-11-08 07:12:03 +00:00
|
|
|
$ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
|
2009-03-28 16:41:00 +00:00
|
|
|
$wgOut->addHTML( "<li id=\"mw-imagepage-reupload-link\"><div class=\"plainlinks\">{$ulink}</div></li>\n" );
|
2005-09-05 06:16:48 +00:00
|
|
|
}
|
2008-03-19 16:58:56 +00:00
|
|
|
|
2006-05-22 09:28:03 +00:00
|
|
|
# External editing link
|
2009-06-06 22:42:48 +00:00
|
|
|
$elink = $sk->link(
|
|
|
|
|
$this->mTitle,
|
|
|
|
|
wfMsgHtml( 'edit-externally' ),
|
|
|
|
|
array(),
|
|
|
|
|
array(
|
|
|
|
|
'action' => 'edit',
|
|
|
|
|
'externaledit' => 'true',
|
|
|
|
|
'mode' => 'file'
|
|
|
|
|
),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
2009-03-28 16:41:00 +00:00
|
|
|
$wgOut->addHTML( '<li id="mw-imagepage-edit-external">' . $elink . ' <small>' . wfMsgExt( 'edit-externally-help', array( 'parseinline' ) ) . "</small></li>\n" );
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2009-03-28 16:41:00 +00:00
|
|
|
$wgOut->addHTML( "</ul>\n" );
|
2005-03-24 13:30:09 +00:00
|
|
|
}
|
2005-07-03 04:40:07 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function closeShowImage() {} # For overloading
|
2004-01-12 00:55:01 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
|
|
|
|
* If the page we've just displayed is in the "Image" namespace,
|
|
|
|
|
* we follow it with an upload history of the image and its usage.
|
|
|
|
|
*/
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function imageHistory() {
|
2008-05-23 09:03:49 +00:00
|
|
|
global $wgOut, $wgUseExternalEditor;
|
2003-09-01 09:59:53 +00:00
|
|
|
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2008-12-14 07:10:42 +00:00
|
|
|
$pager = new ImageHistoryPseudoPager( $this );
|
|
|
|
|
$wgOut->addHTML( $pager->getBody() );
|
2005-04-30 01:59:51 +00:00
|
|
|
|
2008-08-08 21:31:38 +00:00
|
|
|
$this->img->resetHistory(); // free db resources
|
2007-07-07 03:04:20 +00:00
|
|
|
|
2005-04-30 02:37:16 +00:00
|
|
|
# Exist check because we don't want to show this on pages where an image
|
|
|
|
|
# doesn't exist along with the noimage message, that would suck. -ævar
|
|
|
|
|
if( $wgUseExternalEditor && $this->img->exists() ) {
|
2005-04-30 01:59:51 +00:00
|
|
|
$this->uploadLinksBox();
|
|
|
|
|
}
|
2003-09-01 09:59:53 +00:00
|
|
|
}
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function imageLinks() {
|
2008-08-08 21:31:38 +00:00
|
|
|
global $wgUser, $wgOut, $wgLang;
|
2008-06-11 12:07:58 +00:00
|
|
|
|
2008-05-09 11:31:00 +00:00
|
|
|
$limit = 100;
|
2008-05-05 22:14:55 +00:00
|
|
|
|
|
|
|
|
$dbr = wfGetDB( DB_SLAVE );
|
|
|
|
|
|
2008-05-09 11:31:00 +00:00
|
|
|
$res = $dbr->select(
|
|
|
|
|
array( 'imagelinks', 'page' ),
|
|
|
|
|
array( 'page_namespace', 'page_title' ),
|
|
|
|
|
array( 'il_to' => $this->mTitle->getDBkey(), 'il_from = page_id' ),
|
|
|
|
|
__METHOD__,
|
|
|
|
|
array( 'LIMIT' => $limit + 1)
|
|
|
|
|
);
|
2008-06-11 12:07:58 +00:00
|
|
|
$count = $dbr->numRows( $res );
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $count == 0 ) {
|
2008-05-29 03:44:45 +00:00
|
|
|
$wgOut->addHTML( "<div id='mw-imagepage-nolinkstoimage'>\n" );
|
2008-05-09 18:40:52 +00:00
|
|
|
$wgOut->addWikiMsg( 'nolinkstoimage' );
|
2008-05-29 03:44:45 +00:00
|
|
|
$wgOut->addHTML( "</div>\n" );
|
2008-05-05 22:14:55 +00:00
|
|
|
return;
|
2008-08-08 20:55:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$wgOut->addHTML( "<div id='mw-imagepage-section-linkstoimage'>\n" );
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $count <= $limit - 1 ) {
|
2008-08-07 18:46:18 +00:00
|
|
|
$wgOut->addWikiMsg( 'linkstoimage', $count );
|
|
|
|
|
} else {
|
|
|
|
|
// More links than the limit. Add a link to [[Special:Whatlinkshere]]
|
2008-08-08 21:31:38 +00:00
|
|
|
$wgOut->addWikiMsg( 'linkstoimage-more',
|
|
|
|
|
$wgLang->formatNum( $limit ),
|
|
|
|
|
$this->mTitle->getPrefixedDBkey()
|
|
|
|
|
);
|
2008-05-05 22:14:55 +00:00
|
|
|
}
|
|
|
|
|
|
2008-08-08 20:56:46 +00:00
|
|
|
$wgOut->addHTML( "<ul class='mw-imagepage-linkstoimage'>\n" );
|
2008-05-05 22:14:55 +00:00
|
|
|
$sk = $wgUser->getSkin();
|
2008-05-09 11:31:00 +00:00
|
|
|
$count = 0;
|
|
|
|
|
while ( $s = $res->fetchObject() ) {
|
|
|
|
|
$count++;
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $count <= $limit ) {
|
2008-05-09 11:31:00 +00:00
|
|
|
// We have not yet reached the extra one that tells us there is more to fetch
|
2009-06-06 22:42:48 +00:00
|
|
|
$link = $sk->link(
|
|
|
|
|
Title::makeTitle( $s->page_namespace, $s->page_title ),
|
|
|
|
|
null,
|
|
|
|
|
array(),
|
|
|
|
|
array(),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
2008-05-09 11:31:00 +00:00
|
|
|
$wgOut->addHTML( "<li>{$link}</li>\n" );
|
|
|
|
|
}
|
2008-05-05 22:14:55 +00:00
|
|
|
}
|
2009-03-28 16:41:00 +00:00
|
|
|
$wgOut->addHTML( "</ul>\n" );
|
2008-05-09 11:31:00 +00:00
|
|
|
$res->free();
|
2008-06-11 12:07:58 +00:00
|
|
|
|
2008-05-09 11:31:00 +00:00
|
|
|
// Add a links to [[Special:Whatlinkshere]]
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $count > $limit )
|
2008-05-09 18:40:52 +00:00
|
|
|
$wgOut->addWikiMsg( 'morelinkstoimage', $this->mTitle->getPrefixedDBkey() );
|
2009-03-28 16:41:00 +00:00
|
|
|
$wgOut->addHTML( "</div>\n" );
|
2008-05-05 22:14:55 +00:00
|
|
|
}
|
2008-05-08 21:53:39 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function imageRedirects() {
|
2008-08-08 21:31:38 +00:00
|
|
|
global $wgUser, $wgOut, $wgLang;
|
2008-06-11 12:07:58 +00:00
|
|
|
|
2008-12-01 17:14:30 +00:00
|
|
|
$redirects = $this->getTitle()->getRedirectsHere( NS_FILE );
|
2008-11-28 14:29:25 +00:00
|
|
|
if( count( $redirects ) == 0 ) return;
|
2008-05-08 21:53:39 +00:00
|
|
|
|
2008-06-11 01:51:12 +00:00
|
|
|
$wgOut->addHTML( "<div id='mw-imagepage-section-redirectstofile'>\n" );
|
2008-08-08 21:31:38 +00:00
|
|
|
$wgOut->addWikiMsg( 'redirectstofile',
|
|
|
|
|
$wgLang->formatNum( count( $redirects ) )
|
|
|
|
|
);
|
2008-06-11 01:51:12 +00:00
|
|
|
$wgOut->addHTML( "<ul class='mw-imagepage-redirectstofile'>\n" );
|
2008-05-08 21:53:39 +00:00
|
|
|
|
|
|
|
|
$sk = $wgUser->getSkin();
|
2008-05-15 19:17:21 +00:00
|
|
|
foreach ( $redirects as $title ) {
|
2009-06-06 22:42:48 +00:00
|
|
|
$link = $sk->link(
|
|
|
|
|
$title,
|
|
|
|
|
null,
|
|
|
|
|
array(),
|
|
|
|
|
array( 'redirect' => 'no' ),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
2008-05-08 21:53:39 +00:00
|
|
|
$wgOut->addHTML( "<li>{$link}</li>\n" );
|
|
|
|
|
}
|
2008-05-28 19:51:18 +00:00
|
|
|
$wgOut->addHTML( "</ul></div>\n" );
|
2008-05-15 19:17:21 +00:00
|
|
|
|
2008-05-08 21:53:39 +00:00
|
|
|
}
|
2008-06-11 12:07:58 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
protected function imageDupes() {
|
2008-08-08 21:31:38 +00:00
|
|
|
global $wgOut, $wgUser, $wgLang;
|
2008-05-20 03:26:59 +00:00
|
|
|
|
|
|
|
|
$this->loadFile();
|
|
|
|
|
|
2008-05-15 19:17:21 +00:00
|
|
|
$dupes = $this->getDuplicates();
|
2008-11-28 14:29:25 +00:00
|
|
|
if( count( $dupes ) == 0 ) return;
|
2008-05-15 07:16:22 +00:00
|
|
|
|
2008-06-11 01:51:12 +00:00
|
|
|
$wgOut->addHTML( "<div id='mw-imagepage-section-duplicates'>\n" );
|
2008-08-08 21:31:38 +00:00
|
|
|
$wgOut->addWikiMsg( 'duplicatesoffile',
|
2009-02-16 08:51:38 +00:00
|
|
|
$wgLang->formatNum( count( $dupes ) ), $this->mTitle->getDBkey()
|
2008-08-08 21:31:38 +00:00
|
|
|
);
|
2008-06-11 01:51:12 +00:00
|
|
|
$wgOut->addHTML( "<ul class='mw-imagepage-duplicates'>\n" );
|
2008-05-15 07:16:22 +00:00
|
|
|
|
2008-05-14 15:11:48 +00:00
|
|
|
$sk = $wgUser->getSkin();
|
|
|
|
|
foreach ( $dupes as $file ) {
|
2009-02-17 22:27:10 +00:00
|
|
|
$fromSrc = '';
|
2009-06-06 22:42:48 +00:00
|
|
|
if( $file->isLocal() ) {
|
|
|
|
|
$link = $sk->link(
|
|
|
|
|
$file->getTitle(),
|
|
|
|
|
null,
|
|
|
|
|
array(),
|
|
|
|
|
array(),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
|
|
|
|
} else {
|
2008-08-08 21:31:38 +00:00
|
|
|
$link = $sk->makeExternalLink( $file->getDescriptionUrl(),
|
2008-05-14 17:29:38 +00:00
|
|
|
$file->getTitle()->getPrefixedText() );
|
2009-02-17 22:27:10 +00:00
|
|
|
$fromSrc = wfMsg( 'shared-repo-from', $file->getRepo()->getDisplayName() );
|
2008-08-08 21:31:38 +00:00
|
|
|
}
|
2009-02-17 22:27:10 +00:00
|
|
|
$wgOut->addHTML( "<li>{$link} {$fromSrc}</li>\n" );
|
2008-05-14 15:11:48 +00:00
|
|
|
}
|
2008-05-28 19:51:18 +00:00
|
|
|
$wgOut->addHTML( "</ul></div>\n" );
|
2008-05-14 15:11:48 +00:00
|
|
|
}
|
2008-05-05 22:14:55 +00:00
|
|
|
|
2006-06-07 06:40:24 +00:00
|
|
|
/**
|
2007-08-17 20:53:17 +00:00
|
|
|
* Delete the file, or an earlier version of it
|
2006-06-07 06:40:24 +00:00
|
|
|
*/
|
2007-08-17 20:53:17 +00:00
|
|
|
public function delete() {
|
2009-09-11 23:36:28 +00:00
|
|
|
global $wgUploadMaintenance;
|
|
|
|
|
if( $wgUploadMaintenance && $this->mTitle && $this->mTitle->getNamespace() == NS_FILE ) {
|
|
|
|
|
global $wgOut;
|
2009-09-12 08:25:54 +00:00
|
|
|
$wgOut->wrapWikiMsg( "<div class='error'>\n$1</div>\n", array( 'filedelete-maintenance' ) );
|
2009-09-11 23:36:28 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2008-05-20 22:09:30 +00:00
|
|
|
if( !$this->img->exists() || !$this->img->isLocal() || $this->img->getRedirected() ) {
|
2007-08-17 20:53:17 +00:00
|
|
|
// Standard article deletion
|
|
|
|
|
Article::delete();
|
|
|
|
|
return;
|
2003-09-01 09:59:53 +00:00
|
|
|
}
|
2007-08-17 20:53:17 +00:00
|
|
|
$deleter = new FileDeleteForm( $this->img );
|
|
|
|
|
$deleter->execute();
|
2003-09-01 09:59:53 +00:00
|
|
|
}
|
|
|
|
|
|
2007-07-29 22:00:46 +00:00
|
|
|
/**
|
|
|
|
|
* Revert the file to an earlier version
|
|
|
|
|
*/
|
2007-08-17 20:53:17 +00:00
|
|
|
public function revert() {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2007-07-29 22:00:46 +00:00
|
|
|
$reverter = new FileRevertForm( $this->img );
|
|
|
|
|
$reverter->execute();
|
2003-09-01 09:59:53 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-03-01 01:27:36 +00:00
|
|
|
/**
|
|
|
|
|
* Override handling of action=purge
|
|
|
|
|
*/
|
2008-11-28 14:29:25 +00:00
|
|
|
public function doPurge() {
|
2008-05-20 03:26:59 +00:00
|
|
|
$this->loadFile();
|
2006-03-01 01:27:36 +00:00
|
|
|
if( $this->img->exists() ) {
|
|
|
|
|
wfDebug( "ImagePage::doPurge purging " . $this->img->getName() . "\n" );
|
2006-06-18 12:42:16 +00:00
|
|
|
$update = new HTMLCacheUpdate( $this->mTitle, 'imagelinks' );
|
|
|
|
|
$update->doUpdate();
|
2007-05-04 19:39:19 +00:00
|
|
|
$this->img->upgradeRow();
|
2006-03-01 01:27:36 +00:00
|
|
|
$this->img->purgeCache();
|
|
|
|
|
} else {
|
2009-04-24 23:11:07 +00:00
|
|
|
wfDebug( "ImagePage::doPurge no image for " . $this->img->getName() . "; limiting purge to cache only\n" );
|
|
|
|
|
// even if the file supposedly doesn't exist, force any cached information
|
|
|
|
|
// to be updated (in case the cached information is wrong)
|
|
|
|
|
$this->img->purgeCache();
|
2006-03-01 01:27:36 +00:00
|
|
|
}
|
|
|
|
|
parent::doPurge();
|
|
|
|
|
}
|
2005-07-01 21:15:31 +00:00
|
|
|
|
2007-05-30 21:02:32 +00:00
|
|
|
/**
|
2007-07-22 14:45:12 +00:00
|
|
|
* Display an error with a wikitext description
|
2007-05-30 21:02:32 +00:00
|
|
|
*/
|
2007-07-22 14:45:12 +00:00
|
|
|
function showError( $description ) {
|
2007-05-30 21:02:32 +00:00
|
|
|
global $wgOut;
|
|
|
|
|
$wgOut->setPageTitle( wfMsg( "internalerror" ) );
|
2008-07-23 19:05:43 +00:00
|
|
|
$wgOut->setRobotPolicy( "noindex,nofollow" );
|
2007-05-30 21:02:32 +00:00
|
|
|
$wgOut->setArticleRelated( false );
|
|
|
|
|
$wgOut->enableClientCache( false );
|
2007-07-22 14:45:12 +00:00
|
|
|
$wgOut->addWikiText( $description );
|
2007-05-30 21:02:32 +00:00
|
|
|
}
|
|
|
|
|
|
2003-09-01 09:59:53 +00:00
|
|
|
}
|
|
|
|
|
|
2005-01-27 19:51:47 +00:00
|
|
|
/**
|
2007-07-29 18:41:49 +00:00
|
|
|
* Builds the image revision log shown on image pages
|
|
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Media
|
2005-01-27 19:51:47 +00:00
|
|
|
*/
|
2004-11-25 13:47:17 +00:00
|
|
|
class ImageHistoryList {
|
2007-07-29 18:41:49 +00:00
|
|
|
|
2009-07-12 05:37:12 +00:00
|
|
|
protected $imagePage, $img, $skin, $title, $repo, $showThumb;
|
2008-05-23 09:03:49 +00:00
|
|
|
|
|
|
|
|
public function __construct( $imagePage ) {
|
2009-07-12 05:37:12 +00:00
|
|
|
global $wgUser, $wgShowArchiveThumbnails;
|
2008-05-23 09:03:49 +00:00
|
|
|
$this->skin = $wgUser->getSkin();
|
|
|
|
|
$this->current = $imagePage->getFile();
|
|
|
|
|
$this->img = $imagePage->getDisplayedFile();
|
|
|
|
|
$this->title = $imagePage->getTitle();
|
|
|
|
|
$this->imagePage = $imagePage;
|
2009-09-25 14:48:44 +00:00
|
|
|
$this->showThumb = $wgShowArchiveThumbnails && $this->img->canRender();
|
2008-05-23 09:03:49 +00:00
|
|
|
}
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
public function getImagePage() {
|
2008-05-23 09:03:49 +00:00
|
|
|
return $this->imagePage;
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
public function getSkin() {
|
2008-05-23 09:03:49 +00:00
|
|
|
return $this->skin;
|
|
|
|
|
}
|
2007-07-29 18:41:49 +00:00
|
|
|
|
2008-11-28 14:29:25 +00:00
|
|
|
public function getFile() {
|
2008-05-23 09:03:49 +00:00
|
|
|
return $this->img;
|
2004-11-25 13:47:17 +00:00
|
|
|
}
|
2005-07-03 04:40:07 +00:00
|
|
|
|
2008-12-14 07:10:42 +00:00
|
|
|
public function beginImageHistoryList( $navLinks = '' ) {
|
2007-07-29 18:41:49 +00:00
|
|
|
global $wgOut, $wgUser;
|
2009-03-28 16:41:00 +00:00
|
|
|
return Xml::element( 'h2', array( 'id' => 'filehistory' ), wfMsg( 'filehist' ) ) . "\n"
|
|
|
|
|
. "<div id=\"mw-imagepage-section-filehistory\">\n"
|
2007-07-29 18:41:49 +00:00
|
|
|
. $wgOut->parse( wfMsgNoTrans( 'filehist-help' ) )
|
2009-03-28 16:41:00 +00:00
|
|
|
. $navLinks . "\n"
|
2009-06-17 18:05:03 +00:00
|
|
|
. Xml::openElement( 'table', array( 'class' => 'wikitable filehistory' ) ) . "\n"
|
2008-05-19 15:21:29 +00:00
|
|
|
. '<tr><td></td>'
|
2009-09-28 03:09:48 +00:00
|
|
|
. ( $this->current->isLocal() && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deletedrevision') ) ? '<td></td>' : '' )
|
2008-05-19 15:21:29 +00:00
|
|
|
. '<th>' . wfMsgHtml( 'filehist-datetime' ) . '</th>'
|
2009-07-12 05:37:12 +00:00
|
|
|
. ( $this->showThumb ? '<th>' . wfMsgHtml( 'filehist-thumb' ) . '</th>' : '' )
|
2008-05-19 15:21:29 +00:00
|
|
|
. '<th>' . wfMsgHtml( 'filehist-dimensions' ) . '</th>'
|
2008-08-08 21:31:38 +00:00
|
|
|
. '<th>' . wfMsgHtml( 'filehist-user' ) . '</th>'
|
|
|
|
|
. '<th>' . wfMsgHtml( 'filehist-comment' ) . '</th>'
|
2008-05-19 15:21:29 +00:00
|
|
|
. "</tr>\n";
|
2004-11-25 13:47:17 +00:00
|
|
|
}
|
|
|
|
|
|
2008-12-14 07:10:42 +00:00
|
|
|
public function endImageHistoryList( $navLinks = '' ) {
|
2009-03-28 16:41:00 +00:00
|
|
|
return "</table>\n$navLinks\n</div>\n";
|
2004-11-25 13:47:17 +00:00
|
|
|
}
|
|
|
|
|
|
2008-03-19 18:09:20 +00:00
|
|
|
public function imageHistoryLine( $iscur, $file ) {
|
|
|
|
|
global $wgUser, $wgLang, $wgContLang, $wgTitle;
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-03-19 18:09:20 +00:00
|
|
|
$timestamp = wfTimestamp(TS_MW, $file->getTimestamp());
|
|
|
|
|
$img = $iscur ? $file->getName() : $file->getArchiveName();
|
|
|
|
|
$user = $file->getUser('id');
|
|
|
|
|
$usertext = $file->getUser('text');
|
|
|
|
|
$description = $file->getDescription();
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2008-05-19 18:55:48 +00:00
|
|
|
$local = $this->current->isLocal();
|
|
|
|
|
$row = $css = $selected = '';
|
2007-07-30 21:09:31 +00:00
|
|
|
|
2007-07-29 18:41:49 +00:00
|
|
|
// Deletion link
|
2009-09-28 03:09:48 +00:00
|
|
|
if( $local && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deletedrevision') ) ) {
|
2008-05-19 15:21:29 +00:00
|
|
|
$row .= '<td>';
|
2008-03-19 18:09:20 +00:00
|
|
|
# Link to remove from history
|
|
|
|
|
if( $wgUser->isAllowed( 'delete' ) ) {
|
2009-04-07 16:37:29 +00:00
|
|
|
$q = array( 'action' => 'delete' );
|
2008-03-19 18:09:20 +00:00
|
|
|
if( !$iscur )
|
2009-04-07 16:37:29 +00:00
|
|
|
$q['oldimage'] = $img;
|
|
|
|
|
$row .= $this->skin->link(
|
2008-03-19 18:09:20 +00:00
|
|
|
$this->title,
|
|
|
|
|
wfMsgHtml( $iscur ? 'filehist-deleteall' : 'filehist-deleteone' ),
|
2009-04-07 16:37:29 +00:00
|
|
|
array(), $q, array( 'known' )
|
2008-03-19 18:09:20 +00:00
|
|
|
);
|
|
|
|
|
}
|
2009-09-28 03:09:48 +00:00
|
|
|
# Link to hide content. Don't show useless link to people who cannot hide revisions.
|
|
|
|
|
if( $wgUser->isAllowed('deleterevision') || ($wgUser->isAllowed('deletedrevision') && $file->getVisibility()) ) {
|
2008-05-19 15:21:29 +00:00
|
|
|
if( $wgUser->isAllowed('delete') ) {
|
|
|
|
|
$row .= '<br/>';
|
|
|
|
|
}
|
2008-03-19 18:09:20 +00:00
|
|
|
// If file is top revision or locked from this user, don't link
|
|
|
|
|
if( $iscur || !$file->userCan(File::DELETED_RESTRICTED) ) {
|
2008-04-14 07:45:50 +00:00
|
|
|
$del = wfMsgHtml( 'rev-delundel' );
|
2008-03-19 18:09:20 +00:00
|
|
|
} else {
|
2009-04-07 16:37:29 +00:00
|
|
|
list( $ts, $name ) = explode( '!', $img, 2 );
|
2009-09-28 03:09:48 +00:00
|
|
|
$del = $this->skin->link(
|
|
|
|
|
SpecialPage::getTitleFor( 'Revisiondelete' ),
|
|
|
|
|
wfMsgHtml( 'rev-delundel' ),
|
2009-04-07 16:37:29 +00:00
|
|
|
array(),
|
In Special:RevisionDelete:
* Refactored to remove massive duplication
* Removed page parameter and associated contextPage member variable, doesn't seem to do anything.
* Put ID lists into a single ids parameter and member variable instead of having one for each type.
* Fixed inappropriate call of Title::newFromUrl(), always wrong
* Don't pretend to use the return value from functions that don't return anything, this reduces readability.
* Use the table names for deleteKey/typeName values, they look more like English
* Use protected not private
* Remove requirement for log type to be specified in the target
* Use POST for RevisionDelete entry forms, to avoid URL size limits and issues with non-PATH_INFO URLs
* Don't purge all pages that use the given file
* LocalFile::purgeCache() already calls purgeHistory,() no need to do it again. But do call purgeDescription().
* Removed token from unhide=1 links, unnecessary
* Tokens are necessary on file streaming links, added them
* Fixed private data leakage due to incorrect use of LocalRepo::newFromArchiveName(). Non-existent placeholder file was returned which meant that $oimage->userCan(File::DELETED_FILE) was always true. Pass the archive name to tryShowFile() instead of the storage key.
* Using ls_field='oi_timestamp' is not correct, oi_timestamp refers to the timestamp of the revision in question, whereas the key that is stored is the timestamp of the previous revision (i.e. the timestamp in oi_archive_name). oi_archive_name would be more correct, although only half the field is used.
Elsewhere:
* Added missing message filehist-missing
* Fixed double asterisk in Status::getWikiText()
* Fixed escaping of the target parameter to Special:RevisionDelete from ImagePage
* Deleted FileStore.php. Deprecated in filerepo refactor except for get()/export() but somehow resurrected by RevisionDelete. Hopefully this will be the end of it. New interfaces will be added for wfStreamFile() in a later commit.
* Added convenience function File::getStorageKey(), factored out of Special:Undelete
* Added convenience function Revision::newFromArchiveRow(), factored out of Special:Undelete and Special:RevisionDelete
* Fixed notice in Special:Upload, uninitialised $pageText
FIXME: current revision can be suppressed on undeletion causing an unauthenticated unsuppress. Comments indicate this is a known issue. I fixed the parser cache pollution in this case but not the rest.
2009-06-01 11:37:06 +00:00
|
|
|
array(
|
|
|
|
|
'type' => 'oldimage',
|
|
|
|
|
'target' => $wgTitle->getPrefixedText(),
|
|
|
|
|
'ids' => $ts,
|
|
|
|
|
),
|
2009-04-07 16:37:29 +00:00
|
|
|
array( 'known' )
|
|
|
|
|
);
|
2009-09-28 02:11:50 +00:00
|
|
|
// Bolden oversighted content
|
|
|
|
|
if( $file->isDeleted(File::DELETED_RESTRICTED) )
|
|
|
|
|
$del = "<strong>$del</strong>";
|
2008-03-19 18:09:20 +00:00
|
|
|
}
|
2009-09-04 00:29:20 +00:00
|
|
|
$row .= "<span class='mw-revdelundel-link'>$del</span>";
|
2008-03-19 18:09:20 +00:00
|
|
|
}
|
2008-05-19 15:21:29 +00:00
|
|
|
$row .= '</td>';
|
2004-11-25 13:47:17 +00:00
|
|
|
}
|
2007-07-30 21:09:31 +00:00
|
|
|
|
2007-07-29 18:41:49 +00:00
|
|
|
// Reversion link/current indicator
|
2007-10-01 19:50:25 +00:00
|
|
|
$row .= '<td>';
|
2007-07-29 18:41:49 +00:00
|
|
|
if( $iscur ) {
|
2008-02-05 12:40:41 +00:00
|
|
|
$row .= wfMsgHtml( 'filehist-current' );
|
2007-07-29 18:41:49 +00:00
|
|
|
} elseif( $local && $wgUser->isLoggedIn() && $this->title->userCan( 'edit' ) ) {
|
2008-03-19 18:09:20 +00:00
|
|
|
if( $file->isDeleted(File::DELETED_FILE) ) {
|
|
|
|
|
$row .= wfMsgHtml('filehist-revert');
|
|
|
|
|
} else {
|
2009-06-06 22:42:48 +00:00
|
|
|
$row .= $this->skin->link(
|
|
|
|
|
$this->title,
|
2008-03-19 18:09:20 +00:00
|
|
|
wfMsgHtml( 'filehist-revert' ),
|
2009-06-06 22:42:48 +00:00
|
|
|
array(),
|
|
|
|
|
array(
|
|
|
|
|
'action' => 'revert',
|
|
|
|
|
'oldimage' => $img,
|
|
|
|
|
'wpEditToken' => $wgUser->editToken( $img )
|
|
|
|
|
),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
2008-03-19 18:09:20 +00:00
|
|
|
}
|
2007-07-29 18:41:49 +00:00
|
|
|
}
|
|
|
|
|
$row .= '</td>';
|
2007-07-30 21:09:31 +00:00
|
|
|
|
2007-07-29 18:41:49 +00:00
|
|
|
// Date/time and image link
|
2008-05-19 18:55:48 +00:00
|
|
|
if( $file->getTimestamp() === $this->img->getTimestamp() ) {
|
|
|
|
|
$selected = "class='filehistory-selected'";
|
|
|
|
|
}
|
|
|
|
|
$row .= "<td $selected style='white-space: nowrap;'>";
|
2008-03-19 18:09:20 +00:00
|
|
|
if( !$file->userCan(File::DELETED_FILE) ) {
|
|
|
|
|
# Don't link to unviewable files
|
|
|
|
|
$row .= '<span class="history-deleted">' . $wgLang->timeAndDate( $timestamp, true ) . '</span>';
|
2009-04-26 11:12:39 +00:00
|
|
|
} elseif( $file->isDeleted(File::DELETED_FILE) ) {
|
2008-03-19 18:09:20 +00:00
|
|
|
$revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
|
|
|
|
|
# Make a link to review the image
|
2009-06-06 22:42:48 +00:00
|
|
|
$url = $this->skin->link(
|
|
|
|
|
$revdel,
|
|
|
|
|
$wgLang->timeAndDate( $timestamp, true ),
|
|
|
|
|
array(),
|
|
|
|
|
array(
|
2009-06-15 12:32:59 +00:00
|
|
|
'target' => $wgTitle->getPrefixedText(),
|
2009-06-06 22:42:48 +00:00
|
|
|
'file' => $img,
|
|
|
|
|
'token' => $wgUser->editToken( $img )
|
|
|
|
|
),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
2008-03-19 18:09:20 +00:00
|
|
|
$row .= '<span class="history-deleted">'.$url.'</span>';
|
|
|
|
|
} else {
|
2008-05-19 18:55:48 +00:00
|
|
|
$url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl( $img );
|
2008-05-17 00:08:31 +00:00
|
|
|
$row .= Xml::element( 'a', array( 'href' => $url ), $wgLang->timeAndDate( $timestamp, true ) );
|
2008-03-19 18:09:20 +00:00
|
|
|
}
|
2009-04-27 11:18:49 +00:00
|
|
|
$row .= "</td>";
|
2008-03-19 18:09:20 +00:00
|
|
|
|
2008-08-29 11:54:34 +00:00
|
|
|
// Thumbnail
|
2009-07-12 05:37:12 +00:00
|
|
|
if ( $this->showThumb ) {
|
|
|
|
|
$row .= '<td>' . $this->getThumbForLine( $file ) . '</td>';
|
|
|
|
|
}
|
2008-05-17 00:08:31 +00:00
|
|
|
|
2009-04-27 11:18:49 +00:00
|
|
|
// Image dimensions + size
|
|
|
|
|
$row .= '<td>';
|
|
|
|
|
$row .= htmlspecialchars( $file->getDimensionsString() );
|
|
|
|
|
$row .= " <span style='white-space: nowrap;'>(" . $this->skin->formatSize( $file->getSize() ) . ')</span>';
|
|
|
|
|
$row .= '</td>';
|
2007-07-30 21:09:31 +00:00
|
|
|
|
2007-07-29 18:41:49 +00:00
|
|
|
// Uploading user
|
2009-04-27 11:18:49 +00:00
|
|
|
$row .= '<td>';
|
2007-07-29 18:41:49 +00:00
|
|
|
if( $local ) {
|
2008-03-19 18:09:20 +00:00
|
|
|
// Hide deleted usernames
|
2008-05-19 15:21:29 +00:00
|
|
|
if( $file->isDeleted(File::DELETED_USER) ) {
|
2008-03-19 18:09:20 +00:00
|
|
|
$row .= '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>';
|
2008-05-19 15:21:29 +00:00
|
|
|
} else {
|
|
|
|
|
$row .= $this->skin->userLink( $user, $usertext ) . " <span style='white-space: nowrap;'>" .
|
|
|
|
|
$this->skin->userToolLinks( $user, $usertext ) . "</span>";
|
|
|
|
|
}
|
2007-05-30 21:02:32 +00:00
|
|
|
} else {
|
2007-07-29 18:41:49 +00:00
|
|
|
$row .= htmlspecialchars( $usertext );
|
2007-05-30 21:02:32 +00:00
|
|
|
}
|
2008-05-19 15:21:29 +00:00
|
|
|
$row .= '</td><td>';
|
2007-07-30 21:09:31 +00:00
|
|
|
|
2008-03-19 18:09:20 +00:00
|
|
|
// Don't show deleted descriptions
|
2008-11-28 14:29:25 +00:00
|
|
|
if( $file->isDeleted(File::DELETED_COMMENT) ) {
|
2008-05-19 15:21:29 +00:00
|
|
|
$row .= '<span class="history-deleted">' . wfMsgHtml('rev-deleted-comment') . '</span>';
|
2008-05-17 00:08:31 +00:00
|
|
|
} else {
|
2008-05-19 15:21:29 +00:00
|
|
|
$row .= $this->skin->commentBlock( $description, $this->title );
|
2008-05-17 00:08:31 +00:00
|
|
|
}
|
|
|
|
|
$row .= '</td>';
|
2007-07-30 21:09:31 +00:00
|
|
|
|
2008-05-23 09:03:49 +00:00
|
|
|
wfRunHooks( 'ImagePageFileHistoryLine', array( $this, $file, &$row, &$rowClass ) );
|
|
|
|
|
$classAttr = $rowClass ? " class='$rowClass'" : "";
|
2008-05-19 18:55:48 +00:00
|
|
|
|
2008-05-23 09:03:49 +00:00
|
|
|
return "<tr{$classAttr}>{$row}</tr>\n";
|
2004-11-25 13:47:17 +00:00
|
|
|
}
|
2009-04-27 11:18:49 +00:00
|
|
|
|
|
|
|
|
protected function getThumbForLine( $file ) {
|
|
|
|
|
global $wgLang;
|
|
|
|
|
|
2009-06-16 01:06:13 +00:00
|
|
|
if( $file->allowInlineDisplay() && $file->userCan( File::DELETED_FILE ) && !$file->isDeleted( File::DELETED_FILE ) ) {
|
2009-04-27 11:18:49 +00:00
|
|
|
$params = array(
|
|
|
|
|
'width' => '120',
|
|
|
|
|
'height' => '120',
|
|
|
|
|
);
|
|
|
|
|
$timestamp = wfTimestamp(TS_MW, $file->getTimestamp());
|
|
|
|
|
|
|
|
|
|
$thumbnail = $file->transform( $params );
|
|
|
|
|
$options = array(
|
2009-06-01 21:29:31 +00:00
|
|
|
'alt' => wfMsg( 'filehist-thumbtext',
|
|
|
|
|
$wgLang->timeAndDate( $timestamp, true ),
|
|
|
|
|
$wgLang->date( $timestamp, true ),
|
|
|
|
|
$wgLang->time( $timestamp, true ) ),
|
2009-04-27 11:18:49 +00:00
|
|
|
'file-link' => true,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if ( !$thumbnail ) return wfMsgHtml( 'filehist-nothumb' );
|
|
|
|
|
|
|
|
|
|
return $thumbnail->toHtml( $options );
|
|
|
|
|
} else {
|
|
|
|
|
return wfMsgHtml( 'filehist-nothumb' );
|
|
|
|
|
}
|
|
|
|
|
}
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
}
|
2008-12-14 07:10:42 +00:00
|
|
|
|
|
|
|
|
class ImageHistoryPseudoPager extends ReverseChronologicalPager {
|
|
|
|
|
function __construct( $imagePage ) {
|
|
|
|
|
parent::__construct();
|
2008-12-23 17:58:22 +00:00
|
|
|
$this->mImagePage = $imagePage;
|
|
|
|
|
$this->mTitle = clone( $imagePage->getTitle() );
|
2008-12-17 01:35:40 +00:00
|
|
|
$this->mTitle->setFragment( '#filehistory' );
|
2008-12-14 07:10:42 +00:00
|
|
|
$this->mImg = NULL;
|
|
|
|
|
$this->mHist = array();
|
|
|
|
|
$this->mRange = array( 0, 0 ); // display range
|
|
|
|
|
}
|
2008-12-23 17:58:22 +00:00
|
|
|
|
|
|
|
|
function getTitle() {
|
|
|
|
|
return $this->mTitle;
|
|
|
|
|
}
|
2008-12-14 07:10:42 +00:00
|
|
|
|
|
|
|
|
function getQueryInfo() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getIndexField() {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatRow( $row ) {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getBody() {
|
|
|
|
|
$s = '';
|
|
|
|
|
$this->doQuery();
|
|
|
|
|
if( count($this->mHist) ) {
|
|
|
|
|
$list = new ImageHistoryList( $this->mImagePage );
|
|
|
|
|
# Generate prev/next links
|
2009-04-27 11:18:49 +00:00
|
|
|
$navLink = $this->getNavigationBar();
|
2008-12-14 07:10:42 +00:00
|
|
|
$s = $list->beginImageHistoryList($navLink);
|
|
|
|
|
// Skip rows there just for paging links
|
|
|
|
|
for( $i = $this->mRange[0]; $i <= $this->mRange[1]; $i++ ) {
|
|
|
|
|
$file = $this->mHist[$i];
|
|
|
|
|
$s .= $list->imageHistoryLine( !$file->isOld(), $file );
|
|
|
|
|
}
|
|
|
|
|
$s .= $list->endImageHistoryList($navLink);
|
|
|
|
|
}
|
|
|
|
|
return $s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function doQuery() {
|
|
|
|
|
if( $this->mQueryDone ) return;
|
|
|
|
|
$this->mImg = $this->mImagePage->getFile(); // ensure loading
|
|
|
|
|
if( !$this->mImg->exists() ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$queryLimit = $this->mLimit + 1; // limit plus extra row
|
|
|
|
|
if( $this->mIsBackwards ) {
|
|
|
|
|
// Fetch the file history
|
|
|
|
|
$this->mHist = $this->mImg->getHistory($queryLimit,null,$this->mOffset,false);
|
|
|
|
|
// The current rev may not meet the offset/limit
|
|
|
|
|
$numRows = count($this->mHist);
|
|
|
|
|
if( $numRows <= $this->mLimit && $this->mImg->getTimestamp() > $this->mOffset ) {
|
|
|
|
|
$this->mHist = array_merge( array($this->mImg), $this->mHist );
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// The current rev may not meet the offset
|
|
|
|
|
if( !$this->mOffset || $this->mImg->getTimestamp() < $this->mOffset ) {
|
|
|
|
|
$this->mHist[] = $this->mImg;
|
|
|
|
|
}
|
|
|
|
|
// Old image versions (fetch extra row for nav links)
|
|
|
|
|
$oiLimit = count($this->mHist) ? $this->mLimit : $this->mLimit+1;
|
|
|
|
|
// Fetch the file history
|
|
|
|
|
$this->mHist = array_merge( $this->mHist,
|
|
|
|
|
$this->mImg->getHistory($oiLimit,$this->mOffset,null,false) );
|
|
|
|
|
}
|
|
|
|
|
$numRows = count($this->mHist); // Total number of query results
|
|
|
|
|
if( $numRows ) {
|
|
|
|
|
# Index value of top item in the list
|
|
|
|
|
$firstIndex = $this->mIsBackwards ?
|
|
|
|
|
$this->mHist[$numRows-1]->getTimestamp() : $this->mHist[0]->getTimestamp();
|
|
|
|
|
# Discard the extra result row if there is one
|
|
|
|
|
if( $numRows > $this->mLimit && $numRows > 1 ) {
|
|
|
|
|
if( $this->mIsBackwards ) {
|
|
|
|
|
# Index value of item past the index
|
|
|
|
|
$this->mPastTheEndIndex = $this->mHist[0]->getTimestamp();
|
|
|
|
|
# Index value of bottom item in the list
|
|
|
|
|
$lastIndex = $this->mHist[1]->getTimestamp();
|
|
|
|
|
# Display range
|
|
|
|
|
$this->mRange = array( 1, $numRows-1 );
|
|
|
|
|
} else {
|
|
|
|
|
# Index value of item past the index
|
|
|
|
|
$this->mPastTheEndIndex = $this->mHist[$numRows-1]->getTimestamp();
|
|
|
|
|
# Index value of bottom item in the list
|
|
|
|
|
$lastIndex = $this->mHist[$numRows-2]->getTimestamp();
|
|
|
|
|
# Display range
|
|
|
|
|
$this->mRange = array( 0, $numRows-2 );
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
# Setting indexes to an empty string means that they will be
|
|
|
|
|
# omitted if they would otherwise appear in URLs. It just so
|
|
|
|
|
# happens that this is the right thing to do in the standard
|
|
|
|
|
# UI, in all the relevant cases.
|
|
|
|
|
$this->mPastTheEndIndex = '';
|
|
|
|
|
# Index value of bottom item in the list
|
|
|
|
|
$lastIndex = $this->mIsBackwards ?
|
|
|
|
|
$this->mHist[0]->getTimestamp() : $this->mHist[$numRows-1]->getTimestamp();
|
|
|
|
|
# Display range
|
|
|
|
|
$this->mRange = array( 0, $numRows-1 );
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$firstIndex = '';
|
|
|
|
|
$lastIndex = '';
|
|
|
|
|
$this->mPastTheEndIndex = '';
|
|
|
|
|
}
|
|
|
|
|
if( $this->mIsBackwards ) {
|
|
|
|
|
$this->mIsFirst = ( $numRows < $queryLimit );
|
|
|
|
|
$this->mIsLast = ( $this->mOffset == '' );
|
|
|
|
|
$this->mLastShown = $firstIndex;
|
|
|
|
|
$this->mFirstShown = $lastIndex;
|
|
|
|
|
} else {
|
|
|
|
|
$this->mIsFirst = ( $this->mOffset == '' );
|
|
|
|
|
$this->mIsLast = ( $numRows < $queryLimit );
|
|
|
|
|
$this->mLastShown = $lastIndex;
|
|
|
|
|
$this->mFirstShown = $firstIndex;
|
|
|
|
|
}
|
|
|
|
|
$this->mQueryDone = true;
|
|
|
|
|
}
|
|
|
|
|
}
|