Author: Lars Michelsen <[email protected]>
Date: Mon Mar 21 09:59:30 2011 +0100
Committer: Lars Michelsen <[email protected]>
Commit-Date: Mon Mar 21 09:59:35 2011 +0100
Added show_in_multisite option to map global sections to hide maps from
the multisite snapin
---
ChangeLog | 6 ++++++
docs/en_US/map_config_format_description.html | 3 +++
docs/en_US/nagvis_config_format_description.html | 3 +++
etc/nagvis.ini.php-sample | 2 ++
share/server/core/classes/CoreModMultisite.php | 12 ++++++------
share/server/core/classes/GlobalMainCfg.php | 5 +++++
share/server/core/classes/GlobalMapCfg.php | 4 ++++
.../userfiles/templates/default.multisiteMaps.html | 2 +-
8 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0dba8f9..0c8ecdf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1.5.9
+
+Core
+ * Added show_in_multisite option to map global sections to hide maps from
+ the multisite snapin
+
1.5.8
Core
diff --git a/docs/en_US/map_config_format_description.html
b/docs/en_US/map_config_format_description.html
index 66f1d5f..5a8991c 100644
--- a/docs/en_US/map_config_format_description.html
+++ b/docs/en_US/map_config_format_description.html
@@ -191,6 +191,9 @@
<td> show_in_lists </td><td> inherited (<a
href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Show
the maps in lists (dropdowns, index page, ...) </td>
</tr>
<tr>
+ <td> show_in_multisite</td><td> inherited (<a
href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td>Show
the maps in multisite snapin</td>
+ </tr>
+ <tr>
<td>stylesheet</td><td>inherited (<a
href="nagvis_config_format_description.html">nagvis.ini.php</a>)</td><td>Filename
of the custom stylesheet to use on the maps (The file needs to be located in
the share/nagvis/styles directory) <font color="#ff0000">(New in
1.5)</font></td>
</tr>
<tr>
diff --git a/docs/en_US/nagvis_config_format_description.html
b/docs/en_US/nagvis_config_format_description.html
index b5ea5e7..7c035c3 100644
--- a/docs/en_US/nagvis_config_format_description.html
+++ b/docs/en_US/nagvis_config_format_description.html
@@ -232,6 +232,9 @@
<td> showinlists </td><td> 1 </td><td> Show the maps in lists
(dropdowns,index page,...) </td>
</tr>
<tr>
+ <td> showinmultisite </td><td> 1 </td><td> Show the maps in
multisite snapin </td>
+ </tr>
+ <tr>
<td>stylesheet</td><td></td><td>Filename of the custom
stylesheet to use on the maps (The file needs to be located in the
share/nagvis/styles directory) <font color="#ff0000">(New in 1.5)</font></td>
</tr>
<tr>
diff --git a/etc/nagvis.ini.php-sample b/etc/nagvis.ini.php-sample
index a3655a9..60bf967 100644
--- a/etc/nagvis.ini.php-sample
+++ b/etc/nagvis.ini.php-sample
@@ -177,6 +177,8 @@
;recognizeservices=1
; show map in lists (dropdowns, index page, ...)
;showinlists=1
+; show map in multisite snapin
+;showinmultisite=1
; Name of the custom stylesheet to use on the maps (The file needs to be
located
; in the share/nagvis/styles directory)
;stylesheet=""
diff --git a/share/server/core/classes/CoreModMultisite.php
b/share/server/core/classes/CoreModMultisite.php
index 2b1645c..43ddbf8 100644
--- a/share/server/core/classes/CoreModMultisite.php
+++ b/share/server/core/classes/CoreModMultisite.php
@@ -88,20 +88,20 @@ class CoreModMultisite extends CoreModule {
$map['configErrorMsg'] = $e->getMessage();
}
- if($MAPCFG->getValue('global',0 , 'show_in_lists') != 1)
+ if($MAPCFG->getValue('global', 0, 'show_in_lists') != 1
|| $MAPCFG->getValue('global', 0, 'show_in_multisite') != 1)
continue;
$MAP = new NagVisMap($this->CORE, $MAPCFG,
$this->BACKEND, GET_STATE, !IS_VIEW);
// Apply default configuration to object
$objConf = $MAPCFG->getTypeDefaults('global');
- $objConf['type'] = 'map';
- $objConf['map_name'] = $MAPCFG->getName();
- $objConf['object_id'] = $object_id;
+ $objConf['type'] = 'map';
+ $objConf['map_name'] = $MAPCFG->getName();
+ $objConf['object_id'] = $object_id;
// Enable the hover menu in all cases - maybe make it
configurable
- $objConf['hover_menu'] = 1;
+ $objConf['hover_menu'] = 1;
$objConf['hover_childs_show'] = 1;
- $objConf['hover_template'] = 'default';
+ $objConf['hover_template'] = 'default';
unset($objConf['alias']);
$MAP->MAPOBJ->setConfiguration($objConf);
diff --git a/share/server/core/classes/GlobalMainCfg.php
b/share/server/core/classes/GlobalMainCfg.php
index 187a5c3..827e90a 100644
--- a/share/server/core/classes/GlobalMainCfg.php
+++ b/share/server/core/classes/GlobalMainCfg.php
@@ -300,6 +300,11 @@ class GlobalMainCfg {
'default' => 1,
'field_type' => 'boolean',
'match' => MATCH_BOOLEAN),
+ 'showinmultisite' => Array('must' => 0,
+ 'editable' => 1,
+ 'default' => 1,
+ 'field_type' => 'boolean',
+ 'match' =>
MATCH_BOOLEAN),
'urltarget' => Array('must' => 0,
'editable' => 1,
'default' => '_self',
diff --git a/share/server/core/classes/GlobalMapCfg.php
b/share/server/core/classes/GlobalMapCfg.php
index dd20d13..393ccec 100644
--- a/share/server/core/classes/GlobalMapCfg.php
+++ b/share/server/core/classes/GlobalMapCfg.php
@@ -310,6 +310,10 @@ class GlobalMapCfg {
'default' =>
$this->CORE->getMainCfg()->getValue('defaults', 'showinlists'),
'match' => MATCH_BOOLEAN,
'field_type' => 'boolean'),
+ 'show_in_multisite' => Array('must' =>
0,
+ 'default' =>
$this->CORE->getMainCfg()->getValue('defaults', 'showinmultisite'),
+ 'match' => MATCH_BOOLEAN,
+ 'field_type' => 'boolean'),
'stylesheet' => Array('must' => 0,
'default' =>
$this->CORE->getMainCfg()->getValue('defaults', 'stylesheet'),
'match' =>
MATCH_STRING_NO_SPACE),
diff --git a/share/userfiles/templates/default.multisiteMaps.html
b/share/userfiles/templates/default.multisiteMaps.html
index 5ee7236..5b2c864 100644
--- a/share/userfiles/templates/default.multisiteMaps.html
+++ b/share/userfiles/templates/default.multisiteMaps.html
@@ -2,7 +2,7 @@
<tbody>
{foreach $maps map}
<tr><td>
- <div class="statebullet state{if $map.state == "OK"}0{elseif $map.state
== "WARNING"}1{elseif $map.state == "CRITICAL"}2{else}3{/if}"> </div>
+ <div class="statebullet state{if $map.state == "OK" || $map.state ==
"UP"}0{elseif $map.state == "WARNING"}1{elseif $map.state == "CRITICAL" ||
$map.state == "DOWN" || $map.state == "UNREACHABLE"}2{else}3{/if}"> </div>
<a href="{$htmlBase}/index.php?mod=Map&act=view&show={$map.name}"
class="link" target="main">{$map.alias}</a>
</td></tr>
{/foreach}
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins