MediaWiki  REL1_24
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( false, $this->getContext() );
00046 
00047             # $res might contain the whole 1,000 rows, so we read up to
00048             # $num [should update this to use a Pager]
00049             $i = 0;
00050             foreach ( $res as $row ) {
00051                 $i++;
00052                 $namespace = isset( $row->namespace ) ? $row->namespace : NS_FILE;
00053                 $title = Title::makeTitleSafe( $namespace, $row->title );
00054                 if ( $title instanceof Title && $title->getNamespace() == NS_FILE ) {
00055                     $gallery->add( $title, $this->getCellHtml( $row ) );
00056                 }
00057                 if ( $i === $num ) {
00058                     break;
00059                 }
00060             }
00061 
00062             $out->addHTML( $gallery->toHtml() );
00063         }
00064     }
00065 
00066     // Gotta override this since it's abstract
00067     function formatResult( $skin, $result ) {
00068     }
00069 
00076     protected function getCellHtml( $row ) {
00077         return '';
00078     }
00079 }