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 | //cyclage sur le parametre on_home |
---|
54 | if (isset($_GET['id']) and isset($_GET['home']) and !is_adviser()) |
---|
55 | { |
---|
56 | $home = $_GET['home']; |
---|
57 | $global = isset($_GET['global']) ? $_GET['global'] : 'selective'; |
---|
58 | // ordre : homeOFF -> HomeON -> HomeONGlobal |
---|
59 | if ($home == 'true' and $global == 'selective') |
---|
60 | $global = 'global'; |
---|
61 | elseif ($home == 'true' and $global == 'global') |
---|
62 | $home = 'false'; |
---|
63 | else |
---|
64 | { |
---|
65 | $home = 'true'; |
---|
66 | $global = 'selective'; |
---|
67 | } |
---|
68 | |
---|
69 | pwg_query( 'UPDATE ' . FLASHGAL_TABLE . ' |
---|
70 | SET on_home="' . $home. '", on_home_global="' . $global . '" |
---|
71 | WHERE id=' . $_GET['id'] . ' LIMIT 1'); |
---|
72 | |
---|
73 | redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin§ion=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php'); |
---|
74 | } |
---|
75 | //cyclage sur le parametre on_cats |
---|
76 | if (isset($_GET['id']) and isset($_GET['cats']) and !is_adviser()) |
---|
77 | { |
---|
78 | // ordre : catsOFF -> catsON |
---|
79 | pwg_query( 'UPDATE ' . FLASHGAL_TABLE . ' |
---|
80 | SET on_cats="' . ($_GET['cats'] == 'true' ? 'false' : 'true'). '" |
---|
81 | WHERE id=' . $_GET['id'] . ' LIMIT 1'); |
---|
82 | |
---|
83 | redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin§ion=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php'); |
---|
84 | } |
---|
85 | |
---|
86 | if (isset($_GET['id']) and isset($_GET['recurs']) and !is_adviser()) |
---|
87 | { |
---|
88 | // ordre : recursOFF -> recursON |
---|
89 | pwg_query( 'UPDATE ' . FLASHGAL_TABLE . ' |
---|
90 | SET recurs_cats="' . ($_GET['recurs'] == 'true' ? 'false' : 'true'). '" |
---|
91 | WHERE id=' . $_GET['id'] . ' LIMIT 1'); |
---|
92 | |
---|
93 | redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin§ion=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php'); |
---|
94 | } |
---|
95 | |
---|
96 | //Récupération des modules disponibles |
---|
97 | $modules = get_flashgal_modules(); |
---|
98 | |
---|
99 | // Include file |
---|
100 | include(FLASHGAL_PATH.'admin/'.$page['tab'].'.php'); |
---|
101 | |
---|
102 | ?> |
---|