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

Author: LaMi <[email protected]>
Date:   Fri May 14 19:29:46 2010 +0200

#283 changing html entity dashes to real dashes in html output of graphviz

---

 share/server/core/classes/NagVisAutoMap.php |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/share/server/core/classes/NagVisAutoMap.php 
b/share/server/core/classes/NagVisAutoMap.php
index ec44d52..e78173b 100644
--- a/share/server/core/classes/NagVisAutoMap.php
+++ b/share/server/core/classes/NagVisAutoMap.php
@@ -392,6 +392,9 @@ class NagVisAutoMap extends GlobalMap {
                 * <area shape="rect" 
href="/nagios/cgi-bin/status.cgi?host=KASVMNAGIOSMA" target="_self" 
title="host_0" alt="" coords="664,13,679,28"/>
                 * <area shape="rect" 
href="/nagios/cgi-bin/status.cgi?host=RZ1-024-1-143" target="_self" 
title="host_1" alt="" coords="664,119,679,135"/>
                 *
+                * Sometimes the dashes seem to be printed as html entities:
+                * <area shape="rect" 
href="/nagios/cgi&#45;bin/status.cgi?host=RZ1&#45;006&#45;1&#45;130" 
target="_self" title="host_8" alt="" coords="464,272,470,278"/>
+                *
                 * In some cases there may be an ID:
                 * <area shape="rect" id="node1" 
href="/nagios/cgi-bin/status.cgi?host=test_router_0" target="_self" 
title="host_0" alt="" coords="509,378,525,393"/>
                 * <area shape="rect" id="node1" 
href="/icinga/cgi-bin/status.cgi?host=Icinga" target="_self" title="host_0" 
alt="" coords="698,24,713,40"/>
@@ -407,12 +410,13 @@ class NagVisAutoMap extends GlobalMap {
                $aMapCode = explode("\n", $this->mapCode);
                $aObjCoords = Array();
                foreach($aMapCode AS $sLine) {
+                       $sLine = str_replace('&#45;', '-', $sLine);
                        // Extract the area objects
                        // Only parsing rect/polys at the moment
                        
if(preg_match('/^<area\sshape="(rect|poly)"\s(id="[^"]+"\s)?href=".+\/status\.cgi\?host=([^"]+)"\starget="_self"\stitle="[^"]+"\salt=""\scoords="([^"]+)"\/>$/i',
 $sLine, $aMatches)) {
                                if(isset($aMatches[1]) && isset($aMatches[2]) 
&& isset($aMatches[3]) && isset($aMatches[4])) {
                                        $type = $aMatches[1];
-                                       $name1 = trim($aMatches[3]);
+                                       $name1 = str_replace('&#45;', '-', 
trim($aMatches[3]));
                                        $coords = trim($aMatches[4]);
                                        
                                        switch($type) {


------------------------------------------------------------------------------

_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to