aboutsummaryrefslogtreecommitdiffstats
path: root/admin/batch_manager_global.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2011-04-21 22:35:16 +0000
committerpatdenice <patdenice@piwigo.org>2011-04-21 22:35:16 +0000
commit17a04fcd399965f5589b26245ac040969d5ac117 (patch)
tree42d3312acb49873897e47a6dcb22933c290a9d67 /admin/batch_manager_global.php
parentd1eb25df099fa74e725692f3d6335b5d35abfc4b (diff)
feature:2273
Add crop functionality to webservice and batch manager. git-svn-id: http://piwigo.org/svn/trunk@10553 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/batch_manager_global.php')
-rw-r--r--admin/batch_manager_global.php40
1 files changed, 26 insertions, 14 deletions
diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php
index 5b61bc9e8..40628d0d7 100644
--- a/admin/batch_manager_global.php
+++ b/admin/batch_manager_global.php
@@ -417,7 +417,7 @@ SELECT id, path
if ($_POST['regenerateError'] != '0')
array_push($page['warnings'], sprintf(l10n('%s thumbnails can not be regenerated'), $_POST['regenerateError']));
- $update_fields = array('thumb_maxwidth', 'thumb_maxheight', 'thumb_quality');
+ $update_fields = array('thumb_maxwidth', 'thumb_maxheight', 'thumb_quality', 'thumb_crop', 'thumb_follow_orientation');
}
if ('regenerateWebsize' == $action)
@@ -437,26 +437,38 @@ SELECT id, path
$updates = array();
foreach ($update_fields as $field)
{
- $value = null;
- if (!empty($_POST[$field]))
+ if (is_bool($upload_form_config[$field]['default']))
{
- $value = $_POST[$field];
- }
+ $value = isset($_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(
+ $updates[] = array(
'param' => 'upload_form_'.$field,
- 'value' => $value
+ 'value' => boolean_to_string($value)
);
}
else
{
- $updates = null;
- break;
+ $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;
+ }
}
$form_values[$field] = $value;
}