Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotPie.php |
— | — | @@ -7,22 +7,23 @@ |
8 | 8 | */ |
9 | 9 | |
10 | 10 | class SRFjqPlotPie extends SMWResultPrinter { |
11 | | - protected $m_width = 400; |
12 | | - protected $m_height = 400; |
13 | | - protected $m_charttitle = " "; |
14 | | - static protected $m_piechartnum = 1; |
| 11 | + |
| 12 | + protected static $m_piechartnum = 1; |
| 13 | + |
| 14 | + protected $m_width; |
| 15 | + protected $m_height; |
| 16 | + protected $m_charttitle; |
15 | 17 | |
16 | | - protected function readParameters( $params, $outputmode ) { |
17 | | - parent::readParameters( $params, $outputmode ); |
18 | | - if ( array_key_exists( 'width', $this->m_params ) ) { |
19 | | - $this->m_width = $this->m_params['width']; |
20 | | - } |
21 | | - if ( array_key_exists( 'height', $this->m_params ) ) { |
22 | | - $this->m_height = $this->m_params['height']; |
23 | | - } |
24 | | - if ( array_key_exists( 'charttitle', $this->m_params ) ) { |
25 | | - $this->m_charttitle = $this->m_params['charttitle']; |
26 | | - } |
| 18 | + /** |
| 19 | + * (non-PHPdoc) |
| 20 | + * @see SMWResultPrinter::handleParameters() |
| 21 | + */ |
| 22 | + protected function handleParameters( array $params, $outputmode ) { |
| 23 | + parent::handleParameters( $params, $outputmode ); |
| 24 | + |
| 25 | + $this->m_width = $this->m_params['width']; |
| 26 | + $this->m_height = $this->m_params['height']; |
| 27 | + $this->m_charttitle = $this->m_params['charttitle']; |
27 | 28 | } |
28 | 29 | |
29 | 30 | public function getName() { |
— | — | @@ -164,12 +165,18 @@ |
165 | 166 | } |
166 | 167 | |
167 | 168 | public function getParameters() { |
168 | | - return array( |
169 | | - array( 'name' => 'limit', 'type' => 'int', 'description' => wfMsg( 'smw_paramdesc_limit' ) ), |
170 | | - array( 'name' => 'height', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_chartheight' ) ), |
171 | | - array( 'name' => 'charttitle', 'type' => 'string', 'description' => wfMsg( 'srf_paramdesc_charttitle' ) ), |
172 | | - array( 'name' => 'width', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_chartwidth' ) ), |
173 | | - ); |
| 169 | + $params = parent::getParameters(); |
| 170 | + |
| 171 | + $params['height'] = new Parameter( 'height', Parameter::TYPE_INTEGER, 400 ); |
| 172 | + $params['height']->setMessage( 'srf_paramdesc_chartheight' ); |
| 173 | + |
| 174 | + $params['width'] = new Parameter( 'width', Parameter::TYPE_INTEGER, 400 ); |
| 175 | + $params['width']->setMessage( 'srf_paramdesc_chartwidth' ); |
| 176 | + |
| 177 | + $params['charttitle'] = new Parameter( 'charttitle', Parameter::TYPE_STRING, ' ' ); |
| 178 | + $params['charttitle']->setMessage( 'srf_paramdesc_charttitle' ); |
| 179 | + |
| 180 | + return $params; |
174 | 181 | } |
175 | 182 | |
176 | 183 | } |