34 $this->
setName($multi ? str_replace(
'[]',
'', $name).
'[]' : $name);
35 if (isset($_REQUEST[$name])) $this->_select = $_REQUEST[$name];
36 $this->_multi = $multi;
37 $this->_showtype =
$type;
40 if (isset($_REQUEST[$this->
getName()])){
41 $this->_select = $_REQUEST[$this->
getName()];
43 $this->_select = $select;
54 if ($value==0 || $value==1){
55 $this->
setName($value ? str_replace(
'[]',
'',$this->
getName()).
'[]' : str_replace(
'[]',
'',$this->
getName()));
56 $this->_multi = $value;
75 if (is_array($value)){
76 $this->_select = $value;
78 $this->_select = explode(
',',$value);
95 if ($value==0 || $value==1) $this->_showtype = $value;
111 if ($value==0 || $value==1) $this->_showdesc = $value;
127 if ($value>0) $this->_cols = $value;
141 $db = XoopsDatabaseFactory::getDatabaseConnection();
142 $result =
$db->query(
"SELECT * FROM ".
$db->prefix(
"groups").
" ORDER BY `name`");
146 $typeinput = $this->_multi ?
'checkbox' :
'radio';
149 if ($this->_showtype){
150 $rtn =
"<ul class='groups_field_list ".$this->id().
"_groups'>";
151 $rtn .=
"<li><label><input type='$typeinput' name='$name' id='".$this->id().
"' value='0'";
152 if (is_array($this->_select)){
153 if (in_array(0, $this->_select)){
154 $rtn .=
" checked='checked'";
157 $rtn .=
">".__(
'All',
'rmcommon').
"</label></li>";
160 $rtn .=
"<li><label><input type='$typeinput' name='$name' id='".$this->id().
"' value='$row[groupid]'";
161 if (is_array($this->_select)){
162 if (in_array($row[
'groupid'], $this->_select)){
163 $rtn .=
" checked='checked'";
166 $rtn .=
">$row[name]</label>";
168 if ($this->_showdesc){
169 $rtn .=
"<br /><span style='font-size: 10px;' class='description'>$row[description]</span>";
180 $rtn =
"<select name='$name'";
181 $rtn .= $this->_multi ?
" multiple='multiple' size='5'" :
"";
182 $rtn .=
"><option value='0'";
183 if (is_array($this->_select)){
184 if (in_array(0, $this->_select)){
185 $rtn .=
" selected='selected'";
188 $rtn .=
" selected='selected'";
191 $rtn .=
">".__(
'All',
'rmcommon').
"</option>";
194 $rtn .=
"<option value='$row[groupid]'";
195 if (is_array($this->_select)){
196 if (in_array($row[
'groupid'], $this->_select)){
197 $rtn .=
" selected='selected'";
200 $rtn .=
">".$row[
'name'].
"</option>";