Index: trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php |
— | — | @@ -172,11 +172,27 @@ |
173 | 173 | public function getParameters() { |
174 | 174 | $params = parent::getParameters(); |
175 | 175 | |
176 | | - $params[] = array( 'name' => 'perrow', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_perrow' ) ); |
177 | | - $params[] = array( 'name' => 'widths', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_widths' ) ); |
178 | | - $params[] = array( 'name' => 'heights', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_heights' ) ); |
179 | | - |
180 | | - $params[] = array( 'name' => 'autocaptions', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_autocaptions' ), 'values' => array( 'on', 'off' ) ); |
| 176 | + if ( defined( 'SMW_SUPPORTS_VALIDATOR' ) ) { |
| 177 | + $params['perrow'] = new Parameter( 'perrow', Parameter::TYPE_INTEGER ); |
| 178 | + $params['perrow']->setDescription( wfMsg( 'srf_paramdesc_perrow' ) ); |
| 179 | + |
| 180 | + $params['widths'] = new Parameter( 'widths', Parameter::TYPE_INTEGER ); |
| 181 | + $params['widths']->setDescription( wfMsg( 'srf_paramdesc_widths' ) ); |
| 182 | + |
| 183 | + $params['heights'] = new Parameter( 'heights', Parameter::TYPE_INTEGER ); |
| 184 | + $params['heights']->setDescription( wfMsg( 'srf_paramdesc_heights' ) ); |
| 185 | + |
| 186 | + $params['autocaptions'] = new Parameter( 'autocaptions', Parameter::TYPE_BOOLEAN ); |
| 187 | + $params['autocaptions']->setDescription( wfMsg( 'srf_paramdesc_autocaptions' ) ); |
| 188 | + } |
| 189 | + else { |
| 190 | + // This if for b/c with SMW 1.5.x; SMW 1.6 directly accepts Parameter objects. |
| 191 | + $params[] = array( 'name' => 'perrow', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_perrow' ) ); |
| 192 | + $params[] = array( 'name' => 'widths', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_widths' ) ); |
| 193 | + $params[] = array( 'name' => 'heights', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_heights' ) ); |
| 194 | + |
| 195 | + $params[] = array( 'name' => 'autocaptions', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_autocaptions' ), 'values' => array( 'on', 'off' ) ); |
| 196 | + } |
181 | 197 | |
182 | 198 | return $params; |
183 | 199 | } |