[1011]XOOPS 2.5 模組開發
<?php
include 'header.php';
include_once XOOPS_ROOT_PATH."/modules/" . $xoopsModule->getVar("dirname") . "/class/admin.php" ;
$index_admin = new ModuleAdmin() ;
echo $index_admin->addNavigation('groupperm.php') ;
//引入XOOPS的權限表單物件檔
include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php';
//取得本模組編號
$module_id = $xoopsModule->getVar('mid');
//權限項目陣列
$item_list = array(
'1' => "觀看內文",
'2' => "發布文章"
);
//頁面標題
$title_of_form = "細部權限設定";
//權限名稱
$perm_name = 'tad_note_perm';
//權限描述
$perm_desc = '請勾選欲開放給群組使用的權限:<br>';
//建立XOOPS權限表單
$formi = new XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc);
//將權限項目設進表單中
foreach ($item_list as $item_id => $item_name) {
$formi->addItem($item_id, $item_name);
}
echo $formi->render();
include "footer.php";
?>