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

Revision: 73710
Author:   jeroendedauw
Date:     2010-09-25 04:39:59 +0000 (Sat, 25 Sep 2010)

Log Message:
-----------
Follow up to r73708

Modified Paths:
--------------
    trunk/extensions/Maps/Maps.php
    trunk/extensions/Maps/includes/Maps_Mapper.php
    trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php
    trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php
    trunk/extensions/Maps/includes/parserHooks/Maps_Finddestination.php

Modified: trunk/extensions/Maps/Maps.php
===================================================================
--- trunk/extensions/Maps/Maps.php      2010-09-25 03:54:24 UTC (rev 73709)
+++ trunk/extensions/Maps/Maps.php      2010-09-25 04:39:59 UTC (rev 73710)
@@ -120,6 +120,7 @@
        
        // Autoload the "includes/manipulations/" classes.
        $manDir = $incDir . 'manipulations/';
+       $wgAutoloadClasses['MapsParamCoordSet']                 = $manDir . 
'Maps_ParamCoordSet.php';
        $wgAutoloadClasses['MapsParamService']                  = $manDir . 
'Maps_ParamService.php';
        
        // Autoload the "includes/parserHooks/" classes.

Modified: trunk/extensions/Maps/includes/Maps_Mapper.php
===================================================================
--- trunk/extensions/Maps/includes/Maps_Mapper.php      2010-09-25 03:54:24 UTC 
(rev 73709)
+++ trunk/extensions/Maps/includes/Maps_Mapper.php      2010-09-25 04:39:59 UTC 
(rev 73710)
@@ -13,33 +13,6 @@
 final class MapsMapper {
        
        /**
-        * Formats a location to a coordinate set in a certain representation.
-        * 
-        * @since 0.6
-        * 
-        * @param string $locations
-        * @param string $name The name of the parameter.
-        * @param array $parameters Array containing data about the so far 
handled parameters.
-        */             
-       public static function formatLocation( &$location, $name, array 
$parameters ) {
-               if ( self::geocoderIsAvailable() ) {
-                       // TODO
-                       //$geoService = array_key_exists( 'geoservice', 
$parameters ) ? $parameters['geoservice']['value'] : '';
-                       //$mappingService = array_key_exists( 'mappingservice', 
$parameters ) ? $parameters['mappingservice']['value'] : false;                 
-                       $location = MapsGeocoders::attemptToGeocodeToString( 
$location/*, $geoService, $mappingService*/ );
-               } else {
-                       $location = MapsCoordinateParser::parseAndFormat( 
$location );
-               }
-       }
-       
-       /**
-        * @deprecated Method moved to MapsMappingServices. Will be removed in 
0.7.
-        */
-       public static function getValidService( $service, $feature ) {
-               MapsMappingServices::getValidServiceInstance( $service, 
$feature );
-       }
-
-       /**
         * Determines if a value is a valid map dimension, and optionally 
corrects it.
         *
         * @since 0.6
@@ -116,17 +89,6 @@
        public static function setMapDimension( &$value, $name, array 
$parameters, $dimension, $default ) {
                self::isMapDimension( $value, $name, $parameters, $dimension, 
true, $default );
        }
-
-       /**
-        * Returns a boolean indicating if MapsGeocoders is available.
-        *
-        * @deprecated - use MapsGeocoders::canGeocode() instead
-        *
-        * @return Boolean
-        */
-       public static function geocoderIsAvailable() {
-               return MapsGeocoders::canGeocode();
-       }
        
        /**
         * Add a JavaScript file out of skins/common, or a given relative path.

Modified: trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php
===================================================================
--- trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php  
2010-09-25 03:54:24 UTC (rev 73709)
+++ trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php  
2010-09-25 04:39:59 UTC (rev 73710)
@@ -6,7 +6,7 @@
  * @since 0.7
  * 
  * @file Maps_ParamService.php
- * @ingroup Validator
+ * @ingroup Maps
  * @ingroup ParameterManipulations
  * 
  * @author Jeroen De Dauw

Modified: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php
===================================================================
--- trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php      
2010-09-25 03:54:24 UTC (rev 73709)
+++ trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php      
2010-09-25 04:39:59 UTC (rev 73710)
@@ -63,21 +63,12 @@
                
                $params['mappingservice']->default = 
$egMapsDefaultServices['display_map'];
                
-               $params['coordinates'] = new Parameter(
-                       'coordinates', 
-                       Parameter::TYPE_STRING,
-                       null,
-                       array( 'coords', 'location', 'address' ),
-                       array(
-                               new CriterionIsLocation(),
-                       )
-               );
-               
+               $params['coordinates'] = new Parameter( 'coordinates' );
+               $params['coordinates']->addAliases( 'coords', 'location', 
'address' );
+               $params['coordinates']->addCriteria( new CriterionIsLocation() 
);
+               $params['coordinates']->addManipulations( new 
MapsParamCoordSet() );            
                $params['coordinates']->lowerCaseValue = false;
                
-               // TODO
-               $params['coordinates']->outputTypes = array( 'coordinateSet' => 
array( 'coordinateSet' ) );             
-               
                return $params;
        }
        

Modified: trunk/extensions/Maps/includes/parserHooks/Maps_Finddestination.php
===================================================================
--- trunk/extensions/Maps/includes/parserHooks/Maps_Finddestination.php 
2010-09-25 03:54:24 UTC (rev 73709)
+++ trunk/extensions/Maps/includes/parserHooks/Maps_Finddestination.php 
2010-09-25 04:39:59 UTC (rev 73710)
@@ -139,7 +139,7 @@
         * @return string
         */
        public function render( array $parameters ) {
-               $canGeocode = MapsMapper::geocoderIsAvailable();
+               $canGeocode = MapsGeocoders::canGeocode();
                        
                if ( $canGeocode ) {
                        $location = MapsGeocoders::attemptToGeocode(



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

Reply via email to