1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | global $template, $conf; |
---|
5 | |
---|
6 | // Chargement des parametres |
---|
7 | load_language('plugin.lang', thumbnail_tooltip_PATH); |
---|
8 | include(dirname(__FILE__).'/config_default.inc.php'); |
---|
9 | $params = array_merge($config_default, unserialize($conf['thumbnail_tooltip'])); |
---|
10 | |
---|
11 | // Mise a jour de la base de donnee |
---|
12 | if (isset($_POST['submit'])) |
---|
13 | { |
---|
14 | $params = array( |
---|
15 | 'display_name' => $_POST['display_name'] ? true : false, |
---|
16 | 'value1' => $_POST['value1'], |
---|
17 | 'value2' => $_POST['value2'], |
---|
18 | 'value3' => $_POST['value3'], |
---|
19 | 'value4' => $_POST['value4'], |
---|
20 | 'value5' => $_POST['value5'], |
---|
21 | 'value6' => $_POST['value6'], |
---|
22 | 'separator' => $_POST['separator'], |
---|
23 | 'display_author_cat'=> $_POST['display_author_cat'], |
---|
24 | ); |
---|
25 | |
---|
26 | $query = ' |
---|
27 | UPDATE ' . CONFIG_TABLE . ' |
---|
28 | SET value="' . addslashes(serialize($params)) . '" |
---|
29 | WHERE param="thumbnail_tooltip" |
---|
30 | LIMIT 1'; |
---|
31 | pwg_query($query); |
---|
32 | array_push($page['infos'], l10n('tn_configuration_saved')); |
---|
33 | } |
---|
34 | |
---|
35 | |
---|
36 | // Restaurer les paramètres par défaut |
---|
37 | if (isset($_POST['restore'])) |
---|
38 | { |
---|
39 | $params = $config_default; |
---|
40 | |
---|
41 | $query = ' |
---|
42 | UPDATE ' . CONFIG_TABLE . ' |
---|
43 | SET value="' . addslashes(serialize($params)) . '" |
---|
44 | WHERE param="thumbnail_tooltip" |
---|
45 | LIMIT 1'; |
---|
46 | pwg_query($query); |
---|
47 | array_push($page['infos'], l10n('tn_default_parameters_saved')); |
---|
48 | } |
---|
49 | |
---|
50 | |
---|
51 | // Configuration du template |
---|
52 | $template->assign(array( |
---|
53 | 'DISPLAY_NAME' => $params['display_name'], |
---|
54 | 'VALUE1' => $params['value1'], |
---|
55 | 'VALUE2' => $params['value2'], |
---|
56 | 'VALUE3' => $params['value3'], |
---|
57 | 'VALUE4' => $params['value4'], |
---|
58 | 'VALUE5' => $params['value5'], |
---|
59 | 'VALUE6' => $params['value6'], |
---|
60 | 'SEPARATOR' => $params['separator'], |
---|
61 | 'DISPLAY_AUTHOR_CAT' => $params['display_author_cat'], |
---|
62 | )); |
---|
63 | |
---|
64 | |
---|
65 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
66 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
67 | ?> |
---|