MediaWiki  REL1_22
ImageQueryPage.php
Go to the documentation of this file.
00001 <?php
00031 abstract class ImageQueryPage extends QueryPage {
00043     protected function outputResults( $out, $skin, $dbr, $res, $num, $offset ) {
00044         if ( $num > 0 ) {
00045             $gallery = ImageGalleryBase::factory();
00046             $gallery->setContext( $this->getContext() );
00047 
00048             # $res might contain the whole 1,000 rows, so we read up to
00049             # $num [should update this to use a Pager]
00050             for ( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
00051                 $namespace = isset( $row->namespace ) ? $row->namespace : NS_FILE;
00052                 $title = Title::makeTitleSafe( $namespace, $row->title );
00053                 if ( $title instanceof Title && $title->getNamespace() == NS_FILE ) {
00054                     $gallery->add( $title, $this->getCellHtml( $row ) );
00055                 }
00056             }
00057 
00058             $out->addHTML( $gallery->toHtml() );
00059         }
00060     }
00061 
00062     // Gotta override this since it's abstract
00063     function formatResult( $skin, $result ) { }
00064 
00071     protected function getCellHtml( $row ) {
00072         return '';
00073     }
00074 }