1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | global $template, $conf, $user; |
---|
4 | include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php'); |
---|
5 | load_language('plugin.lang', UDP_PATH); |
---|
6 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
7 | |
---|
8 | // +-----------------------------------------------------------------------+ |
---|
9 | // | Check Access and exit when user status is not ok | |
---|
10 | // +-----------------------------------------------------------------------+ |
---|
11 | check_status(ACCESS_ADMINISTRATOR); |
---|
12 | |
---|
13 | //-------------------------------------------------------- sections definitions |
---|
14 | |
---|
15 | // Gestion des onglets |
---|
16 | if (!isset($_GET['tab'])) |
---|
17 | $page['tab'] = 'gestion'; |
---|
18 | else |
---|
19 | $page['tab'] = $_GET['tab']; |
---|
20 | |
---|
21 | $tabsheet = new tabsheet(); |
---|
22 | $tabsheet->add('gestion', |
---|
23 | l10n('Configuration'), |
---|
24 | $my_base_url.'&tab=gestion'); |
---|
25 | $tabsheet->select($page['tab']); |
---|
26 | $tabsheet->assign(); |
---|
27 | |
---|
28 | // Onglet gest |
---|
29 | switch ($page['tab']) |
---|
30 | { |
---|
31 | case 'gestion': |
---|
32 | |
---|
33 | global $conf; |
---|
34 | |
---|
35 | $selected = $conf['udp']; |
---|
36 | $options['Author'] = l10n('Author'); |
---|
37 | $options['datecreate'] = l10n('Created on'); |
---|
38 | $options['datepost'] = l10n('Posted on'); |
---|
39 | $options['Dimensions'] = l10n('Dimensions'); |
---|
40 | $options['File'] = l10n('File'); |
---|
41 | $options['Filesize'] = l10n('Filesize'); |
---|
42 | $options['Tags'] = l10n('tags'); |
---|
43 | $options['Categories'] = l10n('Albums'); |
---|
44 | $options['Visits'] = l10n('Visits'); |
---|
45 | $options['Average'] = l10n('Rating score'); |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | $template->assign( |
---|
50 | 'gestionA', |
---|
51 | array( |
---|
52 | 'OPTIONS' => $options, |
---|
53 | 'SELECTED' => $selected |
---|
54 | )); |
---|
55 | |
---|
56 | |
---|
57 | if (isset($_POST['infoudp'])) |
---|
58 | { |
---|
59 | conf_update_param('udp', $_POST['infoudp']); |
---|
60 | $template->delete_compiled_templates(); |
---|
61 | array_push($page['infos'], l10n('Your configuration settings are saved')); |
---|
62 | |
---|
63 | $selected = $_POST['infoudp']; |
---|
64 | $template->assign( |
---|
65 | 'gestionA', |
---|
66 | array( |
---|
67 | 'OPTIONS' => $options, |
---|
68 | 'SELECTED' => $selected |
---|
69 | )); |
---|
70 | } |
---|
71 | break; |
---|
72 | } |
---|
73 | |
---|
74 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
75 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
76 | ?> |
---|