source: extensions/physical2virtual/admin.php @ 27096

Last change on this file since 27096 was 27096, checked in by JanisV, 10 years ago

Initial commit

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