1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | global $template, $conf, $user; |
---|
6 | |
---|
7 | load_language('plugin.lang', STUFFS_PATH); |
---|
8 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
9 | include_once(STUFFS_PATH . 'include/functions.inc.php'); |
---|
10 | include_once(STUFFS_PATH . 'admin/functions.inc.php'); |
---|
11 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
12 | |
---|
13 | // +-----------------------------------------------------------------------+ |
---|
14 | // | Tabsheet |
---|
15 | // +-----------------------------------------------------------------------+ |
---|
16 | if (!isset($_GET['tab'])) |
---|
17 | $page['tab'] = 'manage'; |
---|
18 | else |
---|
19 | $page['tab'] = $_GET['tab']; |
---|
20 | |
---|
21 | $tabsheet = new tabsheet(); |
---|
22 | $tabsheet->add('manage', |
---|
23 | l10n('stuffs_mods_management'), |
---|
24 | $my_base_url.'&tab=manage'); |
---|
25 | $tabsheet->add('new', |
---|
26 | l10n('stuffs_add_mod'), |
---|
27 | $my_base_url.'&tab=new'); |
---|
28 | $tabsheet->select($page['tab']); |
---|
29 | $tabsheet->assign(); |
---|
30 | |
---|
31 | //Ajout d'un module |
---|
32 | if (isset($_POST['addModule']) and !is_adviser()) |
---|
33 | { |
---|
34 | if (!isset($_POST['module'])) |
---|
35 | { |
---|
36 | array_push($page['errors'], l10n('stuffs_error_no_mod_selected')); |
---|
37 | } |
---|
38 | else |
---|
39 | { |
---|
40 | redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin§ion=' . STUFFS_DIR . '%2Fadmin%2Fadd_module.php&type=' . $_POST['module']); |
---|
41 | } |
---|
42 | } |
---|
43 | |
---|
44 | //Suppression d'un module |
---|
45 | if (isset($_GET['del']) and !is_adviser()) |
---|
46 | { |
---|
47 | pwg_query('DELETE FROM ' . STUFFS_TABLE . ' WHERE id = ' . $_GET['del'] . ' LIMIT 1;'); |
---|
48 | redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin§ion=' . STUFFS_DIR . '%2Fadmin%2Fadmin.php'); |
---|
49 | } |
---|
50 | |
---|
51 | //Récupération des modules disponibles |
---|
52 | $modules = get_stuffs_modules(); |
---|
53 | |
---|
54 | // Include file |
---|
55 | include(STUFFS_PATH.'admin/'.$page['tab'].'.php'); |
---|
56 | |
---|
57 | ?> |
---|