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

Author: Lars Michelsen <[email protected]>
Date:   Thu Oct 14 18:50:29 2010 +0200

Applied patch to make the map loop detection (hopefully finally) work - thanks 
thomas!

---

 share/server/core/classes/objects/NagVisMapObj.php |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/share/server/core/classes/objects/NagVisMapObj.php 
b/share/server/core/classes/objects/NagVisMapObj.php
index 15b7b0a..a010a73 100644
--- a/share/server/core/classes/objects/NagVisMapObj.php
+++ b/share/server/core/classes/objects/NagVisMapObj.php
@@ -6,6 +6,9 @@
  *
  * Copyright (c) 2004-2010 NagVis Project (Contact: [email protected])
  *
+ * Modifications by Super-Visions BVBA
+ * Copyright (c) 2010 Super-Visions BVBA (Contact: [email protected])
+ *
  * License:
  *
  * This program is free software; you can redistribute it and/or modify
@@ -326,9 +329,10 @@ class NagVisMapObj extends NagVisStatefulObject {
        /**
         * Gets all objects of the map
         *
+        * @author      Thomas Casteleyn <[email protected]>
         * @author      Lars Michelsen <[email protected]>
         */
-       public function fetchMapObjects(&$arrMapNames = Array()) {
+       public function fetchMapObjects(&$arrMapNames = Array(), $depth = 0) {
                foreach($this->MAPCFG->getValidObjectTypes() AS $type) {
                        if($type != 'global' && $type != 'template' && 
is_array($objs = $this->MAPCFG->getDefinitions($type))){
                                $typeDefs = 
$this->MAPCFG->getTypeDefaults($type);
@@ -395,10 +399,11 @@ class NagVisMapObj extends NagVisStatefulObject {
                                                                
$OBJ->isSummaryObject = true;
 
                                                        /**
-               * All maps which were seen before are stored in the list once. 
If
-                                                        * they are already in 
the list skip them to prevent loops.
+                                                        * All maps which were 
seen before are stored in the list once. If
+                                                        * they are already in 
the list and depth is more than 3 levels,
+                                                        * skip them to prevent 
loops.
                                                         */
-                                                       
if(isset($arrMapNames[$SUBMAPCFG->getName()])) {
+                                                       
if(isset($arrMapNames[$SUBMAPCFG->getName()]) && ($depth > 3)) {
                                                                
$OBJ->isLoopingBacklink = true;
                                                                continue;
                                                        }
@@ -454,7 +459,7 @@ class NagVisMapObj extends NagVisStatefulObject {
                                if($sType == 'map' && $OBJ->isLoopingBacklink)
                                        continue;
                                
-                               $OBJ->fetchMapObjects($arrMapNames);
+                               $OBJ->fetchMapObjects($arrMapNames, $depth+1);
                        }
                }
        }


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to