Index: trunk/extensions/Maps/includes/parserHooks/Maps_Distance.php |
— | — | @@ -55,22 +55,31 @@ |
56 | 56 | */ |
57 | 57 | protected function getParameterInfo() { |
58 | 58 | 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() ), |
73 | 74 | ) |
74 | | - ); |
| 75 | + ); |
| 76 | + |
| 77 | + $params['decimals'] = new Parameter( |
| 78 | + 'decimals', |
| 79 | + Parameter::TYPE_INTEGER, |
| 80 | + $egMapsDistanceDecimals |
| 81 | + ); |
| 82 | + |
| 83 | + return $params; |
75 | 84 | } |
76 | 85 | |
77 | 86 | /** |