MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mthemeelement.class
Ir para a documentação deste ficheiro.
1<?php
2
4{
5 function __construct($name = NULL, $content = '', $class = '')
6 {
7 parent::__construct($name);
8 $this->SetInner($content);
9 $this->SetClass($class);
10 }
11
12 function Clear($halted = false)
13 {
14 if (!$halted)
15 {
16 $this->ClearControls();
17 }
18 }
19
20 function Get($key = 0)
21 {
22 return $this->GetElement($key);
23 }
24
25 function Set($element, $id = '', $key = NULL)
26 {
27 $this->SetElement($element, $key, 's');
28 $this->SetId($id);
29 }
30
31 function Insert($element, $key = NULL, $halted = false)
32 {
33 if (!$halted)
34 {
35 $this->SetElement($element, $key, 'i');
36 }
37 }
38
39 function Append($element, $key = NULL, $halted = false)
40 {
41 if (!$halted)
42 {
43 $this->SetElement($element, $key, 'a');
44 }
45 }
46
47 function Count()
48 {
49 return $this->controlsCount;
50 }
51
52 function SetElement($element, $key = NULL, $op = 's')
53 {
54 if (is_array($element))
55 {
56 $this->Clear();
57
58 foreach ($element as $e)
59 {
60 $this->SetElement($e, $key, 'a');
61 }
62 }
63 else
64 {
65 switch ($op)
66 {
67 case 's':
68 $this->Clear();
69
70 $this->AddControl($element);
71 break;
72
73 case 'a':
74 $this->AddControl($element);
75 break;
76
77 case 'i':
78 $this->InsertControl($element);
79 break;
80 }
81 }
82 }
83
84 function GetElement($key)
85 {
86 return $this->GetControl($key);
87 }
88
89 function GetElementById($key)
90 {
91 return $this->GetControlById($key);
92 }
93
94 function Space($space = '20px')
95 {
96 $this->Append(new MSpacer($space));
97 }
98
99 function GenerateInner()
100 {
101 $this->SetBoxId($this->GetId());
102 $this->SetBoxClass($this->GetClass());
103 $controls = $this->GetControls();
104 $this->inner = $this->painter->GenerateToString($controls);
105 return $this->inner;
106 }
107}
108?>
Space($space='20px')
Set($element, $id='', $key=NULL)
SetElement($element, $key=NULL, $op='s')
__construct($name=NULL, $content='', $class='')
Append($element, $key=NULL, $halted=false)
Insert($element, $key=NULL, $halted=false)
Clear($halted=false)