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/cvar.inc.php | |
| 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/cvar.inc.php')
| -rw-r--r-- | frontends/php/include/classes/cvar.inc.php | 47 |
1 files changed, 45 insertions, 2 deletions
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; + } + } ?> |
