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

Last change on this file since 23383 was 23383, checked in by mistic100, 11 years ago

new parameters on config screen "photo_size", "one_archive", "force_pclzip", "direct"

File size: 2.6 KB
RevLine 
[16379]1<?php
2if (!defined('BATCH_DOWNLOAD_PATH')) die('Hacking attempt!');
3
4if (isset($_POST['save_config']))
5{
[21422]6  if (!defined('USER_COLLEC_ID')) $_POST['what']['collections'] = 'on';
7 
[16379]8  $conf['batch_download'] = array(
9    'groups'          => isset($_POST['groups']) ? $_POST['groups'] : array(),
10    'level'           => $_POST['level'],
[21422]11    'what'            => isset($_POST['what']) ? array_keys($_POST['what']) : array(),
[16379]12    'photo_size'      => $_POST['photo_size'],
13    'archive_prefix'  => trim($_POST['archive_prefix']),
14    'archive_timeout' => intval($_POST['archive_timeout']),
15    'max_elements'    => intval($_POST['max_elements']),
16    'max_size'        => intval($_POST['max_size']),
[23383]17    'one_archive'     => isset($_POST['one_archive']),
18    'force_pclzip'    => isset($_POST['force_pclzip']),
19    'direct'          => isset($_POST['direct']),
[16379]20    'last_clean'      => $conf['batch_download']['last_clean'],
21    );
[16689]22  $conf['batch_download_comment'] = trim($_POST['archive_comment']);
[16379]23 
24  conf_update_param('batch_download', serialize($conf['batch_download']));
[16689]25  conf_update_param('batch_download_comment', $conf['batch_download_comment']);
[23383]26 
27  array_push($page['infos'], l10n('Information data registered in database'));
[16379]28}
29
[21422]30
[16379]31// groups
32$query = '
33SELECT id, name
34  FROM '.GROUPS_TABLE.'
35  ORDER BY name ASC
36;';
37$group_options = simple_hash_from_query($query, 'id', 'name');
38
39// levels
40$level_options = get_privacy_level_options();
41
42// sizes
[23383]43$type_map = ImageStdParams::get_defined_type_map();
44$sizes_keys = array_keys($type_map);
[16379]45$sizes_names = array_map(create_function('$s', 'return l10n($s);'), $sizes_keys);
46
47$sizes_options = array_combine($sizes_keys, $sizes_names);
48$sizes_options['original'] = l10n('Original');
49
[16392]50// max values
51$conf['batch_download']['max_elements_value'] = isset($conf['batch_download_max_elements']) ? $conf['batch_download_max_elements'] : 1000;
[21422]52$conf['batch_download']['max_size_value'] =     isset($conf['batch_download_max_size']) ?     $conf['batch_download_max_size'] :     500;
[16392]53
[21422]54
[16379]55$template->assign(array(
56  'group_options' => $group_options,
57  'level_options' => $level_options,
58  'sizes_options' => $sizes_options,
[21422]59  'USER_COLLEC_LOADED' => defined('USER_COLLEC_ID'),
[16379]60  'batch_download' => $conf['batch_download'],
[16689]61  'batch_download_comment' => stripslashes($conf['batch_download_comment']),
[23383]62  'use_ziparchive' => class_exists('ZipArchive') && !$conf['batch_download']['force_pclzip'],
[17880]63  'PHP_VERSION' => PHP_VERSION,
[23288]64  'ADVANCED_CONF' => load_language('advanced.html', BATCH_DOWNLOAD_PATH, array('return'=>true))
[16379]65  ));
66
67
68$template->set_filename('batch_download', dirname(__FILE__) . '/template/config.tpl');
69
70?>
Note: See TracBrowser for help on using the repository browser.