Index: trunk/extensions/SemanticResultFormats/Outline/SRF_Outline.php |
— | — | @@ -5,13 +5,12 @@ |
6 | 6 | * helper classes to handle the aggregation |
7 | 7 | */ |
8 | 8 | |
9 | | -if ( !defined( 'MEDIAWIKI' ) ) die(); |
10 | | - |
11 | 9 | /** |
12 | 10 | * Represents a single item, or page, in the outline - contains both the |
13 | 11 | * SMWResultArray and an array of some of its values, for easier aggregation |
14 | 12 | */ |
15 | 13 | class SRFOutlineItem { |
| 14 | + |
16 | 15 | var $mRow; |
17 | 16 | var $mVals; |
18 | 17 | |
— | — | @@ -86,10 +85,7 @@ |
87 | 86 | |
88 | 87 | protected function handleParameters( $params, $outputmode ) { |
89 | 88 | parent::handleParameters( $params, $outputmode ); |
90 | | - |
91 | | - if ( array_key_exists( 'outlineproperties', $params ) ) { |
92 | | - $this->mOutlineProperties = array_map( 'trim', explode( ',', $params['outlineproperties'] ) ); |
93 | | - } |
| 89 | + $this->mOutlineProperties = $params['outlineproperties']; |
94 | 90 | } |
95 | 91 | |
96 | 92 | public function getName() { |
— | — | @@ -231,9 +227,14 @@ |
232 | 228 | } |
233 | 229 | |
234 | 230 | public function getParameters() { |
235 | | - $params = parent::getParameters(); |
236 | | - $params[] = array( 'name' => 'outlineproperties', 'type' => 'string', 'description' => wfMsg( 'srf_paramdesc_outlineproperties' ) ); |
237 | | - return $params; |
| 231 | + $params = parent::getParameters(); |
| 232 | + |
| 233 | + $params['outlineproperties'] = new ListParameter( 'outlineproperties' ); |
| 234 | + $params['outlineproperties']->setMessage( 'srf_paramdesc_outlineproperties' ); |
| 235 | + $params['outlineproperties']->setDefault( array() ); |
| 236 | + $params['outlineproperties']->addManipulations( new ParamManipulationFunctions( 'trim' ) ); |
| 237 | + |
| 238 | + return $params; |
238 | 239 | } |
239 | 240 | |
240 | 241 | } |
Index: trunk/extensions/SemanticResultFormats/vCard/SRF_vCard.php |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | * TODO: make SRFvCardAddress constructor sane |
20 | 20 | */ |
21 | 21 | class SRFvCard extends SMWResultPrinter { |
| 22 | + |
22 | 23 | protected $m_title = ''; |
23 | 24 | protected $m_description = ''; |
24 | 25 | |
— | — | @@ -34,7 +35,7 @@ |
35 | 36 | } |
36 | 37 | |
37 | 38 | public function getQueryMode( $context ) { |
38 | | - return ( $context == SMWQueryProcessor::SPECIAL_PAGE ) ? SMWQuery::MODE_INSTANCES:SMWQuery::MODE_NONE; |
| 39 | + return ( $context == SMWQueryProcessor::SPECIAL_PAGE ) ? SMWQuery::MODE_INSTANCES : SMWQuery::MODE_NONE; |
39 | 40 | } |
40 | 41 | |
41 | 42 | public function getName() { |
— | — | @@ -339,12 +340,7 @@ |
340 | 341 | } |
341 | 342 | |
342 | 343 | public function getParameters() { |
343 | | - if ( defined( 'SMW_SUPPORTS_VALIDATOR' ) ) { |
344 | | - return array_merge( parent::getParameters(), $this->exportFormatParameters() ); |
345 | | - } |
346 | | - else { |
347 | | - return parent::exportFormatParameters(); |
348 | | - } |
| 344 | + return array_merge( parent::getParameters(), $this->exportFormatParameters() ); |
349 | 345 | } |
350 | 346 | } |
351 | 347 | |
— | — | @@ -426,6 +422,8 @@ |
427 | 423 | |
428 | 424 | /** |
429 | 425 | * Creates the vCard output for a single item. |
| 426 | + * |
| 427 | + * CAUTION: this might hurt your eyes |
430 | 428 | */ |
431 | 429 | public function text() { |
432 | 430 | $text = "BEGIN:VCARD\r\n"; |