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

Revision: 54804
Author:   jeroendedauw
Date:     2009-08-11 18:37:20 +0000 (Tue, 11 Aug 2009)

Log Message:
-----------
Changes for 0.3

Modified Paths:
--------------
    trunk/extensions/SemanticMaps/SM_FormInput.php
    trunk/extensions/SemanticMaps/SM_MapPrinter.php
    trunk/extensions/SemanticMaps/SemanticMaps.php

Modified: trunk/extensions/SemanticMaps/SM_FormInput.php
===================================================================
--- trunk/extensions/SemanticMaps/SM_FormInput.php      2009-08-11 18:36:33 UTC 
(rev 54803)
+++ trunk/extensions/SemanticMaps/SM_FormInput.php      2009-08-11 18:37:20 UTC 
(rev 54804)
@@ -57,9 +57,10 @@
                
                // Create html element names
                $this->setMapName();
-               $this->geocodeFieldName = 
$this->elementNamePrefix.'_geocode_'.$this->elementNr;
-               $this->coordsFieldName = 
$this->elementNamePrefix.'_coords_'.$this->elementNr;
-               $this->infoFieldName = 
$this->elementNamePrefix.'_info_'.$this->elementNr;                      
+               $this->mapName .= '_'.$sfgTabIndex;
+               $this->geocodeFieldName = 
$this->elementNamePrefix.'_geocode_'.$this->elementNr.'_'.$sfgTabIndex;
+               $this->coordsFieldName = 
$this->elementNamePrefix.'_coords_'.$this->elementNr.'_'.$sfgTabIndex;
+               $this->infoFieldName = 
$this->elementNamePrefix.'_info_'.$this->elementNr.'_'.$sfgTabIndex;            
         
 
                // Create the non specific form HTML
                $this->output .= "

Modified: trunk/extensions/SemanticMaps/SM_MapPrinter.php
===================================================================
--- trunk/extensions/SemanticMaps/SM_MapPrinter.php     2009-08-11 18:36:33 UTC 
(rev 54803)
+++ trunk/extensions/SemanticMaps/SM_MapPrinter.php     2009-08-11 18:37:20 UTC 
(rev 54804)
@@ -56,7 +56,7 @@
         *
         * @param unknown_type $res
         * @param unknown_type $outputmode
-        * @return unknown
+        * @return array
         */
        public final function getResultText($res, $outputmode) {
                $this->formatResultData($res, $outputmode);
@@ -65,16 +65,19 @@
                
                $this->manageMapProperties($this->m_params);
                
-               $this->doMapServiceLoad();
-
-               $this->setMapName();
+               // Only create a map when there is at least one result.
+               if (count($this->m_locations) > 0) {
+                       $this->doMapServiceLoad();
+       
+                       $this->setMapName();
+                       
+                       $this->setZoom();
+                       
+                       $this->setCentre();             
+                       
+                       $this->addSpecificMapHTML();                    
+               }
                
-               $this->setZoom();
-               
-               $this->setCentre();             
-               
-               $this->addSpecificMapHTML();
-               
                return array($this->output, 'noparse' => 'true', 'isHTML' => 
'true');
        }
        

Modified: trunk/extensions/SemanticMaps/SemanticMaps.php
===================================================================
--- trunk/extensions/SemanticMaps/SemanticMaps.php      2009-08-11 18:36:33 UTC 
(rev 54803)
+++ trunk/extensions/SemanticMaps/SemanticMaps.php      2009-08-11 18:37:20 UTC 
(rev 54804)
@@ -10,6 +10,15 @@
  * @author Jeroen De Dauw
  */
 
+/**
+ * This documenation group collects source code files belonging to Semantic 
Maps.
+ *
+ * Please do not use this group name for other code. If you have an extension 
to 
+ * Semantic Maps, please use your own group defenition.
+ * 
+ * @defgroup SemanticMaps Semantic Maps
+ */
+
 if( !defined( 'MEDIAWIKI' ) ) {
        die( 'Not an entry point.' );
 }



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to