32 public function addOption($caption, $name, $value, $state=0){
34 $rtn[
'caption'] = $caption;
35 $rtn[
'value'] = $value;
36 $rtn[
'state'] = $state;
38 $this->_options[] =
$rtn;
54 $rtn .=
"<table width='100%' cellspacing='1' cellpadding='2' border='0'><tr>";
56 foreach ($this->_options as $k => $v){
57 if (
$cols>$this->tableCols){
61 $rtn .=
"<td><label><input type='checkbox' name='$v[name]' id='".$this->id().
"' value='$v[value]' ";
63 $rtn .= isset($_REQUEST[$v[
'name']]) && $_REQUEST[$v[
'name']]==$v[
'value'] ?
"checked='checked' " : ($v[
'state']==1 ?
"checked='checked' " :
'');
65 $rtn .=
"/> $v[caption]</label></td>";
68 $rtn .=
"</tr></table>";
70 foreach ($this->_options as $k => $v){
71 $rtn .=
"<input type='checkbox' name='$v[name]' id='".$this->id().
"' value='$v[value]' ";
75 $rtn .= isset($_REQUEST[$v[
'name']]) && $_REQUEST[$v[
'name']]==$v[
'value'] ?
"checked='checked' " : ($v[
'state']==1 ?
"checked='checked' " :
'');
76 $rtn .=
"/> $v[caption]<br />";
87 $this->tableCols =
$cols;
112 $this->_type =
$type;
113 $this->_cols =
$cols;
114 if ($salto==0){ $this->_break =
'<br />'; }
else { $this->_break =
' '; }
122 public function addOption($caption, $value, $state = 0, $extra =
''){
124 $rtn[
'caption'] = $caption;
125 $rtn[
'value'] = $value;
126 $rtn[
'state'] = $state;
127 $rtn[
'extra'] = $extra;
128 $this->_options[] =
$rtn;
146 $rtn .=
"<table cellspacing='1' cellpadding='2' border='0'><tr>";
148 foreach ($this->_options as $k => $v){
149 if (
$i>$this->_cols){
153 $rtn .=
"<td><label><input name='".$this->getName().
"' id='".$this->
id().
"' type='radio' value='$v[value]' ";
154 $rtn .= isset($_REQUEST[$this->
getName()]) && $_REQUEST[$this->
getName()]==$v[
'value'] ?
"checked='checked' " : ($v[
'state']==1 ?
"checked='checked' " :
'');
155 $rtn .= ($v[
'extra']!=
'' ?
"$v[extra] " :
'').
"/> $v[caption]</label></td>";
158 $rtn .=
"</tr></table>";
162 foreach ($this->_options as $k => $v){
163 $rtn .=
"<label><input name='".$this->getName().
"' id='".$this->
id().
"' type='radio' value='$v[value]' ";
164 $rtn .= isset($_REQUEST[$this->
getName()]) && $_REQUEST[$this->
getName()]==$v[
'value'] ?
"checked='checked' " : ($v[
'state']==1 ?
"checked='checked' " :
'');
165 $rtn .= ($v[
'extra']!=
'' ?
"$v[extra] " :
'').
"/> $v[caption]</label>".$this->_break;
187 $this->_value = isset($_REQUEST[$this->
getName()]) ? $_REQUEST[$this->
getName()] : $inicial;
194 $this->_value = $value;
208 $rtn =
"<input name='".$this->getName().
"' id='".$this->
getName().
"' type='radio' value='1' ";
209 if ($this->_value==1){
210 $rtn .=
"checked='checked' ";
212 $rtn .=
"/> ".__(
'Yes',
'rmcommon').
" ";
213 $rtn .=
"<input name='".$this->getName().
"' id='".$this->
getName().
"' type='radio' value='0' ";
214 if ($this->_value==0){
215 $rtn .=
"checked='checked' ";
217 $rtn .=
"/> ".__(
'No',
'rmcommon');