22 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
24 include_once XOOPS_ROOT_PATH . '/kernel/group.php';
35 function __construct()
37 parent::__construct();
48 $a_mod_value = array();
49 $r_mod_value = array();
50 $r_block_value = array();
53 $s_cat_value = $sysperm_handler->getItemIds(
'system_admin', $this->getVar(
'groupid'));
57 $a_mod_value =
$moduleperm_handler->getItemIds(
'module_admin', $thisgroup->getVar(
'groupid'));
58 $r_mod_value =
$moduleperm_handler->getItemIds(
'module_read', $thisgroup->getVar(
'groupid'));
60 $r_block_value =
$gperm_handler->getItemIds(
'block_read', $this->getVar(
'groupid'));
64 include_once XOOPS_ROOT_PATH .
'/modules/system/constants.php';
68 $form->setExtra(
'enctype="multipart/form-data"');
77 $s_cat_checkbox_all->setExtra(
" onclick='xoopsCheckGroup(\"groupform\", \"catbox\" , \"system_catids[]\");' ");
78 $s_cat_checkbox_all->setClass(
'xo-checkall');
79 $system_catids->addElement($s_cat_checkbox_all);
82 $s_cat_checkbox->columns = 6;
83 $admin_dir = XOOPS_ROOT_PATH .
'/modules/system/admin/';
86 include XOOPS_ROOT_PATH .
'/modules/system/admin/' . $file .
'/xoops_version.php';
95 $system_catids->addElement($s_cat_checkbox);
101 $s_admin_checkbox_all->setExtra(
" onclick='xoopsCheckGroup(\"groupform\", \"adminbox\" , \"admin_mids[]\");' ");
102 $s_admin_checkbox_all->setClass(
'xo-checkall');
103 $admin_mids->addElement($s_admin_checkbox_all);
106 $a_mod_checkbox->columns = 5;
112 $admin_mids->addElement($a_mod_checkbox);
118 $s_mod_checkbox_all->setExtra(
" onclick='xoopsCheckGroup(\"groupform\", \"readbox\" , \"read_mids[]\");' ");
119 $s_mod_checkbox_all->setClass(
'xo-checkall');
120 $read_mids->addElement($s_mod_checkbox_all);
123 $r_mod_checkbox->columns = 5;
127 $read_mids->addElement($r_mod_checkbox);
136 $block_handler = xoops_getHandler(
"block");
137 $blocks_obj = $block_handler->getObjects(
new Criteria(
"mid",
"('" . implode(
"', '", array_keys($module_list)) .
"')",
"IN"),
true);
139 $blocks_module = array();
140 foreach (array_keys($blocks_obj) as $bid) {
141 $title = $blocks_obj[$bid]->getVar(
"title");
142 $blocks_module[$blocks_obj[$bid]->getVar(
'mid')][$blocks_obj[$bid]->getVar(
'bid')] = empty(
$title) ? $blocks_obj[$bid]->getVar(
"name") :
$title;
144 ksort($blocks_module);
149 $s_checkbox_all->setExtra(
" onclick='xoopsCheckGroup(\"groupform\", \"blocksbox\" , \"read_bids[]\");' ");
150 $s_checkbox_all->setClass(
'xo-checkall');
151 $r_block_tray->addElement($s_checkbox_all);
152 foreach (array_keys($blocks_module) as
$mid) {
154 $new_blocks_array = array();
155 foreach ($blocks_module[$mid] as $key => $value) {
156 $new_blocks_array[$key] =
"<a href='" . XOOPS_URL .
"/modules/system/admin.php?fct=blocksadmin&op=edit&bid={$key}' title='ID: {$key}' rel='external'>{$value}</a>";
158 $r_block_checkbox =
new XoopsFormCheckBox(
'<strong>' . $module_list[$mid] .
'</strong><br />',
"read_bids[]", $r_block_value);
159 $r_block_checkbox->columns = 5;
160 $r_block_checkbox->addOptionArray($new_blocks_array);
161 $r_block_tray->addElement($r_block_checkbox);
162 unset($r_block_checkbox);
164 if (!$this->isNew()) {
170 $form->addElement($name_text,
true);
171 $form->addElement($desc_text);
172 $form->addElement($system_catids);
173 $form->addElement($admin_mids);
174 $form->addElement($read_mids);
175 $form->addElement($r_block_tray);
195 parent::__construct(
$db,
'groups',
'SystemGroup',
'groupid',
'name');