r61177 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61176‎ | r61177 | r61178 >
Date:19:06, 17 January 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for O.5.2. Usage of Validator 0.2 features for the static map specific parameters.
Modified paths:
  • /trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php (modified) (history)
  • /trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispMap.php (modified) (history)
  • /trunk/extensions/Maps/YahooMaps/Maps_YahooMaps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispMap.php
@@ -31,10 +31,9 @@
3232
3333 $this->spesificParameters = array(
3434 'static' => array(
35 - 'criteria' => array(
36 - 'in_array' => array('yes', 'no')
37 - ),
38 - 'default' => $egMapsOSMStaticAsDefault ? 'yes' : 'no' // TODO: boolean type
 35+ 'type' => 'boolean',
 36+ 'default' => $egMapsOSMStaticAsDefault,
 37+ 'output-type' => 'boolean'
3938 ),
4039 'mode' => array(
4140 'criteria' => array(
@@ -43,10 +42,9 @@
4443 'default' => $modes[0]
4544 ),
4645 'activatable' => array(
47 - 'criteria' => array(
48 - 'in_array' => array('yes', 'no')
49 - ),
50 - 'default' => $egMapsOSMStaticActivatable ? 'yes' : 'no' // TODO: boolean type
 46+ 'type' => 'boolean',
 47+ 'default' => $egMapsOSMStaticActivatable,
 48+ 'output-type' => 'boolean'
5149 ),
5250 );
5351 }
@@ -87,7 +85,7 @@
8886
8987 EOT;
9088
91 - $this->output .= $this->static == 'yes' ? $this->getStaticMap() : $this->getDynamicMap();
 89+ $this->output .= $this->static ? $this->getStaticMap() : $this->getDynamicMap();
9290 }
9391
9492 /**
@@ -123,7 +121,7 @@
124122
125123 $alt = wfMsg( 'maps_centred_on', $this->centre_lat, $this->centre_lon );
126124
127 - if ($this->activatable != 'no') {
 125+ if ($this->activatable) {
128126 $title = wfMsg('maps_click_to_activate');
129127 $activationCode = "onclick=\"slippymaps['$this->mapName'].init();\"";
130128 }
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php
@@ -70,7 +70,7 @@
7171 'criteria' => array(
7272 'in_array' => $allowedTypes
7373 ),
74 - 'default' => $egMapsGoogleMapsType,
 74+ 'default' => $egMapsGoogleMapsType, // FIXME: default value should not be used when not present in types parameter.
7575 'output-type' => 'gmaptype'
7676 ),
7777 'types' => array(
Index: trunk/extensions/Maps/YahooMaps/Maps_YahooMaps.php
@@ -69,7 +69,7 @@
7070 'criteria' => array(
7171 'in_array' => $allowedTypes
7272 ),
73 - 'default' => $egMapsYahooMapsType,
 73+ 'default' => $egMapsYahooMapsType, // FIXME: default value should not be used when not present in types parameter.
7474 'output-type' => 'ymaptype'
7575 ),
7676 'types' => array (

Status & tagging log