Author: Lars Michelsen <[email protected]>
Date: Sun Sep 25 12:09:54 2011 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Sun Sep 25 12:09:54 2011 +0200
Fixed editing of statless lines; New add/modify dialog processes hidden
attributes correctly now
---
share/frontend/nagvis-js/js/NagVisObject.js | 45 +++++++++++++++++++
.../frontend/nagvis-js/js/NagVisStatefulObject.js | 46 --------------------
share/server/core/classes/WuiViewMapAddModify.php | 8 +++-
3 files changed, 52 insertions(+), 47 deletions(-)
diff --git a/share/frontend/nagvis-js/js/NagVisObject.js
b/share/frontend/nagvis-js/js/NagVisObject.js
index 64d73a5..80d0965 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -1198,6 +1198,51 @@ var NagVisObject = Base.extend({
jsObj = null;
},
+ /**
+ * Returns the object ID of the object
+ */
+ getJsObjId: function() {
+ if(this.conf.view_type && this.conf.view_type === 'line')
+ return this.conf.object_id+'-linelink';
+ else
+ return this.conf.object_id+'-icon';
+ },
+
+ /**
+ * PUBLIC toggleObjectActions()
+ *
+ * This enables/disables the hover menu and the icon link
+ * temporary. e.g. in unlocked mode the hover menu shal be suppressed.
+ *
+ * @author Lars Michelsen <[email protected]>
+ */
+ toggleObjectActions: function(enable) {
+ var o = document.getElementById(this.getJsObjId());
+ if(o) {
+ if(enable && isset(o.disabled_onmousemove)) {
+ // Hover-menu
+ o.onmousemove = o.disabled_onmousemove;
+ o.onmouseout = o.disabled_onmouseout;
+ o.disabled_onmousemove = null;
+ o.disabled_onmouseout = null;
+
+ // Link (Left mouse action)
+ if(o.parentNode.tagName == 'A')
+ o.parentNode.onclick = null;
+ } else if(!enable) {
+ // Hover-menu
+ o.disabled_onmousemove = o.onmousemove;
+ o.disabled_onmouseout = o.onmouseout;
+ o.onmousemove = null;
+ o.onmouseout = null;
+
+ // Link (Left mouse action)
+ if(o.parentNode.tagName == 'A')
+ o.parentNode.onclick = function() {return false};
+ }
+ o = null;
+ }
+ },
highlight: function(show) {}
});
diff --git a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
index 01e87e6..4a1dd84 100644
--- a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
@@ -356,16 +356,6 @@ var NagVisStatefulObject = NagVisObject.extend({
},
/**
- * Returns the object ID of the object
- */
- getJsObjId: function() {
- if(this.conf.view_type && this.conf.view_type === 'line')
- return this.conf.object_id+'-linelink';
- else
- return this.conf.object_id+'-icon';
- },
-
- /**
* PUBLIC parseHoverMenu()
*
* Parses the hover menu. Don't add this functionality to the normal icon
@@ -379,42 +369,6 @@ var NagVisStatefulObject = NagVisObject.extend({
},
/**
- * PUBLIC toggleObjectActions()
- *
- * This enables/disables the hover menu and the icon link
- * temporary. e.g. in unlocked mode the hover menu shal be suppressed.
- *
- * @author Lars Michelsen <[email protected]>
- */
- toggleObjectActions: function(enable) {
- var o = document.getElementById(this.getJsObjId());
- if(o) {
- if(enable && isset(o.disabled_onmousemove)) {
- // Hover-menu
- o.onmousemove = o.disabled_onmousemove;
- o.onmouseout = o.disabled_onmouseout;
- o.disabled_onmousemove = null;
- o.disabled_onmouseout = null;
-
- // Link (Left mouse action)
- if(o.parentNode.tagName == 'A')
- o.parentNode.onclick = null;
- } else if(!enable) {
- // Hover-menu
- o.disabled_onmousemove = o.onmousemove;
- o.disabled_onmouseout = o.onmouseout;
- o.onmousemove = null;
- o.onmouseout = null;
-
- // Link (Left mouse action)
- if(o.parentNode.tagName == 'A')
- o.parentNode.onclick = function() {return false};
- }
- o = null;
- }
- },
-
- /**
* PUBLIC parseContextMenu()
*
* Parses the context menu. Don't add this functionality to the normal icon
diff --git a/share/server/core/classes/WuiViewMapAddModify.php
b/share/server/core/classes/WuiViewMapAddModify.php
index c2ddd62..926d505 100644
--- a/share/server/core/classes/WuiViewMapAddModify.php
+++ b/share/server/core/classes/WuiViewMapAddModify.php
@@ -137,12 +137,18 @@ class WuiViewMapAddModify {
$fieldType = $prop['field_type'];
// do nothing with hidden or deprecated attributes
- if($fieldType == 'hidden' || (isset($prop['deprecated']) &&
$prop['deprecated'] === true))
+ if($propname === 'object_id'
+ || (isset($prop['deprecated']) && $prop['deprecated'] === true))
continue;
list($inherited, $value) = $this->getAttr($typeDefaults, $update,
$objId, $propname, $prop['must']);
unset($this->hiddenAttrs[$propname]);
+ if($fieldType === 'hidden') {
+ $ret .= '<input id="'.$propname.'" type="hidden"
name="'.$propname.'" value="'.$value.'" />';
+ continue;
+ }
+
$rowHide = '';
$rowClasses = Array();
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins