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

Revision: 73707
Author:   jeroendedauw
Date:     2010-09-25 02:46:36 +0000 (Sat, 25 Sep 2010)

Log Message:
-----------
Added file I forgot to commit a while back

Added Paths:
-----------
    
trunk/extensions/Maps/includes/services/GoogleMaps/CriterionGoogleOverlay.php

Added: 
trunk/extensions/Maps/includes/services/GoogleMaps/CriterionGoogleOverlay.php
===================================================================
--- 
trunk/extensions/Maps/includes/services/GoogleMaps/CriterionGoogleOverlay.php   
                            (rev 0)
+++ 
trunk/extensions/Maps/includes/services/GoogleMaps/CriterionGoogleOverlay.php   
    2010-09-25 02:46:36 UTC (rev 73707)
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * Parameter criterion stating that the value must be a google overlay.
+ * 
+ * @since 0.7
+ * 
+ * @file CriterionGoogleOverlay.php
+ * @ingroup Maps
+ * @ingroup Criteria
+ * @ingroup MapsGoogleMaps
+ * 
+ * @author Jeroen De Dauw
+ */
+class CriterionGoogleOverlay extends ItemParameterCriterion {
+       
+       /**
+        * A list of supported overlays.
+        * 
+        * @since 0.7
+        * 
+        * @var array
+        */
+       protected $overlayData;
+       
+       /**
+        * Constructor.
+        * 
+        * @since 0.7
+        * 
+        * @param array $overlayData
+        */
+       public function __construct( array $overlayData ) {
+               parent::__construct();
+               
+               $this->overlayData = $overlayData;
+       }
+       
+       /**
+        * @see ItemParameterCriterion::validate
+        */     
+       protected function doValidation( $value ) {
+               $value = explode( '-', $value );
+               
+               return
+                       in_array( $value[0], array_keys( $this->overlayData ) )
+                       || count( $value ) == 2 && in_array( $value[1], array( 
'0', '1' ) )
+               ;
+       }       
+       
+}


Property changes on: 
trunk/extensions/Maps/includes/services/GoogleMaps/CriterionGoogleOverlay.php
___________________________________________________________________
Added: svn:eol-style
   + native



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

Reply via email to