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

Author: LaMi <[email protected]>
Date:   Tue Dec 22 20:02:01 2009 +0100

#177 Made header menu in WUI configurable

---

 docs/en_US/nagvis_config_format_description.html |   10 ++++++++--
 etc/nagvis.ini.php-sample                        |    4 ++++
 share/frontend/wui/classes/WuiModMap.php         |    6 +++---
 share/server/core/classes/GlobalMainCfg.php      |    8 ++++++++
 4 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/docs/en_US/nagvis_config_format_description.html 
b/docs/en_US/nagvis_config_format_description.html
index f1477f9..085ddff 100644
--- a/docs/en_US/nagvis_config_format_description.html
+++ b/docs/en_US/nagvis_config_format_description.html
@@ -287,10 +287,16 @@
                <th width="200"> Value </th><th width="150"> Default </th><th> 
Description </th>
                </tr>
                <tr>
-               <td> allowedforconfig </td><td> EVERYONE </td><td> Users who 
are allowed to change the NagVis configuration (comma separated list) or 
EVERYONE </td>
+               <td>allowedforconfig</td><td> EVERYONE </td><td> Users who are 
allowed to change the NagVis configuration (comma separated list) or EVERYONE 
</td>
                </tr>
                <tr>
-               <td> autoupdatefreq </td><td> 25 </td><td> In this interval the 
map gets backuped by the WUI. </td>
+               <td>autoupdatefreq</td><td> 25 </td><td> In this interval the 
map gets backuped by the WUI. </td>
+               </tr>
+               <tr>
+               <td>headermenu</td><td>1</td><td>Enable/Disable the header menu 
in the WUI. <font color="#ff0000">(New in 1.5)</font></td>
+               </tr>
+               <tr>
+               <td>headertemplate</td><td>default</td><td>Default <a 
href="header_templates.html">header template</a> to use in the WUI <font 
color="#ff0000">(New in 1.5)</font>.</td>
                </tr>
                <tr>
                <td> maplocktime </td><td> 5 </td><td> Time in minutes a map is 
locked by an editing user. </td>
diff --git a/etc/nagvis.ini.php-sample b/etc/nagvis.ini.php-sample
index 3e08762..bac9692 100644
--- a/etc/nagvis.ini.php-sample
+++ b/etc/nagvis.ini.php-sample
@@ -210,6 +210,10 @@
 ;allowedforconfig=EVERYONE
 ; auto update frequency
 ;autoupdatefreq=25
+; enable/disable header menu in the WUI
+;headermenu="1"
+; header template to use in the WUI
+;headertemplate="default"
 ; map lock time (minutes)
 ;maplocktime=5
 
diff --git a/share/frontend/wui/classes/WuiModMap.php 
b/share/frontend/wui/classes/WuiModMap.php
index a975535..7bf7c35 100644
--- a/share/frontend/wui/classes/WuiModMap.php
+++ b/share/frontend/wui/classes/WuiModMap.php
@@ -51,7 +51,7 @@ class WuiModMap extends WuiModule {
                // Need to load the custom stylesheet?
                $customStylesheet = $MAPCFG->getValue('global', 0, 
'stylesheet');
                if($customStylesheet !== '') {
-                       
$INDEX->setCustomStylesheet($CORE->getMainCfg()->getValue('paths','htmlstyles') 
. $customStylesheet);
+                       
$INDEX->setCustomStylesheet($this->CORE->getMainCfg()->getValue('paths','htmlstyles')
 . $customStylesheet);
                }
                
                $MAP = new WuiMap(WuiCore::getInstance(), $MAPCFG);
@@ -69,9 +69,9 @@ class WuiModMap extends WuiModule {
                }
                
     // Need to parse the header menu by config or url value?
-    if($MAPCFG->getValue('global', 0, 'header_menu')) {
+    if($this->CORE->getMainCfg()->getValue('wui','headermenu')) {
       // Parse the header menu
-      $HEADER = new WuiHeaderMenu($this->CORE, $this->AUTHORISATION, 
$MAPCFG->getValue('global', 0, 'header_template'), $MAPCFG);
+      $HEADER = new WuiHeaderMenu($this->CORE, $this->AUTHORISATION, 
$this->CORE->getMainCfg()->getValue('wui','headertemplate'), $MAPCFG);
       $INDEX->setHeaderMenu($HEADER->__toString());
     }
                
diff --git a/share/server/core/classes/GlobalMainCfg.php 
b/share/server/core/classes/GlobalMainCfg.php
index 1f63202..5336d44 100644
--- a/share/server/core/classes/GlobalMainCfg.php
+++ b/share/server/core/classes/GlobalMainCfg.php
@@ -266,6 +266,14 @@ class GlobalMainCfg {
                                        'editable' => 1,
                                        'default' => '25',
                                        'match' => MATCH_INTEGER),
+                               'headermenu' => Array('must' => 1,
+                                       'editable' => 1,
+                                       'default' => '1',
+                                       'match' => MATCH_BOOLEAN),
+                               'headertemplate' => Array('must' => 0,
+                                       'editable' => 1,
+                                       'default' => 'default',
+                                       'match' => MATCH_STRING_NO_SPACE),
                                'maplocktime' => Array('must' => 0,
                                        'editable' => 1,
                                        'default' => '350',


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to