Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php |
— | — | @@ -86,39 +86,64 @@ |
87 | 87 | protected function getParameterInfo() { |
88 | 88 | global $egMapsMapWidth, $egMapsMapHeight, $egMapsDefaultServices, $egMapsDefaultTitle, $egMapsDefaultLabel; |
89 | 89 | |
| 90 | + // TODO |
90 | 91 | Validator::addOutputFormat( 'geoPoints', array( __CLASS__, 'formatGeoPoints' ) ); |
91 | 92 | |
92 | | - return array_merge( MapsMapper::getCommonParameters(), array( |
93 | | - // TODO |
94 | | - 'mappingservice' => array( |
95 | | - 'default' => $egMapsDefaultServices['display_point'] |
96 | | - ), |
97 | | - 'centre' => array( |
98 | | - 'aliases' => array( 'center' ), |
99 | | - 'tolower' => false, |
100 | | - ), |
101 | | - 'title' => array( |
102 | | - 'default' => $egMapsDefaultTitle |
103 | | - ), |
104 | | - 'label' => array( |
105 | | - 'default' => $egMapsDefaultLabel |
106 | | - ), |
107 | | - 'icon' => array( |
108 | | - 'criteria' => array( |
109 | | - 'not_empty' => array() |
110 | | - ) |
111 | | - ), |
112 | | - 'coordinates' => array( |
113 | | - 'required' => true, |
114 | | - 'tolower' => false, |
115 | | - 'type' => array( 'string', 'list', ';' ), |
116 | | - 'aliases' => array( 'coords', 'location', 'locations', 'address', 'addresses' ), |
117 | | - 'criteria' => array( |
118 | | - new CriterionIsLocation( '~' ) |
119 | | - ), |
120 | | - 'output-type' => array( 'geoPoints', '~' ), |
121 | | - ), |
122 | | - ) ); |
| 93 | + $params = MapsMapper::getCommonParameters(); |
| 94 | + |
| 95 | + $params['mappingservice']->default = $egMapsDefaultServices['display_point']; |
| 96 | + |
| 97 | + $params['coordinates'] = new Parameter( |
| 98 | + 'coordinates', |
| 99 | + Parameter::TYPE_STRING, |
| 100 | + null, |
| 101 | + array( 'coords', 'location', 'locations', 'address', 'addresses' ), |
| 102 | + array( |
| 103 | + new CriterionIsLocation(), |
| 104 | + ) |
| 105 | + ); |
| 106 | + |
| 107 | + $params['coordinates']->lowerCaseValue = false; |
| 108 | + |
| 109 | + // TODO |
| 110 | + $params['coordinates']->outputTypes = array( 'coordinateSet' => array( 'coordinateSet', '~' ) ); |
| 111 | + |
| 112 | + $params['centre'] = new Parameter( |
| 113 | + 'centre', |
| 114 | + Parameter::TYPE_STRING, |
| 115 | + '', // TODO |
| 116 | + array( 'center' ), |
| 117 | + array( |
| 118 | + new CriterionIsLocation(), |
| 119 | + ) |
| 120 | + ); |
| 121 | + |
| 122 | + $params['centre']->lowerCaseValue = false; |
| 123 | + |
| 124 | + $params['title'] = new Parameter( |
| 125 | + 'title', |
| 126 | + Parameter::TYPE_STRING, |
| 127 | + $egMapsDefaultTitle |
| 128 | + ); |
| 129 | + |
| 130 | + $params['label'] = new Parameter( |
| 131 | + 'label', |
| 132 | + Parameter::TYPE_STRING, |
| 133 | + $egMapsDefaultLabel, |
| 134 | + array( 'text' ) |
| 135 | + ); |
| 136 | + |
| 137 | + $params['icon'] = new Parameter( |
| 138 | + 'icon', |
| 139 | + Parameter::TYPE_STRING, |
| 140 | + '', // TODO |
| 141 | + array(), |
| 142 | + array( |
| 143 | + New CriterionNotEmpty() |
| 144 | + ) |
| 145 | + ); |
| 146 | + |
| 147 | + return $params; |
123 | 148 | } |
124 | 149 | |
125 | 150 | /** |