diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-03-22 15:12:52 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-03-22 15:12:52 +0000 |
| commit | 67caec0a308312b19cc85f6c09e482d717c0f252 (patch) | |
| tree | 5566dedd907341525bfa9f8c595812d69ab67033 /frontends/php/include/classes | |
| parent | eb9c8c4c00ab339b6e105b35d65f3c99dc5cb677 (diff) | |
| download | zabbix-67caec0a308312b19cc85f6c09e482d717c0f252.tar.gz zabbix-67caec0a308312b19cc85f6c09e482d717c0f252.tar.xz zabbix-67caec0a308312b19cc85f6c09e482d717c0f252.zip | |
- improved JS supporting for IE
git-svn-id: svn://svn.zabbix.com/trunk@3909 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes')
| -rw-r--r-- | frontends/php/include/classes/cbutton.inc.php | 24 | ||||
| -rw-r--r-- | frontends/php/include/classes/ccheckbox.inc.php | 4 | ||||
| -rw-r--r-- | frontends/php/include/classes/clink.inc.php | 2 | ||||
| -rw-r--r-- | frontends/php/include/classes/ctag.inc.php | 8 |
4 files changed, 18 insertions, 20 deletions
diff --git a/frontends/php/include/classes/cbutton.inc.php b/frontends/php/include/classes/cbutton.inc.php index 42c31afa..50b5a126 100644 --- a/frontends/php/include/classes/cbutton.inc.php +++ b/frontends/php/include/classes/cbutton.inc.php @@ -28,15 +28,14 @@ $this->tag_body_start = ''; $this->options['type'] = 'submit'; $this->AddOption('value', $caption); -// $this->options["type"] = "button"; $this->options['class'] = 'button'; $this->SetName($name); $this->SetAction($action); $this->SetAccessKey($accesskey); } - function SetAction($value='submit()', $event='onClick') + function SetAction($value=null) { - $this->AddOption($event, $value); + $this->AddAction('onClick', $value); } function SetTitle($value='button title') { @@ -54,19 +53,21 @@ class CButtonCancel extends CButton { - function CButtonCancel($vars=NULL){ + function CButtonCancel($vars=NULL,$action=NULL){ parent::CButton('cancel',S_CANCEL); + $this->options['type'] = 'button'; $this->SetVars($vars); + $this->SetAction($action); } function SetVars($value=NULL){ global $page; - $url = $page["file"]."?cancel=1"; + $url = "?cancel=1"; if(!is_null($value)) $url = $url.$value; - return $this->SetAction("return Redirect('$url')"); + return parent::SetAction("return Redirect('$url')"); } } @@ -82,19 +83,18 @@ /* var $vars; var $msg; - var $name; - var $do_redirect;*/ + var $name;*/ - function CButtonQMessage($name, $caption, $msg=NULL, $vars=NULL, $do_redirect=true){ + function CButtonQMessage($name, $caption, $msg=NULL, $vars=NULL){ $this->vars = null; $this->msg = null; $this->name = $name; - $this->do_redirect = $do_redirect; parent::CButton($name,$caption); $this->SetMessage($msg); $this->SetVars($vars); + $this->SetAction(NULL); } function SetVars($value=NULL){ if(!is_string($value) && !is_null($value)){ @@ -113,7 +113,7 @@ $this->msg = $value; $this->SetAction(NULL); } - function SetAction($value=null, $event='onClick'){ + function SetAction($value=null){ if(!is_null($value)) return parent::SetAction($value); @@ -121,7 +121,7 @@ $confirmation = "Confirm('".$this->msg."')"; - if($this->do_redirect) + if(isset($this->vars)) { $redirect = "Redirect('".$page["file"]."?".$this->name."=1".$this->vars."')"; } diff --git a/frontends/php/include/classes/ccheckbox.inc.php b/frontends/php/include/classes/ccheckbox.inc.php index 526ceedf..2d616da8 100644 --- a/frontends/php/include/classes/ccheckbox.inc.php +++ b/frontends/php/include/classes/ccheckbox.inc.php @@ -29,7 +29,7 @@ $this->options['type'] = 'checkbox'; $this->options['value'] = $value; $this->options['name'] = $name; - $this->options['onClick'] = $action; + $this->SetAction($action); $this->SetChecked($checked); } function SetEnabled($value='yes') @@ -49,7 +49,7 @@ } function SetAction($value='submit()', $event='onClick') { - $this->options[$event] = $value; + $this->AddAction('onClick', $value); } } diff --git a/frontends/php/include/classes/clink.inc.php b/frontends/php/include/classes/clink.inc.php index 374453ca..eb785941 100644 --- a/frontends/php/include/classes/clink.inc.php +++ b/frontends/php/include/classes/clink.inc.php @@ -40,7 +40,7 @@ if(is_null($value)) return $this->options['action'] = $page['file']; - return $this->options['onClick'] = htmlspecialchars($value); + return parent::AddAction('onClick', $value); } function SetUrl($value) { diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php index 70decbfc..93671c81 100644 --- a/frontends/php/include/classes/ctag.inc.php +++ b/frontends/php/include/classes/ctag.inc.php @@ -218,7 +218,7 @@ { insert_showhint_javascript(); - $text = addslashes(htmlspecialchars(unpack_object($text))); + $text = unpack_object($text); if($width != '' || $class!= '') { $code = "show_hint_ext(this,event,'".$text."','".$width."','".$class."');"; @@ -239,10 +239,8 @@ function AddAction($name, $value) { - if(isset($value)) - $this->options[$name] = str_replace("\n", '', strval($value)); - else - unset($this->options[$name]); + if(!empty($value)) + $this->options[$name] = htmlentities(str_replace("\n", '', strval($value)),ENT_COMPAT); } function AddOption($name, $value) |
