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