mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
- Add 3XL and 4XL sizes to defaults but keep them disabled by default - Update admin restore default derivatives resets sizes and clears cache - Update migration 177 => updates existing installs: set 3XL/4XL as disabled
35 lines
1.3 KiB
PHP
35 lines
1.3 KiB
PHP
<?php
|
|
// +-----------------------------------------------------------------------+
|
|
// | This file is part of Piwigo. |
|
|
// | |
|
|
// | For copyright and license information, please view the COPYING.txt |
|
|
// | file that was distributed with this source code. |
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
if (!defined('PHPWG_ROOT_PATH'))
|
|
{
|
|
die('Hacking attempt!');
|
|
}
|
|
|
|
$upgrade_description = 'Add 3XL and 4XL sizes (disabled by default)';
|
|
|
|
load_conf_from_db();
|
|
|
|
//get default sizes from derivative_std_params
|
|
$default_sizes = ImageStdParams::get_default_sizes();
|
|
|
|
// set new derivatives to add
|
|
$new_derivatives = array(IMG_3XLARGE, IMG_4XLARGE);
|
|
|
|
// get current disabled derivative_std_params
|
|
$disabled_derivatives = safe_unserialize(ImageStdParams::get_disabled_type_map());
|
|
|
|
// get the new derivative_std_params and merge with current disabled derivative_std_params
|
|
$new_disabled_derivatives = array_intersect_key($default_sizes, array_flip($new_derivatives));
|
|
$disabled = array_merge($disabled_derivatives, $new_disabled_derivatives);
|
|
|
|
// set and set new derivative_std_params in disabled list
|
|
ImageStdParams::set_and_save_disabled($disabled);
|
|
|
|
echo "\n".$upgrade_description."\n";
|
|
?>
|