Module: nagvis Branch: master Commit: 75dbe84df5da58d05ae9413853ddae27b539dd54 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=75dbe84df5da58d05ae9413853ddae27b539dd54
Author: Lars Michelsen <[email protected]> Date: Fri Oct 9 20:22:17 2009 +0200 #68 Added gadget specific option param gadget_opts --- docs/en_US/map_config_format_description.html | 3 +++ share/frontend/nagvis-js/js/NagVisService.js | 8 +++++++- share/frontend/wui/includes/classes/WuiMap.php | 7 ++++++- share/server/core/classes/GlobalMapCfg.php | 5 +++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/en_US/map_config_format_description.html b/docs/en_US/map_config_format_description.html index b97fc61..8bf0fd7 100644 --- a/docs/en_US/map_config_format_description.html +++ b/docs/en_US/map_config_format_description.html @@ -320,6 +320,9 @@ <td> gadget_scale </td><td>100</td><td> The scale of the gadget. Default scale is 100. The gadgets should be able to be resized by this parameter <font color="#ff0000">(New in 1.4.2)</font> </td> </tr> <tr> + <td> gadget_opts </td><td></td><td> Optional gadget specific params. The contents can be free defined for each gadget. The value is processed as GET param "opts". We reccomend to use a var/val format like this: key1=val1,key2=val2. Then you can easily split this string to an array in the gadget. <font color="#ff0000">(New in 1.4.4)</font> </td> + </tr> + <tr> <td> hover_menu </td><td> inherited (<a href="nagvis_config_format_description.html">nagvis.ini.php</a>) </td><td> Enable/Disable the hover menu </td> </tr> <tr> diff --git a/share/frontend/nagvis-js/js/NagVisService.js b/share/frontend/nagvis-js/js/NagVisService.js index e83343b..f425b77 100755 --- a/share/frontend/nagvis-js/js/NagVisService.js +++ b/share/frontend/nagvis-js/js/NagVisService.js @@ -53,7 +53,13 @@ var NagVisService = NagVisStatefulObject.extend({ sParams = '&'; } - sParams = sParams + 'name1=' + this.conf.name + '&name2=' + escapeUrlValues(this.conf.service_description) + '&scale=' + escapeUrlValues(this.conf.gadget_scale.toString()) + '&state=' + this.conf.state + '&stateType=' + this.conf.state_type + '&perfdata=' + this.conf.perfdata.replace(/\"\;|\&\#145\;/g,'%22'); + // Process the optional gadget_opts param + var sGadgetOpts = ''; + if(this.conf.gadget_opts && this.conf.gadget_opts != '') { + sGadgetOpts = '&opts=' + escapeUrlValues(this.conf.gadget_opts.toString()); + } + + sParams = sParams + 'name1=' + this.conf.name + '&name2=' + escapeUrlValues(this.conf.service_description) + '&scale=' + escapeUrlValues(this.conf.gadget_scale.toString()) + '&state=' + this.conf.state + '&stateType=' + this.conf.state_type + '&perfdata=' + this.conf.perfdata.replace(/\"\;|\&\#145\;/g,'%22') + sGadgetOpts; var oIcon = document.createElement('img'); oIcon.setAttribute('id', this.conf.object_id+'-icon'); diff --git a/share/frontend/wui/includes/classes/WuiMap.php b/share/frontend/wui/includes/classes/WuiMap.php index b213748..8ae7c5d 100755 --- a/share/frontend/wui/includes/classes/WuiMap.php +++ b/share/frontend/wui/includes/classes/WuiMap.php @@ -253,8 +253,13 @@ class WuiMap extends GlobalMap { if(strpos($obj['gadget_url'], '?') === false) { $sDelim = '?'; } + + $sGadgetOpts = ''; + if(isset($obj['gadget_opts']) && $obj['gadget_opts'] != '') { + $sGadgetOpts = '&opts=' . urlencode($obj['gadget_opts']); + } - $obj['iconParams'] = $sDelim . 'name1=dummyHost&name2=dummyService&state=OK&stateType=HARD&conf=1&scale=' . $obj['gadget_scale']; + $obj['iconParams'] = $sDelim . 'name1=dummyHost&name2=dummyService&state=OK&stateType=HARD&conf=1&scale=' . $obj['gadget_scale'] . $sGadgetOpts; } else { $obj['iconParams'] = ''; } diff --git a/share/server/core/classes/GlobalMapCfg.php b/share/server/core/classes/GlobalMapCfg.php index 650b03b..42c6eef 100755 --- a/share/server/core/classes/GlobalMapCfg.php +++ b/share/server/core/classes/GlobalMapCfg.php @@ -619,6 +619,11 @@ class GlobalMapCfg { 'match' => MATCH_INTEGER, 'depends_on' => 'view_type', 'depends_value' => 'gadget'), + 'gadget_opts' => Array('must' => 0, + 'default' => '', + 'match' => MATCH_STRING_NO_SPACE, + 'depends_on' => 'view_type', + 'depends_value' => 'gadget'), 'context_menu' => Array('must' => 0, 'match' => MATCH_BOOLEAN, ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
