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