MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
options.class
Ir para a documentação deste ficheiro.
1<?php
6class Option extends MControl
7{
11 var $label;
12
16 var $name;
17
21 var $value;
22
27
31 var $type='circle';
32
36 var $control; // owner control of this Option
37
38
52 function Option($name='',$value=null,$label='',$checked=false,$id=false)
53 {
54 $this->label = $label;
55 $this->name = $name;
56 $this->value = $value;
57 $this->checked = $checked;
58 }
59
70 {
71 $this->control = $control;
72 }
73
81 function Generate()
82 {
83 if (is_array($this->control->value))
84 {
85 $found = array_search($this->value,$this->control->value);
86 $checked = (!is_null($found)) && ($found !== false);
87 }
88 else
89 {
90 $checked = ($this->value == $this->control->value);
91 }
92 $this->checked = $this->checked || $checked;
93 return HtmlPainter::Option($this->value, $this->label, $this->checked, $this->control->showValues);
94 }
95
96}
97
102class OptionGroup extends MControl
103{
108
112 var $name;
113
117 var $options; // array of option objects
118
119
132 {
133 $this->label = $label;
134 $this->name = $name;
135 $this->options = $options;
136 }
137
145 function Generate()
146 {
147 foreach( $this->options as $o )
148 {
149 $content .= $o->Generate();
150 }
151 return HtmlPainter::OptionGroup('formCombo',"$this->label", $content);
152 }
153}
154?>
OptionGroup($name, $label='', $options=NULL)
Definição options.class:131
Generate()
Definição options.class:81
SetControl($control)
Definição options.class:69
Option($name='', $value=null, $label='', $checked=false, $id=false)
Definição options.class:52