http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73722

Revision: 73722
Author:   jeroendedauw
Date:     2010-09-25 05:54:01 +0000 (Sat, 25 Sep 2010)

Log Message:
-----------
Changes for 0.7 - Follow up to r73721

Modified Paths:
--------------
    trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php
    trunk/extensions/Maps/includes/services/GoogleMaps/Maps_ParamGMapType.php

Modified: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php
===================================================================
--- trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php      
2010-09-25 05:47:35 UTC (rev 73721)
+++ trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php      
2010-09-25 05:54:01 UTC (rev 73722)
@@ -45,10 +45,6 @@
        protected function initParameterInfo( array &$params ) {
                global $egMapsGoogleMapsType, $egMapsGoogleMapsTypes, 
$egMapsGoogleAutozoom, $egMapsGMapControls;
                
-               // TODO
-               //Validator::addOutputFormat( 'gmaptype', array( __CLASS__, 
'setGMapType' ) );
-               //Validator::addOutputFormat( 'gmaptypes', array( __CLASS__, 
'setGMapTypes' ) );
-               
                //$params['zoom']->addCriterion( new CriterionInRange( 0, 20 ) 
);
                //$params['zoom']->setDefault( self::getDefaultZoom() );
                
@@ -67,30 +63,26 @@
                $params['type'] = new Parameter(
                        'type',
                        Parameter::TYPE_STRING,
-                       $egMapsGoogleMapsType,// FIXME: default value should 
not be used when not present in types parameter.
+                       $egMapsGoogleMapsType, // FIXME: default value should 
not be used when not present in types parameter.
                        array(),
                        array(
-                               new CriterionInArray( self::getTypeNames() ),
+                               new CriterionInArray( array_keys( 
self::$mapTypes ) ),
                        ),
                        array( 'types' )                
                );
+               $params['type']->addManipulations( new MapsParamGMapType() );
 
-               // TODO
-               $params['type']->outputTypes = array( 'gmaptype' => array( 
'gmaptype' ) );
-
                $params['types'] = new ListParameter(
                        'types',
                        ListParameter::DEFAULT_DELIMITER,
                        Parameter::TYPE_STRING,
-                       $egMapsGoogleMapsTypes, // FIXME: default value should 
not be used when not present in types parameter.
+                       $egMapsGoogleMapsTypes,
                        array(),
                        array(
-                               new CriterionInArray( self::getTypeNames() ),
+                               new CriterionInArray( array_keys( 
self::$mapTypes ) ),
                        )
                );
-
-               // TODO
-               $params['types']->outputTypes = array( 'gmaptype' => array( 
'gmaptype' ) );                     
+               $params['types']->addManipulations( new MapsParamGMapType() );  
        
                
                $params['autozoom'] = new Parameter(
                        'autozoom',
@@ -172,7 +164,7 @@
         * 
         * @var array
         */ 
-       protected static $mapTypes = array(
+       public static $mapTypes = array(
                'normal' => 'G_NORMAL_MAP',
                'satellite' => 'G_SATELLITE_MAP',
                'hybrid' => 'G_HYBRID_MAP',
@@ -186,15 +178,6 @@
                'mars-elevation' => 'G_MARS_ELEVATION_MAP',
                'mars-infrared' => 'G_MARS_INFRARED_MAP'
        );
-
-       /**
-        * Returns the names of all supported map types.
-        * 
-        * @return array
-        */
-       public static function getTypeNames() {
-               return array_keys( self::$mapTypes );
-       }
        
        /**
         * Returns the names of all supported controls. 

Modified: 
trunk/extensions/Maps/includes/services/GoogleMaps/Maps_ParamGMapType.php
===================================================================
--- trunk/extensions/Maps/includes/services/GoogleMaps/Maps_ParamGMapType.php   
2010-09-25 05:47:35 UTC (rev 73721)
+++ trunk/extensions/Maps/includes/services/GoogleMaps/Maps_ParamGMapType.php   
2010-09-25 05:54:01 UTC (rev 73722)
@@ -29,7 +29,7 @@
         * @since 0.7
         */     
        public function doManipulation( &$value, array &$parameters ) {
-
+               $value = MapsGoogleMaps::$mapTypes[$value];
        }
        
 }
\ No newline at end of file



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to