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

Revision: 73706
Author:   jeroendedauw
Date:     2010-09-25 02:45:48 +0000 (Sat, 25 Sep 2010)

Log Message:
-----------
Follow up to r73702

Added Paths:
-----------
    trunk/extensions/Maps/includes/manipulations/
    trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php

Added: trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php
===================================================================
--- trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php          
                (rev 0)
+++ trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php  
2010-09-25 02:45:48 UTC (rev 73706)
@@ -0,0 +1,59 @@
+<?php
+
+/**
+ * Parameter manipulation ensuring the service is valid and loading adittional 
parameter definitions.
+ * 
+ * @since 0.7
+ * 
+ * @file Maps_ParamService.php
+ * @ingroup Validator
+ * @ingroup ParameterManipulations
+ * 
+ * @author Jeroen De Dauw
+ */
+class MapsParamService extends ItemParameterManipulation {
+       
+       /**
+        * The mapping feature. Needed to determine which services are 
available.
+        * 
+        * @since 0.7
+        * 
+        * @var string
+        */
+       protected $feature;
+       
+       /**
+        * Adittional parameter definitions to load.
+        * 
+        * @since 0.7
+        * 
+        * @var array of Parameter
+        */
+       protected $serviceParams;
+       
+       /**
+        * Constructor.
+        * 
+        * @since 0.7
+        */
+       public function __construct( $feature, array $serviceParams = array() ) 
{
+               parent::__construct();
+               
+               $this->feature = $feature;
+               $this->serviceParams = $serviceParams;
+       }       
+       
+       /**
+        * @see ItemParameterManipulation::doManipulation
+        * 
+        * @since 0.7
+        */     
+       public function doManipulation( &$value, array &$parameters ) {
+               // Make sure the service is valid.
+               $value = MapsMappingService::getValidServiceName( $value, 
$this->feature );
+               
+               // Add the service specific service parameters.
+               $parameters = array_merge( $parameters, $this->serviceParams );
+       }
+       
+}
\ No newline at end of file


Property changes on: 
trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php
___________________________________________________________________
Added: svn:eol-style
   + native



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

Reply via email to