diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-04-05 09:16:29 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-04-05 09:16:29 +0000 |
| commit | 0c9653d6ab8fca3be69489943f1fcc4e9d797102 (patch) | |
| tree | 4e3d0f7e328577428161b62d3872bbdeefacb70c /frontends/php/include/classes | |
| parent | 07abfc5904f98fd5139b5ac6d92aaa34a7ccf9b7 (diff) | |
| download | zabbix-0c9653d6ab8fca3be69489943f1fcc4e9d797102.tar.gz zabbix-0c9653d6ab8fca3be69489943f1fcc4e9d797102.tar.xz zabbix-0c9653d6ab8fca3be69489943f1fcc4e9d797102.zip | |
- added latest values filtring/marking of log history (Eugene)
- developed multiple log history viewing (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2719 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes')
| -rw-r--r-- | frontends/php/include/classes/cform.inc.php | 10 | ||||
| -rw-r--r-- | frontends/php/include/classes/ctag.inc.php | 37 |
2 files changed, 41 insertions, 6 deletions
diff --git a/frontends/php/include/classes/cform.inc.php b/frontends/php/include/classes/cform.inc.php index ace2a10b..2d2e8103 100644 --- a/frontends/php/include/classes/cform.inc.php +++ b/frontends/php/include/classes/cform.inc.php @@ -66,7 +66,15 @@ } function AddVar($name, $value) { - $this->AddItem(new CVar($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/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php index 563ad4eb..9ddc0b20 100644 --- a/frontends/php/include/classes/ctag.inc.php +++ b/frontends/php/include/classes/ctag.inc.php @@ -27,6 +27,7 @@ var $paired; /* protected */ var $items = array(); + var $items_max_count; var $tag_body_start; var $tag_body_end; @@ -34,14 +35,27 @@ var $tag_end; /* public */ - function CTag($name=NULL, $paired='no') + function CTag($name=NULL, $paired='no', $body=NULL) { $this->SetTagName($name); $this->SetPaired($paired); - $this->tag_start= ""; - $this->tag_end = "\n"; - $this->tag_body_start = "\n"; - $this->tag_body_end = ""; + $this->SetMaxLength(0); + + $this->tag_start=$this->tag_end=$this->tag_body_start=$this->tag_body_end= ""; + + if(is_null($body)) $this->tag_end = "\n"; + if(is_null($body)) $this->tag_body_start = "\n"; + + CTag::AddItem($body); + + } + function SetMaxLength($value) + { + if(!is_int($value)) + return $this->error("Incorrect value for SetMaxLength [$value]"); + + $this->items_max_count = $value; + return 0; } function Show() { @@ -129,6 +143,10 @@ { $this->items = array(); } + function GetItemsCount() + { + return count($this->items); + } function AddItem($value) { if(is_null($value)) @@ -138,10 +156,19 @@ elseif(is_array($value)) { foreach($value as $item) + { + if($this->items_max_count > 0) + if(count($this->items) >= $this->items_max_count) + return $this->error("Maximal tag lenght '".$this->items_max_count."' is achived"); array_push($this->items,$item); + } } else { + if($this->items_max_count > 0) + if(count($this->items) >= $this->items_max_count) + return $this->error("Maximal tag lenght '".$this->items_max_count."' is achived"); + array_push($this->items,$value); } return 0; |
