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

Author: LaMi <[email protected]>
Date:   Sat Apr 10 01:09:51 2010 +0200

Fixed state fetching problems on overview page

---

 share/server/core/classes/CoreModGeneral.php       |    5 +++--
 share/server/core/classes/GlobalMapCfg.php         |    2 +-
 share/server/core/classes/objects/NagVisMapObj.php |    5 ++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/share/server/core/classes/CoreModGeneral.php 
b/share/server/core/classes/CoreModGeneral.php
index 18a11c4..31f210f 100644
--- a/share/server/core/classes/CoreModGeneral.php
+++ b/share/server/core/classes/CoreModGeneral.php
@@ -274,11 +274,12 @@ class CoreModGeneral extends CoreModule {
                }
                
                $TMPMAPCFG = new NagVisMapCfg($this->CORE);
+               $TMPMAPCFG->gatherTypeDefaults(!ONLY_GLOBAL);
                
                // merge with "global" settings
-               foreach($TMPMAPCFG->getValidTypeKeys('global') AS $key) {
+               foreach($TMPMAPCFG->getTypeDefaults('global') AS $key => 
$default) {
                        if($key != 'type') {
-                               $objConf[$key] = $TMPMAPCFG->getValue('global', 
0, $key);
+                               $objConf[$key] = $default;
                        }
                }
                
diff --git a/share/server/core/classes/GlobalMapCfg.php 
b/share/server/core/classes/GlobalMapCfg.php
index ec515b8..82f9d5c 100644
--- a/share/server/core/classes/GlobalMapCfg.php
+++ b/share/server/core/classes/GlobalMapCfg.php
@@ -1221,7 +1221,7 @@ class GlobalMapCfg {
         * @param   Boolean  Only fetch global type settings
         * @author      Lars Michelsen <[email protected]>
         */
-       private function gatherTypeDefaults($onlyGlobal) {
+       public function gatherTypeDefaults($onlyGlobal) {
                if($onlyGlobal)
                        $types = Array('global');
                else
diff --git a/share/server/core/classes/objects/NagVisMapObj.php 
b/share/server/core/classes/objects/NagVisMapObj.php
index 234b7e5..a495574 100644
--- a/share/server/core/classes/objects/NagVisMapObj.php
+++ b/share/server/core/classes/objects/NagVisMapObj.php
@@ -376,15 +376,14 @@ class NagVisMapObj extends NagVisStatefulObject {
                foreach($this->MAPCFG->getValidObjectTypes() AS $type) {
                        if($type != 'global' && $type != 'template' && 
is_array($objs = $this->MAPCFG->getDefinitions($type))){
                                $typeDefs = 
$this->MAPCFG->getTypeDefaults($type);
-                               $typeKeys = array_keys($typeDefs);
                                foreach($objs AS $index => $objConf) {
                                        // workaround
                                        $objConf['id'] = $index;
                                        
                                        // merge with "global" settings
-                                       foreach($typeKeys AS $key) {
+                                       foreach($typeDefs AS $key => $default) {
                                                if(!isset($objConf[$key])) {
-                                                       $objConf[$key] = 
$typeDefs[$key];
+                                                       $objConf[$key] = 
$default;
                                                }
                                        }
                                        


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to