37 $this->selected = is_array($select) ? $select : array($select);
45 $this->can_change = $enable;
47 !defined(
'RM_FRAME_USERS_CREATED') ? define(
'RM_FRAME_USERS_CREATED', 1) :
'';
51 $this->can_change = $enable;
58 $this->_onchange = base64_encode(addslashes(
$action));
71 if (function_exists(
"xoops_cp_header")){
77 $rtn =
"<div id='".$this->id().
"-users-container'".($this->
getExtra()!=
'' ?
" ".$this->getExtra() :
'').
" class='form_users_container'>
78 <ul id='".$this->
id().
"-users-list'>";
79 $db = XoopsDatabaseFactory::getDatabaseConnection();
81 if ($this->showall && in_array(0, $this->selected)){
82 $rtn .=
"<li id='".$this->id().
"-exmuser-0'>\n
83 <label><input type='".($this->multi ?
'checkbox' :
'radio').
"' name='".($this->multi ? $this->
getName().
'[]' : $this->
getName()).
"' id='".$this->
id().
"-0'
84 value='0' checked='checked' /> ".
__(
'All Users',
'rmcommon').
"
85 <a href='javascript:;' onclick=\"users_field_name='".$this->
id().
"'; usersField.remove(0);\"><span>delete</span></a>
89 if (is_array($this->selected) && !empty($this->selected) && !(count($this->selected)==1 && $this->selected[0]==0)){
90 $sql =
"SELECT uid,uname FROM ".$db->prefix(
"users").
" WHERE ";
93 foreach ($this->selected as
$id){
94 if ($id!=0) $sql1 .= $sql1 ==
'' ?
"uid='$id'" :
" OR uid='$id'";
97 if ($this->selected[0]!=0) $sql1 =
"uid='".$this->selected[0].
"'";
102 $rtn .=
"<li id='".$this->id().
"-exmuser-$row[uid]'>\n
103 <label style='overflow: hidden;'>
104 <input type='".($this->multi ?
'checkbox' :
'radio').
"' name='".($this->multi ? $this->
getName().
'[]' : $this->
getName()).
"' id='".$this->
id().
"-".$row[
'uid'].
"'
105 value='$row[uid]' checked='checked' />
107 $rtn .= $this->can_change ?
" <a href='javascript:;' onclick=\"users_field_name='".$this->id().
"'; usersField.remove($row[uid]);\"><span>delete</span></a>" :
'';
108 $rtn .=
"</label></li>";
112 $rtn .=
"</ul></div><br />";
113 if ($this->can_change){
114 $rtn .=
"<input type='button' value='".__(
'Search Users',
'rmcommon').
"' onclick=\"usersField.form_search_users('".$this->
id().
"',".$this->width.
",".$this->
height.
",".$this->limit.
",".intval($this->multi).
",'".XOOPS_URL.
"');\" />
115 <div id='".$this->
id().
"-dialog-search' title='".
__(
'Search Users',
'rmcommon').
"' style='display: none;'>
145 $this->selected = $select;
152 !defined(
'RM_FRAME_USERS_CREATED') ? define(
'RM_FRAME_USERS_CREATED', 1) :
'';