summaryrefslogtreecommitdiffstats
path: root/frontends/php/popup.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-20 14:07:18 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-20 14:07:18 +0000
commitf3b0ed3265201da1d292b7d80beb31a190f4cc2f (patch)
tree1cec643d8a3be8025f0344f0100bed2dcbbc1811 /frontends/php/popup.php
parenta23c4de7f946b02f036315d319591ff5cfe08a93 (diff)
downloadzabbix-f3b0ed3265201da1d292b7d80beb31a190f4cc2f.tar.gz
zabbix-f3b0ed3265201da1d292b7d80beb31a190f4cc2f.tar.xz
zabbix-f3b0ed3265201da1d292b7d80beb31a190f4cc2f.zip
- added default ports for discovery checks (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3901 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/popup.php')
-rw-r--r--frontends/php/popup.php28
1 files changed, 11 insertions, 17 deletions
diff --git a/frontends/php/popup.php b/frontends/php/popup.php
index 7370fde6..f3771059 100644
--- a/frontends/php/popup.php
+++ b/frontends/php/popup.php
@@ -619,27 +619,21 @@ function add_template(formname,id,name)
<script language="JavaScript" type="text/javascript">
<!--
-function add_variable(formname,value)
+function add_item_variable(s_formname,x_value)
{
- var msg = '';
- var form = window.opener.document.forms[formname];
- if(!form)
- {
- alert('form '+formname+' not exist');
- window.close();
- }
+ if(add_variable(null, "itemid[]", x_value, s_formname, window.opener.document))
+ {
+ var o_form;
- new_variable = window.opener.document.createElement('input');
- new_variable.type = 'hidden';
- new_variable.name = 'itemid[]';
- new_variable.value = value;
+ if( !(o_form = window.opener.document.forms[s_formname]) )
+ throw "Missed form with name '"+s_formname+"'.";
- form.appendChild(new_variable);
+ var element = o_form.elements['itemid'];
+ if(element) element.name = 'itemid[]';
- var element = form.elements['itemid'];
- if(element) element.name = 'itemid[]';
+ o_form.submit();
+ }
- form.submit();
window.close();
return true;
}
@@ -665,7 +659,7 @@ function add_variable(formname,value)
while($db_item = DBfetch($db_items))
{
$description = new CLink(item_description($db_item["description"],$db_item["key_"]),"#","action");
- $description->SetAction("return add_variable('".$dstfrm."',".$db_item["itemid"].");");
+ $description->SetAction("return add_item_variable('".$dstfrm."',".$db_item["itemid"].");");
switch($db_item["status"]){
case 0: $status=new CCol(S_ACTIVE,"enabled"); break;