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

Author: Lars Michelsen <[email protected]>
Date:   Tue Sep 14 22:55:08 2010 +0200

#350 Added [map_name] macro to context and hover menus

---

 docs/en_US/context_templates.html           |    3 +++
 share/frontend/nagvis-js/js/NagVisObject.js |    6 ++++++
 share/frontend/nagvis-js/js/hover.js        |    6 ++++++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/docs/en_US/context_templates.html 
b/docs/en_US/context_templates.html
index beda16c..a47e0c3 100644
--- a/docs/en_US/context_templates.html
+++ b/docs/en_US/context_templates.html
@@ -40,6 +40,9 @@
                <td>[custom_3]</td><td>Third custom macro. Same as above.</td>
                </tr>
                <tr>
+               <td>[map_name]</td><td>Name of the current map/automap <font 
color="#ff0000">(New in 1.5.2)</font>.</td>
+               </tr>
+               <tr>
                <th colspan="2"> Language macros </th>
                </tr>
                <tr>
diff --git a/share/frontend/nagvis-js/js/NagVisObject.js 
b/share/frontend/nagvis-js/js/NagVisObject.js
index 89bb67a..333cf01 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -171,6 +171,12 @@ var NagVisObject = Base.extend({
                oMacros.custom_1 = this.conf.custom_1;
                oMacros.custom_2 = this.conf.custom_2;
                oMacros.custom_3 = this.conf.custom_3;
+
+         if(typeof(oPageProperties) != 'undefined' && oPageProperties != null 
+                  && (oPageProperties.view_type === 'map' || 
oPageProperties.view_type === 'automap'))
+                       oMacros.map_name = oPageProperties.map_name;
+               else
+                       oMacros.map_name = '';
                
                if(this.conf.type === 'service') {
                        oMacros.service_description = 
escapeUrlValues(this.conf.service_description);
diff --git a/share/frontend/nagvis-js/js/hover.js 
b/share/frontend/nagvis-js/js/hover.js
index 28907c1..7e5f9a1 100644
--- a/share/frontend/nagvis-js/js/hover.js
+++ b/share/frontend/nagvis-js/js/hover.js
@@ -101,6 +101,12 @@ function replaceHoverTemplateChildMacros(oObj, 
sTemplateCode) {
 
 function replaceHoverTemplateDynamicMacros(replaceChild, oObj, sTemplateCode) {
        var oMacros = {};
+
+       if(typeof(oPageProperties) != 'undefined' && oPageProperties != null 
+          && (oPageProperties.view_type === 'map' || oPageProperties.view_type 
=== 'automap'))
+               oMacros.map_name = oPageProperties.map_name;
+       else
+               oMacros.map_name = '';
        
        oMacros.last_status_refresh = date(oGeneralProperties.date_format, 
oObj.lastUpdate/1000);
        


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to