diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-30 11:21:15 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-30 11:21:15 +0000 |
| commit | 1911c670de385a295b404edcf8a3764d64c25614 (patch) | |
| tree | 3615108eaec5c722e91ae220585626ebd676665b | |
| parent | 99334a88dbac754adc43e82dbfe1027b28c4d9de (diff) | |
| download | zabbix-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
| -rw-r--r-- | frontends/php/css.css | 9 | ||||
| -rw-r--r-- | frontends/php/include/classes/cformtable.inc.php | 15 | ||||
| -rw-r--r-- | frontends/php/include/classes/cimg.inc.php | 9 | ||||
| -rw-r--r-- | frontends/php/include/classes/clink.inc.php | 6 | ||||
| -rw-r--r-- | frontends/php/include/config.inc.php | 14 | ||||
| -rw-r--r-- | frontends/php/include/forms.inc.php | 26 | ||||
| -rw-r--r-- | frontends/php/popup.php | 12 |
7 files changed, 60 insertions, 31 deletions
diff --git a/frontends/php/css.css b/frontends/php/css.css index c456f061..95fa8ef3 100644 --- a/frontends/php/css.css +++ b/frontends/php/css.css @@ -1,7 +1,6 @@ body { background-color:#e5e5e5; - margin: 3px 3px 3px 3px; margin: 0px 0px 0px 0px; padding: 0px; color:black; @@ -93,7 +92,7 @@ td.form_row_last padding-left: 5px; } -/* SREEN TABLE */ +/* SCREEN TABLE */ table.screen { background-color: #FFFFFF; @@ -396,19 +395,15 @@ table.page_header } td.page_header_l { - background-color: #FFFFFF; vertical-align: middle; padding: 0; } td.page_header_r { + vertical-align: middle; text-align: right; - background-color: #FFFFFF; - border-width:0px; - border-right-style: solid; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; - vertical-align: middle; } /**************** PAGE FOOTER ****************/ 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); diff --git a/frontends/php/popup.php b/frontends/php/popup.php index ce9e40d6..995af0b2 100644 --- a/frontends/php/popup.php +++ b/frontends/php/popup.php @@ -93,10 +93,14 @@ { continue; } -// $host ="<a href=\"#\" onclick='send_back('Accounts','9ca3e791-4bc9-7808-f70c-4374c24de0df');'>".$row["host"]."</a>"; -// $host ="<a href=\"#\" onclick=\"zzz();\">".$row["host"]."</a>"; - $host ="<a href=\"#\" onclick=\"window.opener.document.".$_REQUEST["form"].".".$_REQUEST["field1"].".value='".$row["hostid"]."'; window.opener.document.".$_REQUEST["form"].".".$_REQUEST["field2"].".value='".$row["host"]."'; window.close();\">".$row["host"]."</a>"; -// $host="<a href=\"popup.php?hostid=".$row["hostid"]."\">".$row["host"]."</a>"; + + $host ="<a href=\"#\" onclick='". + " window.opener.document.forms[\"".$_REQUEST["form"]."\"].".$_REQUEST["field1"]. + ".value=\"".$row["hostid"]."\";". + " window.opener.document.forms[\"".$_REQUEST["form"]."\"].".$_REQUEST["field2"]. + ".value=\"".$row["host"]."\";". + " window.close();". + "'>".$row["host"]."</a>"; if($row["useip"]==1) { |
