86 $ret =
'<table class="outer"><tr><td class="odd"><table><tr>';
89 foreach ($this->optionTree[0][
'children'] as $topitem) {
94 $tree =
'<td valign="top">';
97 $ret .= $tree .
'</td>';
100 $ret .=
'</tr></table></td><td class="even" valign="top">';
101 $option_ids = array();
102 foreach (array_keys($this->optionTree) as
$id) {
104 $option_ids[] =
"'" . $ele_name .
'[groups][' . $this->groupId .
'][' . $id .
']' .
"'";
107 $checkallbtn_id = $ele_name .
'[checkallbtn][' . $this->groupId .
']';
108 $option_ids_str = implode(
', ', $option_ids);
109 $ret .=
\XoopsLocale::ALL .
" <input id=\"" . $checkallbtn_id .
"\" type=\"checkbox\" value=\"\" onclick=\"var optionids = new Array(" . $option_ids_str .
"); xoopsCheckAllElements(optionids, '" . $checkallbtn_id .
"');\" />";
110 $ret .=
'</td></tr></table>';
125 $tree .= $prefix .
"<input type=\"checkbox\" name=\"" . $ele_name .
"[groups][" . $this->groupId .
"][" .
$option[
'id'] .
"]\" id=\"" . $ele_name .
"[groups][" . $this->groupId .
"][" .
$option[
'id'] .
"]\" onclick=\"";
129 foreach ($parentIds as
$pid) {
130 $parent_ele = $ele_name .
'[groups][' . $this->groupId .
'][' . $pid .
']';
131 $tree .=
"var ele = xoopsGetElementById('" . $parent_ele .
"'); if(ele.checked != true) {ele.checked = this.checked;}";
137 foreach (
$option[
'allchild'] as $cid) {
138 $child_ele = $ele_name .
'[groups][' . $this->groupId .
'][' . $cid .
']';
139 $tree .=
"var ele = xoopsGetElementById('" . $child_ele .
"'); if(this.checked != true) {ele.checked = false;}";
141 $tree .=
'" value="1"';
142 if (in_array(
$option[
'id'], $this->value)) {
143 $tree .=
' checked="checked"';
145 $tree .=
" />" .
$option[
'name'] .
"<input type=\"hidden\" name=\"" . $ele_name .
"[parents][" .
$option[
'id'] .
"]\" value=\"" . implode(
':', $parentIds) .
"\" /><input type=\"hidden\" name=\"" . $ele_name .
"[itemname][" .
$option[
'id'] .
"]\" value=\"" . htmlspecialchars(
$option[
'name']) .
"\" /><br />\n";
146 if (isset(
$option[
'children'])) {
147 foreach (
$option[
'children'] as $child) {
148 array_push($parentIds,
$option[
'id']);
149 $this->
renderOptionTree($tree, $this->optionTree[$child], $prefix .
' -', $parentIds);