diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-23 15:11:17 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-23 15:11:17 +0000 |
| commit | 5f752fe36c36745650e388a63ed9028543f3f784 (patch) | |
| tree | 421227514e1cb76ccbb7a9cd1691cee4bb5ac652 /frontends/php/include/classes/cimg.inc.php | |
| parent | 6d840be8cd1efc9c3ccaac0a19eb7a59f5dc062d (diff) | |
| download | zabbix-5f752fe36c36745650e388a63ed9028543f3f784.tar.gz zabbix-5f752fe36c36745650e388a63ed9028543f3f784.tar.xz zabbix-5f752fe36c36745650e388a63ed9028543f3f784.zip | |
- Frontend improvements (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2560 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes/cimg.inc.php')
| -rw-r--r-- | frontends/php/include/classes/cimg.inc.php | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/frontends/php/include/classes/cimg.inc.php b/frontends/php/include/classes/cimg.inc.php index c185337c..48a102c0 100644 --- a/frontends/php/include/classes/cimg.inc.php +++ b/frontends/php/include/classes/cimg.inc.php @@ -22,12 +22,14 @@ class CImg extends CTag { /* public */ - function CImg($src,$alt_text) + function CImg($src,$alt_text=NULL,$width=NULL,$height=NULL) { parent::CTag("img","no"); $this->AddOption('border',0); $this->SetAltText($alt_text); $this->SetSrc($src); + $this->SetWidth($width); + $this->SetHeight($height); } function SetSrc($value) { @@ -37,13 +39,32 @@ } return $this->AddOption("src",$value); } - function SetAltText($value="picture") + function SetAltText($value=NULL) { + if(is_null($value)) + $value="image"; + if(!is_string($value)) { return $this->error("Incorrect value for SetText [$value]"); } return $this->AddOption("alt",$value); } + function SetWidth($value=NULL){ + if(is_null($value)) + return $this->DelOption("width"); + elseif(is_numeric($value)||is_int($value)) + return $this->AddOption("width",$value); + else + return $this->error("Incorrect value for SetWidth [$value]"); + } + function SetHeight($value=NULL){ + if(is_null($value)) + return $this->DelOption("height"); + elseif(is_numeric($value)||is_int($value)) + return $this->AddOption("height",$value); + else + return $this->error("Incorrect value for SetHeight [$value]"); + } } ?> |
