diff options
author | patdenice <patdenice@piwigo.org> | 2011-04-23 08:51:53 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2011-04-23 08:51:53 +0000 |
commit | 6597975404e82f5d5d4234afd70d4002db222824 (patch) | |
tree | 8305cdb40bdbfe15d09f05b0c6592c4b5dfdb98a /admin/batch_manager_global.php | |
parent | ef00110fe75a3036908602d3f4c8e54df43dd72d (diff) |
Create a function to save upload form settings.
git-svn-id: http://piwigo.org/svn/trunk@10589 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/batch_manager_global.php')
-rw-r--r-- | admin/batch_manager_global.php | 49 |
1 files changed, 4 insertions, 45 deletions
diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index 40628d0d7..d00101b9c 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -433,56 +433,15 @@ SELECT id, path if (!empty($update_fields)) { - // Update configuration + // Update upload configuration $updates = array(); foreach ($update_fields as $field) { - if (is_bool($upload_form_config[$field]['default'])) - { - $value = isset($_POST[$field]); - - $updates[] = array( - 'param' => 'upload_form_'.$field, - 'value' => boolean_to_string($value) - ); - } - else - { - $value = null; - if (!empty($_POST[$field])) - { - $value = $_POST[$field]; - } - - if (preg_match($upload_form_config[$field]['pattern'], $value) - and $value >= $upload_form_config[$field]['min'] - and $value <= $upload_form_config[$field]['max']) - { - $conf['upload_form_'.$field] = $value; - $updates[] = array( - 'param' => 'upload_form_'.$field, - 'value' => $value - ); - } - else - { - $updates = null; - break; - } - } + $value = !empty($_POST[$field]) ? $_POST[$field] : null; $form_values[$field] = $value; + $updates[$field] = $value; } - if (!empty($updates)) - { - mass_updates( - CONFIG_TABLE, - array( - 'primary' => array('param'), - 'update' => array('value') - ), - $updates - ); - } + save_upload_form_config($updates); $template->delete_compiled_templates(); } |