Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ps_facetedsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ public function renderAdminMain()
'filter_by_default_category' => (bool) Configuration::get('PS_LAYERED_FILTER_BY_DEFAULT_CATEGORY'),
'use_jquery_ui_slider' => (bool) Configuration::get('PS_USE_JQUERY_UI_SLIDER'),
'default_category_template' => Configuration::get('PS_LAYERED_DEFAULT_CATEGORY_TEMPLATE'),
'add_new_filters_template_link' => $this->context->link->getAdminLink('AdminModules', true, [], ['configure' => 'ps_facetedsearch', 'add_new_filters_template' => 1]),
]);

return $this->display(__FILE__, 'views/templates/admin/manage.tpl');
Expand Down Expand Up @@ -975,6 +976,18 @@ private function getExistingFiltersOverview()
} else {
$filters_templates[$k]['date_add'] = Tools::displayDate($v['date_add'], null, true);
}

$filters_templates[$k]['edit_link'] = $this->context->link->getAdminLink('AdminModules', true, [], [
'configure' => 'ps_facetedsearch',
'edit_filters_template' => 1,
'id_layered_filter' => (int) $v['id_layered_filter'],
]);

$filters_templates[$k]['remove_link'] = $this->context->link->getAdminLink('AdminModules', true, [], [
'configure' => 'ps_facetedsearch',
'deleteFilterTemplate' => 1,
'id_layered_filter' => (int) $v['id_layered_filter'],
]);
}

return $filters_templates;
Expand Down
12 changes: 8 additions & 4 deletions views/templates/admin/manage.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,18 @@
{if empty($limit_warning)}
<div class="btn-group-action">
<div class="btn-group pull-right">
<a href="{$current_url}&amp;edit_filters_template=1&amp;id_layered_filter={(int)$template['id_layered_filter']}" class="btn btn-default">
<a class="btn btn-default" href="{$template.edit_link|escape:'htmlall':'UTF-8'}">
<i class="icon-pencil"></i> {l s='Edit' d='Admin.Actions'}
</a>
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>&nbsp;
</button>
<ul class="dropdown-menu">
<li>
<a href="{$current_url}&amp;deleteFilterTemplate=1&amp;id_layered_filter={(int)$template['id_layered_filter']}"
onclick="return confirm('{l s='Do you really want to delete this filter template?' d='Modules.Facetedsearch.Admin'}');">
<a
href="{$template.remove_link|escape:'htmlall':'UTF-8'}"
onclick="return confirm('{l s='Do you really want to delete this filter template?' d='Modules.Facetedsearch.Admin'}');"
>
<i class="icon-trash"></i> {l s='Delete' d='Admin.Actions'}
</a>
</li>
Expand All @@ -104,7 +106,9 @@
{/if}
{if empty($limit_warning)}
<div class="panel-footer">
<a class="btn btn-default pull-right" href="{$current_url}&amp;add_new_filters_template=1"><i class="process-icon-plus"></i> {l s='Add new template' d='Modules.Facetedsearch.Admin'}</a>
<a class="btn btn-default pull-right" href="{$add_new_filters_template_link|escape:'htmlall':'UTF-8'}">
<i class="process-icon-plus"></i> {l s='Add new template' d='Modules.Facetedsearch.Admin'}
</a>
</div>
{/if}
</div>
Expand Down
Loading