diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-07-19 14:17:45 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-07-19 14:17:45 +0000 |
| commit | 2691ad6741639192c107509983aa42a0fcd39141 (patch) | |
| tree | 83dfc7e8829477e3ee68d4917dc4eb7e80446cc3 /frontends/php/include/classes | |
| parent | 9952250afe4243f8ac3de8fbcb7d4b5b1292179d (diff) | |
| download | zabbix-2691ad6741639192c107509983aa42a0fcd39141.tar.gz zabbix-2691ad6741639192c107509983aa42a0fcd39141.tar.xz zabbix-2691ad6741639192c107509983aa42a0fcd39141.zip | |
- developed "Copty to" functionality for trigger groups (Eugene)
- developed "Copty to" functionality for item groups (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3067 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes')
| -rw-r--r-- | frontends/php/include/classes/cform.inc.php | 9 | ||||
| -rw-r--r-- | frontends/php/include/classes/cformtable.inc.php | 16 | ||||
| -rw-r--r-- | frontends/php/include/classes/cvar.inc.php | 47 |
3 files changed, 59 insertions, 13 deletions
diff --git a/frontends/php/include/classes/cform.inc.php b/frontends/php/include/classes/cform.inc.php index e83679dd..9767a7f3 100644 --- a/frontends/php/include/classes/cform.inc.php +++ b/frontends/php/include/classes/cform.inc.php @@ -56,16 +56,9 @@ } return $this->AddOption("enctype",$value); } + function AddVar($name, $value) { - if(is_array($value)) - { - foreach($value as $item) - { - $this->AddItem(new CVar($name."[]", $item)); - } - return 1; - } return $this->AddItem(new CVar($name, $value)); } } diff --git a/frontends/php/include/classes/cformtable.inc.php b/frontends/php/include/classes/cformtable.inc.php index fb5640ed..e2be6439 100644 --- a/frontends/php/include/classes/cformtable.inc.php +++ b/frontends/php/include/classes/cformtable.inc.php @@ -30,10 +30,20 @@ var $center_items = array(); var $bottom_items = array(); /* public */ - function CFormTable($title=NULL, $action=NULL, $method='get', $enctype=NULL) + function CFormTable($title=null, $action=null, $method=null, $enctype=null, $form_variable=null) { global $_REQUEST; + if( null == $method ) + { + $method = 'get'; + } + + if( null == $form_variable ) + { + $form_variable = 'form'; + } + parent::CForm($action,$method,$enctype); $this->SetTitle($title); $this->SetAlign('center'); @@ -43,8 +53,8 @@ // $frm_link->SetName("formtable"); $this->AddItemToTopRow($frm_link); - $this->AddVar("form",get_request("form",1)); - $this->AddVar("form_refresh",get_request("form_refresh",0)+1); + $this->AddVar($form_variable, get_request($form_variable, 1)); + $this->AddVar('form_refresh',get_request('form_refresh',0)+1); $this->bottom_items = new CCol(NULL,'form_row_last'); $this->bottom_items->SetColSpan(2); diff --git a/frontends/php/include/classes/cvar.inc.php b/frontends/php/include/classes/cvar.inc.php index 52dd4f8f..79a136b4 100644 --- a/frontends/php/include/classes/cvar.inc.php +++ b/frontends/php/include/classes/cvar.inc.php @@ -19,10 +19,10 @@ **/ ?> <?php - class CVar extends CTag + /* private */ class CVarTag extends CTag { /* public */ - function CVar($name="",$value="0") + function CVarTag($name="",$value="0") { parent::CTag('input','no'); $this->options['type'] = 'hidden'; @@ -34,4 +34,47 @@ $this->options['value'] = $value; } } + + /* public */ class CVar + { + var $var_container = array(); + var $var_name; + + function CVar($name,$value=null) + { + $this->var_name = $name; + + $this->SetValue($value); + } + + function SetValue($value) + { + $this->var_container = array(); + + if(null == $value) return; + + if(is_array($value)) + { + foreach($value as $item) + { + if( null == $item ) continue; + array_push($this->var_container, new CVarTag($this->var_name.'[]', $item)); + } + return; + } + + array_push($this->var_container, new CVarTag($this->var_name, $value)); + } + + function ToString() + { + $res = ""; + + foreach($this->var_container as $item) + { + $res .= $item->ToString(); + } + return $res; + } + } ?> |
