summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/classes/ccheckbox.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-05-12 14:23:12 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-05-12 14:23:12 +0000
commit4182bc6afb20b00fa27a54c67056bb98a58a49bb (patch)
tree5cab17d23e387cc3b6e8c92e4c928ac5e1111b76 /frontends/php/include/classes/ccheckbox.inc.php
parent6a6ac0772b8215bffc5fe8b02fc1033dbf273f41 (diff)
- speed improvement for Overview screens (Eugene)
- developed 'net.if.total[*]' parameter (Eugene) - fixed new map link adding (Eugene) - fixed host group adding (Eugene) - fixed map displaying (Eugene) - fixed 'No permissions' for 'Latest data','Triggers','Alarms' screens (Eugene) - fixed permision deletion (Eugene) - fixed 'get_map_by_sysmapid' function calls(Eugene) - improved php code execution speed (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@2825 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes/ccheckbox.inc.php')
-rw-r--r--frontends/php/include/classes/ccheckbox.inc.php65
1 files changed, 13 insertions, 52 deletions
diff --git a/frontends/php/include/classes/ccheckbox.inc.php b/frontends/php/include/classes/ccheckbox.inc.php
index 69a856e2..83ac51a6 100644
--- a/frontends/php/include/classes/ccheckbox.inc.php
+++ b/frontends/php/include/classes/ccheckbox.inc.php
@@ -22,66 +22,27 @@
class CCheckBox extends CTag
{
/* public */
- function CCheckBox($name='checkbox',$checked='no',$caption=NULL,$action=NULL,$value='yes')
+ function CCheckBox($name='checkbox',$checked='no',$action=NULL,$value='yes')
{
- parent::CTag("input","no");
- $this->tag_body_start = "";
- $this->AddOption('type','checkbox');
- $this->AddOption('value','yes');
- $this->SetName($name);
- $this->SetCaption($caption);
+ parent::CTag('input','no');
+ $this->tag_body_start = '';
+ $this->options['type'] = 'checkbox';
+ $this->options['value'] = $value;
+ $this->options['name'] = $name;
+ $this->options['onClick'] = $action;
$this->SetChecked($checked);
- $this->SetAction($action);
- $this->SetValue($value);
- }
- function SetName($value='checkbox')
- {
- if(!is_string($value))
- {
- return $this->error("Incorrect value for SetName [$value]");
- }
- return $this->AddOption("name",$value);
- }
- function SetCaption($value=NULL)
- {
- if(is_null($value))
- return 0;
- elseif(is_string($value))
- return $this->AddItem(nbsp($value));
- return $this->error("Incorrect value for SetCaption [$value]");
- }
- function SetValue($value=NULL)
- {
- if(is_null($value))
- return $this->DelOption("value");
- elseif(is_string($value) || is_numeric($value))
- return $this->AddOption('value',$value);
- return $this->error("Incorrect value for SetValue [$value]");
}
function SetChecked($value="yes")
{
- if(is_null($value)){
- return 0;
- }elseif((is_string($value)&&
- ($value=="yes" || $value=="checked" || $value=="on") || $value=="1")
- || (is_int($value)&&$value<>0)){
- return $this->AddOption("checked","checked");
- }elseif((is_string($value)&&
- ($value=="no" || $value=="unchecked" || $value=="off" || $value=="0"))
- || (is_int($value)&&$value==0)){
- return $this->DelOption("checked");
- }
- return $this->error("Incorrect value for SetChacked [$value]");
+ if((is_string($value)&& ($value=="yes" || $value=="checked" || $value=="on") || $value=="1")
+ || (is_int($value)&&$value<>0))
+ return $this->options['checked'] = 'checked';
+
+ $this->DelOption("checked");
}
function SetAction($value='submit()', $event='onClick')
{
- if(is_null($value))
- return 1;
- if(!is_string($value))
- return $this->error("Incorrect value for SetAction [$value]");
- if(!is_string($event))
- return $this->error("Incorrect event for SetAction [$event]");
- return $this->AddOption($event,$value);
+ $this->options[$event] = $value;
}
}
?>