線上書籍

Home

[1071]XOOPS模組開發

<?php /*-----------引入檔案區--------------*/ $xoopsOption['template_main'] = "snews_adm_main.tpl"; include_once "header.php"; include_once "../function.php"; /*-----------function區--------------*/ //顯示預設頁面內容 function snews_list() { global $xoopsTpl; $main = "後台頁面"; $xoopsTpl->assign('content', $main); } //新增文章的表單 function snews_form() { global $xoopsTpl; } /*-----------執行動作判斷區----------*/ include_once $GLOBALS['xoops']->path('/modules/system/include/functions.php'); $op = system_CleanVars($_REQUEST, 'op', '', 'string'); // $sn = system_CleanVars($_REQUEST, 'sn', 0, 'int'); switch ($op) { case "snews_form": snews_form(); break; default: snews_list(); $op = 'snews_list'; $xoopsTpl->assign('content', $main); break; } $xoopsTpl->assign('now_op', $op); include_once 'footer.php';