mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
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:
@@ -1054,6 +1054,7 @@ $conf['default_filters_views'] = array(
|
||||
'file_size' => ['access'=>'everybody', 'default'=>false],
|
||||
'height' => ['access'=>'everybody', 'default'=>false],
|
||||
'width' => ['access'=>'everybody', 'default'=>false],
|
||||
'expert' => ['access'=>'everybody', 'default'=>false],
|
||||
|
||||
'last_filters_conf' => true,
|
||||
);
|
||||
|
||||
@@ -119,15 +119,7 @@ function get_regular_search_results($search, $images_where='')
|
||||
|
||||
$image_ids_for_filter = array();
|
||||
|
||||
if (isset($conf['filters_views']))
|
||||
{
|
||||
$display_filters = unserialize($conf['filters_views']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$display_filters = unserialize('a:14:{s:5:"words";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:1;}s:4:"tags";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:9:"post_date";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:13:"creation_date";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:1;}s:5:"album";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:1;}s:6:"author";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:8:"added_by";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:9:"file_type";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:5:"ratio";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:6:"rating";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:9:"file_size";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:6:"height";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:5:"width";a:2:{s:6:"access";s:9:"everybody";s:7:"default";b:0;}s:17:"last_filters_conf";b:1;}');
|
||||
}
|
||||
|
||||
$display_filters = safe_unserialize(conf_get_param('filters_views', $conf['default_filters_views']));
|
||||
|
||||
foreach($display_filters as $filt_name => $filt_conf){
|
||||
if(isset($filt_conf['access']))
|
||||
@@ -146,7 +138,7 @@ function get_regular_search_results($search, $images_where='')
|
||||
//
|
||||
// expert
|
||||
//
|
||||
if (isset($search['fields']['expert']) and !empty($search['fields']['expert']['string']))
|
||||
if (isset($search['fields']['expert']) and !empty($search['fields']['expert']['string']) and $display_filters['expert']['access'])
|
||||
{
|
||||
$has_filters_filled = true;
|
||||
|
||||
|
||||
@@ -109,7 +109,14 @@ if ('search' == $page['section'] and isset($page['search_details']))
|
||||
|
||||
if (isset($my_search['fields']['expert']))
|
||||
{
|
||||
load_language('help_quick_search.lang');
|
||||
if (!$display_filters['expert']['access'])
|
||||
{
|
||||
unset($my_search['fields']['expert']);
|
||||
}
|
||||
else
|
||||
{
|
||||
load_language('help_quick_search.lang');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($my_search['fields']['author']) and $display_filters['author']['access'])
|
||||
|
||||
Reference in New Issue
Block a user