34 $group_handler =
$xoops->getHandlerGroup();
36 $obj = $group_handler->create();
39 $obj->setVar(
"group_type",
'Admin');
40 if (!$group_handler->insert($obj)) {
41 echo
$xoops->alert(
'error', $obj->getHtmlErrors());
44 $obj = $group_handler->create();
47 $obj->setVar(
"group_type",
'User');
48 if (!$group_handler->insert($obj)) {
49 echo
$xoops->alert(
'error', $obj->getHtmlErrors());
52 $obj = $group_handler->create();
55 $obj->setVar(
"group_type",
'Anonymous');
56 if (!$group_handler->insert($obj)) {
57 echo
$xoops->alert(
'error', $obj->getHtmlErrors());
62 $groupperm_handler =
$xoops->getHandlerGroupPerm();
63 for (
$i = 2;
$i <= 3; ++
$i) {
64 $obj = $groupperm_handler->create();
65 $obj->setVar(
"gperm_groupid",
$i);
66 $obj->setVar(
"gperm_itemid",
'1');
67 $obj->setVar(
"gperm_modid",
'1');
68 $obj->setVar(
"gperm_name",
'module_read');
69 if (!$groupperm_handler->insert($obj)) {
70 echo
$xoops->alert(
'error', $obj->getHtmlErrors());
73 for (
$i = 1;
$i <= 17; ++
$i) {
74 $obj = $groupperm_handler->create();
75 $obj->setVar(
"gperm_groupid",
'1');
76 $obj->setVar(
"gperm_itemid",
$i);
77 $obj->setVar(
"gperm_modid",
'1');
78 $obj->setVar(
"gperm_name",
'module_read');
79 if (!$groupperm_handler->insert($obj)) {
80 echo
$xoops->alert(
'error', $obj->getHtmlErrors());
84 $blockmodulelink_handler =
$xoops->getHandlerBlockmodulelink();
87 foreach ($blocks as $block) {
88 if (in_array($block->getVar(
'template'), array(
89 'system_block_user.tpl',
90 'system_block_login.tpl',
91 'system_block_mainmenu.tpl'
94 $block->setVar(
'visible', 1);
95 $block_handler->insert($block,
true);
97 $blockmodulelink = $blockmodulelink_handler->create();
98 $blockmodulelink->setVar(
'block_id', $block->getVar(
'bid'));
99 $blockmodulelink->setVar(
'module_id', 0);
100 $blockmodulelink_handler->insert($blockmodulelink);
102 for (
$i = 2;
$i <= 3; ++
$i) {
103 $obj = $groupperm_handler->create();
104 $obj->setVar(
"gperm_groupid",
$i);
105 $obj->setVar(
"gperm_itemid", $block->id());
106 $obj->setVar(
"gperm_modid",
'1');
107 $obj->setVar(
"gperm_name",
'block_read');
108 if (!$groupperm_handler->insert($obj)) {
109 echo
$xoops->alert(
'error', $obj->getHtmlErrors());
115 $tplset_handler =
$xoops->getHandlerTplset();
116 $obj = $tplset_handler->create();
117 $obj->setVar(
"tplset_name",
'default');
118 $obj->setVar(
"tplset_desc",
'XOOPS Default Template Set');
119 $obj->setVar(
"tplset_credits",
'');
120 $obj->setVar(
"tplset_created", time());
121 if (!$tplset_handler->insert($obj)) {
122 echo
$xoops->alert(
'error', $obj->getHtmlErrors());
127 $types = array(\PDO::PARAM_INT, \PDO::PARAM_INT);
128 $data = array(
'groupid' => 1,
'uid' => 1);
129 $xoops->db()->insertPrefix(
'groups_users_link', $data, $types);
130 $data = array(
'groupid' => 2,
'uid' => 1);
131 $xoops->db()->insertPrefix(
'groups_users_link', $data, $types);
getByModule($moduleid, $asobject=true)
const WEBMASTERS_OF_THIS_SITE
xoops_module_install_system(&$module)
const ANONYMOUS_USERS_GROUP
const REGISTERED_USERS_GROUP