mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 17:23:04 +02:00
Add a config page in admin for the search filters in the gallery. Privacy and default filters can be selected. Needs a database update.
This commit is contained in:
@@ -112,6 +112,22 @@ $display_info_checkboxes = array(
|
||||
'rating_score',
|
||||
);
|
||||
|
||||
$filters_names_checkboxes = array(
|
||||
'words',
|
||||
'tags',
|
||||
'post_date',
|
||||
'creation_date',
|
||||
'album',
|
||||
'author',
|
||||
'added_by',
|
||||
'file_type',
|
||||
'ratio',
|
||||
'rating',
|
||||
'file_size',
|
||||
'height',
|
||||
'width'
|
||||
);
|
||||
|
||||
// image order management
|
||||
$sort_fields = array(
|
||||
'' => '',
|
||||
@@ -277,6 +293,23 @@ if (isset($_POST['submit']))
|
||||
$_POST['picture_informations'] = addslashes(serialize($_POST['picture_informations']));
|
||||
break;
|
||||
}
|
||||
case 'search' :
|
||||
{
|
||||
foreach( $filters_names_checkboxes as $checkbox)
|
||||
{
|
||||
if (empty($_POST['filters_views_box'][$checkbox])){
|
||||
$_POST['filters_views'][$checkbox]['access'] = 'nobody';
|
||||
$_POST['filters_views'][$checkbox]['default'] = false;
|
||||
}
|
||||
else{
|
||||
$_POST['filters_views'][$checkbox]['default'] =
|
||||
empty($_POST['filters_views'][$checkbox]['default'])? false : true;
|
||||
}
|
||||
}
|
||||
$_POST['filters_views']['last_filters_conf'] =
|
||||
empty($_POST['filters_views']['last_filters_conf'])? false : true;
|
||||
$_POST['filters_views'] = addslashes(serialize($_POST['filters_views']));
|
||||
}
|
||||
}
|
||||
|
||||
// updating configuration if no error found
|
||||
@@ -660,6 +693,18 @@ switch ($page['section'])
|
||||
|
||||
break;
|
||||
}
|
||||
case 'search':
|
||||
{
|
||||
$filters_names = $filters_names_checkboxes;
|
||||
$template->assign(
|
||||
'search',
|
||||
array(
|
||||
'filters_views' => unserialize($conf['filters_views']),
|
||||
'filters_names' => $filters_names,
|
||||
),
|
||||
);
|
||||
$template->assign('SHOW_FILTER_RATINGS', $conf['rate']);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('isWebmaster', (is_webmaster()) ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user