summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/classes
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-10 08:04:38 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-10 08:04:38 +0000
commitda89a85a0eeed1b50bc3b5e38b3392e852fa0f72 (patch)
tree26daa648960d802c28067bf1a766cdce0c8c79e2 /frontends/php/include/classes
parent616715ae783f353d07b1cfa1f48a7631c165a2f8 (diff)
downloadzabbix-da89a85a0eeed1b50bc3b5e38b3392e852fa0f72.tar.gz
zabbix-da89a85a0eeed1b50bc3b5e38b3392e852fa0f72.tar.xz
zabbix-da89a85a0eeed1b50bc3b5e38b3392e852fa0f72.zip
- [DEV-144] fixes to trigger mass-update (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5821 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes')
-rw-r--r--frontends/php/include/classes/ctag.inc.php120
1 files changed, 55 insertions, 65 deletions
diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php
index e05ac3f1..ed44da5c 100644
--- a/frontends/php/include/classes/ctag.inc.php
+++ b/frontends/php/include/classes/ctag.inc.php
@@ -90,11 +90,16 @@
$this->CleanItems();
}
- function CleanItems() { $this->items = array(); }
- function ItemsCount() { return count($this->items); }
+ function CleanItems(){
+ $this->items = array();
+ }
+
+ function ItemsCount(){
+ return count($this->items);
+ }
+
+ function AddItem($value){
- function AddItem($value)
- {
if(is_object($value)){
array_push($this->items,unpack_object($value));
}
@@ -113,8 +118,7 @@
}
}
- class CTag extends CObject
- {
+ class CTag extends CObject{
/* private *//*
var $tagname;
var $options = array();
@@ -128,122 +132,113 @@
var $tag_end;*/
/* public */
- function CTag($tagname=NULL, $paired='no', $body=NULL, $class=null)
- {
+ function CTag($tagname=NULL, $paired='no', $body=NULL, $class=null){
parent::CObject();
$this->options = array();
- if(!is_string($tagname))
- {
+ if(!is_string($tagname)){
return $this->error('Incorrect tagname for CTag ['.$tagname.']');
}
+
$this->tagname = $tagname;
$this->paired = $paired;
$this->tag_start = $this->tag_end = $this->tag_body_start = $this->tag_body_end = '';
- if(is_null($body))
- {
+ if(is_null($body)){
$this->tag_end = $this->tag_body_start = "\n";
}
- else
- {
+ else{
CTag::AddItem($body);
}
$this->SetClass($class);
-
}
+
function ShowStart() { echo $this->StartToString(); }
function ShowBody() { echo $this->BodyToString(); }
function ShowEnd() { echo $this->EndToString(); }
- function StartToString()
- {
+ function StartToString(){
$res = $this->tag_start.'<'.$this->tagname;
- foreach($this->options as $key => $value)
- {
+ foreach($this->options as $key => $value){
$res .= ' '.$key.'="'.$value.'"';
}
$res .= ($this->paired=='yes') ? '>' : '/>';
- return $res;
+ return $res;
}
- function BodyToString()
- {
+
+ function BodyToString(){
$res = $this->tag_body_start;
- return $res.parent::ToString(false);
+ return $res.parent::ToString(false);
/*foreach($this->items as $item)
$res .= $item;
return $res;*/
}
- function EndToString()
- {
+
+ function EndToString(){
$res = ($this->paired=='yes') ? $this->tag_body_end.'</'.$this->tagname.'>' : '';
$res .= $this->tag_end;
- return $res;
+ return $res;
}
- function ToString($destroy=true)
- {
+
+ function ToString($destroy=true){
$res = $this->StartToString();
$res .= $this->BodyToString();
$res .= $this->EndToString();
if($destroy) $this->Destroy();
- return $res;
+ return $res;
}
- function SetName($value)
- {
+
+ function SetName($value){
if(is_null($value)) return $value;
- if(!is_string($value))
- {
+ if(!is_string($value)){
return $this->error("Incorrect value for SetName [$value]");
}
- return $this->AddOption("name",$value);
+ return $this->AddOption("name",$value);
}
- function GetName()
- {
+
+ function GetName(){
if(isset($this->options['name']))
return $this->options['name'];
- return NULL;
+ return NULL;
}
- function SetClass($value)
- {
+
+ function SetClass($value){
if(isset($value))
$this->options['class'] = $value;
else
unset($this->options['class']);
- return $value;
+ return $value;
}
- function DelOption($name)
- {
+
+ function DelOption($name){
unset($this->options[$name]);
}
- function GetOption($name)
- {
+
+ function GetOption($name){
$ret = NULL;
if(isset($this->options[$name]))
$ret =& $this->options[$name];
- return $ret;
+ return $ret;
}
- function SetHint($text, $width='', $class='')
- {
+ function SetHint($text, $width='', $class=''){
if(empty($text)) return false;
insert_showhint_javascript();
$text = unpack_object($text);
- if($width != '' || $class!= '')
- {
+ if($width != '' || $class != ''){
$code = "show_hint_ext(this,event,'".$text."','".$width."','".$class."');";
}
- else
- {
+ else{
$code = "show_hint(this,event,'".$text."');";
}
@@ -251,13 +246,11 @@
$this->AddAction('onMouseMove', 'update_hint(this,event);');
}
- function OnClick($handle_code)
- {
+ function OnClick($handle_code){
$this->AddAction('onclick', $handle_code);
}
- function AddAction($name, $value)
- {
+ function AddAction($name, $value){
if(is_object($value)){
$this->options[$name] = unpack_object($value);
}
@@ -266,8 +259,7 @@
}
}
- function AddOption($name, $value)
- {
+ function AddOption($name, $value){
if(is_object($value)){
$this->options[$name] = unpack_object($value);
}
@@ -277,24 +269,22 @@
unset($this->options[$name]);
}
- function SetEnabled($value='yes')
- {
+ function SetEnabled($value='yes'){
if((is_string($value) && ($value == 'yes' || $value == 'enabled' || $value=='on') || $value=='1')
- || (is_int($value) && $value<>0))
+ || (is_int($value) && $value<>0))
{
unset($this->options['disabled']);
}
- elseif((is_string($value) && ($value == 'no' || $value == 'disabled' || $value=='off') || $value=='0')
- || (is_int($value) && $value==0))
+ else if((is_string($value) && ($value == 'no' || $value == 'disabled' || $value=='off') || $value=='0')
+ || (is_int($value) && $value==0))
{
$this->options['disabled'] = 'disabled';
}
}
- function error($value)
- {
+
+ function error($value){
error('class('.get_class($this).') - '.$value);
return 1;
}
-
}
?>