fixes #2362 add gallery filters options in admin (#2395)

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:
Perrom
2025-08-08 15:07:02 +02:00
committed by GitHub
parent 671657d78b
commit 2465654752
13 changed files with 711 additions and 64 deletions
+45
View File
@@ -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);
+1
View File
@@ -81,6 +81,7 @@ function add_core_tabs($sheets, $tab_id)
$sheets['watermark'] = array('caption' => '<span class="icon-file-image"></span>'.l10n('Watermark'), 'url' => $conf_link.'watermark');
$sheets['display'] = array('caption' => '<span class="icon-television"></span>'.l10n('Display'), 'url' => $conf_link.'display');
$sheets['comments'] = array('caption' => '<span class="icon-chat"></span>'.l10n('Comments'), 'url' => $conf_link.'comments');
$sheets['search'] = array('caption' => '<span class="icon-search"></span>'.l10n('Search'), 'url' => $conf_link.'search');
// $sheets['default'] = array('caption' => l10n('Guest Settings'), 'url' => $conf_link.'default');
break;
+30 -2
View File
@@ -629,7 +629,6 @@ table.dataTable thead th, table.dataTable.no-footer {
background: #3C3C3C;
}
.font-checkbox [class*=icon-check]:before { color:#444; }
#watermarkPositionBox {
border:2px solid #ccc;
@@ -651,8 +650,10 @@ FORM#categoryOrdering p.albumActions .userSeparator {border: 1px solid #E1E1E1;}
.afterUploadActions a.secondary_button {background-color: #ECECEC;}
.afterUploadActions a.secondary_button:hover {background-color: #FFA646;}
.font-checkbox:hover {color: #FFA844;}
.font-checkbox:hover {color: #3C3C3C;}
.font-checkbox.selected {color: #ffa646;}
.font-checkbox:hover .icon-check-empty, .font-checkbox:hover .icon-check {color: #FF7700;}
.font-checkbox .icon-check {color: #FFA646;}
LEGEND {color: #3C3C3C;}
a#showPermissions {color: #5B5B5B; border: 1px solid #D6D6D6; background-color: #FAFAFA;}
@@ -920,4 +921,31 @@ li.plupload_delete a.remove-format:hover{color: #474747;}
.RenameTagPopInContainer {
background-color:#fff;
}
/* Filters options */
label:has(> .filters-icon-check:disabled), span:has(+ .filters-icon-check:disabled){
color: #D5D5D5 !important;
cursor: not-allowed;
}
.select-views{
background-color: #f3f3f3;
}
.filter-manager-options-container{
color: #474747;
}
.filter-manager-options-container:hover{
background-color: #EDEDED;
}
.filter-manager-options-container.selected-filter-container{
background-color: #777777;
color: #FFFFFF;
}
.filter-manager-options-container.selected-filter-container:hover{
background-color: #5D5D5D;
}
@@ -0,0 +1,251 @@
{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
{footer_script}
filters_names =
[
'words',
'tags',
'post_date',
'creation_date',
'album',
'author',
'added_by',
'file_type',
'ratio',
'rating',
'file_size',
'height',
'width'
];
for(const filter_name of filters_names){
if(!$("input#"+filter_name+"Filters").is(':checked')){
$("#f"+filter_name+"Select, #"+filter_name+"Arrow").hide();
$("#default_"+filter_name).parent().hide();
}
if($("#f"+filter_name+"Select").val()!="admins-only"){
$("#"+filter_name+"AdminIcon").hide();
}
if($("#default_"+filter_name).is(':checked')){
$("#default_"+filter_name).parent().addClass("selected-filter-container");
}
$("#"+filter_name+"Filters").on("click", function(){
if($("input#"+filter_name+"Filters").is(':checked')){
$("#f"+filter_name+"Select, #"+filter_name+"Arrow").show();
$("#default_"+filter_name).parent().show();
if($("#f"+filter_name+"Select").val()=="admins-only"){
$("#"+filter_name+"AdminIcon").show();
}
}
else{
$("#f"+filter_name+"Select, #"+filter_name+"Arrow, #"+filter_name+"AdminIcon").hide();
$("#default_"+filter_name).parent().hide();
}
})
$("#f"+filter_name+"Select").on("click", function(){
if($("#f"+filter_name+"Select").val()=="admins-only"){
$("#"+filter_name+"AdminIcon").show();
}
else{
$("#"+filter_name+"AdminIcon").hide();
}
})
$("#default_"+filter_name).on("click", function(){
if($("#default_"+filter_name).is(':checked')){
$("#default_"+filter_name).parent().addClass("selected-filter-container");
}
else{
$("#default_"+filter_name).parent().removeClass("selected-filter-container");
}
})
}
{/footer_script}
{combine_css path="themes/default/vendor/fontello/css/gallery-icon.css" order=-10}
<form method="post" action="{$F_ACTION}" class="properties">
<div id="configContent">
<fieldset class="searchConf">
<legend><span class="icon-equalizer icon-blue rotate-element"></span>{'Filters'|translate}</legend>
<ul>
{foreach from=$search.filters_names item=$filter_name}
<li class="filters-grid">
<label class="font-checkbox">
<span class="icon-check"></span>
<input type="checkbox" class="filters-icon-check" name="filters_views_box[{$filter_name}]" id="{$filter_name}Filters"
{if ($search.filters_views.$filter_name.access != 'nobody' and !($filter_name == 'rating' and !$SHOW_FILTER_RATINGS))}
checked="checked"
{/if}
{if ($filter_name == 'rating' and !$SHOW_FILTER_RATINGS)}
disabled
{/if}
>
{if $filter_name == 'words'}
{'Search for words'|translate}
{else if $filter_name == 'file_size'}
{'Filesize'|translate}
{else}
{ucfirst(str_replace('_', ' ', $filter_name))|translate}
{/if}
</label>
<div class='select-views-arrow icon-down-open' id="{$filter_name}Arrow"> </div>
<select name="filters_views[{$filter_name}][access]" id="f{$filter_name}Select" class="select-views">
<option value="everybody" {if ($search.filters_views.$filter_name.access == "everybody")}selected{/if}>{'Everybody'|translate}</option>
<option value="registered-users" {if ($search.filters_views.$filter_name.access == "registered-users")}selected{/if}>{'Registered users'|translate}</option>
<option value="admins-only" id="{$filter_name}Admin" {if ($search.filters_views.$filter_name.access == "admins-only")}selected{/if}>{'Admins only'|translate}</option>
</select>
<div class='icon-users select-views-admin' id="{$filter_name}AdminIcon"> </div>
</li>
{/foreach}
</ul>
</fieldset>
<fieldset class="searchConf">
<legend><span class="icon-equalizer icon-green rotate-element"></span>{'Default filters'|translate}</legend>
<div class="last-filters">
<label class="font-checkbox">
<span class="icon-check"></span>
<input type="checkbox" class="filters-icon-check" name="filters_views[last_filters_conf]" id="lastFilters" {if ($search.filters_views.last_filters_conf)}checked="checked"{/if}>
{'Set last used filters as default for each users'|translate}
</label>
<span class="icon-help-circled tiptip" title="{'This will be different for each user. Won\'t be applied for unregistered visitors'|translate}" style="cursor:help"></span>
</div>
<label class="filter-manager-options-container">
<span class="mcs-icon-options gallery-icon-search">{'Search for words'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[words][default]" id="default_words"
{if ($search.filters_views.words.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options gallery-icon-tag">{'Tags'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[tags][default]" id="default_tags"
{if ($search.filters_views.tags.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options gallery-icon-calendar-plus">{'Post date'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[post_date][default]" id="default_post_date"
{if ($search.filters_views.post_date.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options gallery-icon-calendar">{'Creation date'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[creation_date][default]" id="default_creation_date"
{if ($search.filters_views.creation_date.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options gallery-icon-album">{'Album'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[album][default]" id="default_album"
{if ($search.filters_views.album.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options gallery-icon-user-edit">{'Author'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[author][default]" id="default_author"
{if ($search.filters_views.author.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options icon-user-1">{'Added by'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[added_by][default]" id="default_added_by"
{if ($search.filters_views.added_by.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options icon-file-image">{'File type'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[file_type][default]" id="default_file_type"
{if ($search.filters_views.file_type.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options icon-crop">{'Ratio'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[ratio][default]" id="default_ratio"
{if ($search.filters_views.ratio.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options icon-star">{'Rating'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[rating][default]" id="default_rating"
{if ($search.filters_views.rating.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options icon-hdd">{'Filesize'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[file_size][default]" id="default_file_size"
{if ($search.filters_views.file_size.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options gallery-icon-height">{'Height'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[height][default]" id="default_height"
{if ($search.filters_views.height.default)}
checked="checked"
{/if}
hidden/>
</label>
<label class="filter-manager-options-container">
<span class="mcs-icon-options gallery-icon-width">{'Width'|translate}</span>
<input type="checkbox" class="filter-manager-options-check" name="filters_views[width][default]" id="default_width"
{if ($search.filters_views.width.default)}
checked="checked"
{/if}
hidden/>
</label>
</fieldset>
</div>
<div class="savebar-footer">
<div class="savebar-footer-start">
</div>
<div class="savebar-footer-end">
{if isset($save_success)}
<div class="savebar-footer-block">
<div class="badge info-message">
<i class="icon-ok"></i>{$save_success}
</div>
</div>
{/if}
<div class="savebar-footer-block">
<button class="buttonLike" type="submit" name="submit" {if $isWebmaster != 1}disabled{/if}><i class="icon-floppy"></i> {'Save Settings'|@translate}</button>
</div>
</div>
<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
</div>
</form>
+51 -1
View File
@@ -1920,6 +1920,7 @@ img.ui-datepicker-trigger {
}
.rotate-element{
display: inline-block;
transform: rotate(90deg);
}
@@ -6522,13 +6523,15 @@ table.qsearch_help_table td {
.font-checkbox [class*=icon-check]:before {
font-size:16px;
line-height:16px;
margin-right:0;
margin-right:5px;
margin-left:0;
font-size: 145%;
}
.font-checkbox .icon-check-empty {
position:relative;
left:-1px;
}
.font-checkbox input[type=checkbox], .font-checkbox input[type=radio] {
display:none;
}
@@ -8008,3 +8011,50 @@ color:#FF7B00;
box-shadow: 0px 4px 4px 0px #00000040;
font-size: 10px;
}
/* Filters options */
.filters-grid{
display: grid;
grid-template-columns: 200px 118px 25px;
margin-bottom: 0px !important;
}
.select-views{
background-color: #f3f3f3;
font-size: 11px;
border: none;
height: 16px;
margin-top: 4.5px;
padding-left: 10px;
}
.select-views-arrow{
display: flex;
position: absolute;
margin-left: 299.9px;
margin-top: 5px;
pointer-events: none;
}
.select-views-admin{
margin-left: 3px;
}
.last-filters{
display: block;
margin-bottom: 15px;
font-weight: bold;
}
.filter-manager-options-container{
display: inline-block;
font-size: 11px;
font-weight: normal !important;
border: 1px solid #777;
border-radius: 20px;
padding: 4px 10px;
cursor: pointer;
margin-right: 7.5px;
margin-bottom: 7.5px;
}
.mcs-icon-options::before{
margin-right: 5px;
}
+33 -3
View File
@@ -224,7 +224,7 @@ body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body
#ui-datepicker-div .ui-datepicker-buttonpane .ui-state-error:hover { background: #7e3030;}
INPUT[type="text"].large { width: 317px; }
.buttonLike:disabled, input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled {
.buttonLike:disabled, .filters-icon-check:disabled, input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled {
color:#555;
border-color:#666;
cursor:not-allowed;
@@ -971,8 +971,6 @@ table.qsearch_help_table td {
border-color: #444;
}
.font-checkbox [class*=icon-check]:before { color:#aaa; }
#cboxLoadedContent { background-color:#333 !important; }
#watermarkPositionBox {
@@ -993,6 +991,8 @@ table.qsearch_help_table td {
.font-checkbox {color: #898888;}
.font-checkbox:hover {color: #ededed;}
.font-checkbox:hover .icon-check-empty, .font-checkbox:hover .icon-check {color: #FF7700;}
.font-checkbox .icon-check {color: #FFA646;}
.with-border legend, .with-border strong {color: #c0c0c0;}
.font-checkbox.selected {color: #ffa646;}
@@ -2394,4 +2394,34 @@ ul.jqtree-tree li.jqtree-ghost span.jqtree-line {
.RenameTagPopInContainer {
background-color:#444;
}
/* Filters options */
.select-views{
background-color: #444444;
color: #898888;
border: 1px solid #666;
}
.filter-manager-options-container{
background-color: #333;
color: #aaa;
border-color: #333;
}
.filter-manager-options-container:hover{
background-color: #5D5D5D;
}
.filter-manager-options-container.selected-filter-container{
background-color: #777777;
color: #ddd;
}
.filter-manager-options-container.selected-filter-container:hover{
background-color: #aaa;
}
label:has(> .filters-icon-check:disabled){
color:#555;
}
+37 -13
View File
@@ -119,10 +119,34 @@ 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;}');
}
foreach($display_filters as $filt_name => $filt_conf){
if(isset($filt_conf['access']))
{
if ($filt_conf['access'] == 'everybody' or ($filt_conf['access'] == 'admins-only' and is_admin()) or ($filt_conf['access'] == 'registered-users' and is_classic_user()))
{
$display_filters[$filt_name]['access'] = true;
}
else
{
$display_filters[$filt_name]['access'] = false;
}
}
}
//
// allwords
//
if (isset($search['fields']['allwords']) and !empty($search['fields']['allwords']['words']) and count($search['fields']['allwords']['fields']) > 0)
if (isset($search['fields']['allwords']) and !empty($search['fields']['allwords']['words']) and count($search['fields']['allwords']['fields']) > 0 and $display_filters['words']['access'])
{
$has_filters_filled = true;
@@ -303,7 +327,7 @@ SELECT
//
// author
//
if (isset($search['fields']['author']) and count($search['fields']['author']['words']) > 0)
if (isset($search['fields']['author']) and count($search['fields']['author']['words']) > 0 and $display_filters['author']['access'])
{
$has_filters_filled = true;
@@ -327,7 +351,7 @@ SELECT
//
// filetypes
//
if (!empty($search['fields']['filetypes']))
if (!empty($search['fields']['filetypes']) and $display_filters['file_type']['access'])
{
$has_filters_filled = true;
@@ -351,7 +375,7 @@ SELECT
//
// added_by
//
if (!empty($search['fields']['added_by']))
if (!empty($search['fields']['added_by']) and $display_filters['added_by']['access'])
{
$has_filters_filled = true;
@@ -369,7 +393,7 @@ SELECT
//
// cat
//
if (isset($search['fields']['cat']) and !empty($search['fields']['cat']['words']))
if (isset($search['fields']['cat']) and !empty($search['fields']['cat']['words']) and $display_filters['album']['access'])
{
$has_filters_filled = true;
@@ -403,7 +427,7 @@ SELECT
//
// date_posted
//
if (!empty($search['fields']['date_posted']['preset']))
if (!empty($search['fields']['date_posted']['preset']) and $display_filters['post_date']['access'])
{
$has_filters_filled = true;
@@ -485,7 +509,7 @@ SELECT
//
// date_created
//
if (!empty($search['fields']['date_created']['preset']))
if (!empty($search['fields']['date_created']['preset']) and $display_filters['creation_date']['access'])
{
$has_filters_filled = true;
@@ -567,7 +591,7 @@ SELECT
//
// ratios
//
if (!empty($search['fields']['ratios']))
if (!empty($search['fields']['ratios']) and $display_filters['ratio']['access'])
{
$has_filters_filled = true;
@@ -598,7 +622,7 @@ SELECT
//
// ratings
//
if ($conf['rate'] and !empty($search['fields']['ratings']))
if ($conf['rate'] and !empty($search['fields']['ratings']) and $display_filters['rating']['access'])
{
$has_filters_filled = true;
@@ -629,7 +653,7 @@ SELECT
//
// filesize
//
if (!empty($search['fields']['filesize_min']) and !empty($search['fields']['filesize_max']))
if (!empty($search['fields']['filesize_min']) and !empty($search['fields']['filesize_max']) and $display_filters['file_size']['access'])
{
$has_filters_filled = true;
@@ -649,7 +673,7 @@ SELECT
//
// height
//
if (!empty($search['fields']['height_min']) and !empty($search['fields']['height_max']))
if (!empty($search['fields']['height_min']) and !empty($search['fields']['height_max']) and $display_filters['height']['access'])
{
$has_filters_filled = true;
@@ -667,7 +691,7 @@ SELECT
//
// width
//
if (!empty($search['fields']['width_min']) and !empty($search['fields']['width_max']))
if (!empty($search['fields']['width_min']) and !empty($search['fields']['width_max']) and $display_filters['width']['access'])
{
$has_filters_filled = true;
@@ -685,7 +709,7 @@ SELECT
//
// tags
//
if (isset($search['fields']['tags']) and !empty($search['fields']['tags']['words']))
if (isset($search['fields']['tags']) and !empty($search['fields']['tags']['words']) and $display_filters['tags']['access'])
{
$has_filters_filled = true;
+128 -29
View File
@@ -6,11 +6,38 @@
// | 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;}');
}
$template->assign('display_filter', $filters_views);
// we add isset($page['search_details']) in this condition because it only
// applies to regular search, not the legacy qsearch. As Piwigo 14 will still
// be able to show an old quicksearch result, we must check this condtion too.
if ('search' == $page['section'] and isset($page['search_details']))
{
$display_filters = $filters_views;
foreach($filters_views as $filt_name => $filt_conf){
if(isset($filt_conf['access']))
{
if ($filt_conf['access'] == 'everybody' or ($filt_conf['access'] == 'admins-only' and is_admin()) or ($filt_conf['access'] == 'registered-users' and is_classic_user()))
{
$display_filters[$filt_name]['access'] = true;
}
else
{
$display_filters[$filt_name]['access'] = false;
}
}
}
include_once(PHPWG_ROOT_PATH.'include/functions_search.inc.php');
$my_search = get_search_array($page['search']);
@@ -40,7 +67,12 @@ if ('search' == $page['section'] and isset($page['search_details']))
$search_items_clause = '1=1';
}
if (isset($my_search['fields']['tags']))
if (isset($my_search['fields']['allwords']) and !($display_filters['words']['access']))
{
unset($my_search['fields']['allwords']);
}
if (isset($my_search['fields']['tags']) and $display_filters['tags']['access'])
{
$filter_tags = array();
@@ -77,7 +109,12 @@ if ('search' == $page['section'] and isset($page['search_details']))
$my_search['fields']['tags']['words'] = array_intersect($my_search['fields']['tags']['words'], $filter_tag_ids);
}
if (isset($my_search['fields']['author']))
else if (isset($my_search['fields']['tags']) and !($display_filters['tags']['access']))
{
unset($my_search['fields']['tags']);
}
if (isset($my_search['fields']['author']) and $display_filters['author']['access'])
{
$filter_clause = get_clause_for_filter('author');
@@ -118,7 +155,12 @@ SELECT
$my_search['fields']['author']['words'] = array_intersect($my_search['fields']['author']['words'], $author_names);
}
if (isset($my_search['fields']['date_posted']))
else if (isset($my_search['fields']['author']) and !($display_filters['author']['access']))
{
unset($my_search['fields']['author']);
}
if (isset($my_search['fields']['date_posted']) and $display_filters['post_date']['access'])
{
$filter_clause = get_clause_for_filter('date_posted');
$cache_key = $persistent_cache->make_key('filter_date_posted'.$user['id'].$user['cache_update_time']);
@@ -220,7 +262,12 @@ SELECT
$template->assign('DATE_POSTED', $counters);
}
if (isset($my_search['fields']['date_created']))
else if (isset($my_search['fields']['date_posted']) and !($display_filters['post_date']['access']))
{
unset($my_search['fields']['date_posted']);
}
if (isset($my_search['fields']['date_created']) and $display_filters['creation_date']['access'])
{
$filter_clause = get_clause_for_filter('date_created');
$cache_key = $persistent_cache->make_key('filter_date_created'.$user['id'].$user['cache_update_time']);
@@ -324,8 +371,12 @@ SELECT
$template->assign('DATE_CREATED', $counters);
}
else if (isset($my_search['fields']['date_created']) and !($display_filters['creation_date']['access']))
{
unset($my_search['fields']['date_created']);
}
if (isset($my_search['fields']['added_by']))
if (isset($my_search['fields']['added_by']) and $display_filters['added_by']['access'])
{
$filter_clause = get_clause_for_filter('added_by');
@@ -388,11 +439,18 @@ SELECT
$my_search['fields']['added_by'] = array_intersect($my_search['fields']['added_by'], $user_ids);
}
if (isset($my_search['fields']['cat']) and !empty($my_search['fields']['cat']['words']))
else if (isset($my_search['fields']['added_by']) and !($display_filters['added_by']['access']))
{
$fullname_of = array();
unset($my_search['fields']['added_by']);
}
$query = '
if (isset($my_search['fields']['cat']) and $display_filters['album']['access'])
{
if (!empty($my_search['fields']['cat']['words']))
{
$fullname_of = array();
$query = '
SELECT
id,
uppercats
@@ -400,26 +458,32 @@ SELECT
INNER JOIN '.USER_CACHE_CATEGORIES_TABLE.' ON id = cat_id AND user_id = '.$user['id'].'
WHERE id IN ('.implode(',', $my_search['fields']['cat']['words']).')
;';
$result = pwg_query($query);
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
$cat_display_name = get_cat_display_name_cache(
$row['uppercats'],
'admin.php?page=album-' // TODO not sure it's relevant to link to admin pages
);
$row['fullname'] = strip_tags($cat_display_name);
while ($row = pwg_db_fetch_assoc($result))
{
$cat_display_name = get_cat_display_name_cache(
$row['uppercats'],
'admin.php?page=album-' // TODO not sure it's relevant to link to admin pages
);
$row['fullname'] = strip_tags($cat_display_name);
$fullname_of[$row['id']] = $row['fullname'];
$fullname_of[$row['id']] = $row['fullname'];
}
$template->assign('fullname_of', json_encode($fullname_of));
// in case the search has forbidden albums for current user, we need to filter the search rule
$my_search['fields']['cat']['words'] = array_intersect($my_search['fields']['cat']['words'], array_keys($fullname_of));
}
$template->assign('fullname_of', json_encode($fullname_of));
// in case the search has forbidden albums for current user, we need to filter the search rule
$my_search['fields']['cat']['words'] = array_intersect($my_search['fields']['cat']['words'], array_keys($fullname_of));
}
if (isset($my_search['fields']['filetypes']))
else if (isset($my_search['fields']['cat']) and !($display_filters['album']['access']))
{
unset($my_search['fields']['cat']);
}
if (isset($my_search['fields']['filetypes']) and $display_filters['file_type']['access'])
{
$filter_clause = get_clause_for_filter('filetypes');
@@ -469,12 +533,17 @@ SELECT
}
}
else if (isset($my_search['fields']['filetypes']) and !($display_filters['file_type']['access']))
{
unset($my_search['fields']['filetypes']);
}
// For rating
if ($conf['rate'])
{
$template->assign('SHOW_FILTER_RATINGS', true);
if (isset($my_search['fields']['ratings']))
if (isset($my_search['fields']['ratings']) and $display_filters['rating']['access'])
{
$filter_clause = get_clause_for_filter('ratings');
@@ -529,14 +598,22 @@ SELECT
}
$template->assign('RATING', $ratings);
}
else if (isset($my_search['fields']['ratings']) and !($display_filters['rating']['access']))
{
unset($my_search['fields']['ratings']);
}
}
else
{
$template->assign('SHOW_FILTER_RATINGS', false);
if (isset($my_search['fields']['ratings']))
{
unset($my_search['fields']['ratings']);
}
}
// For filesize
if (isset($my_search['fields']['filesize_min']) && isset($my_search['fields']['filesize_max']))
if (isset($my_search['fields']['filesize_min']) && isset($my_search['fields']['filesize_max']) and $display_filters['file_size']['access'])
{
$filter_clause = get_clause_for_filter('filesize');
@@ -582,8 +659,14 @@ SELECT
$template->assign('FILESIZE', $filesize );
}
else if (isset($my_search['fields']['filesize_min']) && isset($my_search['fields']['filesize_max']) and !($display_filters['file_size']['access']))
{
unset($my_search['fields']['filesize_min']);
unset($my_search['fields']['filesize_max']);
}
if (isset($my_search['fields']['ratios']))
if (isset($my_search['fields']['ratios']) and $display_filters['ratio']['access'])
{
$filter_clause = get_clause_for_filter('ratios');
@@ -648,11 +731,15 @@ SELECT
$persistent_cache->set($cache_key, $ratios);
}
}
$template->assign('RATIOS', $ratios);
}
if (isset($my_search['fields']['height_min']) and isset($my_search['fields']['height_max']))
else if (isset($my_search['fields']['ratios']) and !($display_filters['ratio']['access']))
{
unset($my_search['fields']['ratios']);
}
if (isset($my_search['fields']['height_min']) and isset($my_search['fields']['height_max']) and $display_filters['height']['access'])
{
$filter_clause = get_clause_for_filter('height');
@@ -699,7 +786,13 @@ SELECT
$template->assign('HEIGHT', $height);
}
if (isset($my_search['fields']['width_min']) and isset($my_search['fields']['width_max']))
else if (isset($my_search['fields']['height_min']) && isset($my_search['fields']['height_max']) and !($display_filters['height']['access']))
{
unset($my_search['fields']['height_min']);
unset($my_search['fields']['height_max']);
}
if (isset($my_search['fields']['width_min']) and isset($my_search['fields']['width_max']) and $display_filters['width']['access'])
{
$filter_clause = get_clause_for_filter('width');
@@ -746,6 +839,12 @@ SELECT
$template->assign('WIDTH', $width);
}
else if (isset($my_search['fields']['width_min']) && isset($my_search['fields']['width_max']) and !($display_filters['width']['access']))
{
unset($my_search['fields']['width_min']);
unset($my_search['fields']['width_max']);
}
$template->assign(
array(
'GP' => json_encode($my_search),
+1
View File
@@ -80,3 +80,4 @@ INSERT INTO piwigo_config (param,value) VALUES ('index_search_in_set_action','tr
INSERT INTO piwigo_config (param,value) VALUES ('upload_detect_duplicate','true');
INSERT INTO piwigo_config (param,value) VALUES ('webmaster_id','1');
INSERT INTO piwigo_config (param,value) VALUES ('use_standard_pages','true');
INSERT INTO piwigo_config (param,value,comment) VALUES ('filters_views','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 displays configuration');
+24
View File
@@ -0,0 +1,24 @@
<?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 config parameters to the gallery filters';
// Add line of conf to help with the display of filters and default filters in the gallery
conf_update_param(
'filters_views',
'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;}'
);
echo "\n".$upgrade_description."\n";
?>
+61 -4
View File
@@ -28,9 +28,49 @@ $search = array(
);
// list of filters in user preferences
// allwords, cat, tags, author, added_by, filetypes, date_posted
$default_fields = array('allwords', 'cat', 'tags', 'author');
if (is_a_guest() or is_generic())
// allwords, cat, tags, author, added_by, filetypes, date_posted, date_created, ratios, ratings (if rating is allowed in this Piwigo), height, width
//import the conf for the filters
if (isset($conf['filters_views']))
{
$filters_conf = unserialize($conf['filters_views']);
}
else
{
$filters_conf = 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;}');
}
//change the name of the keys so that they can be used with this part of the program
$filters_conf = array_combine
(
array('allwords',
'tags',
'date_posted',
'date_created',
'cat',
'author',
'added_by',
'filetypes',
'ratios',
'ratings',
'filesize',
'height',
'width',
'last_filters_conf'
),
$filters_conf
);
//get all default filters
$default_fields = array();
foreach($filters_conf as $filt_name => $filt_conf){
if(isset($filt_conf['default'])){
if($filt_conf['default'] == true){
$default_fields[] = $filt_name;
}
}
}
if (is_a_guest() or is_generic() or $filters_conf['last_filters_conf']==false)
{
$fields = $default_fields;
}
@@ -131,7 +171,7 @@ SELECT
}
}
foreach (array('added_by', 'filetypes', 'date_posted') as $field)
foreach (array('added_by', 'filetypes', 'ratios', 'ratings') as $field)
{
if (in_array($field, $fields))
{
@@ -139,6 +179,23 @@ foreach (array('added_by', 'filetypes', 'date_posted') as $field)
}
}
foreach (array('date_posted', 'date_created') as $field){
if (in_array($field, $fields))
{
$search['fields'][$field] = array(
'preset' => ''
);
}
}
foreach (array('filesize_min', 'filesize_max', 'width_min', 'width_max', 'height_min', 'height_max') as $field)
{
if (in_array($field, $fields))
{
$search['fields'][$field] = '';
}
}
list($search_uuid, $search_url) = save_search($search);
redirect($search_url);
?>
+15 -12
View File
@@ -33,6 +33,8 @@ $(document).ready(function () {
PS_params.search_id = search_id;
empty_filters_list = [];
filters_to_remove = [];
// Setup word filter
if (global_params.fields.allwords) {
$(".filter-word").css("display", "flex");
@@ -76,6 +78,7 @@ $(document).ready(function () {
empty_filters_list.push(PS_params.allwords);
}
//Hide filter spinner
$(".filter-spinner").hide();
@@ -87,7 +90,7 @@ $(document).ready(function () {
items: global_params.fields.tags ? global_params.fields.tags.words : null,
});
});
if (global_params.fields.tags) {
$(".filter-tag").css("display", "flex");
$(".filter-manager-controller.tags").prop("checked", true);
@@ -569,17 +572,13 @@ $(document).ready(function () {
empty_filters_list.push(PS_params.ratings);
}
else if (!show_filter_ratings)
{
updateFilters('ratings', 'add');
}
// Setup filesize filter
if (global_params.fields.filesize_min != null && global_params.fields.filesize_max != null) {
$(".filter-filesize").css("display", "flex");
$(".filter-manager-controller.filesize").prop("checked", true);
$(".filter.filter-filesize .slider-info").html(sprintf(sliders.filesizes.text,sliders.filesizes.selected.min,sliders.filesizes.selected.max,));
$(".filter.filter-filesize .slider-info").html(sprintf(sliders.filesizes.text,sliders.filesizes.selected.min,sliders.filesizes.selected.max));
$('[data-slider=filesizes]').pwgDoubleSlider(sliders.filesizes);
@@ -594,7 +593,7 @@ $(document).ready(function () {
if( global_params.fields.filesize_min != null && global_params.fields.filesize_max > 0) {
$(".filter-filesize").addClass("filter-filled");
$(".filter.filter-filesize .search-words").html(sprintf(sliders.filesizes.text,sliders.filesizes.selected.min,sliders.filesizes.selected.max,));
$(".filter.filter-filesize .search-words").html(sprintf(sliders.filesizes.text,sliders.filesizes.selected.min,sliders.filesizes.selected.max));
}
else
{
@@ -622,13 +621,13 @@ $(document).ready(function () {
if (global_params.fields.height_min != null && global_params.fields.height_max != null) {
$(".filter-height").css("display", "flex");
$(".filter-manager-controller.height").prop("checked", true);
$(".filter.filter-height .slider-info").html(sprintf(sliders.heights.text,sliders.heights.selected.min,sliders.heights.selected.max,));
$(".filter.filter-height .slider-info").html(sprintf(sliders.heights.text,sliders.heights.selected.min,sliders.heights.selected.max));
$('[data-slider=heights]').pwgDoubleSlider(sliders.heights);
if( global_params.fields.height_min > 0 && global_params.fields.height_max > 0) {
$(".filter-height").addClass("filter-filled");
$(".filter.filter-height .search-words").html(sprintf(sliders.heights.text,sliders.heights.selected.min,sliders.heights.selected.max,));
$(".filter.filter-height .search-words").html(sprintf(sliders.heights.text,sliders.heights.selected.min,sliders.heights.selected.max));
}
else
{
@@ -656,13 +655,13 @@ $(document).ready(function () {
if (global_params.fields.width_min != null && global_params.fields.width_max != null) {
$(".filter-width").css("display", "flex");
$(".filter-manager-controller.width").prop("checked", true);
$(".filter.filter-width .slider-info").html(sprintf(sliders.widths.text,sliders.widths.selected.min,sliders.widths.selected.max,));
$(".filter.filter-width .slider-info").html(sprintf(sliders.widths.text,sliders.widths.selected.min,sliders.widths.selected.max));
$('[data-slider=widths]').pwgDoubleSlider(sliders.widths);
if( global_params.fields.width_min > 0 && global_params.fields.width_max > 0) {
$(".filter-width").addClass("filter-filled");
$(".filter.filter-width .search-words").html(sprintf(sliders.widths.text,sliders.widths.selected.min,sliders.widths.selected.max,));
$(".filter.filter-width .search-words").html(sprintf(sliders.widths.text,sliders.widths.selected.min,sliders.widths.selected.max));
}
else
{
@@ -686,6 +685,10 @@ $(document).ready(function () {
empty_filters_list.push(PS_params.width_max);
}
if(filters_to_remove.length > 0){
filters_to_remove = [];
performSearch(PS_params, true);
}
// Adapt no result message
if ($(".filter-filled").length === 0) {
@@ -693,7 +696,7 @@ $(document).ready(function () {
$(".mcs-no-result .text .bot").html(str_empty_search_bot_alt);
}
if (!empty_filters_list.every(param => param === "" || param === null)) {
if (!empty_filters_list.every(param => param === "" || param === null || (typeof param == 'undefined'))) {
$(".clear-all").addClass("clickable");
$(".clear-all.clickable").on('click', function () {
exclude_params = ['search_id', 'allwords_mode', 'allwords_fields', 'tags_mode', 'categories_withsubs'];
@@ -23,6 +23,14 @@ fullname_of_cat = {$fullname_of};
search_id = '{$SEARCH_ID}';
{/if}
{if is_admin()}
user_rank = "admin";
{elseif is_classic_user()}
user_rank = "user";
{else}
user_rank = "none";
{/if}
str_word_widget_label = "{'Search for words'|@translate|escape:javascript}";
str_tags_widget_label = "{'Tag'|@translate|escape:javascript}";
str_album_widget_label = "{'Album'|@translate|escape:javascript}";
@@ -101,60 +109,86 @@ const prefix_icon = 'gallery-icon-';
<div class="mcs-popin-title">{'Choose filters'|@translate}</div>
<div class="filter-manager-controller-container">
{if $display_filter.words.access == 'everybody' or ($display_filter.words.access == 'admins-only' and is_admin()) or ($display_filter.words.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='word' class="filter-manager-controller word" type="checkbox"/>
<span class="mcs-icon gallery-icon-search">{'Search for words'|@translate}</span>
</label>
{/if}
{if $display_filter.tags.access == 'everybody' or ($display_filter.tags.access == 'admins-only' and is_admin()) or ($display_filter.tags.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='tag' class="filter-manager-controller tags" type="checkbox"/>
<span class="mcs-icon gallery-icon-tag">{'Tag'|@translate}</span>
</label>
{/if}
{if $display_filter.post_date.access == 'everybody' or ($display_filter.post_date.access == 'admins-only' and is_admin()) or ($display_filter.post_date.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='date_posted' class="filter-manager-controller date_posted" type="checkbox"/>
<span class="mcs-icon gallery-icon-calendar-plus">{'Post date'|@translate}</span>
</label>
{/if}
{if $display_filter.creation_date.access == 'everybody' or ($display_filter.creation_date.access == 'admins-only' and is_admin()) or ($display_filter.creation_date.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='date_created' class="filter-manager-controller date_created" type="checkbox"/>
<span class="mcs-icon gallery-icon-calendar">{'Creation date'|@translate}</span>
</label>
{/if}
{if $display_filter.album.access == 'everybody' or ($display_filter.album.access == 'admins-only' and is_admin()) or ($display_filter.album.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='album' class="filter-manager-controller album" type="checkbox"/>
<span class="mcs-icon gallery-icon-album">{'Album'|@translate}</span>
</label>
{/if}
{if $display_filter.author.access == 'everybody' or ($display_filter.author.access == 'admins-only' and is_admin()) or ($display_filter.author.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='authors' class="filter-manager-controller author" type="checkbox"/>
<span class="mcs-icon gallery-icon-user-edit">{'Author'|@translate}</span>
</label>
{/if}
{if $display_filter.added_by.access == 'everybody' or ($display_filter.added_by.access == 'admins-only' and is_admin()) or ($display_filter.added_by.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='added_by' class="filter-manager-controller added_by" type="checkbox"/>
<span class="mcs-icon gallery-icon-user">{'Added by'|@translate}</span>
</label>
{/if}
{if $display_filter.file_type.access == 'everybody' or ($display_filter.file_type.access == 'admins-only' and is_admin()) or ($display_filter.file_type.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='filetypes' class="filter-manager-controller filetypes" type="checkbox"/>
<span class="mcs-icon gallery-icon-file-image">{'File type'|@translate}</span>
</label>
{/if}
{if $display_filter.ratio.access == 'everybody' or ($display_filter.ratio.access == 'admins-only' and is_admin()) or ($display_filter.ratio.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='ratios' class="filter-manager-controller ratios" type="checkbox"/>
<span class="mcs-icon gallery-icon-crop">{'Ratio'|@translate}</span>
</label>
{/if}
{if $SHOW_FILTER_RATINGS and isset($SHOW_FILTER_RATINGS)}
{if $display_filter.rating.access == 'everybody' or ($display_filter.rating.access == 'admins-only' and is_admin()) or ($display_filter.rating.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='ratings' class="filter-manager-controller ratings" type="checkbox"/>
<span class="mcs-icon gallery-icon-star-1">{'Rating'|@translate}</span>
</label>
{/if}
{/if}
{if $display_filter.file_size.access == 'everybody' or ($display_filter.file_size.access == 'admins-only' and is_admin()) or ($display_filter.file_size.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='filesize' class="filter-manager-controller filesize" type="checkbox"/>
<span class="mcs-icon gallery-icon-hdd">{'Filesize'|@translate}</span>
</label>
{/if}
{if $display_filter.height.access == 'everybody' or ($display_filter.height.access == 'admins-only' and is_admin()) or ($display_filter.height.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='height' class="filter-manager-controller height" type="checkbox"/>
<span class="mcs-icon gallery-icon-height">{'Height'|@translate}</span>
</label>
{/if}
{if $display_filter.width.access == 'everybody' or ($display_filter.width.access == 'admins-only' and is_admin()) or ($display_filter.width.access == 'registered-users' and is_classic_user())}
<label>
<input data-wid='width' class="filter-manager-controller width" type="checkbox"/>
<span class="mcs-icon gallery-icon-width">{'Width'|@translate}</span>
</label>
{/if}
</div>
<div class="filter-manager-actions">