source: extensions/BatchDownloader/admin/config.php @ 16379

Last change on this file since 16379 was 16379, checked in by mistic100, 12 years ago

first commit, not complete
TODO : use multisize, download history, localization, compatibility with User Selection (and create User Selection !!)

File size: 1.6 KB
Line 
1<?php
2if (!defined('BATCH_DOWNLOAD_PATH')) die('Hacking attempt!');
3
4if (isset($_POST['save_config']))
5{
6  $conf['batch_download'] = array(
7    'groups'          => isset($_POST['groups']) ? $_POST['groups'] : array(),
8    'level'           => $_POST['level'],
9    'photo_size'      => $_POST['photo_size'],
10    'archive_prefix'  => trim($_POST['archive_prefix']),
11    'archive_comment' => trim($_POST['archive_comment']),
12    'archive_timeout' => intval($_POST['archive_timeout']),
13    'max_elements'    => intval($_POST['max_elements']),
14    'max_size'        => intval($_POST['max_size']),
15    'last_clean'      => $conf['batch_download']['last_clean'],
16    );
17 
18  conf_update_param('batch_download', serialize($conf['batch_download']));
19}
20
21// groups
22$query = '
23SELECT id, name
24  FROM '.GROUPS_TABLE.'
25  ORDER BY name ASC
26;';
27$group_options = simple_hash_from_query($query, 'id', 'name');
28
29// levels
30$level_options = get_privacy_level_options();
31
32// sizes
33$enabled = ImageStdParams::get_defined_type_map();
34$disabled = @unserialize(@$conf['disabled_derivatives']);
35if ($disabled === false) $disabled = array();
36
37$sizes_keys = array_diff(array_keys($enabled), array_keys($disabled));
38$sizes_names = array_map(create_function('$s', 'return l10n($s);'), $sizes_keys);
39
40$sizes_options = array_combine($sizes_keys, $sizes_names);
41$sizes_options['original'] = l10n('Original');
42
43$template->assign(array(
44  'group_options' => $group_options,
45  'level_options' => $level_options,
46  'sizes_options' => $sizes_options,
47  'batch_download' => $conf['batch_download'],
48  ));
49
50
51$template->set_filename('batch_download', dirname(__FILE__) . '/template/config.tpl');
52
53?>
Note: See TracBrowser for help on using the repository browser.