Index: includes/SMW_QP_List.php =================================================================== --- includes/SMW_QP_List.php (revision 68718) +++ includes/SMW_QP_List.php (working copy) @@ -22,6 +22,8 @@ protected $mTemplate = ''; protected $mUserParam = ''; protected $mColumns = 1; + protected $mIntroTemplate = ''; + protected $mOutroTemplate = ''; protected function readParameters( $params, $outputmode ) { SMWResultPrinter::readParameters( $params, $outputmode ); @@ -41,6 +43,12 @@ $this->mColumns = (int)$columns; } } + if ( array_key_exists( 'introtemplate', $params )) { + $this->mIntroTemplate = str_replace( '_', ' ', $params['introtemplate'] ); + } + if ( array_key_exists( 'outrotemplate', $params )) { + $this->mOutroTemplate = str_replace( '_', ' ', $params['outrotemplate'] ); + } } public function getName() { @@ -89,6 +97,8 @@ $rows_per_column = ceil( $res->getCount() / $this->mColumns ); $rows_in_cur_column = 0; } + if ( $this->mIntroTemplate != '' ) + $result .= "{{".$this->mIntroTemplate."}}"; // Now print each row $rownum = - 1; @@ -157,6 +167,8 @@ $result .= $rowend; } + if ( $this->mOutroTemplate != '' ) + $result .= "{{".$this->mOutroTemplate."}}"; // Make label for finding further results if ( $this->linkFurtherResults( $res ) && ( ( $this->mFormat != 'ol' ) || ( $this->getSearchLabel( SMW_OUTPUT_WIKI ) ) ) ) { @@ -174,7 +186,25 @@ $link->setParameter( $this->m_params['link'], 'link' ); } } - $result .= $rowstart . $link->getText( SMW_OUTPUT_WIKI, $this->mLinker ) . $rowend; + if ( $this->mUserParam != '' ) { + $link->setParameter( $this->mUserParam, 'userparam' ); + } + if ( $this->mColumns != '' ) { + $link->setParameter( $this->mColumns, 'columns' ); + } + if ( $this->mIntro != '' ) { + $link->setParameter( $this->mIntro, 'intro'); + } + if ( $this->mOutro != '' ) { + $link->setParameter( $this->mOutro, 'outro' ); + } + if ( $this->mIntroTemplate != '' ) { + $link->setParameter( $this->mIntroTemplate, 'introtemplate'); + } + if ( $this->mOutroTemplate != '' ) { + $link->setParameter( $this->mOutroTemplate, 'outrotemplate' ); + } + $result .= $rowstart . $link->getText( SMW_OUTPUT_WIKI, $this->mLinker ) . $rowend . "\n"; } if ( $this->mColumns > 1 ) $result .= '' . "\n"; @@ -201,8 +231,17 @@ if ( ! $plainlist ) { $params[] = array( 'name' => 'columns', 'type' => 'int', 'description' => wfMsg( 'smw_paramdesc_columns', 1 ) ); } + if ( ! $plainlist ) { + $params[] = array( 'name' => 'userparam', 'type' => 'string', 'description' => wfMsg( 'smw_paramdesc_userparam' ) ); + } + if ( ! $plainlist ) { + $params[] = array( 'name' => 'introtemplate', 'type' => 'string', 'description' => wfMsg( 'smw_paramdesc_introtemplate' ) ); + } + if ( ! $plainlist ) { + $params[] = array( 'name' => 'outrotemplate', 'type' => 'string', 'description' => wfMsg( 'smw_paramdesc_outrotemplate' ) ); + } return $params; } -} \ No newline at end of file +} Index: languages/SMW_Messages.php =================================================================== --- languages/SMW_Messages.php (revision 68718) +++ languages/SMW_Messages.php (working copy) @@ -71,6 +71,9 @@ 'smw_paramdesc_sep' => 'The separator for values', 'smw_paramdesc_template' => 'The name of a template with which to display the printouts', 'smw_paramdesc_columns' => 'The number of columns in which to display results (default is $1)', + 'smw_paramdesc_userparam' => 'A value passed into each template call, if a template is used', + 'smw_paramdesc_introtemplate' => 'The name of a template to display before the query results, if there are any', + 'smw_paramdesc_outrotemplate' => 'The name of a template to display after the query results, if there are any', 'smw_paramdesc_embedformat' => 'The HTML tag used to define headings', 'smw_paramdesc_embedonly' => 'Display no headings', 'smw_paramdesc_rsstitle' => 'The text to be used as the title of the feed',