Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RSSlink.php |
— | — | @@ -10,34 +10,36 @@ |
11 | 11 | * |
12 | 12 | * @author Denny Vrandecic |
13 | 13 | * @author Markus Krötzsch |
| 14 | + * |
14 | 15 | * @ingroup SMWQuery |
15 | 16 | */ |
16 | 17 | class SMWRSSResultPrinter extends SMWResultPrinter { |
| 18 | + |
17 | 19 | protected $m_title = ''; |
18 | 20 | protected $m_description = ''; |
19 | 21 | |
20 | | - protected function readParameters( $params, $outputmode ) { |
21 | | - parent::readParameters( $params, $outputmode ); |
22 | | - if ( array_key_exists( 'title', $this->m_params ) ) { |
23 | | - $this->m_title = trim( $this->m_params['title'] ); |
24 | | - // for backward compatibiliy |
25 | | - } elseif ( array_key_exists( 'rsstitle', $this->m_params ) ) { |
26 | | - $this->m_title = trim( $this->m_params['rsstitle'] ); |
27 | | - } |
28 | | - if ( array_key_exists( 'description', $this->m_params ) ) { |
29 | | - $this->m_description = trim( $this->m_params['description'] ); |
30 | | - // for backward compatibiliy |
31 | | - } elseif ( array_key_exists( 'rssdescription', $this->m_params ) ) { |
32 | | - $this->m_description = trim( $this->m_params['rssdescription'] ); |
33 | | - } |
| 22 | + /** |
| 23 | + * @see SMWResultPrinter::handleParameters |
| 24 | + * |
| 25 | + * @since 1.6.3 |
| 26 | + * |
| 27 | + * @param array $params |
| 28 | + * @param $outputmode |
| 29 | + */ |
| 30 | + protected function handleParameters( array $params, $outputmode ) { |
| 31 | + parent::handleParameters( $params, $outputmode ); |
| 32 | + |
| 33 | + $this->m_title = trim( $params['title'] ); |
| 34 | + $this->m_description = trim( $params['description'] ); |
34 | 35 | } |
35 | | - |
| 36 | + |
36 | 37 | public function getMimeType( $res ) { |
37 | | - return 'application/rss+xml'; // or is rdf+xml better? Might be confused in either case (with RSS2.0 or RDF) |
| 38 | + // or is rdf+xml better? Might be confused in either case (with RSS2.0 or RDF) |
| 39 | + return 'application/rss+xml'; |
38 | 40 | } |
39 | 41 | |
40 | 42 | public function getQueryMode( $context ) { |
41 | | - return ( $context == SMWQueryProcessor::SPECIAL_PAGE ) ? SMWQuery::MODE_INSTANCES:SMWQuery::MODE_NONE; |
| 43 | + return $context == SMWQueryProcessor::SPECIAL_PAGE ? SMWQuery::MODE_INSTANCES : SMWQuery::MODE_NONE; |
42 | 44 | } |
43 | 45 | |
44 | 46 | public function getName() { |
— | — | @@ -153,9 +155,11 @@ |
154 | 156 | |
155 | 157 | $params['title'] = new Parameter( 'title' ); |
156 | 158 | $params['title']->setMessage( 'smw_paramdesc_rsstitle' ); |
| 159 | + $params['title']->setDefault( '' ); |
157 | 160 | |
158 | 161 | $params['description'] = new Parameter( 'title' ); |
159 | 162 | $params['description']->setMessage( 'smw_paramdesc_rssdescription' ); |
| 163 | + $params['description']->setDefault( '' ); |
160 | 164 | |
161 | 165 | return $params; |
162 | 166 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Table.php |
— | — | @@ -13,11 +13,6 @@ |
14 | 14 | |
15 | 15 | protected $mHTMLClass = ''; |
16 | 16 | |
17 | | - public function __construct( $format, $inline, $useValidator = true ) { |
18 | | - parent::__construct( $format, $inline ); |
19 | | - $this->useValidator = $useValidator; |
20 | | - } |
21 | | - |
22 | 17 | public function getName() { |
23 | 18 | smwfLoadExtensionMessages( 'SemanticMediaWiki' ); |
24 | 19 | return wfMsg( 'smw_printername_' . $this->mFormat ); |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php |
— | — | @@ -296,6 +296,7 @@ |
297 | 297 | */ |
298 | 298 | protected function handleParameters( array $params, $outputmode ) { |
299 | 299 | $this->params = $params; |
| 300 | + $this->m_params = $params; // Compat, change made in 1.6.3 |
300 | 301 | |
301 | 302 | if ( array_key_exists( 'intro', $params ) ) { $this->mIntro = $params['intro']; } |
302 | 303 | if ( array_key_exists( 'outro', $params ) ) { $this->mOutro = $params['outro']; } |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_CSV.php |
— | — | @@ -94,14 +94,14 @@ |
95 | 95 | $link->setParameter( 'csv', 'format' ); |
96 | 96 | $link->setParameter( $this->m_sep, 'sep' ); |
97 | 97 | |
98 | | - if ( array_key_exists( 'mainlabel', $this->m_params ) && $this->m_params['mainlabel'] !== false ) { |
99 | | - $link->setParameter( $this->m_params['mainlabel'], 'mainlabel' ); |
| 98 | + if ( array_key_exists( 'mainlabel', $this->params ) && $this->params['mainlabel'] !== false ) { |
| 99 | + $link->setParameter( $this->params['mainlabel'], 'mainlabel' ); |
100 | 100 | } |
101 | 101 | |
102 | 102 | $link->setParameter( $this->mShowHeaders ? 'show' : 'hide', 'headers' ); |
103 | 103 | |
104 | | - if ( array_key_exists( 'limit', $this->m_params ) ) { |
105 | | - $link->setParameter( $this->m_params['limit'], 'limit' ); |
| 104 | + if ( array_key_exists( 'limit', $this->params ) ) { |
| 105 | + $link->setParameter( $this->params['limit'], 'limit' ); |
106 | 106 | } else { // use a reasonable default limit |
107 | 107 | $link->setParameter( 100, 'limit' ); |
108 | 108 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php |
— | — | @@ -251,8 +251,8 @@ |
252 | 252 | |
253 | 253 | if ( $this->mTemplate != '' ) { |
254 | 254 | $link->setParameter( $this->mTemplate, 'template' ); |
255 | | - if ( array_key_exists( 'link', $this->m_params ) ) { // linking may interfere with templates |
256 | | - $link->setParameter( $this->m_params['link'], 'link' ); |
| 255 | + if ( array_key_exists( 'link', $this->params ) ) { // linking may interfere with templates |
| 256 | + $link->setParameter( $this->params['link'], 'link' ); |
257 | 257 | } |
258 | 258 | } |
259 | 259 | |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RDF.php |
— | — | @@ -102,8 +102,8 @@ |
103 | 103 | $link->setParameter( 'rdf', 'format' ); |
104 | 104 | $link->setParameter( $this->syntax, 'syntax' ); |
105 | 105 | |
106 | | - if ( array_key_exists( 'limit', $this->m_params ) ) { |
107 | | - $link->setParameter( $this->m_params['limit'], 'limit' ); |
| 106 | + if ( array_key_exists( 'limit', $this->params ) ) { |
| 107 | + $link->setParameter( $this->params['limit'], 'limit' ); |
108 | 108 | } else { // use a reasonable default limit |
109 | 109 | $link->setParameter( 100, 'limit' ); |
110 | 110 | } |