source: extensions/physical2virtual/admin.php @ 27153

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

Make processed physical albums private

File size: 1.5 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    '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}
19if (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 = '
31SELECT id,name,uppercats,global_rank
32  FROM '.CATEGORIES_TABLE.'
33;';
34display_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?>
Note: See TracBrowser for help on using the repository browser.