1 | <?php |
---|
2 | |
---|
3 | defined('PHYSICAL2VIRTUAL_PATH') or die('Hacking attempt!'); |
---|
4 | |
---|
5 | global $conf, $template, $page; |
---|
6 | |
---|
7 | if (isset($_POST['submit'])) |
---|
8 | { |
---|
9 | $conf['physical2virtual'] = array( |
---|
10 | 'lock_physical' => isset($_POST['lock_physical']), |
---|
11 | 'private_physical' => isset($_POST['private_physical']), |
---|
12 | ); |
---|
13 | if (isset($_POST['parent_cat']) and $_POST['parent_cat'] > 0) |
---|
14 | $conf['physical2virtual']['parent_cat'] = $_POST['parent_cat']; |
---|
15 | |
---|
16 | conf_update_param('physical2virtual', serialize($conf['physical2virtual'])); |
---|
17 | $page['infos'][] = l10n('Information data registered in database'); |
---|
18 | } |
---|
19 | if (isset($_POST['convert'])) |
---|
20 | { |
---|
21 | $conf['physical2virtual']['lock_physical'] = isset($_POST['lock_physical']); |
---|
22 | $conf['physical2virtual']['private_physical'] = isset($_POST['private_physical']); |
---|
23 | if (isset($_POST['parent_cat']) and $_POST['parent_cat'] > 0) |
---|
24 | $conf['physical2virtual']['parent_cat'] = $_POST['parent_cat']; |
---|
25 | |
---|
26 | physical2virtual_convert(); |
---|
27 | $page['infos'][] = l10n('Convertion done'); |
---|
28 | } |
---|
29 | |
---|
30 | $query = ' |
---|
31 | SELECT id,name,uppercats,global_rank |
---|
32 | FROM '.CATEGORIES_TABLE.' |
---|
33 | ;'; |
---|
34 | display_select_cat_wrapper( |
---|
35 | $query, |
---|
36 | empty($conf['physical2virtual']['parent_cat']) ? array() : array($conf['physical2virtual']['parent_cat']), |
---|
37 | 'category_parent_options' |
---|
38 | ); |
---|
39 | |
---|
40 | $template->assign(array( |
---|
41 | 'physical2virtual' => $conf['physical2virtual'], |
---|
42 | )); |
---|
43 | |
---|
44 | $template->set_filename('admintools_content', realpath(PHYSICAL2VIRTUAL_PATH . 'template/admin.tpl')); |
---|
45 | $template->assign_var_from_handle('ADMIN_CONTENT', 'admintools_content'); |
---|
46 | |
---|
47 | ?> |
---|