~ubuntu-dev/ubuntu/lucid/zabbix/lucid-201002110857

« back to all changes in this revision

Viewing changes to frontends/php/include/classes/ctag.inc.php

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Haas
  • Date: 2009-10-10 12:21:16 UTC
  • mfrom: (1.1.10 upstream) (8.2.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091010122116-44k2zdq57rb40i6z
Tags: 1:1.6.6-2
* debian/po/ja.po updated (Closes: #548651)
* debian/po/cs.po updated (Closes: #548675)
* debian/po/sv.po updated (Closes: #548796)
* debian/po/de.po updated (Closes: #549248)
* debian/po/it.po updated (Closes: #549579)
* debian/po/pt.po updated (Closes: #550087)
* debian/po/ru.po updated (Closes: #550102)
* debian/po/es.po updated (Closes: #550173)
* debian/po/fr.po updated (Closes: #550315)
* Manpages for zabbix_server and zabbix_agent added (Closes: #496696)
* Added hint about the difference of the zabbix_agent.conf and
  zabbix_agentd.conf in each config file as a comment. (Closes: #548701)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
/* 
 
2
/*
3
3
** ZABBIX
4
4
** Copyright (C) 2000-2009 SIA Zabbix
5
5
**
33
33
                $res = $item->toString(false);
34
34
        }
35
35
        else if(is_array($item)){
36
 
                foreach($item as $id => $dat)   
 
36
                foreach($item as $id => $dat)
37
37
                        $res .= unpack_object($item[$id]); // Attention, recursion !!!
38
38
        }
39
39
        else if(!is_null($item)){
59
59
                        $this->addItem($items);
60
60
                }
61
61
        }
62
 
        
 
62
 
63
63
        function toString($destroy=true){
64
64
                $res = implode('',$this->items);
65
65
                if($destroy) $this->destroy();
67
67
        }
68
68
 
69
69
        function show($destroy=true){
70
 
                echo $this->toString($destroy);                 
 
70
                echo $this->toString($destroy);
71
71
        }
72
72
 
73
73
        function destroy(){
76
76
                $this->cleanItems();
77
77
        }
78
78
 
79
 
        function cleanItems(){  
80
 
                $this->items = array(); 
81
 
        }
82
 
        
83
 
        function itemsCount(){  
84
 
                return count($this->items);     
85
 
        }
86
 
        
 
79
        function cleanItems(){
 
80
                $this->items = array();
 
81
        }
 
82
 
 
83
        function itemsCount(){
 
84
                return count($this->items);
 
85
        }
 
86
 
87
87
        function addItem($value){
88
 
        
 
88
 
89
89
                if(is_object($value)){
90
90
                        array_push($this->items,unpack_object($value));
91
91
                }
126
126
                if(!is_string($tagname)){
127
127
                        return $this->error('Incorrect tagname for CTag ['.$tagname.']');
128
128
                }
129
 
                
 
129
 
130
130
                $this->tagname = $tagname;
131
131
                $this->paired = $paired;
132
132
 
141
141
 
142
142
                $this->setClass($class);
143
143
        }
144
 
        
 
144
 
145
145
        function showStart()    {       echo $this->startToString();    }
146
146
        function showBody()     {       echo $this->bodyToString();     }
147
147
        function showEnd()      {       echo $this->endToString();      }
158
158
        function bodyToString(){
159
159
                $res = $this->tag_body_start;
160
160
        return $res.parent::ToString(false);
161
 
                
 
161
 
162
162
                /*foreach($this->items as $item)
163
163
                        $res .= $item;
164
164
                return $res;*/
165
165
        }
166
 
        
 
166
 
167
167
        function endToString(){
168
168
                $res = ($this->paired=='yes') ? $this->tag_body_end.'</'.$this->tagname.'>' : '';
169
169
                $res .= $this->tag_end;
170
170
        return $res;
171
171
        }
172
 
        
 
172
 
173
173
        function toString($destroy=true){
174
174
                $res  = $this->startToString();
175
175
                $res .= $this->bodyToString();
179
179
 
180
180
        return $res;
181
181
        }
182
 
        
 
182
 
183
183
        function setName($value){
184
184
                if(is_null($value)) return $value;
185
185
 
188
188
                }
189
189
        return $this->addOption("name",$value);
190
190
        }
191
 
        
 
191
 
192
192
        function getName(){
193
193
                if(isset($this->options['name']))
194
194
                        return $this->options['name'];
195
195
        return NULL;
196
196
        }
197
 
        
 
197
 
198
198
        function setClass($value){
199
199
                if(isset($value))
200
200
                        $this->options['class'] = $value;
203
203
 
204
204
        return $value;
205
205
        }
206
 
        
 
206
 
207
207
        function DelOption($name){
208
208
                unset($this->options[$name]);
209
209
        }
210
 
        
 
210
 
211
211
        function getOption($name){
212
212
                $ret = NULL;
213
213
                if(isset($this->options[$name]))
250
250
                        $this->options[$name] = unpack_object($value);
251
251
                }
252
252
                else if(isset($value))
253
 
                        $this->options[$name] = htmlspecialchars(strval($value)); 
 
253
                        $this->options[$name] = htmlspecialchars(strval($value));
254
254
                else
255
255
                        unset($this->options[$name]);
256
256
        }
267
267
                        $this->options['disabled'] = 'disabled';
268
268
                }
269
269
        }
270
 
        
 
270
 
271
271
        function error($value){
272
272
                error('class('.get_class($this).') - '.$value);
273
273
                return 1;
274
274
        }
275
275
}
276
 
?>
 
 
b'\\ No newline at end of file'
 
276
?>