00001 <?php
00020 class SMWAutoResultPrinter extends SMWResultPrinter {
00021
00031 public function getResult( SMWQueryResult $results, array $params, $outputmode ) {
00032 $format = false;
00033
00040 wfRunHooks( 'SMWResultFormat', array( &$format, $results->getPrintRequests(), $params ) );
00041
00042
00043 if ( $format === false ) {
00044 $format = $results->getColumnCount() > 1 ? 'table' : 'list';
00045 }
00046
00047 $printer = SMWQueryProcessor::getResultPrinter(
00048 $format,
00049 $this->mInline ? SMWQueryProcessor::INLINE_QUERY : SMWQueryProcessor::SPECIAL_PAGE
00050 );
00051
00052 return $printer->getResult( $results, $params, $outputmode );
00053 }
00054
00061 protected function getResultText( SMWQueryResult $res, $outputmode ) {
00062 return '';
00063 }
00064
00065 public function getName() {
00066 smwfLoadExtensionMessages( 'SemanticMediaWiki' );
00067 return wfMsg( 'smw_printername_auto' );
00068 }
00069
00070 public function getParameters() {
00071
00072
00073 $printer = SMWQueryProcessor::getResultPrinter(
00074 'table',
00075 $this->mInline ? SMWQueryProcessor::INLINE_QUERY : SMWQueryProcessor::SPECIAL_PAGE
00076 );
00077
00078 return $printer->getParameters();
00079 }
00080
00081 }