This commit is contained in:
@@ -1,132 +0,0 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<!-- Block search module TOP -->
|
||||
<div id="search_block_top">
|
||||
|
||||
<form method="get" action="{$link->getPageLink('search')}" id="searchbox">
|
||||
<p>
|
||||
<label for="search_query_top"><!-- image on background --></label>
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="text" id="search_query_top" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{if $instantsearch}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
{literal}
|
||||
function tryToCloseInstantSearch() {
|
||||
if ($('#old_center_column').length > 0)
|
||||
{
|
||||
$('#center_column').remove();
|
||||
$('#old_center_column').attr('id', 'center_column');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
instantSearchQueries = new Array();
|
||||
function stopInstantSearchQueries(){
|
||||
for(i=0;i<instantSearchQueries.length;i++) {
|
||||
instantSearchQueries[i].abort();
|
||||
}
|
||||
instantSearchQueries = new Array();
|
||||
}
|
||||
|
||||
$("#search_query_top").keyup(function(){
|
||||
if($(this).val().length > 0){
|
||||
stopInstantSearchQueries();
|
||||
instantSearchQuery = $.ajax({
|
||||
url: '{/literal}{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}{literal}',
|
||||
data: 'instantSearch=1&id_lang={/literal}{$cookie->id_lang}{literal}&q='+$(this).val(),
|
||||
dataType: 'html',
|
||||
success: function(data){
|
||||
if($("#search_query_top").val().length > 0)
|
||||
{
|
||||
tryToCloseInstantSearch();
|
||||
$('#center_column').attr('id', 'old_center_column');
|
||||
$('#old_center_column').after('<div id="center_column">'+data+'</div>');
|
||||
$("#instant_search_results a.close").click(function() {
|
||||
$("#search_query_top").val('');
|
||||
return tryToCloseInstantSearch();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
tryToCloseInstantSearch();
|
||||
}
|
||||
});
|
||||
instantSearchQueries.push(instantSearchQuery);
|
||||
}
|
||||
else
|
||||
tryToCloseInstantSearch();
|
||||
});
|
||||
// ]]>
|
||||
{/literal}
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
{if $ajaxsearch}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
{literal}
|
||||
$('document').ready( function() {
|
||||
$("#search_query_top")
|
||||
.autocomplete(
|
||||
'{/literal}{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}{literal}', {
|
||||
minChars: 3,
|
||||
max: 10,
|
||||
width: 500,
|
||||
selectFirst: false,
|
||||
scroll: false,
|
||||
dataType: "json",
|
||||
formatItem: function(data, i, max, value, term) {
|
||||
return value;
|
||||
},
|
||||
parse: function(data) {
|
||||
var mytab = new Array();
|
||||
for (var i = 0; i < data.length; i++)
|
||||
mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + data[i].pname };
|
||||
return mytab;
|
||||
},
|
||||
extraParams: {
|
||||
ajaxSearch: 1,
|
||||
id_lang: {/literal}{$cookie->id_lang}{literal}
|
||||
}
|
||||
}
|
||||
)
|
||||
.result(function(event, data, formatted) {
|
||||
$('#search_query_top').val(data.pname);
|
||||
document.location.href = data.product_link;
|
||||
})
|
||||
});
|
||||
{/literal}
|
||||
// ]]>
|
||||
</script>
|
||||
{/if}
|
||||
<!-- /Block search module TOP -->
|
||||
@@ -1,100 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class BlockSearch extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blocksearch';
|
||||
$this->tab = 'search_filter';
|
||||
$this->version = 1.0;
|
||||
$this->author = 'PrestaShop';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Quick Search block');
|
||||
$this->description = $this->l('Adds a block with a quick search field.');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install() OR !$this->registerHook('top')
|
||||
OR !$this->registerHook('leftColumn')
|
||||
OR !$this->registerHook('rightColumn')
|
||||
)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public function hookLeftColumn($params)
|
||||
{
|
||||
return $this->hookRightColumn($params);
|
||||
}
|
||||
|
||||
public function hookRightColumn($params)
|
||||
{
|
||||
$this->_hookCommon($params);
|
||||
return $this->display(__FILE__, 'blocksearch.tpl');
|
||||
}
|
||||
|
||||
public function hookTop($params)
|
||||
{
|
||||
$this->_hookCommon($params);
|
||||
return $this->display(__FILE__, 'blocksearch-top.tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* _hookAll has to be called in each hookXXX methods. This is made to avoid code duplication.
|
||||
*
|
||||
* @param mixed $params
|
||||
* @return void
|
||||
*/
|
||||
private function _hookCommon($params)
|
||||
{
|
||||
global $smarty;
|
||||
$smarty->assign('ENT_QUOTES', ENT_QUOTES);
|
||||
$smarty->assign('search_ssl', (int)(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off'));
|
||||
|
||||
$ajaxSearch=(int)(Configuration::get('PS_SEARCH_AJAX'));
|
||||
$smarty->assign('ajaxsearch', $ajaxSearch);
|
||||
|
||||
$instantSearch = (int)(Configuration::get('PS_INSTANT_SEARCH'));
|
||||
$smarty->assign('instantsearch', $instantSearch);
|
||||
if ($ajaxSearch)
|
||||
{
|
||||
Tools::addCSS(_PS_CSS_DIR_.'jquery.autocomplete.css');
|
||||
Tools::addJS(_PS_JS_DIR_.'jquery/jquery.autocomplete.js');
|
||||
}
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
Tools::addCSS(($this->_path).'blocksearch.css', 'all');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 1.4 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<!-- Block search module -->
|
||||
<div id="search_block_left" class="block exclusive">
|
||||
<h4>{l s='Search' mod='blocksearch'}</h4>
|
||||
<form method="get" action="{$link->getPageLink('search', true)}" id="searchbox">
|
||||
<p class="block_content">
|
||||
<label for="search_query_block">{l s='Enter a product name' mod='blocksearch'}</label>
|
||||
<input type="hidden" name="orderby" value="position" />
|
||||
<input type="hidden" name="orderway" value="desc" />
|
||||
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
|
||||
<input type="submit" id="search_button" class="button_mini" value="{l s='go' mod='blocksearch'}" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{if $instantsearch}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
{literal}
|
||||
function tryToCloseInstantSearch() {
|
||||
if ($('#old_center_column').length > 0)
|
||||
{
|
||||
$('#center_column').remove();
|
||||
$('#old_center_column').attr('id', 'center_column');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
instantSearchQueries = new Array();
|
||||
function stopInstantSearchQueries(){
|
||||
for(i=0;i<instantSearchQueries.length;i++) {
|
||||
instantSearchQueries[i].abort();
|
||||
}
|
||||
instantSearchQueries = new Array();
|
||||
}
|
||||
|
||||
$("#search_query_block").keyup(function(){
|
||||
if($(this).val().length > 0){
|
||||
stopInstantSearchQueries();
|
||||
instantSearchQuery = $.ajax({
|
||||
url: '{/literal}{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}{literal}',
|
||||
data: 'instantSearch=1&id_lang={/literal}{$cookie->id_lang}{literal}&q='+$(this).val(),
|
||||
dataType: 'html',
|
||||
success: function(data){
|
||||
if($("#search_query_block").val().length > 0)
|
||||
{
|
||||
tryToCloseInstantSearch();
|
||||
$('#center_column').attr('id', 'old_center_column');
|
||||
$('#old_center_column').after('<div id="center_column">'+data+'</div>');
|
||||
$("#instant_search_results a.close").click(function() {
|
||||
$("#search_query_block").val('');
|
||||
return tryToCloseInstantSearch();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else
|
||||
tryToCloseInstantSearch();
|
||||
}
|
||||
});
|
||||
instantSearchQueries.push(instantSearchQuery);
|
||||
}
|
||||
else
|
||||
tryToCloseInstantSearch();
|
||||
});
|
||||
// ]]>
|
||||
{/literal}
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
{if $ajaxsearch}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
{literal}
|
||||
$('document').ready( function() {
|
||||
$("#search_query_block")
|
||||
.autocomplete(
|
||||
'{/literal}{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}{literal}', {
|
||||
minChars: 3,
|
||||
max: 10,
|
||||
width: 500,
|
||||
selectFirst: false,
|
||||
scroll: false,
|
||||
dataType: "json",
|
||||
formatItem: function(data, i, max, value, term) {
|
||||
return value;
|
||||
},
|
||||
parse: function(data) {
|
||||
var mytab = new Array();
|
||||
for (var i = 0; i < data.length; i++)
|
||||
mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + data[i].pname };
|
||||
return mytab;
|
||||
},
|
||||
extraParams: {
|
||||
ajaxSearch: 1,
|
||||
id_lang: {/literal}{$cookie->id_lang}{literal}
|
||||
}
|
||||
}
|
||||
)
|
||||
.result(function(event, data, formatted) {
|
||||
$('#search_query_block').val(data.pname);
|
||||
document.location.href = data.product_link;
|
||||
})
|
||||
});
|
||||
{/literal}
|
||||
// ]]>
|
||||
</script>
|
||||
{/if}
|
||||
<!-- /Block search module -->
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>blocksearch</name>
|
||||
<displayName>Quick Search block</displayName>
|
||||
<version>1</version>
|
||||
<description>Adds a block with a quick search field.</description>
|
||||
<author>PrestaShop</author>
|
||||
<tab>search_filter</tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
</module>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch-top_13348442cc6a27032d2b4aa28b75a5d3'] = 'Suche';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_31a0c03d7fbd1dc61d3b8e02760e703b'] = 'Quick Search Block';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_99e20473c0bf3c22d7420eff03ce66c3'] = 'Fügt einen Block mit einem Quick Search Feld hinzu';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_13348442cc6a27032d2b4aa28b75a5d3'] = 'Suche';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_52d578d063d6101bbdae388ece037e60'] = 'Geben Sie einen Produktnamen ein';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_34d1f91fb2e514b8576fab1a75a89a6b'] = 'los';
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch-top_13348442cc6a27032d2b4aa28b75a5d3'] = 'Buscar';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_31a0c03d7fbd1dc61d3b8e02760e703b'] = 'Bloque de búsqueda rápida';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_99e20473c0bf3c22d7420eff03ce66c3'] = 'Añada u bloque con un campo de búsqueda rápida';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_13348442cc6a27032d2b4aa28b75a5d3'] = 'Buscar';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_52d578d063d6101bbdae388ece037e60'] = 'Introduzca el nombre del producto';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_34d1f91fb2e514b8576fab1a75a89a6b'] = 'buscar';
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch-top_13348442cc6a27032d2b4aa28b75a5d3'] = 'Rechercher';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_31a0c03d7fbd1dc61d3b8e02760e703b'] = 'Bloc recherche rapide';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_99e20473c0bf3c22d7420eff03ce66c3'] = 'Ajoute un bloc avec un champ de recherche rapide';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_13348442cc6a27032d2b4aa28b75a5d3'] = 'Rechercher';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_52d578d063d6101bbdae388ece037e60'] = 'Entrez un nom de produit';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_34d1f91fb2e514b8576fab1a75a89a6b'] = 'ok';
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch-top_13348442cc6a27032d2b4aa28b75a5d3'] = 'Cerca';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_31a0c03d7fbd1dc61d3b8e02760e703b'] = 'Blocco ricerca rapida ';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_99e20473c0bf3c22d7420eff03ce66c3'] = 'Aggiunge un blocco con un campo di ricerca rapida';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_13348442cc6a27032d2b4aa28b75a5d3'] = 'Cerca';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_52d578d063d6101bbdae388ece037e60'] = 'Inserisci il nome di un prodotto';
|
||||
$_MODULE['<{blocksearch}prestashop>blocksearch_34d1f91fb2e514b8576fab1a75a89a6b'] = 'Vai';
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 615 B |
Reference in New Issue
Block a user