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', PAB_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 | PAB_ADMIN.'-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['Photo_add_by']; |
---|
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 | $template->assign( |
---|
48 | 'gestionA', |
---|
49 | array( |
---|
50 | 'OPTIONS' => $options, |
---|
51 | 'SELECTED' => $selected, |
---|
52 | )); |
---|
53 | |
---|
54 | $PASPBY = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'see_photos_by_user';")); |
---|
55 | if($PASPBY['state'] == 'active') |
---|
56 | { |
---|
57 | $PABS2T = array( |
---|
58 | l10n('No'), |
---|
59 | l10n('Yes'), |
---|
60 | ); |
---|
61 | |
---|
62 | $PABS2 = array( |
---|
63 | '0', |
---|
64 | '1', |
---|
65 | ); |
---|
66 | |
---|
67 | $template->assign( |
---|
68 | 'gestionB', |
---|
69 | array( |
---|
70 | 'TOTO' => 'toto', |
---|
71 | )); |
---|
72 | global $conf; |
---|
73 | $template->assign('pabs2', $PABS2); |
---|
74 | $template->assign('pabs2t', $PABS2T); |
---|
75 | $template->assign('PABS', $conf['Photo_add_by_show']); |
---|
76 | |
---|
77 | } |
---|
78 | |
---|
79 | if (isset($_POST['submitpab'])) |
---|
80 | { |
---|
81 | conf_update_param('Photo_add_by', $_POST['infopab']); |
---|
82 | if($PASPBY['state'] == 'active') |
---|
83 | { |
---|
84 | conf_update_param('Photo_add_by_show', $_POST['inspabs2']); |
---|
85 | $template->assign( |
---|
86 | 'gestionB', |
---|
87 | array( |
---|
88 | 'TOTO' => 'toto', |
---|
89 | )); |
---|
90 | $template->assign('PABS', $_POST['inspabs2']); |
---|
91 | } |
---|
92 | $template->delete_compiled_templates(); |
---|
93 | array_push($page['infos'], l10n('Your configuration settings are saved')); |
---|
94 | |
---|
95 | $selected = $_POST['infopab']; |
---|
96 | $template->assign( |
---|
97 | 'gestionA', |
---|
98 | array( |
---|
99 | 'OPTIONS' => $options, |
---|
100 | 'SELECTED' => $selected, |
---|
101 | )); |
---|
102 | } |
---|
103 | break; |
---|
104 | } |
---|
105 | |
---|
106 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin/admin.tpl')); |
---|
107 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
108 | ?> |
---|