aboutsummaryrefslogtreecommitdiffstats
path: root/admin/configuration.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2012-01-12 21:37:28 +0000
committerplegall <plg@piwigo.org>2012-01-12 21:37:28 +0000
commitcac417c74bc6d5f528b356190561d244e9b4f93a (patch)
tree98d7f341215bfec3e75de2dde0a2a2167d54b30c /admin/configuration.php
parent6a115001ba122c2084e28353e025f7c8c5f62335 (diff)
feature 2548, multiple size:
* adapt the upload script * remove the resize settings screen * add a new screen [Administration > Configuration > Options > Photo Sizes] with the ability to resize original after upload git-svn-id: http://piwigo.org/svn/trunk@12879 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/configuration.php')
-rw-r--r--admin/configuration.php62
1 files changed, 61 insertions, 1 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index a59e815fc..bc6f3634d 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -27,6 +27,7 @@ if( !defined("PHPWG_ROOT_PATH") )
}
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
// +-----------------------------------------------------------------------+
@@ -54,6 +55,10 @@ $main_checkboxes = array(
'allow_user_customization',
);
+$sizes_checkboxes = array(
+ 'original_resize',
+ );
+
$history_checkboxes = array(
'log',
'history_admin',
@@ -182,6 +187,36 @@ if (isset($_POST['submit']))
}
break;
}
+ case 'sizes' :
+ {
+ $fields = array(
+ 'original_resize',
+ 'original_resize_maxwidth',
+ 'original_resize_maxheight',
+ 'original_resize_quality',
+ );
+
+ $updates = array();
+
+ foreach ($fields as $field)
+ {
+ $value = !empty($_POST[$field]) ? $_POST[$field] : null;
+ $form_values[$field] = $value;
+ $updates[$field] = $value;
+ }
+
+ save_upload_form_config($updates, $page['errors']);
+
+ if (count($page['errors']) == 0)
+ {
+ array_push(
+ $page['infos'],
+ l10n('Your configuration settings are saved')
+ );
+ }
+
+ break;
+ }
case 'history' :
{
foreach( $history_checkboxes as $checkbox)
@@ -228,7 +263,7 @@ if (isset($_POST['submit']))
}
// updating configuration if no error found
- if (count($page['errors']) == 0)
+ if ('sizes' != $page['section'] and count($page['errors']) == 0)
{
//echo '<pre>'; print_r($_POST); echo '</pre>';
$result = pwg_query('SELECT param FROM '.CONFIG_TABLE);
@@ -268,6 +303,7 @@ $template->set_filename('config', 'configuration.tpl');
$tabsheet = new tabsheet();
// TabSheet initialization
$tabsheet->add('main', l10n('Main'), $conf_link.'main');
+$tabsheet->add('sizes', l10n('Photo Sizes'), $conf_link.'sizes');
$tabsheet->add('display', l10n('Display'), $conf_link.'display');
$tabsheet->add('history', l10n('History'), $conf_link.'history');
$tabsheet->add('comments', l10n('Comments'), $conf_link.'comments');
@@ -439,6 +475,30 @@ switch ($page['section'])
);
break;
}
+ case 'sizes' :
+ {
+ $template->assign(
+ 'sizes',
+ array(
+ 'original_resize_maxwidth' => $conf['original_resize_maxwidth'],
+ 'original_resize_maxheight' => $conf['original_resize_maxheight'],
+ 'original_resize_quality' => $conf['original_resize_quality'],
+ )
+ );
+
+ foreach ($sizes_checkboxes as $checkbox)
+ {
+ $template->append(
+ 'sizes',
+ array(
+ $checkbox => $conf[$checkbox]
+ ),
+ true
+ );
+ }
+
+ break;
+ }
}
//----------------------------------------------------------- sending html code