mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
search filters: avoid to write 3 times the same default configuration
This commit is contained in:
@@ -1027,12 +1027,37 @@ $conf['batch_manager_images_per_page_unit'] = 5;
|
||||
// how many missing md5sum should Piwigo compute at once.
|
||||
$conf['checksum_compute_blocksize'] = 50;
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | Search |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
// quicksearch engine: include all photos from sub-albums of any matching
|
||||
// album. For example, if search is "bear", then we display photos from
|
||||
// "bear/grizzly". When value changed, delete database cache files in
|
||||
// _data/cache directory
|
||||
$conf['quick_search_include_sub_albums'] = false;
|
||||
|
||||
// default configuration for search filters. It will then be configurable
|
||||
// with the configuration page. Having this setting in this file avoids to
|
||||
// duplicate it in several files
|
||||
$conf['default_filters_views'] = array(
|
||||
'words' => ['access'=>'everybody', 'default'=>true],
|
||||
'tags' => ['access'=>'everybody', 'default'=>false],
|
||||
'post_date' => ['access'=>'everybody', 'default'=>false],
|
||||
'creation_date' => ['access'=>'everybody', 'default'=>true],
|
||||
'album' => ['access'=>'everybody', 'default'=>true],
|
||||
'author' => ['access'=>'everybody', 'default'=>false],
|
||||
'added_by' => ['access'=>'everybody', 'default'=>false],
|
||||
'file_type' => ['access'=>'everybody', 'default'=>false],
|
||||
'ratio' => ['access'=>'everybody', 'default'=>false],
|
||||
'rating' => ['access'=>'everybody', 'default'=>false],
|
||||
'file_size' => ['access'=>'everybody', 'default'=>false],
|
||||
'height' => ['access'=>'everybody', 'default'=>false],
|
||||
'width' => ['access'=>'everybody', 'default'=>false],
|
||||
|
||||
'last_filters_conf' => true,
|
||||
);
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | log |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
@@ -6,14 +6,7 @@
|
||||
// | file that was distributed with this source code. |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
if (isset($conf['filters_views']))
|
||||
{
|
||||
$filters_views = unserialize($conf['filters_views']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$filters_views = 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;}');
|
||||
}
|
||||
$filters_views = safe_unserialize(conf_get_param('filters_views', $conf['default_filters_views']));
|
||||
|
||||
$template->assign('display_filter', $filters_views);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user