Module: nagvis
Branch: master
Commit: 61880352b169bc4ca897c2b01f3279eef1a85597
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=61880352b169bc4ca897c2b01f3279eef1a85597

Author: Lars Michelsen <[email protected]>
Date:   Tue Oct 20 21:49:00 2009 +0200

Fixed automap param forward to server on general map status fetching

---

 share/frontend/nagvis-js/js/frontend.js      |    8 ++++++-
 share/server/core/classes/CoreModGeneral.php |   30 +++++++++++++-------------
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/share/frontend/nagvis-js/js/frontend.js 
b/share/frontend/nagvis-js/js/frontend.js
index 377411f..da4f961 100644
--- a/share/frontend/nagvis-js/js/frontend.js
+++ b/share/frontend/nagvis-js/js/frontend.js
@@ -506,8 +506,14 @@ function setPageTitle(sTitle) {
  * @author     Lars Michelsen <[email protected]>
  */
 function updateMapBasics() {
+       var sAutomapParams = '';
+       if(oPageProperties.view_type === 'automap') {
+               sAutomapParams = getAutomapParams();
+       }
+       
        // Get new map state from core
-       var o = 
getSyncRequest(oGeneralProperties.path_server+'?mod=General&act=getObjectStates&ty=state&i[]='+escapeUrlValues(oPageProperties.map_name)+'&t[]='+escapeUrlValues(oPageProperties.view_type)+'&n1[]='+escapeUrlValues(oPageProperties.map_name),
 false)[0];
+       var o = 
getSyncRequest(oGeneralProperties.path_server+'?mod=General&act=getObjectStates&ty=state&i[]='+escapeUrlValues(oPageProperties.map_name)+'&t[]='+escapeUrlValues(oPageProperties.view_type)+'&n1[]='+escapeUrlValues(oPageProperties.map_name)+sAutomapParams,
 false)[0];
+       sAutomapParams = null;
        
        // Update favicon
        setPageFavicon(getFaviconImage(o));
diff --git a/share/server/core/classes/CoreModGeneral.php 
b/share/server/core/classes/CoreModGeneral.php
index 693456b..d955f0f 100644
--- a/share/server/core/classes/CoreModGeneral.php
+++ b/share/server/core/classes/CoreModGeneral.php
@@ -205,23 +205,23 @@ class CoreModGeneral extends CoreModule {
                                        $MAPCFG = new 
NagVisAutomapCfg($this->CORE, $arrName1[$i]);
                                        $MAPCFG->readMapConfig();
                                        
-                                       // FIXME: Maybe should be recoded?
-                                       // FIXME: What about the options given 
in URL when calling the map?
-                                       $opts = Array();
-                                       // Fetch option array from 
defaultparams string (extract variable
-                                       // names and values)
-                                       $params = explode('&', 
$this->CORE->MAINCFG->getValue('automap','defaultparams'));
-                                       unset($params[0]);
-                                       foreach($params AS &$set) {
-                                               $arrSet = explode('=',$set);
-                                               $opts[$arrSet[0]] = $arrSet[1];
-                                       }
+                                       $aOpts = Array('backend' => 
MATCH_STRING_NO_SPACE_EMPTY,
+                                    'root' => MATCH_STRING_NO_SPACE_EMPTY,
+                                    'maxLayers' => MATCH_INTEGER_EMPTY,
+                                    'renderMode' => MATCH_AUTOMAP_RENDER_MODE,
+                                    'width' => MATCH_INTEGER_EMPTY,
+                                    'height' => MATCH_INTEGER_EMPTY,
+                                    'ignoreHosts' => 
MATCH_STRING_NO_SPACE_EMPTY,
+                                    'filterGroup' => 
MATCH_STRING_NO_SPACE_EMPTY);
+               
+                                       $aOpts = 
$this->getCustomOptions($aOpts);
+                                       
                                        // Save the automap name to use
-                                       $opts['automap'] = $arrName1[$i];
-                                       // Save the preview mode
-                                       $opts['preview'] = 1;
+                                       $aOpts['automap'] = $arrName1[$i];
+                                       // Save the preview mode 
(Enables/Disables printing of errors)
+                                       $aOpts['preview'] = 0;
                                        
-                                       $MAP = new NagVisAutoMap($this->CORE, 
$MAPCFG, $BACKEND, $opts);
+                                       $MAP = new NagVisAutoMap($this->CORE, 
$MAPCFG, $BACKEND, $aOpts);
                                        $OBJ = $MAP->MAPOBJ;
                                break;
                                default:


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to