Index: trunk/extensions/SemanticResultFormats/iCalendar/SRF_iCalendar.php |
— | — | @@ -15,25 +15,15 @@ |
16 | 16 | * @ingroup SemanticResultFormats |
17 | 17 | */ |
18 | 18 | class SRFiCalendar extends SMWResultPrinter { |
19 | | - protected $m_title = ''; |
20 | | - protected $m_description = ''; |
| 19 | + |
| 20 | + protected $m_title; |
| 21 | + protected $m_description; |
21 | 22 | |
22 | | - protected function handleParameters( $params, $outputmode ) { |
| 23 | + protected function handleParameters( array $params, $outputmode ) { |
23 | 24 | parent::handleParameters( $params, $outputmode ); |
24 | 25 | |
25 | | - if ( array_key_exists( 'title', $this->m_params ) ) { |
26 | | - $this->m_title = trim( $this->m_params['title'] ); |
27 | | - // for backward compatibility |
28 | | - } elseif ( array_key_exists( 'icalendartitle', $this->m_params ) ) { |
29 | | - $this->m_title = trim( $this->m_params['icalendartitle'] ); |
30 | | - } |
31 | | - |
32 | | - if ( array_key_exists( 'description', $this->m_params ) ) { |
33 | | - $this->m_description = trim( $this->m_params['description'] ); |
34 | | - // for backward compatibility |
35 | | - } elseif ( array_key_exists( 'icalendardescription', $this->m_params ) ) { |
36 | | - $this->m_description = trim( $this->m_params['icalendardescription'] ); |
37 | | - } |
| 26 | + $this->m_params = trim( $this->m_params['title'] ); |
| 27 | + $this->m_description = trim( $this->m_params['icalendardescription'] ); |
38 | 28 | } |
39 | 29 | |
40 | 30 | public function getMimeType( $res ) { |
— | — | @@ -244,25 +234,16 @@ |
245 | 235 | } |
246 | 236 | |
247 | 237 | public function getParameters() { |
248 | | - if ( defined( 'SMW_SUPPORTS_VALIDATOR' ) ) { |
249 | | - $params = array_merge( parent::getParameters(), $this->exportFormatParameters() ); |
250 | | - |
251 | | - $params['title'] = new Parameter( 'title' ); |
252 | | - $params['title']->setDescription( wfMsg( 'srf_paramdesc_icalendartitle' ) ); |
253 | | - $params['title']->setDefault( '' ); |
254 | | - |
255 | | - $params['description'] = new Parameter( 'description' ); |
256 | | - $params['description']->setDescription( wfMsg( 'srf_paramdesc_icalendardescription' ) ); |
257 | | - $params['description']->setDefault( '' ); |
258 | | - } |
259 | | - else { |
260 | | - // This if for b/c with SMW 1.5.x; SMW 1.6 directly accepts Parameter objects. |
261 | | - $params = parent::exportFormatParameters(); |
262 | | - |
263 | | - $params[] = array( 'name' => 'title', 'type' => 'string', 'description' => wfMsg( 'srf_paramdesc_icalendartitle' ) ); |
264 | | - $params[] = array( 'name' => 'description', 'type' => 'string', 'description' => wfMsg( 'srf_paramdesc_icalendardescription' ) ); |
265 | | - } |
| 238 | + $params = array_merge( parent::getParameters(), $this->exportFormatParameters() ); |
266 | 239 | |
| 240 | + $params['title'] = new Parameter( 'title' ); |
| 241 | + $params['title']->setMessage( 'srf_paramdesc_icalendartitle' ); |
| 242 | + $params['title']->setDefault( '' ); |
| 243 | + |
| 244 | + $params['description'] = new Parameter( 'description' ); |
| 245 | + $params['description']->setMessage( 'srf_paramdesc_icalendardescription' ); |
| 246 | + $params['description']->setDefault( '' ); |
| 247 | + |
267 | 248 | return $params; |
268 | 249 | } |
269 | 250 | |