summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-01-30 11:21:15 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-01-30 11:21:15 +0000
commit1911c670de385a295b404edcf8a3764d64c25614 (patch)
tree3615108eaec5c722e91ae220585626ebd676665b /frontends/php/include
parent99334a88dbac754adc43e82dbfe1027b28c4d9de (diff)
downloadzabbix-1911c670de385a295b404edcf8a3764d64c25614.tar.gz
zabbix-1911c670de385a295b404edcf8a3764d64c25614.tar.xz
zabbix-1911c670de385a295b404edcf8a3764d64c25614.zip
- Frontend improvements (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2572 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/classes/cformtable.inc.php15
-rw-r--r--frontends/php/include/classes/cimg.inc.php9
-rw-r--r--frontends/php/include/classes/clink.inc.php6
-rw-r--r--frontends/php/include/config.inc.php14
-rw-r--r--frontends/php/include/forms.inc.php26
5 files changed, 50 insertions, 20 deletions
diff --git a/frontends/php/include/classes/cformtable.inc.php b/frontends/php/include/classes/cformtable.inc.php
index 1adb45d0..d42cbae6 100644
--- a/frontends/php/include/classes/cformtable.inc.php
+++ b/frontends/php/include/classes/cformtable.inc.php
@@ -77,18 +77,25 @@
}
function SetHelp($value=NULL)
{
- if(is_null($value))
+ if(is_null($value)) {
$this->help = new CHelp();
- elseif(is_a($value,'chelp'))
+ $this->AddOption("name",'form');
+ } elseif(is_a($value,'chelp')) {
$this->help = $value;
- elseif(is_string($value))
+ $this->AddOption("name",'form');
+ } elseif(is_string($value)) {
$this->help = new CHelp($value);
- else
+ $this->AddOption("name",$value);
+ } else
{
return $this->error("Incorrect value for SetHelp [$value]");
}
return 0;
}
+ function GetName()
+ {
+ return $this->GetOption("name");
+ }
function AddVar($name, $value)
{
$this->AddItemToTopRow(new CVar($name, $value));
diff --git a/frontends/php/include/classes/cimg.inc.php b/frontends/php/include/classes/cimg.inc.php
index 11503faf..cd557489 100644
--- a/frontends/php/include/classes/cimg.inc.php
+++ b/frontends/php/include/classes/cimg.inc.php
@@ -22,14 +22,21 @@
class CImg extends CTag
{
/* public */
- function CImg($src,$alt_text=NULL,$width=NULL,$height=NULL)
+ function CImg($src,$alt_text=NULL,$width=NULL,$height=NULL,$class=NULL)
{
parent::CTag("img","no");
+
+ $this->tag_start= "";
+ $this->tag_end = "";
+ $this->tag_body_start = "";
+ $this->tag_body_end = "";
+
$this->AddOption('border',0);
$this->SetAltText($alt_text);
$this->SetSrc($src);
$this->SetWidth($width);
$this->SetHeight($height);
+ $this->SetClass($class);
}
function SetSrc($value)
{
diff --git a/frontends/php/include/classes/clink.inc.php b/frontends/php/include/classes/clink.inc.php
index b99e307d..a4cb49d7 100644
--- a/frontends/php/include/classes/clink.inc.php
+++ b/frontends/php/include/classes/clink.inc.php
@@ -25,6 +25,12 @@
function CLink($item="www.zabbix.com",$url="http://www.zabbix.com",$class=NULL)
{
parent::CTag("a","yes");
+
+ $this->tag_start= "";
+ $this->tag_end = "";
+ $this->tag_body_start = "";
+ $this->tag_body_end = "";
+
$this->SetClass($class);
$this->AddItem($item);
$this->SetUrl($url);
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index a86df47f..5c5d5e71 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1012,9 +1012,9 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=<?php echo S_HTML_CHARSET; ?>">
- <meta name="Author" content="Alexei Vladishev">
- <link rel="stylesheet" href="css.css">
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo S_HTML_CHARSET; ?>">
+<meta name="Author" content="Alexei Vladishev">
+<link rel="stylesheet" href="css.css">
<?php
// if($USER_DETAILS['alias']=='guest')
// {
@@ -1033,7 +1033,6 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
?>
</head>
-
<body>
<?php
if($nomenu == 0)
@@ -2431,6 +2430,8 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
{
global $USER_DETAILS;
+ show_messages();
+
echo BR;
$table = new CTable(NULL,"page_footer");
$table->SetCellSpacing(0);
@@ -2840,6 +2841,11 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
window.location = url;
return false;
}
+ function PopUp(url,name,param)
+ {
+ window.open(url,name,param);
+ return false;
+ }
</script>
";
}
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index bf6926ff..1213b819 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -377,8 +377,9 @@
$frmItem->AddRow(S_DESCRIPTION, new CTextBox("description",$description,40));
$frmItem->AddRow(S_HOST, array(
new CTextBox("host",$host,30,NULL,'yes'),
- new CButton("btn1","Select","window.open('popup.php?form=item&field1=hostid".
- "&field2=host','new_win','width=450,height=450,resizable=1,scrollbars=1');","T")
+ new CButton("btn1","Select","return PopUp('popup.php?form=".$frmItem->GetName().
+ "&field1=hostid&field2=host','host','width=450,height=450,".
+ "resizable=1,scrollbars=1');","T")
));
$cmbType = new CComboBox("type",$type,"submit()");
@@ -455,7 +456,7 @@
$frmItem->AddVar("multiplier",$multiplier);
}
- if($multiplier == S_CUSTOM_MULTIPLIER)
+ if($multiplier == 1)
{
$frmItem->AddRow(S_CUSTOM_MULTIPLIER, new CTextBox("formula",$formula,40));
}
@@ -930,8 +931,9 @@
$frmAutoReg->AddRow(S_HOST,array(
new CTextBox("host",$host,32,NULL,'yes'),
new CButton("btn1","Select",
- "window.open('popup.php?form=auto&field1=hostid&field2=host',".
- "'new_win','width=450,height=450,resizable=1,scrollbars=1');",
+ "return PopUp('popup.php?form=".$frmAutoReg->GetName().
+ "&field1=hostid&field2=host','new_win',".
+ "'width=450,height=450,resizable=1,scrollbars=1');",
'T')
));
$frmAutoReg->AddVar("hostid",$hostid);
@@ -955,7 +957,7 @@
$uid=NULL;
$frmAction = new CFormTable(S_ACTION,'actionconf.php');
- $frmAction->SetHelp('web.actions.action');
+ $frmAction->SetHelp('web.actions.action.php');
$conditiontype = get_request("conditiontype",0);
@@ -1113,8 +1115,9 @@
$txtCondVal->SetReadonly('yes');
$btnSelect = new CButton('btn1','Select',
- "window.open('popup.php?form=action&field1=value&field2=host',".
- "'new_win','width=450,height=450,resizable=1,scrollbars=1');");
+ "return PopUp('popup.php?form=".$frmAction->GetName().
+ "&field1=value&field2=host','new_win',".
+ "'width=450,height=450,resizable=1,scrollbars=1');");
$btnSelect->SetAccessKey('T');
array_push($rowCondition, $txtCondVal, $btnSelect);
@@ -1258,7 +1261,7 @@
}
$frmMeadia = new CFormTable(S_MEDIA,"config.php");
- $frmMeadia->SetHelp("web.config.medias");
+ $frmMeadia->SetHelp("web.config.medias.php");
if(isset($_REQUEST["mediatypeid"]))
{
@@ -2083,8 +2086,9 @@
$frmHost->AddVar("hostid",$hostid);
$frmHost->AddRow("Host",array(
new CTextBox("host",$host,32,NULL,'yes'),
- new CButton("btn1","Select","window.open('popup.php?form=host&field1=hostid&field2=host'".
- ",'new_win','width=450,height=450,resizable=1,scrollbars=1');","T")
+ new CButton("btn1","Select","return PopUp('popup.php?form=".$frmHost->GetName().
+ "&field1=hostid&field2=host','new_win',".
+ "'width=450,height=450,resizable=1,scrollbars=1');","T")
));
$cmbIcon = new CComboBox("icon",$icon);