first commit

This commit is contained in:
2025-01-06 20:47:25 +01:00
commit 3bdbd78c2f
25591 changed files with 3586440 additions and 0 deletions

View File

@@ -0,0 +1,148 @@
{$css_js_assets|as4_nofilter}
<div id="pm_backoffice_wrapper" class="pm_bo_ps_{$ps_major_version|escape:'htmlall':'UTF-8'} pm_bo_ps_{$ps_version_full|escape:'htmlall':'UTF-8'}">
{module->_displayTitle text="{$module_display_name}"}
{if !$permissions_errors|sizeof}
{if $module_is_up_to_date}
{if $context_is_shop}
{if $block_layered_is_active}
{module->_showWarning text="
{l s='"%s" is not compatible with Advanced Search 4.' sprintf=$block_layered_display_name mod='pm_advancedsearch4'}<br />
{l s='You must disable it to prevent unexpected behaviour on your shop.' mod='pm_advancedsearch4'}
"}
{/if}
{$rating_invite|as4_nofilter}
{$parent_content|as4_nofilter}
{if $cache_alert}
{module->_showWarning text="
{l s='Cache is currently disabled. We really recommend you to enable it when you are in production mode.' mod='pm_advancedsearch4'}<br /><br />
<a class=\"button\" href=\"#moduleCache_on\">
{l s='Enable it' mod='pm_advancedsearch4'}
</a>
"}
{/if}
{as4_button text={l s='Add a new search engine' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_load_function=displaySearchForm&class=AdvancedSearchClass&pm_js_callback=closeDialogIframe" class='open_on_dialog_iframe' rel='980_530_1' icon_class='ui-icon ui-icon-plusthick'}
<br />
<br />
<div id="wrapAsTab">
<ul id="asTab">
{foreach from=$search_engines item=search_engine}
<li id="TabSearchAdminPanel{$search_engine.id_search|intval}">
<a href="{$base_config_url|as4_nofilter}&pm_load_function=displaySearchAdminPanel&id_search={$search_engine.id_search|intval}">
<span>{$search_engine.id_search|intval} - {$search_engine.internal_name|escape:'htmlall':'UTF-8'}</span>
</a>
</li>
{/foreach}
</ul>
</div>
<br />
<div id="msgNoResults" style="{if $search_engines|is_array && $search_engines|sizeof}display:none{/if}">
{module->_showWarning text="{l s='You do not have added a search engine yet. Please click on the click “Add a new search engine“ in order to start.' mod='pm_advancedsearch4'}"}
<br />
</div>
<div id="wrapConfigTab">
<ul id="configTab">
<li>
<a href="#config-1">
<span><img src="{$module_path|as4_nofilter}views/img/cog.gif" /> {l s='General settings' mod='pm_advancedsearch4'}</span>
</a>
</li>
<li>
<a href="#config-2">
<span><img src="{$module_path|as4_nofilter}views/img/document-code.png" /> {l s='Advanced styles (CSS)' mod='pm_advancedsearch4'}</span>
</a>
</li>
<li>
<a href="#config-3">
<span><img src="{$module_path|as4_nofilter}views/img/clock.png" /> {l s='Scheduled Task' mod='pm_advancedsearch4'}</span>
</a>
</li>
<li>
<a href="#config-4">
<span><img src="{$module_path|as4_nofilter}views/img/drill.png" /> {l s='Maintenance' mod='pm_advancedsearch4'}</span>
</a>
</li>
</ul>
<div id="config-1">
{$configuration_tab|as4_nofilter}
</div>
<div id="config-2">
{$advanced_styles_tab|as4_nofilter}
</div>
<div id="config-3">
{$cron_tab|as4_nofilter}
</div>
<div id="config-4">
{$maintenance_tab|as4_nofilter}
</div>
</div>
<script type="text/javascript">
var editTranlate = {{l s='Configure' mod='pm_advancedsearch4'}|json_encode};
var deleteTranlate = {{l s='Delete' mod='pm_advancedsearch4'}|json_encode};
var alertDeleteCriterionGroup = {{l s='Do you really want to delete this criterion group from your search engine ?' mod='pm_advancedsearch4'}|json_encode};
var reindexationInprogressMsg = {{l s='Another reindexing is in progress. Please wait.' mod='pm_advancedsearch4'}|json_encode};
var reindexingCriteriaMsg = {{l s='Reindexing group' mod='pm_advancedsearch4'}|json_encode};
var reindexingCriteriaOfMsg = "/";
{literal}
$(document).ready(function() {
// Initialise the second table specifying a dragClass and an onDrop function that will display an alert
$("#wrapConfigTab").tabs({cache:false});
$("#wrapAsTab").tabs({cache:false}).find(".ui-tabs-nav").sortable({
axis: "x",
update: function(event, ui) {
var order = $(this).sortable("toArray");
saveOrder(order.join(","), "orderSearchEngine");
},
stop: function() {
$("#wrapAsTab").tabs("refresh");
}
});
});
{/literal}
</script>
{else}
{module->_showWarning text="{l s='You must select a specific shop in order to continue, you can\'t create/edit a search engine from the “all shop“ or “group shop“ context.' mod='pm_advancedsearch4'}"}
{/if}
{else}
{if $from_version_4_9}
{* 4.10 releases updates *}
{module->_showWarning text="
{l s='You have an old version of the module, this new version has a new approach for multishop features.' mod='pm_advancedsearch4'}<br /><br />
{l s='Because of a lot of constraints, you will not be able to associate one search engine to multiple shops anymore.' mod='pm_advancedsearch4'}<br /><br />
{l s='If it is your case at this time, we will only associate your search engine to one shop (from all the shops it was currently associated).' mod='pm_advancedsearch4'}<br /><br />
{l s='We really recommand you to re-index all the search engines after this update. Thank you for your comprehension.' mod='pm_advancedsearch4'}
"}
{elseif $from_version_4_10}
{* 4.11 releases updates *}
{module->_showWarning text="
{l s='We really recommand you to re-index all the search engines after this update.' mod='pm_advancedsearch4'}<br /><br />
{l s='Also, please backup every database table related to this module before updating (<your prefix>_pm_advancedsearch*).' mod='pm_advancedsearch4'}
"}
{/if}
{module->_showWarning text="
{l s='We have detected that you installed a new version of the module on your shop' mod='pm_advancedsearch4'}<br /><br />
<center>
<a href=\"{$base_config_url|as4_nofilter}&makeUpdate=1\" class=\"button\">
{l s='Please click here in order to finish the installation process' mod='pm_advancedsearch4'}
</a>
</center>
"}
{/if}
{else}
{module->_showWarning text="
{l s='Before being able to configure the module, make sure to set write permissions to files and folders listed below:' mod='pm_advancedsearch4'}<br /><br />
{$permissions_errors|implode:'<br />'|as4_nofilter}
"}
{/if}
{module->_displaySupport}
</div>

View File

@@ -0,0 +1,145 @@
{if $pm_load_function != 'displaySortCriteriaPanel'}
<div id="sortCriteriaPanel">
{/if}
{include file="../../core/clear.tpl"}
{if $auto_sync_active_status}
{module->_showInfo text="{l s='Be aware that auto synchronize object status with criterions is enabled into the module configuration. You will not be able to change the criterions status here.' mod='pm_advancedsearch4'}"}
{/if}
<div class="criterionGroupActions">
<ul>
<li>
<a href="{$base_config_url|as4_nofilter}&pm_load_function=processEnableAllCriterions&id_criterion_group={$criterion_group->id|intval}&id_search={$criterion_group->id_search|intval}" class="ajax_script_load activeAllCriterions{if $auto_sync_active_status} disabledAction{/if}" title="{l s='Enable all criterions' mod='pm_advancedsearch4'}">{l s='Enable all criterions' mod='pm_advancedsearch4'}</a>
</li>
<li>
<a href="{$base_config_url|as4_nofilter}&pm_load_function=processDisableAllCriterions&id_criterion_group={$criterion_group->id|intval}&id_search={$criterion_group->id_search|intval}" class="ajax_script_load disableAllCriterions{if $auto_sync_active_status} disabledAction{/if}" title="{l s='Disable all criterions' mod='pm_advancedsearch4'}">{l s='Disable all criterions' mod='pm_advancedsearch4'}</a>
</li>
</ul>
</div>
{include file="../../core/clear.tpl"}
<table class="criterionsList">
<thead>
<th colspan="2">{l s='Label' mod='pm_advancedsearch4'}</th>
{if $criterion_group->display_type == 2}
<th>{l s='Image' mod='pm_advancedsearch4'}</th>
{/if}
{if $has_custom_criterions}
<th>{l s='Link to a custom criterion' mod='pm_advancedsearch4'}</th>
{/if}
<th>{l s='Actions' mod='pm_advancedsearch4'}</th>
</thead>
<tbody>
{foreach from=$criterions item=criterion}
<tr id="criterion_{$criterion.id_criterion|intval}">
<td{if $criterion_group->sort_by == 'position'} class="dragIcon dragIconCriterion"{/if}>
<span class="ui-icon ui-icon-arrow-4-diag" style="{if $criterion_group->sort_by != 'position'}visibility:hidden{/if}"></span>
</td>
<td>
{if empty($criterion.is_custom)}
{$criterion.value|escape:'htmlall':'UTF-8'}
{if $criterion_group->criterion_group_type == 'category'}
{strip}
(
{if $criterion.level_depth > 0}
{l s='parent:' mod='pm_advancedsearch4'} {$criterion.parent_name|escape:'htmlall':'UTF-8'}
{/if}
{if $criterion.level_depth > 0 && $criterion_group->id_criterion_group_linked == 0} - {/if}
{if $criterion_group->id_criterion_group_linked == 0}
{l s='level:' mod='pm_advancedsearch4'} {if $criterion.level_depth > 0}{($criterion.level_depth|intval - 1)}{else}{$criterion.level_depth|intval}{/if}
{/if}
)
{/strip}
{/if}
{else}
<div class="criterionCustomLiveEditContainer" data-id-criterion="{$criterion.id_criterion|intval}" data-id-search="{$criterion_group->id_search|intval}">
{if $is_color_group}
<div class="criterionCustomLiveField">
{as4_inputColor obj=$criterion.obj key='color' label={l s='Color:' mod='pm_advancedsearch4'}}
</div>
{/if}
<div class="criterionCustomLiveField">
{as4_inputTextLang obj=$criterion.obj key='value'}
</div>
{module->_displaySubmit text="{l s='Save' mod='pm_advancedsearch4'}" name='submitCustomCriterionForm'}
</div>
{/if}
</td>
{if $criterion_group->display_type == 2}
<td class="criterionImageTd">
<div class="criterionImageContainer">
<form action="{$base_config_url|as4_nofilter}" method="post" enctype="multipart/form-data" target="dialogIframePostForm">
{as4_inlineUploadFile obj=$criterion.obj key="icon{$criterion.id_criterion|intval}" key_db='icon' destination='/search_files/criterions/'}
<input name="id_search" value="{$criterion_group->id_search|intval}" type="hidden" />
<input name="id_criterion" value="{$criterion.id_criterion|intval}" type="hidden" />
<input name="key_criterions_group" value="{$criterion_group->criterion_group_type|escape:'htmlall':'UTF-8'}-{$criterion_group->id_criterion_group_linked|intval}-{$criterion_group->id_search|intval}" type="hidden" />
</form>
</div>
</td>
{/if}
{if $has_custom_criterions}
<td class="criterionCustomTd">
{if empty($criterion.is_custom)}
{if $criterion.custom_criterions_list|is_array && sizeof($criterion.custom_criterions_list) > 1}
<div class="addCriterionToCustomGroupContainer">
{as4_select obj=$criterion.custom_criterions_obj options=$criterion.custom_criterions_list key="custom_group_link_id_{$criterion.id_criterion|intval}" defaultvalue=false onchange="processAddCustomCriterionToGroup($(this), {$criterion_group->id_search|intval}, {$criterion_group->id|intval})"}
</div>
{/if}
{/if}
</td>
{/if}
<td>
{if !empty($criterion.is_custom)}
<div class="criterionActions">
{strip}
<a href="{$base_config_url|as4_nofilter}&pm_load_function=processActiveCriterion&id_criterion={$criterion.id_criterion|intval}&id_search={$criterion_group->id_search|intval}" class="ajax_script_load {if !$auto_sync_active_status}activeCriterion{else} disabledAction{/if}">
<img src="../img/admin/{if $criterion.visible}enabled{else}disabled{/if}.gif" id="imgActiveCriterion{$criterion.id_criterion|intval}" />
</a>
&nbsp;
<a href="{$base_config_url|as4_nofilter}&pm_load_function=processDeleteCustomCriterion&id_criterion={$criterion.id_criterion|intval}&id_search={$criterion_group->id_search|intval}" class="ajax_script_load pm_confirm deleteCustomCriterion" title="{l s='Do you really want to delete this custom criterion ?' mod='pm_advancedsearch4'}">
<img src="../img/admin/delete.gif" id="imgDeleteCriterion{$criterion.id_criterion|intval}" class="imgDeleteCriterion" />
</a>
{/strip}
</div>
{elseif empty($criterion.is_custom)}
<div class="criterionActions">
<a href="{$base_config_url|as4_nofilter}&pm_load_function=processActiveCriterion&id_criterion={$criterion.id_criterion|intval}&id_search={$criterion_group->id_search|intval}" class="ajax_script_load {if !$auto_sync_active_status}activeCriterion{else} disabledAction{/if}">
<img src="../img/admin/{if $criterion.visible}enabled{else}disabled{/if}.gif" id="imgActiveCriterion{$criterion.id_criterion|intval}" />
</a>
</div>
{else}
<div class="criterionActions">
<a href="{$base_config_url|as4_nofilter}&pm_load_function=processActiveCriterion&id_criterion={$criterion.id_criterion|intval}&id_search={$criterion_group->id_search|intval}" class="ajax_script_load {if !$auto_sync_active_status}activeCriterion{else} disabledAction{/if}">
<img src="../img/admin/{if $criterion.visible}enabled{else}disabled{/if}.gif" id="imgActiveCriterion{$criterion.id_criterion|intval}" />
</a>
</div>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
{if $criterion_group->sort_by == 'position'}
<script type="text/javascript">
$("table.criterionsList tbody").sortable({
axis: 'y',
handle : '.dragIconCriterion',
helper: function(e, ui) {
ui.children().each(function() {
$(this).width($(this).outerWidth(true));
});
return ui;
},
update: function(event, ui) {
var order = $(this).sortable('toArray');
saveOrder(order.join(","), 'orderCriterion', {$criterion_group->id_search|intval});
}
});
</script>
{/if}
{if $pm_load_function != 'displaySortCriteriaPanel'}
</div>
{/if}

View File

@@ -0,0 +1,8 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,139 @@
{as4_startForm id="criteriaGroupOptions_{$params.obj->id}" obj=$params.obj params=$params}
{module->_displayTitle text="{l s='Criterion group settings' mod='pm_advancedsearch4'}"}
{if $params.obj->criterion_group_type == 'category'}
{if !empty($params.obj->id_criterion_group_linked)}
{module->_displaySubTitle text="{l s='Type:' mod='pm_advancedsearch4'} {l s='Category (level %d)' sprintf=$params.obj->id_criterion_group_linked mod='pm_advancedsearch4'}"}
{else}
{module->_displaySubTitle text="{l s='Type:' mod='pm_advancedsearch4'} {l s='Category (all level)' mod='pm_advancedsearch4'}"}
{/if}
{else}
{module->_displaySubTitle text="{l s='Type:' mod='pm_advancedsearch4'} {$criteria_group_labels[$params.obj->criterion_group_type]|ucfirst}"}
{/if}
{if $params.obj->criterion_group_type == 'subcategory'}
{module->_showInfo text="
{l s='This criterion group will only be available on categories and products pages.' mod='pm_advancedsearch4'}<br /><br />
{l s='Only subcategories of the base URL (context) will be shown.' mod='pm_advancedsearch4'}
"}
{/if}
{as4_inputTextLang obj=$params.obj key='name' label={l s='Public name' mod='pm_advancedsearch4'}}
{as4_select obj=$params.obj options=$display_type label={l s='Display method' mod='pm_advancedsearch4'} key='display_type' defaultvalue=false onchange="showRelatedOptions($(this), '{$params.obj->criterion_group_type}');"}
{as4_inputFileLang obj=$params.obj key='icon' label={l s='Icon' mod='pm_advancedsearch4'} destination='/search_files/criterions_group/' required=false extend=true tips={l s='You can upload a picture from your hard disk. This picture can be different for each language.' mod='pm_advancedsearch4'}}
{if $params.obj->criterion_group_type == 'category'}
<div class="blc_category_tree_options {if is_array($context_type) && sizeof($context_type) == 1}as4-hidden{/if}">
{as4_select obj=$params.obj options=$context_type label={l s='Starting level' mod='pm_advancedsearch4'} key='context_type' defaultvalue=false}
</div>
<div class="blc_category_options">
{if empty($params.obj->id_criterion_group_linked)}
<input name="show_all_depth" value="{$params.obj->show_all_depth|intval}" type="hidden" />
{*
{as4_inputActive obj=$params.obj key_active='show_all_depth' key_db='show_all_depth' label={l s='Show all depth' mod='pm_advancedsearch4'}}
*}
{else}
{as4_inputActive obj=$params.obj key_active='only_children' key_db='only_children' label={l s='Show only subcategories related to the previously selected criterions' mod='pm_advancedsearch4'}}
{/if}
</div>
{/if}
<div class="all_label" style="display:none">
{as4_inputTextLang obj=$params.obj key='all_label' label={l s='Label for “All“ choice' mod='pm_advancedsearch4'}}
</div>
<div class="blc_range">
{as4_inputActive obj=$params.obj key_active='range' key_db='range' label={l s='Display as range' mod='pm_advancedsearch4'} onclick="displayRangeOptions($(this), '{$params.obj->criterion_group_type}');"}
</div>
<div class="blc_range_nb" style="display:none">
{as4_inputText obj=$params.obj key='range_nb' label={l s='Step' mod='pm_advancedsearch4'} onchange='convertToPointDecimal($(this));'}
</div>
<div class="blc_range_interval" style="display:none">
{as4_inputTextLang obj=$params.obj key='range_interval' label={l s='Range (separated by comma)' mod='pm_advancedsearch4'} placeholder="0,50,100,150,200,500,1000"}
</div>
<div class="blc_range_sign" style="display:none">
{as4_inputTextLang obj=$params.obj key='range_sign' label={l s='Unit' mod='pm_advancedsearch4'}}
</div>
<div class="blc_with_search_area">
{as4_inputActive obj=$params.obj key_active='filter_option' key_db='filter_option' label={l s='Display input text in order to filter values' mod='pm_advancedsearch4'}}
</div>
<div class="multicrit" style="display:none">
{as4_inputActive obj=$params.obj key_active='is_multicriteria' key_db='is_multicriteria' label={l s='Allow multiple choice' mod='pm_advancedsearch4'} onclick="showRelatedOptions($('#display_type'), '{$params.obj->criterion_group_type}');"}
<div class="combined_criterion" style="display:none">
{as4_inputActive obj=$params.obj key_active='is_combined' key_db='is_combined' label={l s='Operator between criterions' mod='pm_advancedsearch4'} on_label={l s='AND' mod='pm_advancedsearch4'} off_label={l s='OR' mod='pm_advancedsearch4'}}
</div>
</div>
{if !$search_engine->id_hook|in_array:$display_vertical_search_block}
{as4_inputText obj=$params.obj key='css_classes' label={l s='CSS classes to apply' mod='pm_advancedsearch4'}}
{/if}
{if $search_engine->show_hide_crit_method == 3}
<div class="overflow_height_container">
{as4_inputText obj=$params.obj key='overflow_height' label={l s='Overflow height (in px)' mod='pm_advancedsearch4'}}
</div>
{/if}
{if $search_engine->show_hide_crit_method == 1 || $search_engine->show_hide_crit_method == 2}
<div class="max_display_container" style="display:none">
{as4_inputText obj=$params.obj key='max_display' label={l s='Maximum number of criteria to display (0 = unlimited)' mod='pm_advancedsearch4'}}
</div>
{/if}
<input name="id_search" value="{$params.obj->id_search|intval}" type="hidden" />
<input name="id_criterion_group" value="{$params.obj->id|intval}" type="hidden" />
{module->_displaySubmit text="{l s='Save' mod='pm_advancedsearch4'}" name='submitCriteriaGroupOptions'}
<script type="text/javascript">
$(document).ready(function () {
$("#range_on:checked").trigger("click");
$("#range_off:checked").trigger("click");
$("#display_type").trigger("change");
loadAjaxLink();
});
</script>
{if $params.obj->criterion_group_type|in_array:$sortable_criterion_group}
<div class="custom_criteria_container">
<hr />
{module->_displayTitle text="{l s='Create a new custom criterion' mod='pm_advancedsearch4'}"}
<div id="addCustomCriterionContainer" data-id-search="{$params.obj->id_search|intval}" data-id-criterion-group="{$params.obj->id|intval}">
{as4_inputTextLang obj=$new_custom_criterion key='value' label={l s='Criterion label:' mod='pm_advancedsearch4'}}
{if $is_color_group}
{as4_inputColor obj=$new_custom_criterion key='color' label={l s='Color:' mod='pm_advancedsearch4'}}
{/if}
<center>
{module->_displaySubmit text="{l s='Add custom criterion' mod='pm_advancedsearch4'}" name='submitAddCustomCriterionForm'}
</center>
</div>
<hr />
</div><!-- .custom_criteria_container -->
<div class="sort_criteria_container">
{module->_displayTitle text="{l s='Sort criteria' mod='pm_advancedsearch4'}"}
<div style="width:380px;float:left;">
<span style="float:left;line-height:25px;">
<b><em>{l s='Apply specific sort order:' mod='pm_advancedsearch4'}</em></b> &nbsp; &nbsp;
</span>
{as4_select obj=$params.obj options=$criterions_sort_by label=false key='sort_by' defaultvalue=0 onchange="reorderCriteria($('#sort_by').val(), $('#sort_way').val(), $('input[name=\'id_criterion_group\']').val(), {$params.obj->id_search|intval});"}
</div>
<div style="width:250px;float:left;">
{as4_select obj=$params.obj options=$criterions_sort_way label=false key='sort_way' defaultvalue=0 onchange="reorderCriteria($('#sort_by').val(), $('#sort_way').val(), $('input[name=\'id_criterion_group\']').val(), {$params.obj->id_search|intval});"}
</div>
{if !empty($criterions_list_rendered)}
{$criterions_list_rendered|as4_nofilter}
{/if}
{include file="../../core/clear.tpl"}
</div>
{/if}
{as4_endForm id="criteriaGroupOptions_{$params.obj->id}"}

View File

@@ -0,0 +1,8 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,8 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,150 @@
{as4_startForm id='searchForm' obj=$params.obj params=$params}
{if !empty($params.obj->id)}
{module->_displayTitle text="{l s='Edit search engine' mod='pm_advancedsearch4'}"}
{else}
{module->_displayTitle text="{l s='Add a new search engine' mod='pm_advancedsearch4'}"}
{/if}
{* General settings *}
{as4_startFieldset title={l s='General settings' mod='pm_advancedsearch4'} hide=false}
{* Type of search *}
{as4_inputText obj=$params.obj key='internal_name' label={l s='Internal title' mod='pm_advancedsearch4'}}
{as4_inputTextLang obj=$params.obj key='title' label={l s='Public title' mod='pm_advancedsearch4'}}
{module->_displaySubTitle text="{l s='Behaviour' mod='pm_advancedsearch4'}"}
{as4_select obj=$params.obj options=$searchType label={l s='Type of search' mod='pm_advancedsearch4'} key='search_type' size='300px' onchange='toggleSearchEngineSettings(true);'}
<input type="hidden" name="step_search" value="{$params.obj->step_search|intval}" />
{* Use context or not *}
{as4_select obj=$params.obj options=$where_to_search label={l s='Where to search ?' mod='pm_advancedsearch4'} key='filter_by_emplacement' size='400px'}
<div class="id_category_root_container">
{as4_select obj=$params.obj options=$category_select label={l s='Starting category for the search (default is user-context category)' mod='pm_advancedsearch4'} key='id_category_root' size='500px'}
</div>
{as4_inputActive obj=$params.obj key_active='recursing_indexing' key_db='recursing_indexing' label={l s='Search through all sub-categories' mod='pm_advancedsearch4'}}
{as4_inputActive obj=$params.obj key_active='search_on_stock' key_db='search_on_stock' label={l s='Only search products that are in stock (with reduced performance)' mod='pm_advancedsearch4'}}
<div class="search_method_options_2"{if $params.obj->search_method != 1} style="display:none"{/if}>
{as4_inputActive obj=$params.obj key_active='redirect_one_product' key_db='redirect_one_product' label={l s='Straight redirect to product if only one result is found' mod='pm_advancedsearch4'} defaultvalue=true}
</div>
{as4_endFieldset}
{* /General settings *}
{* Search block settings *}
{as4_startFieldset title={l s='Search block settings' mod='pm_advancedsearch4'} hide=false}
{* Location *}
{as4_select obj=$params.obj options=$hooksList label={l s='Position' mod='pm_advancedsearch4'} defaultvalue={l s='Do not show' mod='pm_advancedsearch4'} key='id_hook' size='300px' onchange="updateHookOptions($(this), {$hooksId|json_encode});"}
{if $seo_searchs|is_array && $seo_searchs|sizeof}
{module->_showInfo text="
{l s='SEO Pages:' mod='pm_advancedsearch4'}<br />
{l s='Be sure to have the current selected hook/location shown on “module-pm_advancedsearch4-seo“ pages.' mod='pm_advancedsearch4'}<br />
<a href=\"{$theme_layout_preferences_link|escape:'htmlall':'UTF-8'}\" target=\"_blank\">{l s='For left/right column hook, you may check you theme preferences in order to enable the choosen column for this page.' mod='pm_advancedsearch4'}</a><br />
{l s='For any other location, please be sure to include the right code to seo.tpl file when needed.' mod='pm_advancedsearch4'}<br />
"}
{/if}
<div class="hookOptions hookOption-1" style="display:none;">
{if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '>=')}
<input type="hidden" name="smarty_var_name" value="{$params.obj->smarty_var_name|as4_nofilter}" />
<input type="hidden" name="insert_in_center_column" value="{$params.obj->insert_in_center_column|intval}" />
{else}
{as4_inputText obj=$params.obj key='smarty_var_name' label={l s='Smarty var name' mod='pm_advancedsearch4'} defaultvalue="as4_{uniqid()}"}
{as4_inputActive obj=$params.obj key_active='insert_in_center_column' key_db='insert_in_center_column' label={l s='Insert search engine into the center column' mod='pm_advancedsearch4'}}
{/if}
{if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '>=')}
{if Validate::isLoadedObject($params.obj)}
{module->_showInfo text="
<p>{l s='Please insert the following code in your template at the line where you want the search engine to appear:' mod='pm_advancedsearch4'}</p>
<div id=\"custom_content_results\" onclick=\"selectText('smarty_var_name_picker')\" data-no-smarty-var=\"true\">
<pre id=\"smarty_var_name_picker\">{ldelim}widget name=\"pm_advancedsearch4\" id_search_engine=\"{$params.obj->id|intval}\"{rdelim}</pre>
</div>
<p><strong>{l s='Please be sure to have the previous widget code added into views/templates/front/1.7/search-results.tpl if you want to get the search engine shown on search results pages.' mod='pm_advancedsearch4'}</strong></p>
"}
{else}
{module->_showInfo text="{l s='The widget code is provided once the search engine is saved.' mod='pm_advancedsearch4'}"}
{/if}
{else}
{module->_showInfo text="
{l s='Please insert the following code in your template at the line where you want the search engine to appear:' mod='pm_advancedsearch4'}<br />
<div id=\"custom_content_results\" onclick=\"selectText('smarty_var_name_picker')\" data-no-smarty-var=\"false\">
<pre id=\"smarty_var_name_picker\"></pre>
</div>
"}
{/if}
</div>
{if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '>=')}
<div class="hookOptions hookOption-2">
{as4_select obj=$params.obj options=$widgetHooksList label={l s='Hook to use' mod='pm_advancedsearch4'} key='id_hook_widget' size='250px'}
{module->_showWarning text="{l s='This module must be transplanted to the hook you will choose above (you can do this using “Manage hooks“ link)' mod='pm_advancedsearch4'}"}
</div>
{/if}
<div class="hookOptions hookOption-{'displaytop'|array_search:$hooksId|intval} hookOption-{'displayhome'|array_search:$hooksId|intval}{if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '>=')} hookOption-{'displaynavfullwidth'|array_search:$hooksId|intval}{/if} hookOption-1 hookOption-2" style="display:none;">
{as4_inputText obj=$params.obj key='css_classes' label={l s='CSS classes to apply' mod='pm_advancedsearch4'}}
</div>
{* /Location *}
{as4_select obj=$params.obj options=$options_search_method label={l s='Search submission method' mod='pm_advancedsearch4'} key='search_method' onchange='display_search_method_options();' size='250px'}
{as4_inputActive obj=$params.obj key_active='display_nb_result_on_blc' key_db='display_nb_result_on_blc' label={l s='Display number of products found on search block' mod='pm_advancedsearch4'}}
{as4_inputActive obj=$params.obj key_active='remind_selection_block' key_db='remind_selection_block' label={l s='Display a reminder of the selected criterions' mod='pm_advancedsearch4'}}
{as4_inputActive obj=$params.obj key_active='scrolltop_active' key_db='scrolltop_active' label={l s='Enable auto scrolling effect' mod='pm_advancedsearch4'} defaultvalue=true}
{as4_inputActive obj=$params.obj key_active='unique_search' key_db='unique_search' label={l s='Primary' mod='pm_advancedsearch4'} tips={l s='When enabled, only this search engine will be displayed on your page. If other search engines have this option enabled, they\'ll be displayed too' mod='pm_advancedsearch4'}}
{module->_displaySubTitle text="{l s='Criterions group' mod='pm_advancedsearch4'}"}
{as4_inputActive obj=$params.obj key_active='reset_group' key_db='reset_group' label={l s='Display a link to reset selection' mod='pm_advancedsearch4'} defaultvalue=true}
<div class="enabled-option-step-search">
{as4_inputActive obj=$params.obj key_active='step_search_next_in_disabled' key_db='step_search_next_in_disabled' label={l s='Display next criterion groups in disabled mode' mod='pm_advancedsearch4'}}
</div>
<div class="hide-empty-criterion-group">
{as4_inputActive obj=$params.obj key_active='hide_empty_crit_group' key_db='hide_empty_crit_group' label={l s='Hide empty criteria groups' mod='pm_advancedsearch4'}}
</div>
{as4_inputActive obj=$params.obj key_active='hide_criterions_group_with_no_effect' key_db='hide_criterions_group_with_no_effect' label={l s='Hide implicit criteria groups' mod='pm_advancedsearch4'} defaultvalue=false}
{module->_displaySubTitle text="{l s='Criterions' mod='pm_advancedsearch4'}"}
{as4_inputActive obj=$params.obj key_active='display_nb_result_criterion' key_db='display_nb_result_criterion' label={l s='Display product count per criteria' mod='pm_advancedsearch4'}}
{as4_inputActive obj=$params.obj key_active='display_empty_criteria' key_db='display_empty_criteria' label={l s='Display empty criteria' mod='pm_advancedsearch4'} defaultvalue=false onclick='toggleSearchEngineSettings(false)'}
{as4_select obj=$params.obj options=$options_hide_criterion_method label={l s='Out-of limits criteria display method (defined for each group)' mod='pm_advancedsearch4'} key='show_hide_crit_method'}
{as4_endFieldset}
{* /General settings *}
{* Search results settings *}
{as4_startFieldset title={l s='Search results settings' mod='pm_advancedsearch4'} hide=false}
<div id="blc_search_results_selector" data-default-selector="{$default_search_results_selector|as4_nofilter}" style="{if !empty($params.obj->id_hook) && ($params.obj->id_hook == 8 || !empty($params.obj->insert_in_center_column))}display:none{/if}">
{as4_inputText obj=$params.obj key='search_results_selector' label={l s='CSS selector of the center column' mod='pm_advancedsearch4'} defaultvalue=$default_search_results_selector}
</div>
{as4_inputText obj=$params.obj key='search_results_selector_css' label={l s='CSS classes to add to the center column' mod='pm_advancedsearch4'}}
{if $spa_module_is_active}
<div class="displayPriorityOnCombinationImage" style="display: none;">
{/if}
{as4_inputActive obj=$params.obj key_active='priority_on_combination_image' key_db='priority_on_combination_image' label={l s='Match cover image to combinations found' mod='pm_advancedsearch4'}}
{if $spa_module_is_active}
</div>
{/if}
{as4_inputActive obj=$params.obj key_active='add_anchor_to_url' key_db='add_anchor_to_url' label={l s='Pre-select combination found on the product page (anchor)' mod='pm_advancedsearch4'}}
{module->_displaySubTitle text="{l s='Display' mod='pm_advancedsearch4'}"}
{as4_inputText obj=$params.obj key='products_per_page' label={l s='Number of products per page' mod='pm_advancedsearch4'} size='50px' defaultvalue=$products_per_page}
{as4_select obj=$params.obj options=$options_order_by label={l s='Sort products by' mod='pm_advancedsearch4'} key='products_order_by' size='500px'}
{as4_select obj=$params.obj options=$options_order_way label={l s='Order' mod='pm_advancedsearch4'} key='products_order_way'}
{as4_inputActive obj=$params.obj key_active='remind_selection_results' key_db='remind_selection_results' label={l s='Display a reminder of the selected criterions' mod='pm_advancedsearch4'}}
{as4_inputActive obj=$params.obj key_active='keep_category_information' key_db='keep_category_information' label={l s='Keep description on category pages' mod='pm_advancedsearch4'}}
{as4_richTextareaLang obj=$params.obj key='description' label={l s='Description to be displayed above the results' mod='pm_advancedsearch4'}}
{as4_endFieldset}
{* /Search results settings *}
{module->_displaySubmit text="{l s='Save' mod='pm_advancedsearch4'}" name='submitSearch'}
<script type="text/javascript">
$(document).ready(function() {
{if !empty($params.obj->step_search)}
$(".collapse").hide("fast");
{else}
$(".collapse").show("fast");
{/if}
});
displayRelatedSmartyVarOptions();
displayRelatedFilterByEmplacementOptions();
updateHookOptions($("#id_hook"), {$hooksId|json_encode});
toggleSearchEngineSettings(false);
</script>
{as4_endForm id='searchForm'}

View File

@@ -0,0 +1,62 @@
{as4_startForm id='searchForm' obj=$params.obj params=$params}
{module->_displayTitle text="{l s='Visibility restrictions' mod='pm_advancedsearch4'}"}
{module->_showWarning text="
{l s='If you want to restrict the search engine to some pages of your shop, please make your selection below.' mod='pm_advancedsearch4'}<br />
{l s='Leaving theses settings empty will display your search engine everywhere on your shop.' mod='pm_advancedsearch4'}
"}
{* Categories *}
{as4_inputActive obj=$params.obj key_active='bool_cat' key_db='bool_cat' label={l s='Restrict search to categories' mod='pm_advancedsearch4'} defaultvalue="{if $categories_association|is_array && $categories_association|sizeof}1{else}0{/if}" onclick='display_cat_picker();'}
<div id="category_picker">
{as4_categoryTree label={l s='Categories' mod='pm_advancedsearch4'} input_name='categories_association' selected_cat=$categories_association category_root_id=$root_category_id}
</div>
{* Products *}
{as4_inputActive obj=$params.obj key_active='bool_prod' key_db='bool_prod' label={l s='Restrict search to products' mod='pm_advancedsearch4'} defaultvalue="{if $products_association|is_array && $products_association|sizeof}1{else}0{/if}" onclick='display_prod_picker();'}
<div id="product_picker">
{as4_ajaxSelectMultiple selectedoptions=$products_association key='products_association' label={l s='Products' mod='pm_advancedsearch4'} remoteurl="{$base_config_url|as4_nofilter}&getItem=1&itemType=product" idcolumn='id_product' namecolumn='name'}
</div>
{* Product's category *}
{as4_inputActive obj=$params.obj key_active='bool_cat_prod' key_db='bool_cat_prod' label={l s='Restrict search to categories of products' mod='pm_advancedsearch4'} defaultvalue="{if $product_categories_association|is_array && $product_categories_association|sizeof}1{else}0{/if}" onclick='display_cat_prod_picker();'}
<div id="category_product_picker">
{as4_categoryTree label={l s='Categories' mod='pm_advancedsearch4'} input_name='product_categories_association' selected_cat=$product_categories_association category_root_id=$root_category_id}
</div>
{* Manufacturers *}
{as4_inputActive obj=$params.obj key_active='bool_manu' key_db='bool_manu' label={l s='Restrict search to manufacturers' mod='pm_advancedsearch4'} defaultvalue="{if $manufacturers_association|is_array && $manufacturers_association|sizeof}1{else}0{/if}" onclick='display_manu_picker();'}
<div id="manu_picker">
{as4_ajaxSelectMultiple selectedoptions=$manufacturers_association key='manufacturers_association' label={l s='Manufacturers' mod='pm_advancedsearch4'} remoteurl="{$base_config_url|as4_nofilter}&getItem=1&itemType=manufacturer" idcolumn='id_manufacturer' namecolumn='name'}
</div>
{* Suppliers *}
{as4_inputActive obj=$params.obj key_active='bool_supp' key_db='bool_supp' label={l s='Restrict search to suppliers' mod='pm_advancedsearch4'} defaultvalue="{if $suppliers_association|is_array && $suppliers_association|sizeof}1{else}0{/if}" onclick='display_supp_picker();'}
<div id="supp_picker">
{as4_ajaxSelectMultiple selectedoptions=$suppliers_association key='suppliers_association' label={l s='Suppliers' mod='pm_advancedsearch4'} remoteurl="{$base_config_url|as4_nofilter}&getItem=1&itemType=supplier" idcolumn='id_supplier' namecolumn='name'}
</div>
{* CMS *}
{as4_inputActive obj=$params.obj key_active='bool_cms' key_db='bool_cms' label={l s='Restrict search to CMS pages' mod='pm_advancedsearch4'} defaultvalue="{if $cms_association|is_array && $cms_association|sizeof}1{else}0{/if}" onclick='display_cms_picker();'}
<div id="cms_picker">
{as4_ajaxSelectMultiple selectedoptions=$cms_association key='cms_association' label={l s='CMS pages' mod='pm_advancedsearch4'} remoteurl="{$base_config_url|as4_nofilter}&getItem=1&itemType=cms" idcolumn='id_cms' namecolumn='meta_title'}
</div>
{* Controller, special pages *}
{as4_inputActive obj=$params.obj key_active='bool_spe' key_db='bool_spe' label={l s='Restrict search to special pages' mod='pm_advancedsearch4'} defaultvalue="{if $special_pages_association|is_array && $special_pages_association|sizeof}1{else}0{/if}" onclick='display_spe_picker();'}
<div id="special_pages">
{as4_ajaxSelectMultiple selectedoptions=$special_pages_association key='special_pages_association' label={l s='Special pages' mod='pm_advancedsearch4'} remoteurl="{$base_config_url|as4_nofilter}&getItem=1&itemType=controller" idcolumn='page' namecolumn='title'}
</div>
{module->_displaySubmit text="{l s='Save' mod='pm_advancedsearch4'}" name='submitSearchVisibility'}
<br /><br />
<script type="text/javascript">
display_cms_picker();
display_spe_picker();
display_cat_picker();
display_cat_prod_picker();
display_prod_picker();
display_manu_picker();
display_supp_picker();
</script>
{as4_endForm id='searchForm'}

View File

@@ -0,0 +1,8 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,163 @@
{if $criterions_groups_indexed|is_array && $criterions_groups_indexed|sizeof}
{module->_displayTitle text="{l s='Massive add of results pages' mod='pm_advancedsearch4'}"}
{module->_showInfo text="{l s='Select your criteria among the criterion groups and sort them so they can be readable by human' mod='pm_advancedsearch4'}"}
{as4_startForm id="seoMassSearchForm"}
<div id="seoSearchPanelCriteriaTabs" class="massSeo">
<ul>
{foreach from=$criterions_groups_indexed key=criterion_group_key item=criterions_group_indexed}
<li>
<a href="#seoSearchPanelCriteriaTabs-{$criterion_group_key|escape:'htmlall':'UTF-8'}">
{$criterions_group_indexed.name|escape:'htmlall':'UTF-8'}{if empty($criterions_group_indexed.visible)} {l s='(context)' mod='pm_advancedsearch4'}{/if}
</a>
</li>
{/foreach}
</ul>
{foreach from=$criterions_groups_indexed key=criterion_group_key item=criterions_group_indexed}
<div id="seoSearchPanelCriteriaTabs-{$criterion_group_key|escape:'htmlall':'UTF-8'}" class="seoSearchPanelCriteriaTabsContent">
<input type="hidden" name="id_criterion_group" value="{$criterions_group_indexed.id_criterion_group|intval}" style="margin-left:4px;" />
{as4_button text={l s='Check/uncheck all' mod='pm_advancedsearch4'} onclick="enableAllCriterion4MassSeo(this);" icon_class='ui-icon ui-icon-check'}
<br /><br />
<ul class="ui-helper-reset ui-sortable">
{* Range group *}
{if !empty($criterions_group_indexed.range) && $criterions_group_indexed.display_type != 5 && $criterions_group_indexed.display_type != 8}
{foreach from=$criterions_group_indexed.criterions item=criterion}
<li class="ui-state-default massSeoSearchCriterion" id="criterion_{$criterions_group_indexed.id_criterion_group|intval}_{$criterion.id_criterion|as4_nofilter}" title="{$criterion.value|escape:'htmlall':'UTF-8'}" onclick="enableCriterion4MassSeo(this);">
<input type="checkbox" name="criteria[{$criterions_group_indexed.id_criterion_group|intval}][]" value="{$criterions_group_indexed.id_criterion_group|intval}_{$criterion.id_criterion|as4_nofilter}" onclick="enableCriterion4MassSeo($(this).parent('li'));" /> &nbsp; {$criterion.value|escape:'htmlall':'UTF-8'}
</li>
{/foreach}
{* Price group *}
{elseif $criterions_group_indexed.criterion_group_type == 'price'}
<li
class="ui-state-default massSeoSearchCriterion massSeoSearchCriterionPrice"
id="criterion_price-{$criterions_group_indexed.price_range.min_price|floatval}~{$criterions_group_indexed.price_range.max_price|floatval}"
title="{l s='From' mod='pm_advancedsearch4'} {$criterions_group_indexed.price_range.min_price|intval} {l s='to' mod='pm_advancedsearch4'} {$default_currency_sign_left|escape:'htmlall':'UTF-8'} {$criterions_group_indexed.price_range.max_price|intval} {$default_currency_sign_right|escape:'htmlall':'UTF-8'}"
onclick="enableCriterion4MassSeo(this);"
style="height:50px"
>
<input type="checkbox" id="massSeoSearchCriterionPriceInput" name="criteria[{$criterions_group_indexed.id_criterion_group|intval}][]" value="{$criterions_group_indexed.id_criterion_group|intval}_{if isset($criterions_group_indexed.price_range.min_price)}{$criterions_group_indexed.price_range.min_price|floatval}~{$criterions_group_indexed.price_range.max_price|floatval}{/if}" onclick="enableCriterion4MassSeo($(this).parent('li'));" /> &nbsp;
{l s='Define price range:' mod='pm_advancedsearch4'}<br /><br />
<div id="PM_ASSeoPriceRange"></div>
<span id="PM_ASPriceRangeValue">
{$criterions_group_indexed.price_range.min_price|intval} - {$default_currency_sign_left|escape:'htmlall':'UTF-8'} {$criterions_group_indexed.price_range.max_price|intval} {$default_currency_sign_right|escape:'htmlall':'UTF-8'}
</span>
<select id="id_currency" name="id_currency" style="float:left;margin-left:10px;width:50px;{if sizeof($currencies) == 1}display:none;{/if}">
{foreach from=$currencies item=currency}
<option value="{$currency.id_currency|intval}"{if $default_currency_id == $currency.id_currency} selected="selected"{/if}>{$currency.sign|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
<script type="text/javascript">
$(document).on('change', '#id_currency', function() {
var id_currency = $(this).val();
$.ajax({
type : "GET",
url : "{$base_config_url|as4_nofilter}&pm_load_function=displaySeoPriceSlider&id_search={$criterions_group_indexed.id_search|intval}&id_criterion_group_linked={$criterions_group_indexed.id_criterion_group_linked|intval}&id_criterion_group={$criterions_group_indexed.id_criterion_group|intval}&id_currency=" + id_currency,
dataType : "script"
});
});
$("#PM_ASSeoPriceRange").slider({
range: true,
min: {$criterions_group_indexed.price_range.min_price|intval},
max: {$criterions_group_indexed.price_range.max_price|intval},
values: [ {$criterions_group_indexed.price_range.min_price|intval}, {$criterions_group_indexed.price_range.max_price|intval} ],
slide: function(event, ui) {
$("#PM_ASPriceRangeValue").html(ui.values[0] + " - " + "{$default_currency_sign_left|escape:'htmlall':'UTF-8'}" + ui.values[1] + "{$default_currency_sign_right|escape:'htmlall':'UTF-8'}");
$(".seoSearchCriterionPriceSortable").attr("id", "criterion_{$criterions_group_indexed.id_criterion_group|intval}_" + ui.values[0] + "~" + ui.values[1]);
$(".seoSearchCriterionPriceSortable").attr("title", "{l s='From' mod='pm_advancedsearch4'} " + ui.values[0] + " {l s='to' mod='pm_advancedsearch4'} " + "{$default_currency_sign_left|escape:'htmlall':'UTF-8'}" + ui.values[1] + "{$default_currency_sign_right|escape:'htmlall':'UTF-8'}");
}
});
</script>
</li>
{* Slider group *}
{elseif $criterions_group_indexed.display_type == 5 || $criterions_group_indexed.display_type == 8}
<li
class="ui-state-default massSeoSearchCriterion seoSearchCriterionRangeSortable{$criterions_group_indexed.id_criterion_group|intval}"
id="criterion_{$criterions_group_indexed.id_criterion_group|intval}_{$criterions_group_indexed.range.min|floatval}~{$criterions_group_indexed.range.max|floatval}"
title="{l s='From' mod='pm_advancedsearch4'} {$criterions_group_indexed.range.min|intval} {l s='to' mod='pm_advancedsearch4'} {$criterions_group_indexed.range.max|intval} ({$criterions_group_indexed.range_sign|escape:'htmlall':'UTF-8'})"
onclick="enableCriterion4MassSeo(this);"
style="height:50px"
>
<input type="checkbox" id="massSeoSearchCriterionRangeInput{$criterions_group_indexed.id_criterion_group|intval}" name="criteria[{$criterions_group_indexed.id_criterion_group|intval}][]" value="{$criterions_group_indexed.id_criterion_group|intval}_{$criterions_group_indexed.id_criterion_group|intval}_{$criterions_group_indexed.range.min|floatval}~{$criterions_group_indexed.range.max|floatval}" onclick="enableCriterion4MassSeo($( this ).parent('li'));" /> &nbsp;
{l s='Define range:' mod='pm_advancedsearch4'}<br />
<div id="PM_ASSeoRange{$criterions_group_indexed.id_criterion_group|intval}" style="width:30%;margin-left:10px;float:left"></div>
<span id="PM_ASRangeValue{$criterions_group_indexed.id_criterion_group|intval}" style="width:35%;display:block;float:left;font-size:11px;margin-left:10px;">{$criterions_group_indexed.range.min|floatval} - {$criterions_group_indexed.range.max|floatval} ({$criterions_group_indexed.range_sign|escape:'htmlall':'UTF-8'})</span>
<script type="text/javascript">
$("#PM_ASSeoRange{$criterions_group_indexed.id_criterion_group|intval}").slider({
range: true,
min: {$criterions_group_indexed.range.min|intval},
max: {$criterions_group_indexed.range.max|intval},
values: [ {$criterions_group_indexed.range.min|floatval}, {$criterions_group_indexed.range.max|floatval} ],
slide: function(event, ui) {
$("#PM_ASRangeValue{$criterions_group_indexed.id_criterion_group|intval}" ).html(ui.values[0] + " - " + ui.values[1] + " ({$criterions_group_indexed.range_sign|escape:'htmlall':'UTF-8'})");
$("#massSeoSearchCriterionRangeInput{$criterions_group_indexed.id_criterion_group|intval}").val('{$criterions_group_indexed.id_criterion_group|intval}' + "_" + ui.values[0] + "~" + ui.values[1]);
$(".seoSearchCriterionRangeSortable{$criterions_group_indexed.id_criterion_group|intval}" ).attr("id", "criterion_{$criterions_group_indexed.id_criterion_group|intval}_" + ui.values[0] + "~" + ui.values[1]);
$(".seoSearchCriterionRangeSortable{$criterions_group_indexed.id_criterion_group|intval}" ).attr("title", "{l s='From' mod='pm_advancedsearch4'} " + ui.values[0] + " {l s='to' mod='pm_advancedsearch4'} " + ui.values[1] + " ({$criterions_group_indexed.range_sign|escape:'htmlall':'UTF-8'})");
}
});
</script>
</li>
{* Classic group *}
{else}
{foreach from=$criterions_group_indexed.criterions item=criterion}
<li class="ui-state-default massSeoSearchCriterion" id="criterion_{$criterion.id_criterion|as4_nofilter}" title="{$criterion.value|escape:'htmlall':'UTF-8'}" onclick="enableCriterion4MassSeo(this);">
<input type="checkbox" name="criteria[{$criterions_group_indexed.id_criterion_group|intval}][]" value="{$criterions_group_indexed.id_criterion_group|intval}_{$criterion.id_criterion|as4_nofilter}" onclick="enableCriterion4MassSeo($(this).parent('li'));" /> &nbsp;
{$criterion.value|escape:'htmlall':'UTF-8'}
</li>
{/foreach}
{/if}
</ul>
</div>
{/foreach}
</div>
<div id="seoMassSearchPanelCriteriaGroupsTabs">
<ul style="width:835px;min-height:50px;" class="ui-helper-reset ui-sortable">
{foreach from=$criterions_groups_indexed key=criterion_group_key item=criterions_group_indexed}
<li class="ui-state-default seoSearchCriterionSortable ui-state-disabled seoSearchCriterionGroupSortable" id="criterion_group_{$criterions_group_indexed.id_criterion_group|intval}" style="display:none;">
<a href="#seoSearchPanelCriteriaTabs-{$criterion_group_key|escape:'htmlall':'UTF-8'}">
{$criterions_group_indexed.name|escape:'htmlall':'UTF-8'}{if empty($criterions_group_indexed.visible)} {l s='(context)' mod='pm_advancedsearch4'}{/if}
</a>
</li>
{/foreach}
</ul>
</div>
<input type="hidden" name="id_search" id="id_search" value="{$id_search|intval}" />
<input type="hidden" name="criteria_groups" id="massSeoSearchCriterionGroupsInput" />
</div>
{include file='../../core/clear.tpl'}
<script type="text/javascript">
var msgMaxCriteriaForMass = {{l s='You can not select more than three groups of criteria' mod='pm_advancedsearch4'}|json_encode};
var msgNoSeoCriterion = {{l s='You must choose at least one criterion to use this option' mod='pm_advancedsearch4'}|json_encode};
{literal}
$(document).ready(function() {
$('select#id_currency').click(function(e) {
e.stopPropagation();
});
$("#seoSearchPanelCriteriaTabs").tabs({cache:false});
$("#seoMassSearchPanelCriteriaGroupsTabs ul").sortable({
items: "li:not(.ui-state-disabled)",
placeholder: "ui-state-highlight seoSearchCriterionSortable",
sort: function() {
$(this).removeClass("ui-state-default");
},
update: function(event, ui) {
massSeoSearchCriteriaGroupUpdate();
}
});
});
{/literal}
</script>
{as4_inputActive obj=false key_active='massSeoSearchCrossLinks' key_db='massSeoSearchCrossLinks' label={l s='Automatically add cross links between the generated pages' mod='pm_advancedsearch4'} defaultvalue=true}
{module->_displaySubmit text="{l s='Generate pages' mod='pm_advancedsearch4'}" name="submitMassSeoSearchForm"}
{include file='../../core/clear.tpl'}
{as4_endForm id="seoMassSearchForm"}
{else}
{module->_showInfo text="{l s='Before adding a new page, please add criteria groups to your search engine' mod='pm_advancedsearch4'}"}
{/if}

View File

@@ -0,0 +1,200 @@
{if $criterions_groups_indexed|is_array && $criterions_groups_indexed|sizeof}
{if !empty($currentSeo->id)}
{module->_displayTitle text="{l s='Edit results page' mod='pm_advancedsearch4'}"}
{else}
{module->_displayTitle text="{l s='Add results page' mod='pm_advancedsearch4'}"}
{/if}
{as4_startForm id="seoSearchForm" obj=$params.obj params=$params}
<div id="seoSearchPanelCriteriaTabs">
<ul>
{foreach from=$criterions_groups_indexed key=criterion_group_key item=criterions_group_indexed}
<li>
<a href="#seoSearchPanelCriteriaTabs-{$criterion_group_key|escape:'htmlall':'UTF-8'}">
{$criterions_group_indexed.name|escape:'htmlall':'UTF-8'}{if empty($criterions_group_indexed.visible)} {l s='(context)' mod='pm_advancedsearch4'}{/if}
</a>
</li>
{/foreach}
</ul>
{foreach from=$criterions_groups_indexed key=criterion_group_key item=criterions_group_indexed}
<div id="seoSearchPanelCriteriaTabs-{$criterion_group_key|escape:'htmlall':'UTF-8'}" class="seoSearchPanelCriteriaTabsContent">
<ul class="ui-helper-reset ui-sortable">
{* Range group *}
{if !empty($criterions_group_indexed.range) && $criterions_group_indexed.display_type != 5 && $criterions_group_indexed.display_type != 8}
{foreach from=$criterions_group_indexed.criterions item=criterion}
<li class="ui-state-default seoSearchCriterionSortable" id="criterion_{$criterions_group_indexed.id_criterion_group|intval}_{$criterion.id_criterion|as4_nofilter}" title="{$criterion.value|escape:'htmlall':'UTF-8'}">
{$criterion.value|escape:'htmlall':'UTF-8'}
</li>
{/foreach}
{* Price group *}
{elseif $criterions_group_indexed.criterion_group_type == 'price'}
<li
class="ui-state-default seoSearchCriterionSortable seoSearchCriterionPriceSortable"
id="criterion_{$criterions_group_indexed.id_criterion_group|intval}_{$criterions_group_indexed.price_range.min_price|floatval}~{$criterions_group_indexed.price_range.max_price|floatval}"
title="{l s='From' mod='pm_advancedsearch4'} {$criterions_group_indexed.price_range.min_price|intval} {l s='to' mod='pm_advancedsearch4'} {$default_currency_sign_left|escape:'htmlall':'UTF-8'} {$criterions_group_indexed.price_range.max_price|intval} {$default_currency_sign_right|escape:'htmlall':'UTF-8'}"
style="width:50%"
>
{l s='Define price range:' mod='pm_advancedsearch4'}<br />
<div id="PM_ASSeoPriceRange"></div>
<span id="PM_ASPriceRangeValue">
{$criterions_group_indexed.price_range.min_price|intval} - {$default_currency_sign_left|escape:'htmlall':'UTF-8'} {$criterions_group_indexed.price_range.max_price|intval} {$default_currency_sign_right|escape:'htmlall':'UTF-8'}
</span>
<select id="id_currency" name="id_currency" style="float:left;margin-left:10px;width:50px;">
{foreach from=$currencies item=currency}
<option value="{$currency.id_currency|intval}"{if $default_currency_id == $currency.id_currency} selected="selected"{/if}>{$currency.sign|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
<script type="text/javascript">
$(document).on('change', '#id_currency', function() {
var id_currency = $(this).val();
$.ajax({
type : "GET",
url : "{$base_config_url|as4_nofilter}&pm_load_function=displaySeoPriceSlider&id_search={$criterions_group_indexed.id_search|intval}&id_criterion_group_linked={$criterions_group_indexed.id_criterion_group_linked|intval}&id_criterion_group={$criterions_group_indexed.id_criterion_group|intval}&id_currency=" + id_currency,
dataType : "script"
});
});
$("#PM_ASSeoPriceRange").slider({
range: true,
min: {$criterions_group_indexed.price_range.min_price|intval},
max: {$criterions_group_indexed.price_range.max_price|intval},
values: [ {$criterions_group_indexed.price_range.min_price|intval}, {$criterions_group_indexed.price_range.max_price|intval} ],
slide: function(event, ui) {
$("#PM_ASPriceRangeValue").html(ui.values[0] + " - " + "{$default_currency_sign_left|escape:'htmlall':'UTF-8'}" + ui.values[1] + "{$default_currency_sign_right|escape:'htmlall':'UTF-8'}");
$(".seoSearchCriterionPriceSortable").attr("id", "criterion_{$criterions_group_indexed.id_criterion_group|intval}_" + ui.values[0] + "~" + ui.values[1]);
$(".seoSearchCriterionPriceSortable").attr("title", "{l s='From' mod='pm_advancedsearch4'} " + ui.values[0] + " {l s='to' mod='pm_advancedsearch4'} " + "{$default_currency_sign_left|escape:'htmlall':'UTF-8'}" + ui.values[1] + "{$default_currency_sign_right|escape:'htmlall':'UTF-8'}");
}
});
</script>
</li>
{* Slider group *}
{elseif $criterions_group_indexed.display_type == 5 || $criterions_group_indexed.display_type == 8}
<li
class="ui-state-default seoSearchCriterionSortable seoSearchCriterionRangeSortable{$criterions_group_indexed.id_criterion_group|intval}"
id="criterion_{$criterions_group_indexed.id_criterion_group|intval}_{$criterions_group_indexed.range.min|floatval}~{$criterions_group_indexed.range.max|floatval}"
title="{l s='From' mod='pm_advancedsearch4'} {$criterions_group_indexed.range.min|intval} {l s='to' mod='pm_advancedsearch4'} {$criterions_group_indexed.range.max|intval} ({$criterions_group_indexed.range_sign|escape:'htmlall':'UTF-8'})"
style="width:50%"
>
{l s='Define range:' mod='pm_advancedsearch4'}<br />
<div id="PM_ASSeoRange{$criterions_group_indexed.id_criterion_group|intval}" style="width:30%;margin-left:10px;float:left"></div>
<span id="PM_ASRangeValue{$criterions_group_indexed.id_criterion_group|intval}" style="width:35%;display:block;float:left;font-size:11px;margin-left:10px;">{$criterions_group_indexed.range.min|floatval} - {$criterions_group_indexed.range.max|floatval} ({$criterions_group_indexed.range_sign|escape:'htmlall':'UTF-8'})</span>
<script type="text/javascript">
$("#PM_ASSeoRange{$criterions_group_indexed.id_criterion_group|intval}").slider({
range: true,
min: {$criterions_group_indexed.range.min|intval},
max: {$criterions_group_indexed.range.max|intval},
values: [ {$criterions_group_indexed.range.min|floatval}, {$criterions_group_indexed.range.max|floatval} ],
slide: function(event, ui) {
$("#PM_ASRangeValue{$criterions_group_indexed.id_criterion_group|intval}").html(ui.values[0] + " - " + ui.values[1] + " ({$criterions_group_indexed.range_sign|escape:'htmlall':'UTF-8'})");
$(".seoSearchCriterionRangeSortable{$criterions_group_indexed.id_criterion_group|intval}" ).attr("id", "criterion_{$criterions_group_indexed.id_criterion_group|intval}_" + ui.values[0] + "~" + ui.values[1]);
$(".seoSearchCriterionRangeSortable{$criterions_group_indexed.id_criterion_group|intval}" ).attr("title", "{l s='From' mod='pm_advancedsearch4'} " + ui.values[0] + " {l s='to' mod='pm_advancedsearch4'} " + ui.values[1] + " ({$criterions_group_indexed.range_sign|escape:'htmlall':'UTF-8'})");
}
});
</script>
</li>
{* Classic group *}
{else}
{foreach from=$criterions_group_indexed.criterions item=criterion}
<li class="ui-state-default seoSearchCriterionSortable" id="criterion_{$criterions_group_indexed.id_criterion_group|intval}_{$criterion.id_criterion|as4_nofilter}" title="{$criterion.value|escape:'htmlall':'UTF-8'}">
{$criterion.value|escape:'htmlall':'UTF-8'}
</li>
{/foreach}
{/if}
</ul>
</div>
{/foreach}
</div>
{module->_showInfo text="{l s='Add the criteria of your choice using drag & drop to generate predefined searches.' mod='pm_advancedsearch4'}<br /><br />{l s='You can sort them and automaticaly generate friendly title, meta and URL.' mod='pm_advancedsearch4'}"}
<div id="nbProductsCombinationSeoSearchForm"></div>
<div id="seoSearchPanelCriteriaSelected">
<div class="ui-widget-content" style="padding:10px;">
<ul style="width:835px;float:left;min-height:50px;" class="ui-helper-reset ui-sortable">
{if $criteria|is_array && $criteria|sizeof}
{foreach from=$criteria item=criterion}
<li class="ui-state-default seoSearchCriterionSortable" id="biscriterion_{$criterion|as4_nofilter}" rel="criterion_{$criterion|as4_nofilter}">
<span class="ui-icon ui-icon-close" style="float: left; margin-right: .3em;cursor:pointer;" onclick="removeSelectedSeoCriterion(this);"></span> {$criteria_values[$criterion]|escape:'htmlall':'UTF-8'}
<script type="text/javascript">
$('[id="criterion_{$criterion|as4_nofilter}"]').hide();
</script>
</li>
{/foreach}
{else}
<li class="placeholder">{l s='Drop your criteria here' mod='pm_advancedsearch4'}</li>
{/if}
</ul>
{include file='../../core/clear.tpl'}
</div>
</div>
<script type="text/javascript">
var msgNoSeoCriterion = {{l s='You must choose at least one criteria to use this option' mod='pm_advancedsearch4'}|json_encode};
$(document).ready(function() {
$("#seoSearchPanelCriteriaTabs").tabs({ cache:false });
$(".seoSearchPanelCriteriaTabsContent li").draggable({
appendTo: "body",
helper: "clone"
});
$("#seoSearchPanelCriteriaSelected ul").droppable({
activeClass: "ui-state-default",
hoverClass: "ui-state-hover",
accept: ":not(.ui-sortable-helper)",
drop: function( event, ui) {
$(this).find(".placeholder").remove();
if (ui.draggable.hasClass("seoSearchCriterionPriceSortable")) {
$('<li class="ui-state-default seoSearchCriterionSortable" id="bis' + ui.draggable.attr("id") + '" rel="' + ui.draggable.attr("id") + '"></li>').html('<span class="ui-icon ui-icon-close" style="float: left; margin-right: .3em;cursor:pointer;" onclick="removeSelectedSeoCriterion(this);"></span> ' + ui.draggable.attr("title")).appendTo(this);
} else {
$('<li class="ui-state-default seoSearchCriterionSortable" id="bis' + ui.draggable.attr("id") + '" rel="' + ui.draggable.attr("id") + '"></li>').html('<span class="ui-icon ui-icon-close" style="float: left; margin-right: .3em;cursor:pointer;" onclick="removeSelectedSeoCriterion(this);"></span> ' + ui.draggable.attr("title")).appendTo(this);
}
ui.draggable.fadeOut("fast");
seoSearchCriteriaUpdate();
}
}).sortable({
items: "li:not(.placeholder)",
placeholder: "ui-state-highlight seoSearchCriterionSortable",
sort: function() {
$(this).removeClass("ui-state-default");
},
update: function(event, ui) {
seoSearchCriteriaUpdate();
}
});
seoSearchCriteriaUpdate();
});
</script>
{as4_button text={l s='Generate title, meta and URL' mod='pm_advancedsearch4'} onclick='fillSeoFields();' icon_class='ui-icon ui-icon-refresh'}
<br /><br />
{include file='../../core/clear.tpl'}
{as4_inputTextLang obj=$params.obj key='meta_title' label={l s='Meta title' mod='pm_advancedsearch4'} size='350px'}
{as4_inputTextLang obj=$params.obj key='meta_description' label={l s='Meta description' mod='pm_advancedsearch4'} size='350px'}
{as4_inputTextLang obj=$params.obj key='meta_keywords' label={l s='Meta keywords' mod='pm_advancedsearch4'} size='350px'}
{as4_inputTextLang obj=$params.obj key='title' label={l s='Title (H1)' mod='pm_advancedsearch4'} size='350px'}
{as4_inputTextLang obj=$params.obj key='seo_url' label={l s='Friendly URL' mod='pm_advancedsearch4'} size='350px' onkeyup='ASStr2url(this);' onchange='ASStr2url(this);'}
{as4_richTextareaLang obj=$params.obj key='description' label={l s='Description (visible on the top of the page)' mod='pm_advancedsearch4'}}
{as4_ajaxSelectMultiple selectedoptions=$cross_links_selected key='cross_links' label={l s='Results pages to link to this page (cross-linking)' mod='pm_advancedsearch4'} remoteurl="{$base_config_url|as4_nofilter}&pm_load_function=displaySeoSearchOptions&id_seo_origin={$params.obj->id}"}
<input type="hidden" name="criteria" id="seoSearchCriteriaInput" />
<input type="hidden" name="id_search" id="id_search" value="{$id_search|intval}" />
{if !empty($currentSeo->id)}
<input type="hidden" name="id_seo" value="{$currentSeo->id|intval}" />
<input type="hidden" name="id_currency" id="posted_id_currency" value="{$currentSeo->id_currency|intval}" />
<script type="text/javascript">
var id_currency = {$currentSeo->id_currency|json_encode};
</script>
{else}
<input type="hidden" name="id_currency" id="posted_id_currency" />
{/if}
<br class="clear" /><br />
<center>
<p class="ui-state-error ui-corner-all" id="errorCombinationSeoSearchForm" style="display:none;padding:10px;">
<strong>{l s='Your criteria combination led to no result, please reorder them before submiting' mod='pm_advancedsearch4'}</strong>
</p>
</center>
{module->_displaySubmit text="{l s='Save' mod='pm_advancedsearch4'}" name="submitSeoSearchForm"}
{as4_endForm id="seoSearchForm"}
{else}
{module->_showInfo text="{l s='Before adding a new page, please add criteria groups to your search engine'}"}
{/if}

View File

@@ -0,0 +1,15 @@
$("#PM_ASSeoPriceRange").slider({
range: true,
min: {$price_range.min_price|intval},
max: {$price_range.max_price|intval},
values: [ {$price_range.min_price|intval}, {$price_range.max_price|intval} ],
slide: function(event, ui) {
$("#PM_ASPriceRangeValue").html(ui.values[0] + "{$currency->getSign('right')|escape:'htmlall':'UTF-8'}" + " - " + ui.values[1] + "{$currency->getSign('right')|escape:'htmlall':'UTF-8'}");
$(".seoSearchCriterionPriceSortable").attr("id", "criterion_{$id_criterion_group|intval}_" + ui.values[0] + "~" + ui.values[1]);
$(".seoSearchCriterionPriceSortable").attr("title", "{l s='From' mod='pm_advancedsearch4'} " + ui.values[0] + "{$currency->getSign('right')|escape:'htmlall':'UTF-8'}" + " {l s='to' mod='pm_advancedsearch4'} " + ui.values[1] + "{$currency->getSign('right')|escape:'htmlall':'UTF-8'}");
}
});
$("#PM_ASPriceRangeValue").html("{displayPrice price=$price_range.min_price|intval currency=$currency} - {displayPrice price=$price_range.max_price|intval currency=$currency}");
$(".seoSearchCriterionPriceSortable").attr("id", "criterion_{$id_criterion_group|intval}_{$price_range.min_price|intval}~{$price_range.max_price|intval}");
$(".seoSearchCriterionPriceSortable").attr("title", "{l s='From' mod='pm_advancedsearch4'} {displayPrice price=$price_range.min_price|intval currency=$currency} {l s='to' mod='pm_advancedsearch4'} {displayPrice price=$price_range.max_price|intval currency=$currency}");
var id_currency = {$currency->id|json_encode};

View File

@@ -0,0 +1,25 @@
{as4_startForm id="seoRegenerateForm"}
{module->_displayTitle text="{l s='Regenerate SEO metas' mod='pm_advancedsearch4'}"}
{module->_showInfo text="{l s='Select the type of data you want to regenerate, then click on “Regenerate“ button' mod='pm_advancedsearch4'}"}
<input type="hidden" name="id_search" id="id_search" value="{$id_search|intval}" />
<div id="buttonSetSeoRegenerate">
<input type="checkbox" name="fields_to_regenerate[]" id="check1" value="meta_title" /> <label for="check1">{l s='Meta title' mod='pm_advancedsearch4'}</label>
<input type="checkbox" name="fields_to_regenerate[]" id="check2" value="meta_description" /> <label for="check2">{l s='Meta description' mod='pm_advancedsearch4'}</label>
<input type="checkbox" name="fields_to_regenerate[]" id="check3" value="meta_keywords" /> <label for="check3">{l s='Meta keywords' mod='pm_advancedsearch4'}</label>
<input type="checkbox" name="fields_to_regenerate[]" id="check4" value="title" /> <label for="check4">{l s='Title (H1)' mod='pm_advancedsearch4'}</label>
<input type="checkbox" name="fields_to_regenerate[]" id="check5" value="seo_url" /> <label for="check5">{l s='Friendly URL' mod='pm_advancedsearch4'}</label>
</div>
{include file='../../core/clear.tpl'}
<br />
{module->_displaySubmit text="{l s='Regenerate' mod='pm_advancedsearch4'}" name="submitSeoRegenerate"}
<script type="text/javascript">
$(document).ready(function(){
$("#buttonSetSeoRegenerate").buttonset();
});
</script>
{as4_startForm id="seoRegenerateForm"}

View File

@@ -0,0 +1,98 @@
{module->_displayTitle text="{l s='Predefined results page (SEO)' mod='pm_advancedsearch4'}"}
{if !empty($rewrite_settings)}
{if !empty($seo_searchs) && $seo_searchs|is_array && $seo_searchs|sizeof}
<div class="seoGsiteMapUrl">
{module->_showInfo text="{l s='The Advanced Search sitemap is located at:' mod='pm_advancedsearch4'} <a target=\"_blank\" href=\"{$sitemap_url}\">{$sitemap_url}</a>"}
</div>
{/if}
{as4_button text={l s='Add a new results page' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_load_function=displaySeoSearchForm&class=AdvancedSearchSeoClass&pm_js_callback=closeDialogIframe&id_search={$id_search|intval}" class='open_on_dialog_iframe' rel='980_530_1' icon_class='ui-icon ui-icon-plusthick'}
{as4_button text={l s='Massive add of results pages' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_load_function=displayMassSeoSearchForm&pm_js_callback=closeDialogIframe&id_search={$id_search|intval}" class='open_on_dialog_iframe' rel='980_530_1' icon_class='ui-icon ui-icon-plusthick'}
{if !empty($seo_searchs) && $seo_searchs|is_array && $seo_searchs|sizeof}
<hr class="clear" />
{as4_button text={l s='Remove empty results pages' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_load_function=processRemoveEmptySeo&id_search={$id_search|intval}" class='ajax_script_load' icon_class='ui-icon ui-icon-trash'}
{as4_button text={l s='Regenerate SEO meta data' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_load_function=displaySeoRegenerateForm&id_search={$id_search|intval}" class='open_on_dialog_iframe' rel='700_300' icon_class='ui-icon ui-icon-refresh'}
{as4_button text={l s='List all URLs' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_load_function=displaySeoUrlList&id_search={$id_search|intval}" class='open_on_dialog_iframe' rel='980_530_1' icon_class='ui-icon ui-icon-link'}
<table cellspacing="0" cellpadding="0" id="dataTable{$id_search|intval}" style="width:100%;">
<thead>
<tr>
<th width="10"></th>
<th width="50">{l s='Id' mod='pm_advancedsearch4'}</th>
<th style="width:auto">{l s='Title' mod='pm_advancedsearch4'}</th>
<th style="text-align:center;">{l s='Num. products' mod='pm_advancedsearch4'}</th>
<th style="text-align:center;">{l s='Edit' mod='pm_advancedsearch4'}</th>
<th style="text-align:center;">{l s='URL' mod='pm_advancedsearch4'}</th>
<th style="text-align:center;">{l s='Delete' mod='pm_advancedsearch4'}</th>
</tr>
</thead>
<tbody>
{foreach from=$seo_searchs item=seo_search}
<tr>
<td><input type="checkbox" name="seo_group_action[]" value="{$seo_search.id_seo|intval}" /></td>
<td>{$seo_search.id_seo|intval}</td>
<td>{$seo_search.title|escape:'htmlall':'UTF-8'}</td>
<td style="text-align:center;">
<strong{if empty($seo_search.total_products)} style="color: #cc0000"{/if}>{$seo_search.total_products|intval}</strong>
</td>
<td style="text-align:center;">
{as4_button text='' href="{$base_config_url|as4_nofilter}&pm_load_function=displaySeoSearchForm&class=AdvancedSearchSeoClass&pm_js_callback=closeDialogIframe&id_search={$id_search|intval}&id_seo={$seo_search.id_seo|intval}" class='open_on_dialog_iframe' rel='980_530_1' icon_class='ui-icon ui-icon-pencil'}
</td>
<td style="text-align:center;">
{as4_button text='' href="{$base_config_url|as4_nofilter}&pm_load_function=displaySeoUrl&id_search={$id_search|intval}&id_seo={$seo_search.id_seo|intval}" class='open_on_dialog_iframe' rel='980_530_1' icon_class='ui-icon ui-icon-link'}
</td>
<td style="text-align:center;">
{as4_button text='' href="{$base_config_url|as4_nofilter}&pm_load_function=processDeleteSeoSearch&id_search={$id_search|intval}&id_seo={$seo_search.id_seo|intval}" class='ajax_script_load pm_confirm' title={l s='Delete item #%d ?' mod='pm_advancedsearch4' sprintf=$seo_search.id_seo} icon_class='ui-icon ui-icon-trash'}
</td>
</tr>
{/foreach}
</tbody>
</table>
<br />
{as4_button text={l s='Check/uncheck all' mod='pm_advancedsearch4'} onclick="checkAllSeoItems({$id_search|intval});" icon_class='ui-icon ui-icon-check'}
{as4_button text={l s='Delete selected items' mod='pm_advancedsearch4'} onclick="deleteSeoItems({$id_search|intval});" icon_class='ui-icon ui-icon-trash'}
<script type="text/javascript">
$(document).ready(function() {
loadAjaxLink();
var oTable = $('#dataTable{$id_search|intval}').dataTable({
"sDom": 'R<"H"lfr>t<"F"ip<',
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bStateSave": true,
"oLanguage": {
"sLengthMenu": {{l s='Display _MENU_ records per page' mod='pm_advancedsearch4'}|json_encode},
"sZeroRecords": {{l s='Nothing found - sorry' mod='pm_advancedsearch4'}|json_encode},
"sInfo": {{l s='Showing _START_ to _END_ of _TOTAL_ records' mod='pm_advancedsearch4'}|json_encode},
"sInfoEmpty": {{l s='Showing 0 to 0 of 0 records' mod='pm_advancedsearch4'}|json_encode},
"sInfoFiltered": {{l s='(filtered from _MAX_ total records)' mod='pm_advancedsearch4'}|json_encode},
"sPageNext": {{l s='Next' mod='pm_advancedsearch4'}|json_encode},
"sPagePrevious": {{l s='Previous' mod='pm_advancedsearch4'}|json_encode},
"sPageLast": {{l s='Last' mod='pm_advancedsearch4'}|json_encode},
"sPageFirst": {{l s='First' mod='pm_advancedsearch4'}|json_encode},
"sSearch": {{l s='Search' mod='pm_advancedsearch4'}|json_encode},
"sFirst": {{l s='First' mod='pm_advancedsearch4'}|json_encode},
"sPrevious": {{l s='Previous' mod='pm_advancedsearch4'}|json_encode},
"sNext": {{l s='Next' mod='pm_advancedsearch4'}|json_encode},
"sLast": {{l s='Last' mod='pm_advancedsearch4'}|json_encode}
}
});
$(document).on("click", '#dataTable{$id_search|intval} tbody input[type="checkbox"]', function(e) {
e.stopPropagation();
e.stopImmediatePropagation();
});
$(document).on("click", '#dataTable{$id_search|intval} tr td:gt(0)', function(e) {
if ($(this).parent("tr").children("td:first-child").find("input:checked").size() > 0) {
$(this).parent("tr").children("td:first-child").find("input").prop('checked', false);
} else {
$(this).parent("tr").children("td:first-child").find("input").prop('checked', true);
}
});
});
</script>
{/if}
{else}
{module->_showInfo text="{l s='Please enable Friendly URL in order to use this feature' mod='pm_advancedsearch4'}"}
{/if}

View File

@@ -0,0 +1,18 @@
{as4_startForm id="SEOpages"}
{module->_displayTitle text="{l s='URL' mod='pm_advancedsearch4'}"}
{module->_showInfo text="{l s='Use this URL in your slideshows, menus and others. One link per language is available.' mod='pm_advancedsearch4'}"}
<div class="margin-form" style="padding-left:100px;">
{foreach from=$seo_url_by_lang key=id_lang item=seo_url}
<div id="langseo_url_{$id_lang|intval}" class="pmFlag pmFlagLang_{$id_lang|intval}" style="display: {if $id_lang == $default_language}block{else}none{/if}; float: left;">
<input size="130" type="text" name="seo_url_{$id_lang|intval}" onfocus="this.select();" value="{$seo_url|escape:'htmlall':'UTF-8'}" />
</div>
{/foreach}
{$pm_flags|as4_nofilter}
{include file='../../core/clear.tpl'}
</div>
{as4_endForm id="SEOpages"}

View File

@@ -0,0 +1,35 @@
{module->_displayTitle text="{l s='URL list' mod='pm_advancedsearch4'}"}
{if $seo_url_list|is_array && $seo_url_list|sizeof}
{as4_startForm id="SEOURLListForm"}
{module->_showInfo text="{l s='You will find here the list of all the predefined results pages URLs you have created for this search engine. You can use them in your menu, slideshow, footer, blocks, or anywhere you want in your website for Google crawling' mod='pm_advancedsearch4'}"}
<p>{l s='Please select the language:' mod='pm_advancedsearch4'}</p>
{$pm_flags|as4_nofilter}
{include file='../../core/clear.tpl'}
{foreach from=$seo_url_list key=id_lang item=seo_urls}
<div id="langseo_url_{$id_lang|intval}" class="pmFlag pmFlagLang_{$id_lang|intval}" style="display: {if $id_lang == $default_language}block{else}none{/if};">
<h3>{l s='HTML version:' mod='pm_advancedsearch4'}</h3>
{strip}
<textarea rows="10" style="width:100%">
{"<ul>\n"|escape:'htmlall':'UTF-8'}
{foreach from=$seo_urls item=seo_url}
{"\t<li><a"|escape:'htmlall':'UTF-8'} href="{$seo_url.url|as4_nofilter}" title="{$seo_url.title|escape:'htmlall':'UTF-8'}"{">"|escape:'htmlall':'UTF-8'}{$seo_url.title|escape:'htmlall':'UTF-8'}{"</a></li>\n"|escape:'htmlall':'UTF-8'}
{/foreach}
{"</ul>"|escape:'htmlall':'UTF-8'}
</textarea>
{/strip}
<h3>{l s='CSV version:' mod='pm_advancedsearch4'}</h3>
{strip}
<textarea rows="10" style="width:100%">
{foreach from=$seo_urls item=seo_url}"{$seo_url.title|as4_nofilter}";"{$seo_url.url|as4_nofilter}"{"\n"}{/foreach}
</textarea>
{/strip}
</div>
{/foreach}
{as4_startForm id="SEOURLListForm"}
{else}
{module->_showInfo text="{l s='No URL yet' mod='pm_advancedsearch4'}"}
{/if}

View File

@@ -0,0 +1,14 @@
<form action="{$base_config_url|as4_nofilter}#config-2" id="formAdvancedStyles_{$module_name|escape:'htmlall':'UTF-8'}" name="formAdvancedStyles_{$module_name|escape:'htmlall':'UTF-8'}" method="post">
<div class="dynamicTextarea">
<textarea name="advancedConfig" id="advancedConfig" cols="120" rows="30">{$advanced_styles|as4_nofilter}</textarea>
</div>
{include file="../../core/clear.tpl"}
<br />
<center>
<input type="submit" value="{l s='Save' mod='pm_advancedsearch4'}" name="submitAdvancedConfig" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
</center>
</form>
<script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("advancedConfig"), {});
</script>
{include file="../../core/clear.tpl"}

View File

@@ -0,0 +1,23 @@
{as4_startForm id="formGlobalOptions" iframetarget=false target='_self'}
{if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '>=')}
{module->_displaySubTitle text="{l s='General settings' mod='pm_advancedsearch4'}"}
{/if}
{as4_inputActive obj=$config key_active='moduleCache' key_db='moduleCache' label={l s='Enable cache' mod='pm_advancedsearch4'} defaultvalue=$default_config.moduleCache}
{as4_inputActive obj=$config key_active='autoReindex' key_db='autoReindex' label={l s='Activate automatic indexing when adding/editing/deleting items (may slow down your back-office)' mod='pm_advancedsearch4'} defaultvalue=$default_config.autoReindex tips={l s='If you disable this option, you will have to manually reindex the search engine or use cron URL' mod='pm_advancedsearch4'}}
{as4_inputActive obj=$config key_active='autoSyncActiveStatus' key_db='autoSyncActiveStatus' label={l s='Activate the active/inactive status sync of items with your criteria' mod='pm_advancedsearch4'} defaultvalue=$default_config.autoSyncActiveStatus}
{as4_inputActive obj=$config key_active='fullTree' key_db='fullTree' label={l s='Display products from subcategories' mod='pm_advancedsearch4'} defaultvalue=$default_config.fullTree}
{as4_inputActive obj=$config key_active='blurEffect' key_db='blurEffect' label={l s='Enable blur effect when loading results' mod='pm_advancedsearch4'} defaultvalue=$default_config.blurEffect}
{if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '>=')}
{module->_displaySubTitle text="{l s='Available sort orders' mod='pm_advancedsearch4'}"}
{foreach from=$sort_orders item=sort_order}
{as4_inputActive obj=$config.sortOrders key_active=$sort_order->toString() key_db=$sort_order->toString() label=$sort_order->getLabel() defaultvalue=false}
{/foreach}
{/if}
{module->_displaySubmit text="{l s='Save' mod='pm_advancedsearch4'}" name='submitModuleConfiguration'}
{as4_endForm id="formGlobalOptions" includehtmlatend=true}

View File

@@ -0,0 +1,19 @@
{module->_showInfo text="{l s='Heavy catalog may need asynchronous/periodical reindex.' mod='pm_advancedsearch4'}<br />{l s='You will find below the needed URL to run this reindex process.' mod='pm_advancedsearch4'}<br />{l s='If you don\'t known how to implement this, please ask your hoster to do it for you.' mod='pm_advancedsearch4'}"}
{module->_displaySubTitle text="{l s='Reindex all search engines:' mod='pm_advancedsearch4'}"}
<ul>
<li>
<a href="{$main_cron_url|escape:'htmlall':'UTF-8'}" target="_blank">{$main_cron_url|escape:'htmlall':'UTF-8'}</a>
</li>
</ul>
{if !empty($cron_urls) && $cron_urls|is_array && $cron_urls|sizeof}
{module->_displaySubTitle text="{l s='Reindex a specific search engine:' mod='pm_advancedsearch4'}"}
<ul>
{foreach from=$cron_urls item=cron_url}
<li>
<a href="{$cron_url|escape:'htmlall':'UTF-8'}" target="_blank">{$cron_url|escape:'htmlall':'UTF-8'}</a>
</li>
{/foreach}
</ul>
{/if}

View File

@@ -0,0 +1,8 @@
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,43 @@
<script type="text/javascript">
var criteriaGroupToReindex = {$groups_to_reindex|json_encode};
</script>
<div class="width3">
<label>{l s='Clear search engines cache' mod='pm_advancedsearch4'}</label>
<div class="margin-form">
<a href="{$base_config_url|as4_nofilter}&pm_load_function=processClearAllCache" class="ajax_script_load ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" style="padding:7px 5px;">
{l s='Clear cache' mod='pm_advancedsearch4'}
</a>
<div class="clear"></div>
</div>
</div>
<div class="width3">
<label>{l s='Reindex all search engines (CRON alternative)' mod='pm_advancedsearch4'}</label>
<div class="margin-form">
<a id="reindexAllSearchLink" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" style="padding:7px 5px;">
{l s='Reindex all' mod='pm_advancedsearch4'}
</a>
<div class="progressbar_wrapper progressbarReindexSpecificSearch">
<div class="progressbar" id="progressbarReindexAllSearch"></div>
<div class="progressbarpercent"></div>
</div>
<div class="clear"></div>
</div>
</div>
<div class="width3">
<label>{l s='Delete all search engines' mod='pm_advancedsearch4'}</label>
<div class="margin-form">
<a href="{$base_config_url|as4_nofilter}&pm_load_function=processClearAllTables" title="{l s='This will delete all your search engines! Are you really sure?' mod='pm_advancedsearch4'}" class="ajax_script_load ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only pm_confirm" style="padding:7px 5px;">
{l s='Remove all' mod='pm_advancedsearch4'}
</a>
<div class="clear"></div>
</div>
</div>
<script type="text/javascript">
$("#reindexAllSearchLink").unbind("click").bind("click",function() {
reindexSearchCriterionGroups($("#reindexAllSearchLink"), criteriaGroupToReindex, "#progressbarReindexAllSearch");
});
</script>

View File

@@ -0,0 +1,126 @@
<script type="text/javascript">
var criteriaGroupToReindex{$id_search|intval} = {$groups_to_reindex|json_encode};
</script>
<div id="searchTabContainer-{$id_search|intval}" class="searchTabContainer">
<div class="searchSort">
<div class="search-actions-buttons">
{as4_button text={l s='Edit' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_load_function=displaySearchForm&class=AdvancedSearchClass&pm_js_callback=closeDialogIframe&id_search={$search_engine.id_search}" class='open_on_dialog_iframe' rel='980_530_1' icon_class='ui-icon ui-icon-pencil'}
{as4_button text={l s='Visibility' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_load_function=displayVisibilityForm&class=AdvancedSearchClass&pm_js_callback=closeDialogIframe&id_search={$search_engine.id_search}" class='open_on_dialog_iframe' rel='980_530_1' icon_class='ui-icon ui-icon-search'}
{if $search_engine.active}
{as4_button text="{l s='Status:' mod='pm_advancedsearch4'} <em id=\"searchStatusLabel{$search_engine.id_search}\">{l s='enabled' mod='pm_advancedsearch4'}</em>" title="{l s='Change status' mod='pm_advancedsearch4'}" href="{$base_config_url|as4_nofilter}&pm_load_function=processActiveSearch&id_search={$search_engine.id_search}" class="ajax_script_load status_search status_search_{$search_engine.id_search} enabled_search" icon_class='ui-icon ui-icon-circle-check'}
{else}
{as4_button text="{l s='Status:' mod='pm_advancedsearch4'} <em id=\"searchStatusLabel{$search_engine.id_search}\">{l s='disabled' mod='pm_advancedsearch4'}</em>" title="{l s='Change status' mod='pm_advancedsearch4'}" href="{$base_config_url|as4_nofilter}&pm_load_function=processActiveSearch&id_search={$search_engine.id_search}" class="ajax_script_load status_search status_search_{$search_engine.id_search}" icon_class='ui-icon ui-icon-circle-close'}
{/if}
{as4_button text={l s='Delete' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_delete_obj=1&class=AdvancedSearchClass&id_search={$search_engine.id_search}" class='ajax_script_load pm_confirm' icon_class='ui-icon ui-icon-trash' title={l s='Delete item #%d ?' mod='pm_advancedsearch4' sprintf=$search_engine.id_search}}
{as4_button text={l s='Duplicate' mod='pm_advancedsearch4'} href="{$base_config_url|as4_nofilter}&pm_duplicate_obj=1&class=AdvancedSearchClass&id_search={$search_engine.id_search}" class='ajax_script_load pm_confirm' icon_class='ui-icon ui-icon-newwin' title={l s='Duplicate item #%d ?' mod='pm_advancedsearch4' sprintf=$search_engine.id_search}}
{as4_button text={l s='Reindex' mod='pm_advancedsearch4'} class='ajax_script_load' icon_class='ui-icon ui-icon-shuffle' onclick="reindexSearchCriterionGroups(this, criteriaGroupToReindex{$search_engine.id_search}, '#progressbarReindexSpecificSearch{$search_engine.id_search}');"}
</div>
<div class="progressbar_wrapper progressbarReindexSpecificSearch">
<div class="progressbar" id="progressbarReindexSpecificSearch{$id_search|intval}"></div>
<div class="progressbarpercent"></div>
</div>
{include file="../../core/clear.tpl"}
</div>
{include file="../../core/clear.tpl"}
<div class="indexedCriterionGroups connectedSortableDiv" id="IndexCriterionsGroup">
<h3 style="float:left">{l s='Active criteria groups' mod='pm_advancedsearch4'}</h3>
<div style="float:right;">
<abbr title="{l s='This option let you to display hidden criterions groups via a “Show more options“ link' mod='pm_advancedsearch4'}">
{l s='Allow groups to be hidden:' mod='pm_advancedsearch4'}
</abbr>
<input type="checkbox" onclick="displayHideBar($(this));" name="auto_hide" value="{$id_search|intval}" />
</div>
{include file="../../core/clear.tpl"}
<ul class="connectedSortable connectedSortableIndex">
{assign var=hidden value=true}
{foreach from=$criterions_groups_indexed item=criterions_group_indexed}
{if $criterions_group_indexed.hidden && $hidden}
<li class="ui-state-default ui-state-pm-separator as4-hidden-criterions-groups" id="hide_after_{$id_search|intval}">
<span class="ui-icon ui-icon-arrowthick-2-n-s dragIcon dragIconCriterionGroup"></span>
<span class="as4-criterion-group-name">{l s='Groups under this line will be hidden' mod='pm_advancedsearch4'}</span>
<input name="id_search" value="{$id_search|intval}" type="hidden" />
</li>
{assign var=hidden value=false}
{/if}
<li class="ui-state-default" data-id-criterion-group-unit="{$criterions_group_indexed.criterion_group_unit|escape:'htmlall':'UTF-8'}" data-id-criterion-group-type="{$criterions_group_indexed.criterion_group_type|escape:'htmlall':'UTF-8'}" id="{$criterions_group_indexed.unique_id|escape:'htmlall':'UTF-8'}" rel="{$criterions_group_indexed.id_criterion_group|intval}">
<span class="ui-icon ui-icon-arrowthick-2-n-s dragIcon dragIconCriterionGroup"></span>
<span class="as4-criterion-group-name">
{$criterions_group_indexed.name|escape:'htmlall':'UTF-8'}
</span>
<span class="as4-criterion-group-label">
({$criteria_group_labels[$criterions_group_indexed.criterion_group_type]|escape:'htmlall':'UTF-8'})
{if $criterions_group_indexed.criterion_group_type == 'category'}
{if !empty($criterions_group_indexed.id_criterion_group_linked)}
- {l s='Level' mod='pm_advancedsearch4'}&nbsp;{$criterions_group_indexed.id_criterion_group_linked|intval}
{else}
- {l s='All category levels' mod='pm_advancedsearch4'}
{/if}
{/if}
</span>
<span class="ui-icon ui-icon-plusthick plusIcon"></span>
<input name="id_search" value="{$id_search|intval}" type="hidden" />
</li>
<script type="text/javascript">
setCriterionGroupActions("{$criterions_group_indexed.unique_id|escape:'htmlall':'UTF-8'}", true);
</script>
{/foreach}
{if $hidden}
<li class="ui-state-default ui-state-pm-separator as4-hidden-criterions-groups" style="display:none;" id="hide_after_{$id_search|intval}">
<span class="ui-icon ui-icon-arrowthick-2-n-s dragIcon dragIconCriterionGroup"></span>
<span class="as4-criterion-group-name">
{l s='Groups under this line will be hidden' mod='pm_advancedsearch4'}
</span>
<input name="id_search" value="{$id_search|intval}" type="hidden" />
</li>
{/if}
</ul>
<div class="newCriterionGroupPlaceholder"></div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("input[name=auto_hide][value={$id_search|intval}]").prop("checked", {if $hidden}false{else}true{/if});
});
</script>
<div class="availableCriterionGroups connectedSortableDiv" id="DesindexCriterionsGroup">
<h3>{l s='Available criteria groups' mod='pm_advancedsearch4'}</h3>
{foreach from=$criterions_groups key=groupType item=groupList}
<h4>{$criterions_unit_groups_translations[$groupType]|escape:'htmlall':'UTF-8'}</h4>
<ul class="availableCriterionGroups-{$groupType|escape:'htmlall':'UTF-8'} connectedSortable">
{foreach from=$groupList item=criterions_group}
<li title="{{l s='Click to add this criterion group' mod='pm_advancedsearch4'}|escape:'htmlall':'UTF-8'}" class="ui-state-default" id="{$criterions_group.unique_id|escape:'htmlall':'UTF-8'}" data-id-criterion-group-unit="{$groupType|escape:'htmlall':'UTF-8'}" data-id-criterion-group-type="{$criterions_group.type|escape:'htmlall':'UTF-8'}">
<span class="ui-icon ui-icon-arrowthick-2-n-s dragIcon dragIconCriterionGroup"></span>
<span class="as4-criterion-group-name">
{if !empty($criterions_group.internal_name)}
{$criterions_group.internal_name|escape:'htmlall':'UTF-8'}
{else}
{$criterions_group.name|escape:'htmlall':'UTF-8'}
{/if}
</span>
<span class="as4-criterion-group-label">({$criteria_group_labels[$criterions_group.type]|escape:'htmlall':'UTF-8'})</span>
<span class="ui-icon ui-icon-plusthick plusIcon"></span>
<input name="id_search" value="{$id_search|intval}" type="hidden" />
</li>
{/foreach}
</ul>
{/foreach}
</div>
{include file="../../core/clear.tpl"}
<hr />
<div class="seo_search_panel" id="seo_search_panel_{$id_search|intval}"></div>
<script type="text/javascript">
loadPanel("seo_search_panel_{$id_search|intval}", "{$base_config_url|as4_nofilter}&pm_load_function=displaySeoSearchPanelList&id_search={$id_search|intval}");
$(".connectedSortableIndex").sortable({
items: "> li",
axis: "y",
update: function(event, ui) {
var order = $(this).sortable("toArray");
saveOrder(order.join(","), "orderCriterionGroup", $(ui.item).children("input[name=id_search]").val(), $("input[name=auto_hide]").is(":checked"));
}
});
loadAjaxLink();
</script>
</div><!-- .searchTabContainer -->