fixes #2417 ability to hide the new filter "expert mode"

... and removes 2 other duplicates of the filters_views configuration
This commit is contained in:
plegall
2025-10-28 18:39:18 +01:00
parent f0f4b30ce2
commit b416bdb7c9
12 changed files with 85 additions and 64 deletions
+3 -1
View File
@@ -13,7 +13,9 @@ if (!defined('PHPWG_ROOT_PATH'))
$upgrade_description = 'add config parameters to the gallery filters';
conf_update_param('filters_views', $conf['default_filters_views']);
// let the $conf['filters_views'] be written in config table when the admin will change settings in administration.
//
// conf_update_param('filters_views', $conf['default_filters_views']);
echo "\n".$upgrade_description."\n";
+33
View File
@@ -0,0 +1,33 @@
<?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 "expert mode" in filters_views for gallery search';
load_conf_from_db();
// if the filters_views is not already registered in the config table, no need
// to update it because it will be initialized with all filters
if (isset($conf['filters_views']))
{
$conf['filters_views'] = safe_unserialize($conf['filters_views']);
if (!isset($conf['filters_views']['expert']))
{
$conf['filters_views']['expert'] = $conf['default_filters_views']['expert'];
conf_update_param('filters_views', $conf['filters_views']);
}
}
echo "\n".$upgrade_description."\n";
?>