2007-03-28 21:01:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Variant of QueryPage which uses a gallery to output results, thus
|
|
|
|
|
* suited for reports generating images
|
|
|
|
|
*
|
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 SpecialPage
|
2007-03-28 21:01:58 +00:00
|
|
|
* @author Rob Church <robchur@gmail.com>
|
|
|
|
|
*/
|
2010-12-22 14:16:25 +00:00
|
|
|
abstract class ImageQueryPage extends QueryPage {
|
2007-03-28 21:01:58 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Format and output report results using the given information plus
|
|
|
|
|
* OutputPage
|
|
|
|
|
*
|
2010-01-23 20:07:17 +00:00
|
|
|
* @param $out OutputPage to print to
|
|
|
|
|
* @param $skin Skin: user skin to use
|
|
|
|
|
* @param $dbr Database (read) connection to use
|
|
|
|
|
* @param $res Integer: result pointer
|
|
|
|
|
* @param $num Integer: number of available result rows
|
|
|
|
|
* @param $offset Integer: paging offset
|
2007-03-28 21:01:58 +00:00
|
|
|
*/
|
|
|
|
|
protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) {
|
|
|
|
|
if( $num > 0 ) {
|
2008-07-30 03:07:54 +00:00
|
|
|
$gallery = new ImageGallery();
|
|
|
|
|
$gallery->useSkin( $skin );
|
|
|
|
|
|
|
|
|
|
# $res might contain the whole 1,000 rows, so we read up to
|
|
|
|
|
# $num [should update this to use a Pager]
|
|
|
|
|
for( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
|
2010-12-22 16:20:16 +00:00
|
|
|
$namespace = isset( $row->namespace ) ? $row->namespace : NS_FILE;
|
|
|
|
|
$title = Title::makeTitleSafe( $namespace, $row->title );
|
|
|
|
|
if ( $title instanceof Title && $title->getNamespace() == NS_FILE ) {
|
|
|
|
|
$gallery->add( $title, $this->getCellHtml( $row ) );
|
2007-04-21 14:44:56 +00:00
|
|
|
}
|
2007-03-28 21:01:58 +00:00
|
|
|
}
|
2007-04-21 14:44:56 +00:00
|
|
|
|
2008-11-06 22:20:29 +00:00
|
|
|
$out->addHTML( $gallery->toHtml() );
|
2007-03-28 21:01:58 +00:00
|
|
|
}
|
|
|
|
|
}
|
2010-12-22 16:20:16 +00:00
|
|
|
|
2010-12-22 14:16:25 +00:00
|
|
|
// Gotta override this since it's abstract
|
|
|
|
|
function formatResult( $skin, $result ) { }
|
2007-04-21 14:44:56 +00:00
|
|
|
|
2007-03-28 21:01:58 +00:00
|
|
|
/**
|
|
|
|
|
* Get additional HTML to be shown in a results' cell
|
|
|
|
|
*
|
2010-01-23 20:07:17 +00:00
|
|
|
* @param $row Object: result row
|
|
|
|
|
* @return String
|
2007-03-28 21:01:58 +00:00
|
|
|
*/
|
|
|
|
|
protected function getCellHtml( $row ) {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
2008-07-30 03:07:54 +00:00
|
|
|
|
2007-03-28 21:01:58 +00:00
|
|
|
}
|