1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | global $conf, $template; |
---|
5 | load_language('plugin.lang', F2B_PATH); |
---|
6 | $conf['Front2Back'] = explode(',', $conf['Front2Back']); |
---|
7 | |
---|
8 | // Enregistrement de la configuration |
---|
9 | if (isset($_POST['submit'])) |
---|
10 | { |
---|
11 | $conf['Front2Back'] = array( |
---|
12 | !empty($_POST['path']) ? rtrim($_POST['path'],'/').'/' : '', |
---|
13 | !empty($_POST['parent']) ? rtrim($_POST['parent'],'/').'/' : '', |
---|
14 | !empty($_POST['hd_parent']) ? rtrim($_POST['hd_parent'],'/').'/' : '', |
---|
15 | !empty($_POST['suffix']) ? $_POST['suffix'] : '', |
---|
16 | ); |
---|
17 | |
---|
18 | $query = 'UPDATE ' . CONFIG_TABLE . ' |
---|
19 | SET value="' . implode (',', $conf['Front2Back']) . '" |
---|
20 | WHERE param="Front2Back"'; |
---|
21 | pwg_query($query); |
---|
22 | |
---|
23 | array_push($page['infos'], l10n('Information data registered in database')); |
---|
24 | } |
---|
25 | |
---|
26 | $template->assign(array( |
---|
27 | 'PATH' => $conf['Front2Back'][0], |
---|
28 | 'PARENT' => $conf['Front2Back'][1], |
---|
29 | 'HD_PARENT' => $conf['Front2Back'][2], |
---|
30 | 'SUFFIX' => $conf['Front2Back'][3], |
---|
31 | )); |
---|
32 | |
---|
33 | $template->set_filename('Front2Back_conf', dirname(__FILE__).'/template/admin.tpl'); |
---|
34 | $template->assign_var_from_handle('ADMIN_CONTENT', 'Front2Back_conf'); |
---|
35 | |
---|
36 | ?> |
---|