mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
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
This commit is contained in:
+61
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user