summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-08 09:21:28 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-08 09:21:28 +0000
commit29dca6b924dca31f7ac93bafc24985810971ac05 (patch)
treef98ddd1705cadecfc69ceff6a026fd4bebd960ab /frontends/php/include
parent86ada7d77c1ce15210d7894d0858bbafd3a3f0c6 (diff)
downloadzabbix-29dca6b924dca31f7ac93bafc24985810971ac05.tar.gz
zabbix-29dca6b924dca31f7ac93bafc24985810971ac05.tar.xz
zabbix-29dca6b924dca31f7ac93bafc24985810971ac05.zip
- [DEV-149] improved host-group editing (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5683 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/classes/ccombobox.inc.php39
-rw-r--r--frontends/php/include/classes/cformtable.inc.php4
-rw-r--r--frontends/php/include/forms.inc.php2
3 files changed, 26 insertions, 19 deletions
diff --git a/frontends/php/include/classes/ccombobox.inc.php b/frontends/php/include/classes/ccombobox.inc.php
index 30fa6d2d..fd98b43b 100644
--- a/frontends/php/include/classes/ccombobox.inc.php
+++ b/frontends/php/include/classes/ccombobox.inc.php
@@ -157,51 +157,56 @@
}
class CTweenBox{
- function ctweenbox($name_l,$name_r,$size){
- $this->lbox = new ClistBox($name_l,null,$size);
-// $this->lbox->AddOption('style','width: 140px;');
+ function ctweenbox(&$form,$name,$size){
+ $this->form = &$form;
+ $this->name = $name;
+
+ $this->id_l = $this->name.'_left';
+ $this->id_r = $this->name.'_right';
- $this->rbox = new ClistBox($name_r,null,$size);
+ $this->lbox = new ClistBox($this->id_l,null,$size);
+ $this->rbox = new ClistBox($this->id_r,null,$size);
+
+// $this->lbox->AddOption('style','width: 140px;');
// $this->rbox->AddOption('style','width: 140px;');
}
function AddItem($expr, $value, $caption, $selected=NULL, $enabled='yes'){
if($expr){
- $box = &$this->lbox;
+ $this->lbox->AddItem($value,$caption,$selected,$enabled);
+ $this->form->AddVar($this->name.'['.$value.']',$value);
}
else{
- $box = &$this->rbox;
+ $this->rbox->AddItem($value,$caption,$selected,$enabled);
}
-
- $box->AddItem($value,$caption,$selected,$enabled);
}
- function SetAction($expr, $value='submit()', $event='onchange'){
+ function SetAction($expr, $event='onchange', $value='submit()'){
+// $box = &$this->lbox;
if($expr){
- $box = &$this->lbox;
+ $this->lbox->AddOption($event,$value);
}
else{
- $box = &$this->rbox;
+ $this->rbox->AddOption($event,$value);
}
- $box->AddOption($event,$value);
}
function Get($caption_l=null,$caption_r=null){
$grp_tab = new CTable();
+ $grp_tab->SetCellSpacing(0);
+ $grp_tab->SetCellPadding(0);
+
if(!is_null($caption_l) || !is_null($caption_r)){
$grp_tab->AddRow(array(bold($caption_l),SPACE,bold($caption_r)));
}
- $id_l = $this->lbox->options['id'];
- $id_r = $this->rbox->options['id'];
-
$add_btn = new CButton('add',' « ');//S_ADD);//
$add_btn->SetType('button');
- $add_btn->SetAction('javascript: moveListBoxSelectedItem("'.$id_r.'","'.$id_l.'");');
+ $add_btn->SetAction('javascript: moveListBoxSelectedItem("'.$this->form->GetName().'","'.$this->name.'","'.$this->id_r.'","'.$this->id_l.'","add");');
$rmv_btn = new CButton('remove',' » ');//S_REMOVE);//
$rmv_btn->SetType('button');
- $rmv_btn->SetAction('javascript: moveListBoxSelectedItem("'.$id_l.'","'.$id_r.'");');
+ $rmv_btn->SetAction('javascript: moveListBoxSelectedItem("'.$this->form->GetName().'","'.$this->name.'","'.$this->id_l.'","'.$this->id_r.'","rmv");');
$grp_tab->AddRow(array($this->lbox,new CCol(array($add_btn,BR(),$rmv_btn),'top'),$this->rbox));
return $grp_tab;
diff --git a/frontends/php/include/classes/cformtable.inc.php b/frontends/php/include/classes/cformtable.inc.php
index 449c6675..ee5fc85c 100644
--- a/frontends/php/include/classes/cformtable.inc.php
+++ b/frontends/php/include/classes/cformtable.inc.php
@@ -76,7 +76,9 @@
if(!is_string($value)){
return $this->error("Incorrect value for SetAlign [$value]");
}
- return $this->AddOption('name',$value);
+ $this->AddOption('name',$value);
+ $this->AddOption('id',$value);
+ return true;
}
function SetAlign($value){
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 081b6028..b901d1ca 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -4193,7 +4193,7 @@ include_once 'include/discovery.inc.php';
$frmHost->AddRow(S_NAME,new CTextBox('host',$host,20));
- $grp_tb = new CTweenBox('groups_in','groups_out',10);
+ $grp_tb = new CTweenBox($frmHost,'groups',10);
$db_groups=DBselect('SELECT DISTINCT groupid,name '.
' FROM groups '.