Module: nagvis Branch: master Commit: ecc5b24eddfb6ae59c6b7a47387cb45d2955cdfc URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=ecc5b24eddfb6ae59c6b7a47387cb45d2955cdfc
Author: larsi- <[email protected]> Date: Tue Jul 7 20:19:16 2009 +0200 Automaps are now called same as normal maps --- share/nagvis/includes/classes/GlobalIndexPage.php | 2 +- share/nagvis/includes/classes/NagVisAutoMap.php | 13 +------------ share/nagvis/includes/classes/NagVisAutomapCfg.php | 5 +++++ share/nagvis/includes/classes/NagVisFrontend.php | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/share/nagvis/includes/classes/GlobalIndexPage.php b/share/nagvis/includes/classes/GlobalIndexPage.php old mode 100644 new mode 100755 index 80de941..4f16c0f --- a/share/nagvis/includes/classes/GlobalIndexPage.php +++ b/share/nagvis/includes/classes/GlobalIndexPage.php @@ -117,7 +117,7 @@ class GlobalIndexPage { // Save the preview mode $opts['preview'] = 1; - $MAP = new NagVisAutoMap($this->CORE, $this->BACKEND, $opts); + $MAP = new NagVisAutoMap($this->CORE, $MAPCFG, $this->BACKEND, $opts); // Apply default configuration to object $objConf = Array(); diff --git a/share/nagvis/includes/classes/NagVisAutoMap.php b/share/nagvis/includes/classes/NagVisAutoMap.php old mode 100644 new mode 100755 index b35c6bf..d255927 --- a/share/nagvis/includes/classes/NagVisAutoMap.php +++ b/share/nagvis/includes/classes/NagVisAutoMap.php @@ -60,7 +60,7 @@ class NagVisAutoMap extends GlobalMap { * @return String Graphviz configuration * @author Lars Michelsen <[email protected]> */ - public function __construct($CORE, $BACKEND, $prop) { + public function __construct($CORE, $MAPCFG, $BACKEND, $prop) { $this->BACKEND = $BACKEND; $this->arrHostnames = Array(); @@ -70,17 +70,6 @@ class NagVisAutoMap extends GlobalMap { $this->noBinaryFound = FALSE; - // Set the map configuration to use - if(isset($prop['automap']) && $prop['automap'] !== '' && $prop['automap'] !== '1') { - $this->name = $prop['automap']; - } else { - $this->name = '__automap'; - } - - // Create map configuration - $MAPCFG = new NagVisAutomapCfg($CORE, $this->name); - $MAPCFG->readMapConfig(); - parent::__construct($CORE, $MAPCFG); // Set the preview option diff --git a/share/nagvis/includes/classes/NagVisAutomapCfg.php b/share/nagvis/includes/classes/NagVisAutomapCfg.php old mode 100644 new mode 100755 index e41a5fb..d6c8145 --- a/share/nagvis/includes/classes/NagVisAutomapCfg.php +++ b/share/nagvis/includes/classes/NagVisAutomapCfg.php @@ -35,6 +35,11 @@ class NagVisAutomapCfg extends GlobalMapCfg { * @author Lars Michelsen <[email protected]> */ public function __construct($CORE, $name) { + // Fix the automap name (backward compatible to old automap=1) + if(isset($name) && $name === '1') { + $name = '__automap'; + } + // Start of the parent constructor parent::__construct($CORE, $name); diff --git a/share/nagvis/includes/classes/NagVisFrontend.php b/share/nagvis/includes/classes/NagVisFrontend.php old mode 100644 new mode 100755 index 03c8331..95599c9 --- a/share/nagvis/includes/classes/NagVisFrontend.php +++ b/share/nagvis/includes/classes/NagVisFrontend.php @@ -141,7 +141,7 @@ class NagVisFrontend extends GlobalPage { public function getAutoMap($arrOptions) { $this->addBodyLines('<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'); $this->addBodyLines('<div id="map" class="map">'); - $this->MAP = new NagVisAutoMap($this->CORE, $this->BACKEND, $arrOptions); + $this->MAP = new NagVisAutoMap($this->CORE, $this->MAPCFG, $this->BACKEND, $arrOptions); $this->addBodyLines($this->MAP->parseMap()); $this->addBodyLines('</div>'); $this->addBodyLines($this->parseJs($this->MAP->parseMapJson())); ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
