summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-22 15:12:52 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-22 15:12:52 +0000
commit67caec0a308312b19cc85f6c09e482d717c0f252 (patch)
tree5566dedd907341525bfa9f8c595812d69ab67033
parenteb9c8c4c00ab339b6e105b35d65f3c99dc5cb677 (diff)
downloadzabbix-67caec0a308312b19cc85f6c09e482d717c0f252.tar.gz
zabbix-67caec0a308312b19cc85f6c09e482d717c0f252.tar.xz
zabbix-67caec0a308312b19cc85f6c09e482d717c0f252.zip
- improved JS supporting for IE
git-svn-id: svn://svn.zabbix.com/trunk@3909 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r--frontends/php/css.css43
-rw-r--r--frontends/php/include/classes/cbutton.inc.php24
-rw-r--r--frontends/php/include/classes/ccheckbox.inc.php4
-rw-r--r--frontends/php/include/classes/clink.inc.php2
-rw-r--r--frontends/php/include/classes/ctag.inc.php8
-rw-r--r--frontends/php/include/forms.inc.php22
-rw-r--r--frontends/php/items.php17
-rw-r--r--frontends/php/js/common.js6
-rw-r--r--frontends/php/popup.php98
-rw-r--r--frontends/php/popup_gitem.php8
-rw-r--r--frontends/php/popup_httpstep.php8
-rw-r--r--frontends/php/popup_media.php4
-rw-r--r--frontends/php/popup_right.php4
-rw-r--r--frontends/php/popup_trexpr.php2
-rw-r--r--frontends/php/popup_users.php4
-rw-r--r--frontends/php/popup_usrgrp.php2
-rw-r--r--frontends/php/services.php4
17 files changed, 121 insertions, 139 deletions
diff --git a/frontends/php/css.css b/frontends/php/css.css
index 89c56ea6..9751acd2 100644
--- a/frontends/php/css.css
+++ b/frontends/php/css.css
@@ -278,6 +278,7 @@ table.screen_view tr td.right_bttm { text-align: right; vertical-align: bottom;
table.tableinfo
{
+ empty-cells:show;
color: #000000;
width: 100%;
background-color: #AAAAAA;
@@ -292,6 +293,9 @@ table.tableinfo tr td {
text-decoration: none;
text-align: left;
border-width: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ height: 20px;
}
table.tableinfo tr td.message {
text-align: center;
@@ -331,13 +335,13 @@ table.tableinfo tr.footer td {
padding-right: 5px;
padding-left: 5px;
}
-table.tableinfo tr.odd_row td { background-color: #DDDDDD; border: 1px #DDDDDD solid; }
-table.tableinfo tr.odd_row:hover td { background-color: #DDDDEE; border: 1px #DDDDEE solid; }
+table.tableinfo tr.odd_row td { background-color: #DDDDDD; border: 1px #DDDDDD solid; }
+table.tableinfo tr.odd_row:hover td { background-color: #DDDDEE; border: 1px #DDDDEE solid; }
-table.tableinfo tr.even_row td { background-color: #EEEEEE; border: 1px #EEEEEE solid; }
-table.tableinfo tr.even_row:hover td { background-color: #EEEEFE; border: 1px #EEEEFE solid; }
+table.tableinfo tr.even_row td { background-color: #EEEEEE; border: 1px #EEEEEE solid; }
+table.tableinfo tr.even_row:hover td { background-color: #EEEEFE; border: 1px #EEEEFE solid; }
-table.tableinfo tr td.center {vertical-align: middle; text-align: center; }
+table.tableinfo tr td.center { vertical-align: middle; text-align: center; }
table.tableinfo tr td.disaster { background-color: #FF0000; border: 1px #FF0000 solid; }
table.tableinfo tr:hover td.disaster { background-color: #FA0000; border: 1px #FA0000 solid; }
@@ -582,14 +586,16 @@ table.sub_menu tr td span.active a.highlight
{
font-family: Verdana, Helvetica, Geneva;
font-size: 10px;
- border: solid;
- border-width: 1px;
- border-color: gray;
+ border: 1px solid gray;
background-color: white;
margin: 2px;
}
-.biginput:focus { border-color: black; }
-.biginput:hover { border-color: black; }
+.biginput:focus {
+ border-color: black;
+}
+.biginput:hover {
+ border-color: black;
+}
.biginput[readonly] /* NOTE: Ignored by IE */
{
@@ -597,18 +603,19 @@ table.sub_menu tr td span.active a.highlight
background-color: #EEEEEE;
}
-.button
-{
+.button {
font-family: Verdana, Helvetica, Geneva;
font-size: 10px;
- border: solid;
- border-width: 1px;
- border-color: gray;
- background: gray url(images/gradients/button.gif) repeat-x top left;
+ background: #F0F0F0 url(images/gradients/button.gif) repeat-x top left;
+ border: 1px solid #808080;
+ height: 18px;
+ padding: 0px 5px 0px 5px;
margin: 2px;
-/* margin-right:5px; */
}
-.button:hover { text-decoration: underline; border-color: black; }
+.button:hover {
+ text-decoration: underline;
+ border-color: black;
+}
/**************** TRIGGERS INFORMATION MODULE ****************/
table.triggers_info {
diff --git a/frontends/php/include/classes/cbutton.inc.php b/frontends/php/include/classes/cbutton.inc.php
index 42c31afa..50b5a126 100644
--- a/frontends/php/include/classes/cbutton.inc.php
+++ b/frontends/php/include/classes/cbutton.inc.php
@@ -28,15 +28,14 @@
$this->tag_body_start = '';
$this->options['type'] = 'submit';
$this->AddOption('value', $caption);
-// $this->options["type"] = "button";
$this->options['class'] = 'button';
$this->SetName($name);
$this->SetAction($action);
$this->SetAccessKey($accesskey);
}
- function SetAction($value='submit()', $event='onClick')
+ function SetAction($value=null)
{
- $this->AddOption($event, $value);
+ $this->AddAction('onClick', $value);
}
function SetTitle($value='button title')
{
@@ -54,19 +53,21 @@
class CButtonCancel extends CButton
{
- function CButtonCancel($vars=NULL){
+ function CButtonCancel($vars=NULL,$action=NULL){
parent::CButton('cancel',S_CANCEL);
+ $this->options['type'] = 'button';
$this->SetVars($vars);
+ $this->SetAction($action);
}
function SetVars($value=NULL){
global $page;
- $url = $page["file"]."?cancel=1";
+ $url = "?cancel=1";
if(!is_null($value))
$url = $url.$value;
- return $this->SetAction("return Redirect('$url')");
+ return parent::SetAction("return Redirect('$url')");
}
}
@@ -82,19 +83,18 @@
/*
var $vars;
var $msg;
- var $name;
- var $do_redirect;*/
+ var $name;*/
- function CButtonQMessage($name, $caption, $msg=NULL, $vars=NULL, $do_redirect=true){
+ function CButtonQMessage($name, $caption, $msg=NULL, $vars=NULL){
$this->vars = null;
$this->msg = null;
$this->name = $name;
- $this->do_redirect = $do_redirect;
parent::CButton($name,$caption);
$this->SetMessage($msg);
$this->SetVars($vars);
+ $this->SetAction(NULL);
}
function SetVars($value=NULL){
if(!is_string($value) && !is_null($value)){
@@ -113,7 +113,7 @@
$this->msg = $value;
$this->SetAction(NULL);
}
- function SetAction($value=null, $event='onClick'){
+ function SetAction($value=null){
if(!is_null($value))
return parent::SetAction($value);
@@ -121,7 +121,7 @@
$confirmation = "Confirm('".$this->msg."')";
- if($this->do_redirect)
+ if(isset($this->vars))
{
$redirect = "Redirect('".$page["file"]."?".$this->name."=1".$this->vars."')";
}
diff --git a/frontends/php/include/classes/ccheckbox.inc.php b/frontends/php/include/classes/ccheckbox.inc.php
index 526ceedf..2d616da8 100644
--- a/frontends/php/include/classes/ccheckbox.inc.php
+++ b/frontends/php/include/classes/ccheckbox.inc.php
@@ -29,7 +29,7 @@
$this->options['type'] = 'checkbox';
$this->options['value'] = $value;
$this->options['name'] = $name;
- $this->options['onClick'] = $action;
+ $this->SetAction($action);
$this->SetChecked($checked);
}
function SetEnabled($value='yes')
@@ -49,7 +49,7 @@
}
function SetAction($value='submit()', $event='onClick')
{
- $this->options[$event] = $value;
+ $this->AddAction('onClick', $value);
}
}
diff --git a/frontends/php/include/classes/clink.inc.php b/frontends/php/include/classes/clink.inc.php
index 374453ca..eb785941 100644
--- a/frontends/php/include/classes/clink.inc.php
+++ b/frontends/php/include/classes/clink.inc.php
@@ -40,7 +40,7 @@
if(is_null($value))
return $this->options['action'] = $page['file'];
- return $this->options['onClick'] = htmlspecialchars($value);
+ return parent::AddAction('onClick', $value);
}
function SetUrl($value)
{
diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php
index 70decbfc..93671c81 100644
--- a/frontends/php/include/classes/ctag.inc.php
+++ b/frontends/php/include/classes/ctag.inc.php
@@ -218,7 +218,7 @@
{
insert_showhint_javascript();
- $text = addslashes(htmlspecialchars(unpack_object($text)));
+ $text = unpack_object($text);
if($width != '' || $class!= '')
{
$code = "show_hint_ext(this,event,'".$text."','".$width."','".$class."');";
@@ -239,10 +239,8 @@
function AddAction($name, $value)
{
- if(isset($value))
- $this->options[$name] = str_replace("\n", '', strval($value));
- else
- unset($this->options[$name]);
+ if(!empty($value))
+ $this->options[$name] = htmlentities(str_replace("\n", '', strval($value)),ENT_COMPAT);
}
function AddOption($name, $value)
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index b15b5a32..5816ce6d 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -181,7 +181,7 @@
$form->AddItemToBottomRow(new CButton("save", isset($sid) ? S_SAVE : S_ADD));
- $form->AddItemToBottomRow(new CButton('cancel',S_CANCEL,'window.close();'));
+ $form->AddItemToBottomRow(new CButtonCancel('close_window();'));
$form->show();
}
@@ -494,7 +494,7 @@
$frmMsg->AddRow(S_MESSAGE, new CTextArea("message","",80,6));
$frmMsg->AddItemToBottomRow(new CButton("save",$btn_txt));
- $frmMsg->AddItemToBottomRow(new CButton("cancel",S_CANCEL));
+ $frmMsg->AddItemToBottomRow(new CButtonCancel(url_param('"eventid')));
$frmMsg->Show(false);
@@ -654,8 +654,8 @@
$lstGroups,
BR,
new CButton('add_group',S_ADD,
- "return PopUp('popup_usrgrp.php?dstfrm=".$frmUser->GetName().
- "&list_name=user_groups_to_del[]&var_name=user_groups',450, 450);"),
+ 'return PopUp("popup_usrgrp.php?dstfrm='.$frmUser->GetName().
+ '&list_name=user_groups_to_del[]&var_name=user_groups",450, 450);'),
SPACE,
(count($user_groups) > 0) ? new CButton('del_user_group',S_DELETE_SELECTED) : null
));
@@ -1286,7 +1286,7 @@
$form->AddItemToBottomRow(array(
new CButton('select',S_SEARCH),
- new CButton('cancel',S_CANCEL)));
+ new CButtonCancel('&external_filter=1')));
$form->Show();
}
@@ -1532,7 +1532,7 @@
{
$btnSelect = new CButton('btn1',S_SELECT,
"return PopUp('popup.php?dstfrm=".$frmItem->GetName().
- "&dstfld1=key&srctbl=help_items&srcfld1=key_');");
+ "&dstfld1=key&srctbl=help_items&srcfld1=key_&itemtype=".$type."');");
$btnSelect->SetAccessKey('T');
}
@@ -1974,7 +1974,7 @@
$cmbCopyType->AddItem(1,S_HOST_GROUPS);
$frmCopy->AddRow(S_TARGET_TYPE, $cmbCopyType);
- $target_sql = 'select distinct g.groupid target_id, g.name target_name'.
+ $target_sql = 'select distinct g.groupid as target_id, g.name as target_name'.
' from groups g, hosts_groups hg'.
' where hg.groupid=g.groupid';
@@ -1989,7 +1989,7 @@
}
$frmCopy->AddRow('Group', $cmbGroup);
- $target_sql = 'select h.hostid target_id, h.host target_name from hosts h';
+ $target_sql = 'select h.hostid as target_id, h.host as target_name from hosts h';
if($filter_groupid > 0)
{
$target_sql .= ', hosts_groups hg where hg.hostid=h.hostid and hg.groupid='.$filter_groupid;
@@ -2181,7 +2181,7 @@
$frmComent->AddVar("triggerid",$triggerid);
$frmComent->AddRow(S_COMMENTS,new CTextArea("comments",stripslashes($trigger["comments"]),100,25));
$frmComent->AddItemToBottomRow(new CButton("save",S_SAVE));
- $frmComent->AddItemToBottomRow(new CButton("cancel",S_CANCEL));
+ $frmComent->AddItemToBottomRow(new CButtonCancel('&triggerid='.$triggerid));
$frmComent->Show();
}
@@ -2493,7 +2493,7 @@
$frmGItem->AddItemToBottomRow(new CButton("save", isset($gid) ? S_SAVE : S_ADD));
- $frmGItem->AddItemToBottomRow(new CButton('cancel',S_CANCEL,'window.close();'));
+ $frmGItem->AddItemToBottomRow(new CButtonCancel('close_window();'));
$frmGItem->Show();
}
@@ -3485,7 +3485,7 @@
$frmMedia->AddItemToBottomRow(new CButton("add", S_ADD));
$frmMedia->AddItemToBottomRow(SPACE);
- $frmMedia->AddItemToBottomRow(new CButton('cancel',S_CANCEL,'window.close();'));
+ $frmMedia->AddItemToBottomRow(new CButtonCancel(null, 'close_window();'));
$frmMedia->Show();
}
diff --git a/frontends/php/items.php b/frontends/php/items.php
index acfb1f83..f7fb45d8 100644
--- a/frontends/php/items.php
+++ b/frontends/php/items.php
@@ -782,7 +782,7 @@ include_once "include/page_header.php";
$error=new CCol($db_item["error"],"on");
}
- $applications = $show_applications == 1 ? implode(', ', get_applications_by_itemid($db_item["itemid"], 'name')) : null;
+ $applications = $show_applications ? implode(', ', get_applications_by_itemid($db_item["itemid"], 'name')) : null;
$chkBox = new CCheckBox("group_itemid[]",null,null,$db_item["itemid"]);
//if($db_item["templateid"] > 0) $chkBox->SetEnabled(false);
@@ -795,23 +795,20 @@ include_once "include/page_header.php";
$db_item["trends"],
item_type2str($db_item['type']),
$status,
- $show_applications ? $applications : null,
+ $applications,
$error
));
}
$footerButtons = array();
- array_push($footerButtons, new CButton('group_task',S_ACTIVATE_SELECTED,
- "return Confirm('".S_ACTIVATE_SELECTED_ITEMS_Q."');"));
+ array_push($footerButtons, new CButtonQMessage('group_task',S_ACTIVATE_SELECTED,S_ACTIVATE_SELECTED_ITEMS_Q));
array_push($footerButtons, SPACE);
- array_push($footerButtons, new CButton('group_task',S_DISABLE_SELECTED,
- "return Confirm('".S_DISABLE_SELECTED_ITEMS_Q."');"));
+ array_push($footerButtons, new CButtonQMessage('group_task',S_DISABLE_SELECTED,S_DISABLE_SELECTED_ITEMS_Q));
array_push($footerButtons, SPACE);
- array_push($footerButtons, new CButton('group_task',S_CLEAN_HISTORY_SELECTED_ITEMS,
- "return Confirm('".S_HISTORY_CLEANING_CAN_TAKE_A_LONG_TIME_CONTINUE_Q."');"));
+ array_push($footerButtons, new CButtonQMessage('group_task',S_CLEAN_HISTORY_SELECTED_ITEMS,
+ S_HISTORY_CLEANING_CAN_TAKE_A_LONG_TIME_CONTINUE_Q));
array_push($footerButtons, SPACE);
- array_push($footerButtons, new CButton('group_task',S_DELETE_SELECTED,
- "return Confirm('".S_DELETE_SELECTED_ITEMS_Q."');"));
+ array_push($footerButtons, new CButtonQMessage('group_task',S_DELETE_SELECTED,S_DELETE_SELECTED_ITEMS_Q));
array_push($footerButtons, SPACE);
array_push($footerButtons, new CButton('form_copy_to',S_COPY_SELECTED_TO));
array_push($footerButtons, SPACE);
diff --git a/frontends/php/js/common.js b/frontends/php/js/common.js
index 59214a61..8e7b348b 100644
--- a/frontends/php/js/common.js
+++ b/frontends/php/js/common.js
@@ -21,6 +21,12 @@ function SDI(msg)
alert("DEBUG INFO: " + msg);
}
+function close_window()
+{
+ window.setTimeout("window.close()", 500); /* Solve bug for Internet Explorer */
+ return false;
+}
+
function add_variable(o_el, s_name, x_value, s_formname, o_document)
{
var form;
diff --git a/frontends/php/popup.php b/frontends/php/popup.php
index f3771059..c9282fb4 100644
--- a/frontends/php/popup.php
+++ b/frontends/php/popup.php
@@ -94,22 +94,27 @@ include_once "include/page_header.php";
<?php
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields=array(
- "dstfrm" => array(T_ZBX_STR, O_MAND,P_SYS, NOT_EMPTY, NULL),
- "dstfld1"=> array(T_ZBX_STR, O_MAND,P_SYS, NOT_EMPTY, NULL),
- "dstfld2"=> array(T_ZBX_STR, O_OPT,P_SYS, NULL, NULL),
- "srctbl" => array(T_ZBX_STR, O_MAND,P_SYS, NOT_EMPTY, NULL),
- "srcfld1"=> array(T_ZBX_STR, O_MAND,P_SYS, NOT_EMPTY, NULL),
- "srcfld2"=> array(T_ZBX_STR, O_OPT,P_SYS, NULL, NULL),
- "nodeid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, NULL),
- "groupid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, NULL),
- "hostid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, NULL),
- "templates"=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, NULL),
- "existed_templates"=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, NULL),
- "only_hostid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, NULL),
- "monitored_hosts"=> array(T_ZBX_INT, O_OPT, null, IN('0,1'), NULL),
+ "dstfrm" => array(T_ZBX_STR, O_MAND,P_SYS, NOT_EMPTY, null),
+ "dstfld1"=> array(T_ZBX_STR, O_MAND,P_SYS, NOT_EMPTY, null),
+ "dstfld2"=> array(T_ZBX_STR, O_OPT,P_SYS, null, null),
+ "srctbl" => array(T_ZBX_STR, O_MAND,P_SYS, NOT_EMPTY, null),
+ "srcfld1"=> array(T_ZBX_STR, O_MAND,P_SYS, NOT_EMPTY, null),
+ "srcfld2"=> array(T_ZBX_STR, O_OPT,P_SYS, null, null),
+ "nodeid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, null),
+ "groupid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, null),
+ "hostid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, null),
+ "templates"=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, null),
+ "existed_templates"=> array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, null),
+ "only_hostid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, null),
+ "monitored_hosts"=> array(T_ZBX_INT, O_OPT, null, IN('0,1'), null),
+ 'itemtype'=> array(T_ZBX_INT, O_OPT, null, null, null),
- "select"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL)
+ "select"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null)
);
+
+ if(isset($_REQUEST['itemtype']) && !in_array($_REQUEST['itemtype'],
+ array(ITEM_TYPE_ZABBIX,ITEM_TYPE_SIMPLE,ITEM_TYPE_INTERNAL,ITEM_TYPE_AGGREGATE)))
+ unset($_REQUEST['itemtype']);
check_fields($fields);
@@ -271,7 +276,7 @@ include_once "include/page_header.php";
$btnEmpty = new CButton("empty",S_EMPTY,
get_window_opener($dstfrm, $dstfld1, 0).
get_window_opener($dstfrm, $dstfld2, '').
- " window.close();");
+ " close_window(); return false;");
$frmTitle->AddItem(array(SPACE,$btnEmpty));
}
@@ -304,7 +309,7 @@ include_once "include/page_header.php";
$name->SetAction(
get_window_opener($dstfrm, $dstfld1, $host[$srcfld1]).
(isset($srcfld2) ? get_window_opener($dstfrm, $dstfld2, $host[$srcfld2]) : '').
- " window.close();");
+ " close_window(); return false;");
if($host["status"] == HOST_STATUS_MONITORED)
$status=new CSpan(S_MONITORED,"off");
@@ -370,44 +375,13 @@ include_once "include/page_header.php";
$new_templates = array_diff($templates, $existed_templates);
if(count($new_templates) > 0)
{
-?>
-
-<script language="JavaScript" type="text/javascript">
-<!--
-function add_template(formname,id,name)
-{
- var msg = '';
- var form = window.opener.document.forms[formname];
- if(!form)
- {
- alert('form '+formname+' not exist');
- window.close();
- }
-
- new_variable = window.opener.document.createElement('input');
- new_variable.type = 'hidden';
- new_variable.name = 'templates[' + id + ']';
- new_variable.value = name;
-
- form.appendChild(new_variable);
-
- return true;
-}
--->
-</script>
-
-<?php
foreach($new_templates as $id => $name)
{
?>
<script language="JavaScript" type="text/javascript">
<!--
- add_template(
- '<?php echo $dstfrm; ?>',
- '<?php echo $id; ?>',
- '<?php echo $name; ?>'
- );
+ add_variable(null,"templates[" + "<?php echo $id; ?>" + "]","<?php echo $name; ?>","<?php echo $dstfrm; ?>",window.opener.document);
-->
</script>
@@ -418,8 +392,8 @@ function add_template(formname,id,name)
<script language="JavaScript" type="text/javascript">
<!--
var form = window.opener.document.forms['<?php echo $dstfrm; ?>'];
- form.submit();
- window.close();
+ if(form) form.submit();
+ close_window();
-->
</script>
@@ -447,7 +421,7 @@ function add_template(formname,id,name)
while($host = DBfetch($db_hosts))
{
$chk = new CCheckBox('templates['.$host["hostid"].']',isset($templates[$host["hostid"]]),
- NULL,$host["host"]);
+ null,$host["host"]);
$chk->SetEnabled(!isset($existed_templates[$host["hostid"]]));
$table->AddRow(array(
@@ -488,7 +462,7 @@ function add_template(formname,id,name)
$name->SetAction(
get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]).
(isset($srcfld2) ? get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) : '').
- " window.close();");
+ " return close_window();");
$table->AddRow($name);
}
@@ -506,7 +480,7 @@ function add_template(formname,id,name)
$name->SetAction(
get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]).
(isset($srcfld2) ? get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) : '').
- " window.close();");
+ " close_window(); return false;");
$table->AddRow($name);
}
@@ -523,8 +497,8 @@ function add_template(formname,id,name)
{
$name = new CLink($row["key_"],"#","action");
$name->SetAction(
- get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]).
- " window.close();");
+ get_window_opener($dstfrm, $dstfld1, html_entity_decode($row[$srcfld1])).
+ " close_window(); return false;");
$table->AddRow(array(
$name,
@@ -563,7 +537,7 @@ function add_template(formname,id,name)
$description->SetAction(
get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]).
get_window_opener($dstfrm, $dstfld2, $exp_desc).
- " window.close();");
+ " close_window(); return false;");
if($row['dep_count'] > 0)
{
@@ -634,7 +608,7 @@ function add_item_variable(s_formname,x_value)
o_form.submit();
}
- window.close();
+ close_window();
return true;
}
-->
@@ -644,7 +618,7 @@ function add_item_variable(s_formname,x_value)
$table = new CTableInfo(S_NO_ITEMS_DEFINED);
$table->SetHeader(array(
- !isset($hostid) ? S_HOST : NULL,
+ !isset($hostid) ? S_HOST : null,
S_DESCRIPTION,S_KEY,nbsp(S_UPDATE_INTERVAL),
S_STATUS));
@@ -669,7 +643,7 @@ function add_item_variable(s_formname,x_value)
}
$table->AddRow(array(
- !isset($hostid) ? $db_item["host"] : NULL,
+ !isset($hostid) ? $db_item["host"] : null,
$description,
$db_item["key_"],
$db_item["delay"],
@@ -713,7 +687,7 @@ function add_item_variable(s_formname,x_value)
$description->SetAction(
get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]).
(isset($srcfld2) ? get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) : '').
- " window.close();");
+ " close_window(); return false;");
$table->AddRow(array(
(isset($hostid) ? null : $row['host']),
@@ -751,7 +725,7 @@ function add_item_variable(s_formname,x_value)
$name->SetAction(
get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]).
(isset($srcfld2) ? get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) : '').
- " window.close();");
+ " close_window(); return false;");
$table->AddRow(array(isset($hostid) ? null : $row['host'], $name));
}
@@ -771,7 +745,7 @@ function add_item_variable(s_formname,x_value)
$name->SetAction(
get_window_opener($dstfrm, $dstfld1, $row[$srcfld1]).
(isset($srcfld2) ? get_window_opener($dstfrm, $dstfld2, $row[$srcfld2]) : '').
- " window.close();");
+ " close_window(); return false;");
$table->AddRow($name);
}
diff --git a/frontends/php/popup_gitem.php b/frontends/php/popup_gitem.php
index 7e7916bc..e4ebe329 100644
--- a/frontends/php/popup_gitem.php
+++ b/frontends/php/popup_gitem.php
@@ -80,7 +80,7 @@ function add_graph_item(formname,itemid,color,drawtype,sortorder,yaxisside,calc_
if(!form)
{
- window.close();
+ close_window();
return false;
}
@@ -94,7 +94,7 @@ function add_graph_item(formname,itemid,color,drawtype,sortorder,yaxisside,calc_
add_var_to_opener_obj(form,'new_graph_item[periods_cnt]',periods_cnt);
form.submit();
- window.close();
+ close_window();
return true;
}
@@ -104,7 +104,7 @@ function update_graph_item(formname,list_name,gid,itemid,color,drawtype,sortorde
if(!form)
{
- window.close();
+ close_window();
return false;
}
@@ -118,7 +118,7 @@ function update_graph_item(formname,list_name,gid,itemid,color,drawtype,sortorde
add_var_to_opener_obj(form,list_name + '[' + gid + '][periods_cnt]',periods_cnt);
form.submit();
- window.close();
+ close_window();
return true;
}
-->
diff --git a/frontends/php/popup_httpstep.php b/frontends/php/popup_httpstep.php
index 2b4ebe5f..3773a5a3 100644
--- a/frontends/php/popup_httpstep.php
+++ b/frontends/php/popup_httpstep.php
@@ -84,7 +84,7 @@ function add_httpstep(formname,name,timeout,url,posts,required)
if(!form)
{
- window.close();
+ close_window();
return false;
}
@@ -95,7 +95,7 @@ function add_httpstep(formname,name,timeout,url,posts,required)
add_var_to_opener_obj(form,'new_httpstep[required]',required);
form.submit();
- window.close();
+ close_window();
return true;
}
@@ -124,7 +124,7 @@ function update_httpstep(formname,list_name,sid,name,timeout,url,posts,required)
if(!form)
{
- window.close();
+ close_window();
return false;
}
@@ -136,7 +136,7 @@ function update_httpstep(formname,list_name,sid,name,timeout,url,posts,required)
form.submit();
- window.close();
+ close_window();
return true;
}
diff --git a/frontends/php/popup_media.php b/frontends/php/popup_media.php
index 8b7f2042..44935379 100644
--- a/frontends/php/popup_media.php
+++ b/frontends/php/popup_media.php
@@ -71,7 +71,7 @@ function add_media(formname,mediatypeid,sendto,period,active,severity)
if(!form)
{
- window.close();
+ close_window();
return false;
}
@@ -82,7 +82,7 @@ function add_media(formname,mediatypeid,sendto,period,active,severity)
add_var_to_opener_obj(form,'new_media[severity]',severity);
form.submit();
- window.close();
+ close_window();
return true;
}
-->
diff --git a/frontends/php/popup_right.php b/frontends/php/popup_right.php
index d61c0bee..9a25cdb8 100644
--- a/frontends/php/popup_right.php
+++ b/frontends/php/popup_right.php
@@ -64,7 +64,7 @@ function add_right(formname,type,id,permission,name)
if(!form)
{
- window.close();
+ close_window();
return false;
}
@@ -74,7 +74,7 @@ function add_right(formname,type,id,permission,name)
add_var_to_opener_obj(form,'new_right[name]',name);
form.submit();
- window.close();
+ close_window();
return true;
}
-->
diff --git a/frontends/php/popup_trexpr.php b/frontends/php/popup_trexpr.php
index e41eec8a..efa471d3 100644
--- a/frontends/php/popup_trexpr.php
+++ b/frontends/php/popup_trexpr.php
@@ -260,7 +260,7 @@ if(form)
if(el)
{
InsertText(el, '<?php echo $expression; ?>');
- window.close();
+ close_window();
}
}
-->
diff --git a/frontends/php/popup_users.php b/frontends/php/popup_users.php
index 28712c71..8094f007 100644
--- a/frontends/php/popup_users.php
+++ b/frontends/php/popup_users.php
@@ -66,7 +66,7 @@ function add_user(formname,user_id,alias)
if(!form)
{
- window.close();
+ close_window();
return false;
}
@@ -74,7 +74,7 @@ function add_user(formname,user_id,alias)
add_var_to_opener_obj(form,'new_user[alias]',alias);
form.submit();
- window.close();
+ close_window();
return true;
}
-->
diff --git a/frontends/php/popup_usrgrp.php b/frontends/php/popup_usrgrp.php
index 060940e7..d7378c15 100644
--- a/frontends/php/popup_usrgrp.php
+++ b/frontends/php/popup_usrgrp.php
@@ -77,7 +77,7 @@ form = window.opener.document.forms['<?php echo $dstfrm; ?>'];
if(form)
{
form.submit();
- window.close();
+ close_window();
}
-->
</script>
diff --git a/frontends/php/services.php b/frontends/php/services.php
index bee054ad..b000b163 100644
--- a/frontends/php/services.php
+++ b/frontends/php/services.php
@@ -341,7 +341,7 @@ include_once "include/page_header.php";
));
}
- $table->SetFooter(new CCol(new CButtonQMessage('delete',S_DELETE_SELECTED,S_DELETE_SELECTED_SERVICES,null,false)));
+ $table->SetFooter(new CCol(new CButtonQMessage('delete',S_DELETE_SELECTED,S_DELETE_SELECTED_SERVICES)));
$form->AddItem($table);
$form->Show();
?>
@@ -387,7 +387,7 @@ include_once "include/page_header.php";
$row["soft"] == 0 ? S_HARD : S_SOFT
));
}
- $table->SetFooter(new CCol(new CButtonQMessage('delete',S_DELETE_SELECTED,S_DELETE_SELECTED_SERVICES,null,false)));
+ $table->SetFooter(new CCol(new CButtonQMessage('delete',S_DELETE_SELECTED,S_DELETE_SELECTED_SERVICES)));
$form->AddItem($table);
$form->Show();
}