Author:   Lars Michelsen <[email protected]>
Date:     Mon Mar 21 10:17:28 2011 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Mon Mar 21 10:17:28 2011 +0100

Added show_in_multisite option to map global sections to hide maps from
the multisite snapin

Conflicts:

        ChangeLog
        share/server/core/classes/CoreModMultisite.php

---

 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 +-
 7 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/docs/en_US/map_config_format_description.html 
b/docs/en_US/map_config_format_description.html
index 06e0b14..a237869 100644
--- a/docs/en_US/map_config_format_description.html
+++ b/docs/en_US/map_config_format_description.html
@@ -198,6 +198,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 2f0dd6c..f65e91a 100644
--- a/docs/en_US/nagvis_config_format_description.html
+++ b/docs/en_US/nagvis_config_format_description.html
@@ -235,6 +235,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 a74b093..af3938b 100644
--- a/etc/nagvis.ini.php-sample
+++ b/etc/nagvis.ini.php-sample
@@ -186,6 +186,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 2517ea9..1a14d1c 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(0, 'show_in_lists') != 1)
+                       if($MAPCFG->getValue(0, 'show_in_lists') != 1 || 
$MAPCFG->getValue(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 be567a8..143e418 100644
--- a/share/server/core/classes/GlobalMainCfg.php
+++ b/share/server/core/classes/GlobalMainCfg.php
@@ -312,6 +312,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 67a5e68..8987970 100644
--- a/share/server/core/classes/GlobalMapCfg.php
+++ b/share/server/core/classes/GlobalMapCfg.php
@@ -325,6 +325,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}">&nbsp;</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}">&nbsp;</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

Reply via email to