summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/forms.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-02-01 16:32:52 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-02-01 16:32:52 +0000
commit17aeb9f5d4c671f48f74e4ab97f663da9caa041a (patch)
treef83a597ef1ad5ac5f46212ee598e541f6cc35722 /frontends/php/include/forms.inc.php
parent3ebc3209bcb250eb96a62340f7df9d73203185d4 (diff)
downloadzabbix-17aeb9f5d4c671f48f74e4ab97f663da9caa041a.tar.gz
zabbix-17aeb9f5d4c671f48f74e4ab97f663da9caa041a.tar.xz
zabbix-17aeb9f5d4c671f48f74e4ab97f663da9caa041a.zip
- Frontend validation improvements (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2598 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/forms.inc.php')
-rw-r--r--frontends/php/include/forms.inc.php69
1 files changed, 40 insertions, 29 deletions
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 2cdacebf..1bfa3ad3 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -910,22 +910,27 @@
if(isset($_REQUEST["autoregid"]))
{
$frmAutoReg->AddVar("autoregid",$_REQUEST["autoregid"]);
- $result=DBselect("select * from autoreg where id=".$_REQUEST["autoregid"]);
+ $result = DBselect("select * from autoreg where id=".$_REQUEST["autoregid"]);
- $row=DBfetch($result);
-
- $pattern=$row["pattern"];
- $priority=$row["priority"];
- $hostid=$row["hostid"];
- $h=get_host_by_hostid($hostid);
- $host=$h["host"];
+ $row = DBfetch($result);
+ $pattern= $row["pattern"];
+
+ $frmAutoReg->SetTitle(S_AUTOREGISTRATION." \"".$pattern."\"");
+ }
+
+ if(isset($_REQUEST["autoregid"]) && !isset($_REQUEST["form_refresh"]))
+ {
+ $priority = $row["priority"];
+ $hostid = $row["hostid"];
+ $h = get_host_by_hostid($hostid);
+ $host = $h["host"];
}
else
{
- $pattern="*";
- $priority=10;
- $hostid=0;
- $host="";
+ $pattern = get_request("pattern", "*");
+ $priority = get_request("priority", 10);
+ $hostid = get_request("hostid", 0);
+ $host = get_request("host", "");
}
$col=0;
@@ -948,7 +953,8 @@
$frmAutoReg->AddItemToBottomRow(SPACE);
$frmAutoReg->AddItemToBottomRow(new CButtonDelete(
"Delete selected autoregistration rule?",
- url_param("form").url_param("config").url_param("autoregid")));
+ url_param("form").url_param("config").url_param("autoregid").
+ "&pattern=".$pattern));
}
$frmAutoReg->AddItemToBottomRow(SPACE);
$frmAutoReg->AddItemToBottomRow(new CButtonCancel(url_param("config")));
@@ -1310,28 +1316,33 @@
function insert_image_form()
{
- if(!isset($_REQUEST["imageid"]))
- {
- $name="";
- $imagetype=1;
- }
- else
+ $frmImages = new CFormTable(S_IMAGE,"config.php","post","multipart/form-data");
+ $frmImages->SetHelp("web.config.images.php");
+ $frmImages->AddVar("MAX_FILE_SIZE",(1024*1024));
+ $frmImages->AddVar("config",get_request("config",3));
+
+ if(isset($_REQUEST["imageid"]))
{
- $result=DBselect("select imageid,imagetype,name,image from images where imageid=".$_REQUEST["imageid"]);
+ $result=DBselect("select imageid,imagetype,name,image from images".
+ " where imageid=".$_REQUEST["imageid"]);
+
$row=DBfetch($result);
- $name=$row["name"];
- $imagetype=$row["imagetype"];
- $imageid=$row["imageid"];
+ $frmImages->SetTitle(S_IMAGE." \"".$row["name"]."\"");
+ $frmImages->AddVar("imageid",$_REQUEST["imageid"]);
}
- $frmImages = new CFormTable(S_IMAGE,"config.php","post","multipart/form-data");
- $frmImages->SetHelp("web.config.images.php");
- $frmImages->AddVar("MAX_FILE_SIZE",(1024*1024));
- $frmImages->AddVar("config",3);
- if(isset($imageid))
+ if(isset($_REQUEST["imageid"]) && !isset($_REQUEST["form_refresh"]))
{
- $frmImages->AddVar("imageid",$imageid);
+ $name = $row["name"];
+ $imagetype = $row["imagetype"];
+ $imageid = $row["imageid"];
+ }
+ else
+ {
+ $name = get_request("name","");
+ $imagetype = get_request("imagetype",1);
}
+
$frmImages->AddRow(S_NAME,new CTextBox("name",$name,64));
$cmbImg = new CComboBox("imagetype",$imagetype);