Index: trunk/extensions/SemanticResultFormats/iCalendar/SRF_iCalendar.php |
— | — | @@ -22,8 +22,8 @@ |
23 | 23 | protected function handleParameters( array $params, $outputmode ) { |
24 | 24 | parent::handleParameters( $params, $outputmode ); |
25 | 25 | |
26 | | - $this->m_params = trim( $this->params['title'] ); |
27 | | - $this->m_description = trim( $this->params['icalendardescription'] ); |
| 26 | + $this->m_params = trim( $params['title'] ); |
| 27 | + $this->m_description = trim( $params['icalendardescription'] ); |
28 | 28 | } |
29 | 29 | |
30 | 30 | public function getMimeType( $res ) { |
Index: trunk/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php |
— | — | @@ -12,28 +12,21 @@ |
13 | 13 | */ |
14 | 14 | class SRFCalendar extends SMWResultPrinter { |
15 | 15 | |
16 | | - protected $mTemplate = ''; |
17 | | - protected $mUserParam = ''; |
| 16 | + protected $mTemplate; |
| 17 | + protected $mUserParam; |
18 | 18 | protected $mRealUserLang = null; |
19 | 19 | |
20 | | - protected function handleParameters( $params, $outputmode ) { |
| 20 | + protected function handleParameters( array $params, $outputmode ) { |
21 | 21 | parent::handleParameters( $params, $outputmode ); |
22 | 22 | |
23 | | - if ( array_key_exists( 'template', $params ) ) { |
24 | | - $this->mTemplate = trim( $params['template'] ); |
25 | | - } |
| 23 | + $this->mTemplate = trim( $params['template'] ); |
| 24 | + $this->mUserParam = trim( $params['userparam'] ); |
26 | 25 | |
27 | | - if ( array_key_exists( 'userparam', $params ) ) { |
28 | | - $this->mUserParam = trim( $params['userparam'] ); |
29 | | - } |
30 | | - |
31 | | - if ( array_key_exists( 'lang', $params ) ) { |
32 | | - global $wgLang; |
33 | | - // store the actual user's language, so we can revert |
34 | | - // back to it after printing the calendar |
35 | | - $this->mRealUserLang = clone ( $wgLang ); |
36 | | - $wgLang = Language::factory( trim( $params['lang'] ) ); |
37 | | - } |
| 26 | + global $wgLang; |
| 27 | + // store the actual user's language, so we can revert |
| 28 | + // back to it after printing the calendar |
| 29 | + $this->mRealUserLang = clone ( $wgLang ); |
| 30 | + $wgLang = Language::factory( trim( $params['lang'] ) ); |
38 | 31 | } |
39 | 32 | |
40 | 33 | public function getName() { |
— | — | @@ -508,7 +501,16 @@ |
509 | 502 | */ |
510 | 503 | public function getParameters() { |
511 | 504 | $params = parent::getParameters(); |
512 | | - $params[] = array( 'name' => 'lang', 'type' => 'string', 'description' => wfMsg( 'srf_paramdesc_calendarlang' ) ); |
| 505 | + |
| 506 | + $params['lang'] = new Parameter( 'lang' ); |
| 507 | + $params['lang']->setMessage( 'srf_paramdesc_calendarlang' ); |
| 508 | + |
| 509 | + $params['template'] = new Parameter( 'template' ); |
| 510 | + $params['template']->setDefault( '' ); |
| 511 | + |
| 512 | + $params['userparam'] = new Parameter( 'userparam' ); |
| 513 | + $params['userparam']->setDefault( '' ); |
| 514 | + |
513 | 515 | return $params; |
514 | 516 | } |
515 | 517 | |