Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
plegall committed Jan 12, 2012
1 parent 6a11500 commit cac417c
Show file tree
Hide file tree
Showing 44 changed files with 204 additions and 832 deletions.
9 changes: 0 additions & 9 deletions admin/batch_manager_global.php
Expand Up @@ -33,14 +33,6 @@
}

include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');

$upload_form_config = get_upload_form_config();
foreach ($upload_form_config as $param_shortname => $param)
{
$param_name = 'upload_form_'.$param_shortname;
$form_values[$param_shortname] = $conf[$param_name];
}

// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
Expand Down Expand Up @@ -463,7 +455,6 @@
'filter' => $_SESSION['bulk_manager_filter'],
'selection' => $collection,
'all_elements' => $page['cat_elements_id'],
'upload_form_settings' => $form_values,
'U_DISPLAY'=>$base_url.get_query_string_diff(array('display')),
'F_ACTION'=>$base_url.get_query_string_diff(array('cat')),
)
Expand Down
62 changes: 61 additions & 1 deletion admin/configuration.php
Expand Up @@ -27,6 +27,7 @@
}

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');

// +-----------------------------------------------------------------------+
Expand Down Expand Up @@ -54,6 +55,10 @@
'allow_user_customization',
);

$sizes_checkboxes = array(
'original_resize',
);

$history_checkboxes = array(
'log',
'history_admin',
Expand Down Expand Up @@ -182,6 +187,36 @@
}
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)
Expand Down Expand Up @@ -228,7 +263,7 @@
}

// 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);
Expand Down Expand Up @@ -268,6 +303,7 @@
$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');
Expand Down Expand Up @@ -439,6 +475,30 @@ function order_by_is_local()
);
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
Expand Down

0 comments on commit cac417c

Please sign in to comment.