-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpost.php
67 lines (58 loc) · 1.87 KB
/
post.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
use Xmf\Request;
use XoopsModules\Tadtools\Utility;
/*-----------引入檔案區--------------*/
$GLOBALS['xoopsOption']['template_main'] = 'tadnews_index.tpl';
require_once __DIR__ . '/header.php';
require XOOPS_ROOT_PATH . '/header.php';
/*-----------function區--------------*/
if (empty($xoopsUser)) {
redirect_header('index.php', 3, _MD_TADNEWS_NO_POST_POWER);
}
/*-----------執行動作判斷區----------*/
$op = Request::getString('op');
$nsn = Request::getInt('nsn');
$ncsn = Request::getInt('ncsn');
$sort = Request::getInt('sort');
switch ($op) {
//新增資料
case 'insert_tad_news':
$Tadnews->insert_tad_news();
break;
//輸入表格
case 'tad_news_form':
$Tadnews->tad_news_form($nsn);
break;
//更新資料
case 'update_tad_news':
$Tadnews->update_tad_news($nsn);
break;
//啟用文章
case 'enable_news':
$Tadnews->enable_tad_news($nsn);
break;
//刪除頁籤
case 'del_page_tab':
$Tadnews->del_page_tab($nsn, $sort);
header("location:post.php?op=tad_news_form&nsn=$nsn");
exit;
//刪除封面圖
case 'delete_cover':
$Tadnews->delete_cover($nsn);
header("location:post.php?op=tad_news_form&nsn=$nsn");
exit;
default:
$Tadnews->tad_news_form($nsn, $ncsn);
$op = 'tad_news_form';
break;
}
/*-----------秀出結果區--------------*/
$xoopsTpl->assign('now_op', $op);
$xoopsTpl->assign('tadnews_adm', $tadnews_adm);
$xoopsTpl->assign('toolbar', Utility::toolbar_bootstrap($interface_menu, false, $interface_icon));
$xoTheme->addStylesheet('modules/tadnews/css/module.css');
if ($xoopsModuleConfig['use_table_shadow']) {
$xoTheme->addStylesheet('modules/tadnews/css/module2.css');
}
$xoTheme->addStylesheet('modules/tadtools/css/iconize.css');
require_once XOOPS_ROOT_PATH . '/footer.php';