Author:   Lars Michelsen <[email protected]>
Date:     Wed Mar  2 20:25:51 2011 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Wed Mar  2 20:25:51 2011 +0100

The eventlog hide state is stored in the profile file now and used when the 
eventlog is enabled for a map

---

 ChangeLog                                       |    1 +
 share/frontend/nagvis-js/js/frontendEventlog.js |   12 ++++++++----
 share/server/core/classes/CoreUserCfg.php       |    5 +++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a5466f5..b61f937 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ Core
     * Added user/role profile config files located in 
nagvis/etc/profiles/(user|role).profile
       The profile files can contain user/role specific options like languages 
and so on
     * The language of a user is stored in the profile file now
+    * The eventlog hide state is stored in the profile file now and used when 
the eventlog is enabled for a map
     * Added new options {file_group} and {file_mode} to global section of 
nagvis.ini.php.
       These options are used whenever a file is written by NagVis
     * Livestatus backend: Better error handling when writing to livestatus 
socket
diff --git a/share/frontend/nagvis-js/js/frontendEventlog.js 
b/share/frontend/nagvis-js/js/frontendEventlog.js
index 4f563e0..d16f36f 100644
--- a/share/frontend/nagvis-js/js/frontendEventlog.js
+++ b/share/frontend/nagvis-js/js/frontendEventlog.js
@@ -35,9 +35,12 @@ var oSeverity = {
        'error':    1
 };
 
-function eventlogToggle() {
+function eventlogToggle(store) {
        var oLog = document.getElementById('eventlog');
        var oLogControl = document.getElementById('eventlogControl');
+
+       if(store === true)
+               storeUserOption('eventlog', oLog.style.display == 'none');
        
        if(oLog.style.display != 'none') {
                oLog.style.display = 'none';
@@ -78,7 +81,7 @@ function eventlogInitialize() {
        };
        
        oEventlogControl.onclick = function() {
-               eventlogToggle();
+               eventlogToggle(true);
        };
        
        doc.body.appendChild(oEventlog);
@@ -87,8 +90,9 @@ function eventlogInitialize() {
        oEventlogControl = null;
        
        // Hide eventlog when configured
-       if(oPageProperties.event_log_hidden == 1)
-               eventlogToggle();
+       if((typeof(oUserProperties.eventlog) !== 'undefined' && 
oUserProperties.eventlog === false)
+          || oPageProperties.event_log_hidden == 1)
+               eventlogToggle(false);
        
        _eventlog = oEventlog;
        oEventlog = null;
diff --git a/share/server/core/classes/CoreUserCfg.php 
b/share/server/core/classes/CoreUserCfg.php
index 2825b89..deddaf2 100644
--- a/share/server/core/classes/CoreUserCfg.php
+++ b/share/server/core/classes/CoreUserCfg.php
@@ -33,8 +33,9 @@ class CoreUserCfg {
 
        // Optional list of value types to be fixed
        private $types = Array(
-         'sidebar' => 'i',
-         'header'  => 'b',
+         'sidebar'  => 'i',
+         'header'   => 'b',
+         'eventlog' => 'b',
        );
 
        /**


------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to