r73467 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73466‎ | r73467 | r73468 >
Date:18:00, 21 September 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.7 - matching new Validator structure
Modified paths:
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Distance.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/parserHooks/Maps_Distance.php
@@ -55,22 +55,31 @@
5656 */
5757 protected function getParameterInfo() {
5858 global $egMapsDistanceUnit, $egMapsDistanceDecimals;
59 -
60 - return array(
61 - 'distance' => array(
62 - 'required' => true
63 - ),
64 - 'unit' => array(
65 - 'criteria' => array(
66 - 'in_array' => MapsDistanceParser::getUnits()
67 - ),
68 - 'default' => $egMapsDistanceUnit
69 - ),
70 - 'decimals' => array(
71 - 'type' => 'integer',
72 - 'default' => $egMapsDistanceDecimals
 59+
 60+ $params = array();
 61+
 62+ $params['distance'] = new Parameter(
 63+ 'distance'
 64+ // TODO: add distance criterion
 65+ );
 66+
 67+ $params['unit'] = new Parameter(
 68+ 'unit',
 69+ Parameter::TYPE_STRING,
 70+ $egMapsDistanceUnit,
 71+ array(),
 72+ array(
 73+ new CriterionInArray( MapsDistanceParser::getUnits() ),
7374 )
74 - );
 75+ );
 76+
 77+ $params['decimals'] = new Parameter(
 78+ 'decimals',
 79+ Parameter::TYPE_INTEGER,
 80+ $egMapsDistanceDecimals
 81+ );
 82+
 83+ return $params;
7584 }
7685
7786 /**

Status & tagging log