Jump to content

¿Cómo añadir este grandioso código de statictic en mi caso? (Módulo de búsqueda con imágenes)


Rubén

Recommended Posts

Cito el código, nadie, como ayer hice eso contigo no sé si será igual.

[quote][color=#7B7B7B][font=Arial, Helvetica, sans-serif][size=3][i]Buenas a tod@s, aquí os dejo como añadir el plugin Jquery autocomple a la caja de busqueda del menu horizontal que trae de base el Prestashop (blocktopmenu) y la imagen del producto en el resultado de la busqueda. Tambien es funcional con la busqueda instantánea.[/i][/size][/font][/color][color=#7B7B7B][font=Arial, Helvetica, sans-serif][size=3][i]


Lo primero de todo, es entender que hace falta un override para la clase Search, ya que la busqueda ajax no contempla el id de la imagen del producto.

Creamos un archivo php llamado Search con el siguente código y lo subiremos a la carpeta [b]override/classes[/b] de nuestra tienda:

[color=#666600]<?[/color][color=#000000]php
[/color][color=#000088]class[/color][color=#000000] [/color][color=#660066]Search[/color][color=#000000] [/color][color=#000088]extends[/color][color=#000000] [/color][color=#660066]SearchCore[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000]
[/color][color=#000088]public[/color][color=#000000] [/color][color=#000088]static[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] find[/color][color=#666600]([/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] $expr[/color][color=#666600],[/color][color=#000000] $page_number [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] $page_size [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] $order_by [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'position'[/color][color=#666600],[/color][color=#000000] $order_way [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'desc'[/color][color=#666600],[/color][color=#000000] $ajax [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] $use_cookie [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600],[/color][color=#000000] [/color][color=#660066]Context[/color][color=#000000] $context [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]null[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]$context[/color][color=#666600])[/color]
[color=#000000] $context [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Context[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]();[/color]
[color=#000000] $db [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]([/color][color=#000000]_PS_USE_SQL_SLAVE_[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#880000]// Only use cookie if id_customer is not present[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$use_cookie[/color][color=#666600])[/color]
[color=#000000] $id_customer [/color][color=#666600]=[/color][color=#000000] $context[/color][color=#666600]->[/color][color=#000000]customer[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] $id_customer [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600];[/color]
[color=#000000] [/color][color=#880000]// TODO : smart page management[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$page_number [/color][color=#666600]<[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600])[/color][color=#000000] $page_number [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$page_size [/color][color=#666600]<[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600])[/color][color=#000000] $page_size [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isOrderBy[/color][color=#666600]([/color][color=#000000]$order_by[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color][color=#000000] [/color][color=#666600]![/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isOrderWay[/color][color=#666600]([/color][color=#000000]$order_way[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600];[/color]
[color=#000000] $intersect_array [/color][color=#666600]=[/color][color=#000000] array[/color][color=#666600]();[/color]
[color=#000000] $score_array [/color][color=#666600]=[/color][color=#000000] array[/color][color=#666600]();[/color]
[color=#000000] $words [/color][color=#666600]=[/color][color=#000000] explode[/color][color=#666600]([/color][color=#008800]' '[/color][color=#666600],[/color][color=#000000] [/color][color=#660066]Search[/color][color=#666600]::[/color][color=#000000]sanitize[/color][color=#666600]([/color][color=#000000]$expr[/color][color=#666600],[/color][color=#000000] $id_lang[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$words [/color][color=#000088]as[/color][color=#000000] $key [/color][color=#666600]=>[/color][color=#000000] $word[/color][color=#666600])[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]empty[/color][color=#666600]([/color][color=#000000]$word[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] strlen[/color][color=#666600]([/color][color=#000000]$word[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]>=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_SEARCH_MINWORDLEN'[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $word [/color][color=#666600]=[/color][color=#000000] str_replace[/color][color=#666600]([/color][color=#008800]'%'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'\\%'[/color][color=#666600],[/color][color=#000000] $word[/color][color=#666600]);[/color]
[color=#000000] $word [/color][color=#666600]=[/color][color=#000000] str_replace[/color][color=#666600]([/color][color=#008800]'_'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'\\_'[/color][color=#666600],[/color][color=#000000] $word[/color][color=#666600]);[/color]
[color=#000000] $intersect_array[/color][color=#666600][][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'SELECT si.id_product
FROM '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'search_word sw
LEFT JOIN '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'search_index si ON sw.id_word = si.id_word
WHERE sw.id_lang = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#008800]'
AND sw.id_shop = '[/color][color=#666600].[/color][color=#000000]$context[/color][color=#666600]->[/color][color=#000000]shop[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600].[/color][color=#008800]'
AND sw.word LIKE
'[/color][color=#666600].([/color][color=#000000]$word[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]'-'[/color]
[color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' \''[/color][color=#666600].[/color][color=#000000]pSQL[/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]substr[/color][color=#666600]([/color][color=#000000]$word[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] PS_SEARCH_MAX_WORD_LENGTH[/color][color=#666600])).[/color][color=#008800]'%\''[/color]
[color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]'\''[/color][color=#666600].[/color][color=#000000]pSQL[/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]substr[/color][color=#666600]([/color][color=#000000]$word[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600],[/color][color=#000000] PS_SEARCH_MAX_WORD_LENGTH[/color][color=#666600])).[/color][color=#008800]'%\''[/color]
[color=#000000] [/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$word[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]!=[/color][color=#000000] [/color][color=#008800]'-'[/color][color=#666600])[/color]
[color=#000000] $score_array[/color][color=#666600][][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'sw.word LIKE \''[/color][color=#666600].[/color][color=#000000]pSQL[/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]substr[/color][color=#666600]([/color][color=#000000]$word[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600],[/color][color=#000000] PS_SEARCH_MAX_WORD_LENGTH[/color][color=#666600])).[/color][color=#008800]'%\''[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] unset[/color][color=#666600]([/color][color=#000000]$words[/color][color=#666600][[/color][color=#000000]$key[/color][color=#666600]]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$words[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$ajax [/color][color=#666600]?[/color][color=#000000] array[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] array[/color][color=#666600]([/color][color=#008800]'total'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'result'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] array[/color][color=#666600]()));[/color]
[color=#000000] $score [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$score_array[/color][color=#666600]))[/color]
[color=#000000] $score [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]',(
SELECT SUM(weight)
FROM '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'search_word sw
LEFT JOIN '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'search_index si ON sw.id_word = si.id_word
WHERE sw.id_lang = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#008800]'
AND sw.id_shop = '[/color][color=#666600].[/color][color=#000000]$context[/color][color=#666600]->[/color][color=#000000]shop[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600].[/color][color=#008800]'
AND si.id_product = p.id_product
AND ('[/color][color=#666600].[/color][color=#000000]implode[/color][color=#666600]([/color][color=#008800]' OR '[/color][color=#666600],[/color][color=#000000] $score_array[/color][color=#666600]).[/color][color=#008800]')
) position'[/color][color=#666600];[/color]
[color=#000000] $sql [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'SELECT cp.`id_product`
FROM `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'category_group` cg
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'category_product` cp ON cp.`id_category` = cg.`id_category`
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'category` c ON cp.`id_category` = c.`id_category`
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'product` p ON cp.`id_product` = p.`id_product`
'[/color][color=#666600].[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlAssociation[/color][color=#666600]([/color][color=#008800]'product'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'p'[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600]).[/color][color=#008800]'
WHERE c.`active` = 1
AND product_shop.`active` = 1
AND product_shop.`visibility` IN ("both", "search")
AND product_shop.indexed = 1
AND cg.`id_group` '[/color][color=#666600].(![/color][color=#000000]$id_customer [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]'= 1'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]'IN (
SELECT id_group FROM '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'customer_group
WHERE id_customer = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_customer[/color][color=#666600].[/color][color=#008800]'
)'[/color][color=#666600]);[/color]
[color=#000000] $results [/color][color=#666600]=[/color][color=#000000] $db[/color][color=#666600]->[/color][color=#000000]executeS[/color][color=#666600]([/color][color=#000000]$sql[/color][color=#666600]);[/color]
[color=#000000] $eligible_products [/color][color=#666600]=[/color][color=#000000] array[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$results [/color][color=#000088]as[/color][color=#000000] $row[/color][color=#666600])[/color]
[color=#000000] $eligible_products[/color][color=#666600][][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] $row[/color][color=#666600][[/color][color=#008800]'id_product'[/color][color=#666600]];[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$intersect_array [/color][color=#000088]as[/color][color=#000000] $query[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $eligible_products2 [/color][color=#666600]=[/color][color=#000000] array[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$db[/color][color=#666600]->[/color][color=#000000]executeS[/color][color=#666600]([/color][color=#000000]$query[/color][color=#666600])[/color][color=#000000] [/color][color=#000088]as[/color][color=#000000] $row[/color][color=#666600])[/color]
[color=#000000] $eligible_products2[/color][color=#666600][][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] $row[/color][color=#666600][[/color][color=#008800]'id_product'[/color][color=#666600]];[/color]
[color=#000000] $eligible_products [/color][color=#666600]=[/color][color=#000000] array_intersect[/color][color=#666600]([/color][color=#000000]$eligible_products[/color][color=#666600],[/color][color=#000000] $eligible_products2[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$eligible_products[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$ajax [/color][color=#666600]?[/color][color=#000000] array[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] array[/color][color=#666600]([/color][color=#008800]'total'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'result'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] array[/color][color=#666600]()));[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $eligible_products [/color][color=#666600]=[/color][color=#000000] array_unique[/color][color=#666600]([/color][color=#000000]$eligible_products[/color][color=#666600]);[/color]
[color=#000000] $product_pool [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$eligible_products [/color][color=#000088]as[/color][color=#000000] $id_product[/color][color=#666600])[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$id_product[/color][color=#666600])[/color]
[color=#000000] $product_pool [/color][color=#666600].=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_product[/color][color=#666600].[/color][color=#008800]','[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]empty[/color][color=#666600]([/color][color=#000000]$product_pool[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$ajax [/color][color=#666600]?[/color][color=#000000] array[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] array[/color][color=#666600]([/color][color=#008800]'total'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'result'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] array[/color][color=#666600]()));[/color]
[color=#000000] $product_pool [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600](([/color][color=#000000]strpos[/color][color=#666600]([/color][color=#000000]$product_pool[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]','[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]===[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#666600]([/color][color=#008800]' = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$product_pool[/color][color=#666600].[/color][color=#008800]' '[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]([/color][color=#008800]' IN ('[/color][color=#666600].[/color][color=#000000]rtrim[/color][color=#666600]([/color][color=#000000]$product_pool[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]','[/color][color=#666600]).[/color][color=#008800]') '[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$ajax[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#880000]// Add image ID to the query[/color]
[color=#000000] $sql [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname, i.id_image,
cl.link_rewrite crewrite, pl.link_rewrite prewrite '[/color][color=#666600].[/color][color=#000000]$score[/color][color=#666600].[/color][color=#008800]'
FROM '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'product p
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'product_lang` pl ON (
p.`id_product` = pl.`id_product`
AND pl.`id_lang` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlRestrictionOnLang[/color][color=#666600]([/color][color=#008800]'pl'[/color][color=#666600]).[/color][color=#008800]'
)
'[/color][color=#666600].[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlAssociation[/color][color=#666600]([/color][color=#008800]'product'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'p'[/color][color=#666600]).[/color][color=#008800]'
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'category_lang` cl ON (
product_shop.`id_category_default` = cl.`id_category`
AND cl.`id_lang` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlRestrictionOnLang[/color][color=#666600]([/color][color=#008800]'cl'[/color][color=#666600]).[/color][color=#008800]'
)
LEFT JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'image` i ON (i.`id_product` = p.`id_product` AND i.cover=1)
WHERE p.`id_product` '[/color][color=#666600].[/color][color=#000000]$product_pool[/color][color=#666600].[/color][color=#008800]'
ORDER BY position DESC LIMIT 10'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] $db[/color][color=#666600]->[/color][color=#000000]executeS[/color][color=#666600]([/color][color=#000000]$sql[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]strpos[/color][color=#666600]([/color][color=#000000]$order_by[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'.'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]>[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $order_by [/color][color=#666600]=[/color][color=#000000] explode[/color][color=#666600]([/color][color=#008800]'.'[/color][color=#666600],[/color][color=#000000] $order_by[/color][color=#666600]);[/color]
[color=#000000] $order_by [/color][color=#666600]=[/color][color=#000000] pSQL[/color][color=#666600]([/color][color=#000000]$order_by[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]]).[/color][color=#008800]'.`'[/color][color=#666600].[/color][color=#000000]pSQL[/color][color=#666600]([/color][color=#000000]$order_by[/color][color=#666600][[/color][color=#006666]1[/color][color=#666600]]).[/color][color=#008800]'`'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $alias [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$order_by [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]'price'[/color][color=#666600])[/color]
[color=#000000] $alias [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'product_shop.'[/color][color=#666600];[/color]
[color=#000000] $sql [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity,
pl.`description_short`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`name`,
MAX(image_shop.`id_image`) id_image, il.`legend`, m.`name` manufacturer_name '[/color][color=#666600].[/color][color=#000000]$score[/color][color=#666600].[/color][color=#008800]', MAX(product_attribute_shop.`id_product_attribute`) id_product_attribute,
DATEDIFF(
p.`date_add`,
DATE_SUB(
NOW(),
INTERVAL '[/color][color=#666600].([/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isUnsignedInt[/color][color=#666600]([/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_NB_DAYS_NEW_PRODUCT'[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_NB_DAYS_NEW_PRODUCT'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#006666]20[/color][color=#666600]).[/color][color=#008800]' DAY
)
) > 0 new
FROM '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'product p
'[/color][color=#666600].[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlAssociation[/color][color=#666600]([/color][color=#008800]'product'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'p'[/color][color=#666600]).[/color][color=#008800]'
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'product_lang` pl ON (
p.`id_product` = pl.`id_product`
AND pl.`id_lang` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlRestrictionOnLang[/color][color=#666600]([/color][color=#008800]'pl'[/color][color=#666600]).[/color][color=#008800]'
)
LEFT JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'product_attribute` pa ON (p.`id_product` = pa.`id_product`)
'[/color][color=#666600].[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlAssociation[/color][color=#666600]([/color][color=#008800]'product_attribute'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'pa'[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'product_attribute_shop.`default_on` = 1'[/color][color=#666600]).[/color][color=#008800]'
'[/color][color=#666600].[/color][color=#660066]Product[/color][color=#666600]::[/color][color=#000000]sqlStock[/color][color=#666600]([/color][color=#008800]'p'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'product_attribute_shop'[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] $context[/color][color=#666600]->[/color][color=#000000]shop[/color][color=#666600]).[/color][color=#008800]'
LEFT JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer`
LEFT JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'image` i ON (i.`id_product` = p.`id_product`)'[/color][color=#666600].[/color]
[color=#000000] [/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlAssociation[/color][color=#666600]([/color][color=#008800]'image'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'i'[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'image_shop.cover=1'[/color][color=#666600]).[/color][color=#008800]'
LEFT JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#008800]')
WHERE p.`id_product` '[/color][color=#666600].[/color][color=#000000]$product_pool[/color][color=#666600].[/color][color=#008800]'
GROUP BY product_shop.id_product
'[/color][color=#666600].([/color][color=#000000]$order_by [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]'ORDER BY '[/color][color=#666600].[/color][color=#000000]$alias[/color][color=#666600].[/color][color=#000000]$order_by [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]).([/color][color=#000000]$order_way [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' '[/color][color=#666600].[/color][color=#000000]$order_way [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]).[/color][color=#008800]'
LIMIT '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])(([/color][color=#000000]$page_number [/color][color=#666600]-[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]*[/color][color=#000000] $page_size[/color][color=#666600]).[/color][color=#008800]','[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$page_size[/color][color=#666600];[/color]
[color=#000000] $result [/color][color=#666600]=[/color][color=#000000] $db[/color][color=#666600]->[/color][color=#000000]executeS[/color][color=#666600]([/color][color=#000000]$sql[/color][color=#666600]);[/color]
[color=#000000] $sql [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'SELECT COUNT(*)
FROM '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'product p
'[/color][color=#666600].[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlAssociation[/color][color=#666600]([/color][color=#008800]'product'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'p'[/color][color=#666600]).[/color][color=#008800]'
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'product_lang` pl ON (
p.`id_product` = pl.`id_product`
AND pl.`id_lang` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]addSqlRestrictionOnLang[/color][color=#666600]([/color][color=#008800]'pl'[/color][color=#666600]).[/color][color=#008800]'
)
LEFT JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer`
WHERE p.`id_product` '[/color][color=#666600].[/color][color=#000000]$product_pool[/color][color=#666600];[/color]
[color=#000000] $total [/color][color=#666600]=[/color][color=#000000] $db[/color][color=#666600]->[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#000000]$sql[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]$result[/color][color=#666600])[/color]
[color=#000000] $result_properties [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] $result_properties [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Product[/color][color=#666600]::[/color][color=#000000]getProductsProperties[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] $result[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] array[/color][color=#666600]([/color][color=#008800]'total'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] $total[/color][color=#666600],[/color][color=#008800]'result'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] $result_properties[/color][color=#666600]);[/color]
[color=#666600]}[/color]
[color=#666600]}[/color]
[color=#666600]?>[/color]
El siguente paso es reemplazar el contenido completo del archivo blocktopmenu.php por este otro:

[color=#666600]<?[/color][color=#000000]php
[/color][color=#880000]/*
* 2007-2013 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 [email protected] 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 <[email protected]>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/[/color]
[color=#000088]require[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]dirname[/color][color=#666600]([/color][color=#000000]__FILE__[/color][color=#666600]).[/color][color=#008800]'/menutoplinks.class.php'[/color][color=#666600]);[/color]
[color=#000088]class[/color][color=#000000] [/color][color=#660066]Blocktopmenu[/color][color=#000000] [/color][color=#000088]extends[/color][color=#000000] [/color][color=#660066]Module[/color]
[color=#666600]{[/color]
[color=#000088]private[/color][color=#000000] $_menu [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000088]private[/color][color=#000000] $_html [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000088]private[/color][color=#000000] $user_groups[/color][color=#666600];[/color]
[color=#880000]/*
* Pattern for matching config values
*/[/color]
[color=#000088]private[/color][color=#000000] $pattern [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'/^([A-Z_]*)[0-9]+/'[/color][color=#666600];[/color]
[color=#880000]/*
* Name of the controller
* Used to set item selected or not in top menu
*/[/color]
[color=#000088]private[/color][color=#000000] $page_name [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#880000]/*
* Spaces per depth in BO
*/[/color]
[color=#000088]private[/color][color=#000000] $spacer_size [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'5'[/color][color=#666600];[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] __construct[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]name [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'blocktopmenu'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]tab [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'front_office_features'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]version [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]1.5[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]author [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'PrestaShop'[/color][color=#666600];[/color]
[color=#000000] parent[/color][color=#666600]::[/color][color=#000000]__construct[/color][color=#666600]();[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]displayName [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Top horizontal menu'[/color][color=#666600]);[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]description [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Add a new horizontal menu to the top of your e-commerce website.'[/color][color=#666600]);[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] install[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]parent[/color][color=#666600]::[/color][color=#000000]install[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'displayTop'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000000]updateGlobalValue[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_ITEMS'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'CAT1,CMS1,CMS2,PRD1'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000000]updateGlobalValue[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_SEARCH'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'1'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectCategoryUpdateAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectCategoryDeleteAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectCmsUpdateAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectCmsDeleteAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectSupplierUpdateAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectSupplierDeleteAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectManufacturerUpdateAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectManufacturerDeleteAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectProductUpdateAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionObjectProductDeleteAfter'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'categoryUpdate'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]registerHook[/color][color=#666600]([/color][color=#008800]'actionShopDataDuplication'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]installDB[/color][color=#666600]())[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600];[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] installDb[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]execute[/color][color=#666600]([/color][color=#008800]'
CREATE TABLE IF NOT EXISTS `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'linksmenutop` (
`id_linksmenutop` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`id_shop` INT(11) UNSIGNED NOT NULL,
`new_window` TINYINT( 1 ) NOT NULL,
INDEX (`id_shop`)
) ENGINE = '[/color][color=#666600].[/color][color=#000000]_MYSQL_ENGINE_[/color][color=#666600].[/color][color=#008800]' CHARACTER SET utf8 COLLATE utf8_general_ci;'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]&&[/color]
[color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]execute[/color][color=#666600]([/color][color=#008800]'
CREATE TABLE IF NOT EXISTS `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'linksmenutop_lang` (
`id_linksmenutop` INT(11) UNSIGNED NOT NULL,
`id_lang` INT(11) UNSIGNED NOT NULL,
`id_shop` INT(11) UNSIGNED NOT NULL,
`label` VARCHAR( 128 ) NOT NULL ,
`link` VARCHAR( 128 ) NOT NULL ,
INDEX ( `id_linksmenutop` , `id_lang`, `id_shop`)
) ENGINE = '[/color][color=#666600].[/color][color=#000000]_MYSQL_ENGINE_[/color][color=#666600].[/color][color=#008800]' CHARACTER SET utf8 COLLATE utf8_general_ci;'[/color][color=#666600]));[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] uninstall[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]parent[/color][color=#666600]::[/color][color=#000000]uninstall[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000000]deleteByName[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_ITEMS'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000000]deleteByName[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_SEARCH'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color]
[color=#000000] [/color][color=#666600]![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]uninstallDB[/color][color=#666600]())[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600];[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] uninstallDb[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]execute[/color][color=#666600]([/color][color=#008800]'DROP TABLE `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'linksmenutop`'[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]execute[/color][color=#666600]([/color][color=#008800]'DROP TABLE `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'linksmenutop_lang`'[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600];[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] getContent[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Context[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]()->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] $languages [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]controller[/color][color=#666600]->[/color][color=#000000]getLanguages[/color][color=#666600]();[/color]
[color=#000000] $default_language [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_LANG_DEFAULT'[/color][color=#666600]);[/color]
[color=#000000] $labels [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'label'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] array_filter[/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'label'[/color][color=#666600]),[/color][color=#000000] [/color][color=#008800]'strlen'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] array[/color][color=#666600]();[/color]
[color=#000000] $links_label [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'link'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] array_filter[/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'link'[/color][color=#666600]),[/color][color=#000000] [/color][color=#008800]'strlen'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] array[/color][color=#666600]();[/color]
[color=#000000] $spacer [/color][color=#666600]=[/color][color=#000000] str_repeat[/color][color=#666600]([/color][color=#008800]'&nbsp;'[/color][color=#666600],[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]spacer_size[/color][color=#666600]);[/color]
[color=#000000] $divLangName [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'link_label'[/color][color=#666600];[/color]
[color=#000000] $update_cache [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]isSubmit[/color][color=#666600]([/color][color=#008800]'submitBlocktopmenu'[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000000]updateValue[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_ITEMS'[/color][color=#666600],[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'items'[/color][color=#666600])))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]displayConfirmation[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'The settings have been updated.'[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]displayError[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Unable to update settings.'[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000000]updateValue[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_SEARCH'[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]bool[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'search'[/color][color=#666600]));[/color]
[color=#000000] $update_cache [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color][color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]isSubmit[/color][color=#666600]([/color][color=#008800]'submitBlocktopmenuLinks'[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]((![/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$links_label[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$labels[/color][color=#666600])))[/color]
[color=#000000] [/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]else[/color][color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$links_label[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]displayError[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Please complete the "link" field.'[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]else[/color][color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$labels[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]displayError[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Please add a label'[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]else[/color][color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]isset[/color][color=#666600]([/color][color=#000000]$labels[/color][color=#666600][[/color][color=#000000]$default_language[/color][color=#666600]]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]displayError[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Please add a label for your default language.'[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000000]add[/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'link'[/color][color=#666600]),[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'label'[/color][color=#666600]),[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'new_window'[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600]),[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]());[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]displayConfirmation[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'The link has been added.'[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $update_cache [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color][color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]isSubmit[/color][color=#666600]([/color][color=#008800]'submitBlocktopmenuRemove'[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $id_linksmenutop [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_linksmenutop'[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000000]remove[/color][color=#666600]([/color][color=#000000]$id_linksmenutop[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]());[/color]
[color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000000]updateValue[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_ITEMS'[/color][color=#666600],[/color][color=#000000] str_replace[/color][color=#666600]([/color][color=#000000]array[/color][color=#666600]([/color][color=#008800]'LNK'[/color][color=#666600].[/color][color=#000000]$id_linksmenutop[/color][color=#666600].[/color][color=#008800]','[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'LNK'[/color][color=#666600].[/color][color=#000000]$id_linksmenutop[/color][color=#666600]),[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600],[/color][color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_ITEMS'[/color][color=#666600])));[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]displayConfirmation[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'The link has been removed'[/color][color=#666600]));[/color]
[color=#000000] $update_cache [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color][color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]isSubmit[/color][color=#666600]([/color][color=#008800]'submitBlocktopmenuEdit'[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $id_linksmenutop [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_linksmenutop'[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600]);[/color]
[color=#000000] $id_shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]isSubmit[/color][color=#666600]([/color][color=#008800]'link'[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $tmp [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000000]getLinkLang[/color][color=#666600]([/color][color=#000000]$id_linksmenutop[/color][color=#666600],[/color][color=#000000] $id_shop[/color][color=#666600]);[/color]
[color=#000000] $links_label_edit [/color][color=#666600]=[/color][color=#000000] $tmp[/color][color=#666600][[/color][color=#008800]'link'[/color][color=#666600]];[/color]
[color=#000000] $labels_edit [/color][color=#666600]=[/color][color=#000000] $tmp[/color][color=#666600][[/color][color=#008800]'label'[/color][color=#666600]];[/color]
[color=#000000] $new_window_edit [/color][color=#666600]=[/color][color=#000000] $tmp[/color][color=#666600][[/color][color=#008800]'new_window'[/color][color=#666600]];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000000]update[/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'link'[/color][color=#666600]),[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'label'[/color][color=#666600]),[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'new_window'[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600]),[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_shop[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_linksmenutop[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_linksmenutop[/color][color=#666600]);[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]displayConfirmation[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'The link has been edited'[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $update_cache [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$update_cache[/color][color=#666600])[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'
<fieldset>
<div class="multishop_info">
'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'The modifications will be applied to'[/color][color=#666600]).[/color][color=#008800]' '[/color][color=#666600].([/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] [/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]CONTEXT_SHOP [/color][color=#666600]?[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'shop'[/color][color=#666600]).[/color][color=#008800]' '[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]shop[/color][color=#666600]->[/color][color=#000000]name [/color][color=#666600]:[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'all shops'[/color][color=#666600])).[/color][color=#008800]'.
</div>
<legend><img src="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]_path[/color][color=#666600].[/color][color=#008800]'logo.gif" alt="" title="" />'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Settings'[/color][color=#666600]).[/color][color=#008800]'</legend>
<form action="'[/color][color=#666600].[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]safeOutput[/color][color=#666600]([/color][color=#000000]$_SERVER[/color][color=#666600][[/color][color=#008800]'REQUEST_URI'[/color][color=#666600]]).[/color][color=#008800]'" method="post" id="form">
<div style="display: none">
<label>'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Items'[/color][color=#666600]).[/color][color=#008800]'</label>
<div class="margin-form">
<input type="text" name="items" id="itemsInput" value="'[/color][color=#666600].[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]safeOutput[/color][color=#666600]([/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_ITEMS'[/color][color=#666600])).[/color][color=#008800]'" size="70" />
</div>
</div>
<div class="clear">&nbsp;</div>
<table style="margin-left: 130px;">
<tbody>
<tr>
<td style="padding-left: 20px;">
<select multiple="multiple" id="availableItems" style="width: 300px; height: 160px;">'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#880000]// BEGIN CMS[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<optgroup label="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'CMS'[/color][color=#666600]).[/color][color=#008800]'">'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCMSOptions[/color][color=#666600]([/color][color=#006666]0[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] $id_lang[/color][color=#666600]);[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</optgroup>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#880000]// BEGIN SUPPLIER[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<optgroup label="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Supplier'[/color][color=#666600]).[/color][color=#008800]'">'[/color][color=#666600];[/color]
[color=#000000] $suppliers [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Supplier[/color][color=#666600]::[/color][color=#000000]getSuppliers[/color][color=#666600]([/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] $id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$suppliers [/color][color=#000088]as[/color][color=#000000] $supplier[/color][color=#666600])[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="SUP'[/color][color=#666600].[/color][color=#000000]$supplier[/color][color=#666600][[/color][color=#008800]'id_supplier'[/color][color=#666600]].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$spacer[/color][color=#666600].[/color][color=#000000]$supplier[/color][color=#666600][[/color][color=#008800]'name'[/color][color=#666600]].[/color][color=#008800]'</option>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</optgroup>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#880000]// BEGIN Manufacturer[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<optgroup label="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Manufacturer'[/color][color=#666600]).[/color][color=#008800]'">'[/color][color=#666600];[/color]
[color=#000000] $manufacturers [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Manufacturer[/color][color=#666600]::[/color][color=#000000]getManufacturers[/color][color=#666600]([/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] $id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$manufacturers [/color][color=#000088]as[/color][color=#000000] $manufacturer[/color][color=#666600])[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="MAN'[/color][color=#666600].[/color][color=#000000]$manufacturer[/color][color=#666600][[/color][color=#008800]'id_manufacturer'[/color][color=#666600]].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$spacer[/color][color=#666600].[/color][color=#000000]$manufacturer[/color][color=#666600][[/color][color=#008800]'name'[/color][color=#666600]].[/color][color=#008800]'</option>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</optgroup>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#880000]// BEGIN Categories[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<optgroup label="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Categories'[/color][color=#666600]).[/color][color=#008800]'">'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCategoryOption[/color][color=#666600]([/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]());[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</optgroup>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#880000]// BEGIN Shops[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]isFeatureActive[/color][color=#666600]())[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<optgroup label="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Shops'[/color][color=#666600]).[/color][color=#008800]'">'[/color][color=#666600];[/color]
[color=#000000] $shops [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getShopsCollection[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$shops [/color][color=#000088]as[/color][color=#000000] $shop[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]$shop[/color][color=#666600]->[/color][color=#000000]setUrl[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] [/color][color=#666600]![/color][color=#000000]$shop[/color][color=#666600]->[/color][color=#000000]getBaseURL[/color][color=#666600]())[/color]
[color=#000000] [/color][color=#000088]continue[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="SHOP'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$shop[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$spacer[/color][color=#666600].[/color][color=#000000]$shop[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</option>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</optgroup>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#880000]// BEGIN Products[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<optgroup label="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Products'[/color][color=#666600]).[/color][color=#008800]'">'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="PRODUCT" style="font-style:italic">'[/color][color=#666600].[/color][color=#000000]$spacer[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Choose product ID'[/color][color=#666600]).[/color][color=#008800]'</option>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</optgroup>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#880000]// BEGIN Menu Top Links[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<optgroup label="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Menu Top Links'[/color][color=#666600]).[/color][color=#008800]'">'[/color][color=#666600];[/color]
[color=#000000] $links [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000000]gets[/color][color=#666600]([/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]null[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]());[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$links [/color][color=#000088]as[/color][color=#000000] $link[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'label'[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $link [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'id_linksmenutop'[/color][color=#666600]],[/color][color=#000000] $default_language[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]());[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="LNK'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'id_linksmenutop'[/color][color=#666600]].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$spacer[/color][color=#666600].[/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'label'[/color][color=#666600]].[/color][color=#008800]'</option>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="LNK'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'id_linksmenutop'[/color][color=#666600]].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$spacer[/color][color=#666600].[/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'label'[/color][color=#666600]].[/color][color=#008800]'</option>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</optgroup>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</select><br />
<br />
<a href="#" id="addItem" style="border: 1px solid rgb(170, 170, 170); margin: 2px; padding: 2px; text-align: center; display: block; text-decoration: none; background-color: rgb(250, 250, 250); color: rgb(18, 52, 86);">'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Add'[/color][color=#666600]).[/color][color=#008800]' &gt;&gt;</a>
</td>
<td>
<select multiple="multiple" id="items" style="width: 300px; height: 160px;">'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]makeMenuOption[/color][color=#666600]();[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</select><br/>
<br/>
<a href="#" id="removeItem" style="border: 1px solid rgb(170, 170, 170); margin: 2px; padding: 2px; text-align: center; display: block; text-decoration: none; background-color: rgb(250, 250, 250); color: rgb(18, 52, 86);">&lt;&lt; '[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Remove'[/color][color=#666600]).[/color][color=#008800]'</a>
</td>
</tr>
</tbody>
</table>
<div class="clear">&nbsp;</div>
<script type="text/javascript">
$(document).ready(function(){
$("#addItem").click(add);
$("#availableItems").dblclick(add);
$("#removeItem").click(remove);
$("#items").dblclick(remove);
function add()
{
$("#availableItems option:selected").each(function(i){
var val = $(this).val();
var text = $(this).text();
text = text.replace(/(^\s*)|(\s*$)/gi,"");
if (val == "PRODUCT")
{
val = prompt("'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Set ID product'[/color][color=#666600]).[/color][color=#008800]'");
if (val == null || val == "" || isNaN(val))
return;
text = "'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Product ID'[/color][color=#666600]).[/color][color=#008800]' "+val;
val = "PRD"+val;
}
$("#items").append("<option value=\""+val+"\">"+text+"</option>");
});
serialize();
return false;
}
function remove()
{
$("#items option:selected").each(function(i){
$(this).remove();
});
serialize();
return false;
}
function serialize()
{
var options = "";
$("#items option").each(function(i){
options += $(this).val()+",";
});
$("#itemsInput").val(options.substr(0, options.length - 1));
}
});
</script>
<label for="s">'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Search Bar'[/color][color=#666600]).[/color][color=#008800]'</label>
<div class="margin-form">
<input type="checkbox" name="search" id="s" value="1"'[/color][color=#666600].(([/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_SEARCH'[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' checked=""'[/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]).[/color][color=#008800]'/>
</div>
<p class="center">
<input type="submit" name="submitBlocktopmenu" value="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Save '[/color][color=#666600]).[/color][color=#008800]'" class="button" />
</p>
</form>
</fieldset><br />'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'
<fieldset>
<legend><img src="../img/admin/add.gif" alt="" title="" />'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Add Menu Top Link'[/color][color=#666600]).[/color][color=#008800]'</legend>
<form action="'[/color][color=#666600].[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]safeOutput[/color][color=#666600]([/color][color=#000000]$_SERVER[/color][color=#666600][[/color][color=#008800]'REQUEST_URI'[/color][color=#666600]]).[/color][color=#008800]'" method="post" id="form">
'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$languages [/color][color=#000088]as[/color][color=#000000] $language[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'
<div id="link_label_'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]].[/color][color=#008800]'" style="display: '[/color][color=#666600].([/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] $id_lang [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]'block'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]'none'[/color][color=#666600]).[/color][color=#008800]';">
<label>'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Label'[/color][color=#666600]).[/color][color=#008800]'</label>
<div class="margin-form">
<input type="text" name="label['[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]].[/color][color=#008800]']" id="label_'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]].[/color][color=#008800]'" size="70" value="'[/color][color=#666600].([/color][color=#000000]isset[/color][color=#666600]([/color][color=#000000]$labels_edit[/color][color=#666600][[/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]]])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]safeOutput[/color][color=#666600]([/color][color=#000000]$labels_edit[/color][color=#666600][[/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]]])[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]).[/color][color=#008800]'" />
</div>
'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'
<label>'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Link'[/color][color=#666600]).[/color][color=#008800]'</label>
<div class="margin-form">
<input type="text" name="link['[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]].[/color][color=#008800]']" id="link_'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]].[/color][color=#008800]'" value="'[/color][color=#666600].([/color][color=#000000]isset[/color][color=#666600]([/color][color=#000000]$links_label_edit[/color][color=#666600][[/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]]])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]safeOutput[/color][color=#666600]([/color][color=#000000]$links_label_edit[/color][color=#666600][[/color][color=#000000]$language[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]]])[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]).[/color][color=#008800]'" size="70" />
</div>
</div>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<label>'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Language'[/color][color=#666600]).[/color][color=#008800]'</label>
<div class="margin-form">'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]displayFlags[/color][color=#666600]([/color][color=#000000]$languages[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] $divLangName[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'link_label'[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600]).[/color][color=#008800]'</div><p style="clear: both;"> </p>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<label style="clear: both;">'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'New Window'[/color][color=#666600]).[/color][color=#008800]'</label>
<div class="margin-form">
<input style="clear: both;" type="checkbox" name="new_window" value="1" '[/color][color=#666600].([/color][color=#000000]isset[/color][color=#666600]([/color][color=#000000]$new_window_edit[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] $new_window_edit [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]'checked'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]).[/color][color=#008800]'/>
</div>
<div class="margin-form">'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]isSubmit[/color][color=#666600]([/color][color=#008800]'id_linksmenutop'[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<input type="hidden" name="id_linksmenutop" value="'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_linksmenutop'[/color][color=#666600]).[/color][color=#008800]'" />'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]isSubmit[/color][color=#666600]([/color][color=#008800]'submitBlocktopmenuEdit'[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<input type="submit" name="submitBlocktopmenuEdit" value="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Edit'[/color][color=#666600]).[/color][color=#008800]'" class="button" />'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'
<input type="submit" name="submitBlocktopmenuLinks" value="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Add '[/color][color=#666600]).[/color][color=#008800]'" class="button" />
</div>
</form>
</fieldset><br />'[/color][color=#666600];[/color]
[color=#000000] $links [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000000]gets[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]null[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]());[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$links[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'
<fieldset>
<legend><img src="../img/admin/details.gif" alt="" title="" />'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'List Menu Top Link'[/color][color=#666600]).[/color][color=#008800]'</legend>
<table style="width:100%;">
<thead>
<tr style="text-align: left;">
<th>'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Id Link'[/color][color=#666600]).[/color][color=#008800]'</th>
<th>'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Label'[/color][color=#666600]).[/color][color=#008800]'</th>
<th>'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Link'[/color][color=#666600]).[/color][color=#008800]'</th>
<th>'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'New Window'[/color][color=#666600]).[/color][color=#008800]'</th>
<th>'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Action'[/color][color=#666600]).[/color][color=#008800]'</th>
</tr>
</thead>
<tbody>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$links [/color][color=#000088]as[/color][color=#000000] $link[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'
<tr>
<td>'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'id_linksmenutop'[/color][color=#666600]].[/color][color=#008800]'</td>
<td>'[/color][color=#666600].[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]safeOutput[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'label'[/color][color=#666600]]).[/color][color=#008800]'</td>
<td><a href="'[/color][color=#666600].[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]safeOutput[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'link'[/color][color=#666600]]).[/color][color=#008800]'"'[/color][color=#666600].(([/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'new_window'[/color][color=#666600]])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' target="_blank"'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]).[/color][color=#008800]'>'[/color][color=#666600].[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]safeOutput[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'link'[/color][color=#666600]]).[/color][color=#008800]'</a></td>
<td>'[/color][color=#666600].(([/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'new_window'[/color][color=#666600]])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Yes'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'No'[/color][color=#666600])).[/color][color=#008800]'</td>
<td>
<form action="'[/color][color=#666600].[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]safeOutput[/color][color=#666600]([/color][color=#000000]$_SERVER[/color][color=#666600][[/color][color=#008800]'REQUEST_URI'[/color][color=#666600]]).[/color][color=#008800]'" method="post">
<input type="hidden" name="id_linksmenutop" value="'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'id_linksmenutop'[/color][color=#666600]].[/color][color=#008800]'" />
<input type="submit" name="submitBlocktopmenuEdit" value="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Edit'[/color][color=#666600]).[/color][color=#008800]'" class="button" />
<input type="submit" name="submitBlocktopmenuRemove" value="'[/color][color=#666600].[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]l[/color][color=#666600]([/color][color=#008800]'Remove'[/color][color=#666600]).[/color][color=#008800]'" class="button" />
</form>
</td>
</tr>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</tbody>
</table>
</fieldset>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html[/color][color=#666600];[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] getMenuItems[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] explode[/color][color=#666600]([/color][color=#008800]','[/color][color=#666600],[/color][color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_ITEMS'[/color][color=#666600]));[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] makeMenuOption[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] $menu_item [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getMenuItems[/color][color=#666600]();[/color]
[color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] $id_shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$menu_item [/color][color=#000088]as[/color][color=#000000] $item[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]$item[/color][color=#666600])[/color]
[color=#000000] [/color][color=#000088]continue[/color][color=#666600];[/color]
[color=#000000] preg_match[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]pattern[/color][color=#666600],[/color][color=#000000] $item[/color][color=#666600],[/color][color=#000000] $values[/color][color=#666600]);[/color]
[color=#000000] $id [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]substr[/color][color=#666600]([/color][color=#000000]$item[/color][color=#666600],[/color][color=#000000] strlen[/color][color=#666600]([/color][color=#000000]$values[/color][color=#666600][[/color][color=#006666]1[/color][color=#666600]]),[/color][color=#000000] strlen[/color][color=#666600]([/color][color=#000000]$item[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]switch[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]substr[/color][color=#666600]([/color][color=#000000]$item[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600],[/color][color=#000000] strlen[/color][color=#666600]([/color][color=#000000]$values[/color][color=#666600][[/color][color=#006666]1[/color][color=#666600]])))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'CAT'[/color][color=#666600]:[/color]
[color=#000000] $category [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Category[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isLoadedObject[/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="CAT'[/color][color=#666600].[/color][color=#000000]$id[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</option>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'PRD'[/color][color=#666600]:[/color]
[color=#000000] $product [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Product[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isLoadedObject[/color][color=#666600]([/color][color=#000000]$product[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="PRD'[/color][color=#666600].[/color][color=#000000]$id[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$product[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</option>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'CMS'[/color][color=#666600]:[/color]
[color=#000000] $cms [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] CMS[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isLoadedObject[/color][color=#666600]([/color][color=#000000]$cms[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="CMS'[/color][color=#666600].[/color][color=#000000]$id[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$cms[/color][color=#666600]->[/color][color=#000000]meta_title[/color][color=#666600].[/color][color=#008800]'</option>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'CMS_CAT'[/color][color=#666600]:[/color]
[color=#000000] $category [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]CMSCategory[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isLoadedObject[/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="CMS_CAT'[/color][color=#666600].[/color][color=#000000]$id[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</option>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'MAN'[/color][color=#666600]:[/color]
[color=#000000] $manufacturer [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Manufacturer[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isLoadedObject[/color][color=#666600]([/color][color=#000000]$manufacturer[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="MAN'[/color][color=#666600].[/color][color=#000000]$id[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$manufacturer[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</option>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'SUP'[/color][color=#666600]:[/color]
[color=#000000] $supplier [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Supplier[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isLoadedObject[/color][color=#666600]([/color][color=#000000]$supplier[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="SUP'[/color][color=#666600].[/color][color=#000000]$id[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$supplier[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</option>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'LNK'[/color][color=#666600]:[/color]
[color=#000000] $link [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_shop[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]isset[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'label'[/color][color=#666600]])[/color][color=#000000] [/color][color=#666600]||[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'label'[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $default_language [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_LANG_DEFAULT'[/color][color=#666600]);[/color]
[color=#000000] $link [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'id_linksmenutop'[/color][color=#666600]],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$default_language[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]());[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="LNK'[/color][color=#666600].[/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'id_linksmenutop'[/color][color=#666600]].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'label'[/color][color=#666600]].[/color][color=#008800]'</option>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'SHOP'[/color][color=#666600]:[/color]
[color=#000000] $shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Shop[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isLoadedObject[/color][color=#666600]([/color][color=#000000]$shop[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="SHOP'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$shop[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</option>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] makeMenu[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] $menu_items [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getMenuItems[/color][color=#666600]();[/color]
[color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] $id_shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$menu_items [/color][color=#000088]as[/color][color=#000000] $item[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]$item[/color][color=#666600])[/color]
[color=#000000] [/color][color=#000088]continue[/color][color=#666600];[/color]
[color=#000000] preg_match[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]pattern[/color][color=#666600],[/color][color=#000000] $item[/color][color=#666600],[/color][color=#000000] $value[/color][color=#666600]);[/color]
[color=#000000] $id [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]substr[/color][color=#666600]([/color][color=#000000]$item[/color][color=#666600],[/color][color=#000000] strlen[/color][color=#666600]([/color][color=#000000]$value[/color][color=#666600][[/color][color=#006666]1[/color][color=#666600]]),[/color][color=#000000] strlen[/color][color=#666600]([/color][color=#000000]$item[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]switch[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]substr[/color][color=#666600]([/color][color=#000000]$item[/color][color=#666600],[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600],[/color][color=#000000] strlen[/color][color=#666600]([/color][color=#000000]$value[/color][color=#666600][[/color][color=#006666]1[/color][color=#666600]])))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'CAT'[/color][color=#666600]:[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCategory[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'PRD'[/color][color=#666600]:[/color]
[color=#000000] $selected [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]page_name [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]'product'[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_product'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] $id[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' class="sfHover"'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] $product [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Product[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]is_null[/color][color=#666600]([/color][color=#000000]$product[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li'[/color][color=#666600].[/color][color=#000000]$selected[/color][color=#666600].[/color][color=#008800]'><a href="'[/color][color=#666600].[/color][color=#000000]$product[/color][color=#666600]->[/color][color=#000000]getLink[/color][color=#666600]().[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$product[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</a></li>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'CMS'[/color][color=#666600]:[/color]
[color=#000000] $selected [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]page_name [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]'cms'[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_cms'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] $id[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' class="sfHover"'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] $cms [/color][color=#666600]=[/color][color=#000000] CMS[/color][color=#666600]::[/color][color=#000000]getLinks[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] array[/color][color=#666600]([/color][color=#000000]$id[/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$cms[/color][color=#666600]))[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li'[/color][color=#666600].[/color][color=#000000]$selected[/color][color=#666600].[/color][color=#008800]'><a href="'[/color][color=#666600].[/color][color=#000000]$cms[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'link'[/color][color=#666600]].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$cms[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'meta_title'[/color][color=#666600]].[/color][color=#008800]'</a></li>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'CMS_CAT'[/color][color=#666600]:[/color]
[color=#000000] $category [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]CMSCategory[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li><a href="'[/color][color=#666600].[/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]getLink[/color][color=#666600]().[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</a>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCMSMenuItems[/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600]);[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</li>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'MAN'[/color][color=#666600]:[/color]
[color=#000000] $selected [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]page_name [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]'manufacturer'[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_manufacturer'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] $id[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' class="sfHover"'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] $manufacturer [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Manufacturer[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]is_null[/color][color=#666600]([/color][color=#000000]$manufacturer[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]intval[/color][color=#666600]([/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_REWRITING_SETTINGS'[/color][color=#666600])))[/color]
[color=#000000] $manufacturer[/color][color=#666600]->[/color][color=#000000]link_rewrite [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]link_rewrite[/color][color=#666600]([/color][color=#000000]$manufacturer[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] $manufacturer[/color][color=#666600]->[/color][color=#000000]link_rewrite [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600];[/color]
[color=#000000] $link [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Link[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li'[/color][color=#666600].[/color][color=#000000]$selected[/color][color=#666600].[/color][color=#008800]'><a href="'[/color][color=#666600].[/color][color=#000000]$link[/color][color=#666600]->[/color][color=#000000]getManufacturerLink[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] $manufacturer[/color][color=#666600]->[/color][color=#000000]link_rewrite[/color][color=#666600]).[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$manufacturer[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</a></li>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'SUP'[/color][color=#666600]:[/color]
[color=#000000] $selected [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]page_name [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]'supplier'[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_supplier'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] $id[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' class="sfHover"'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] $supplier [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Supplier[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]is_null[/color][color=#666600]([/color][color=#000000]$supplier[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $link [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Link[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li'[/color][color=#666600].[/color][color=#000000]$selected[/color][color=#666600].[/color][color=#008800]'><a href="'[/color][color=#666600].[/color][color=#000000]$link[/color][color=#666600]->[/color][color=#000000]getSupplierLink[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] $supplier[/color][color=#666600]->[/color][color=#000000]link_rewrite[/color][color=#666600]).[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$supplier[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</a></li>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'SHOP'[/color][color=#666600]:[/color]
[color=#000000] $selected [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]page_name [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]'index'[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]shop[/color][color=#666600]->[/color][color=#000000]id [/color][color=#666600]==[/color][color=#000000] $id[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' class="sfHover"'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] $shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Shop[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Validate[/color][color=#666600]::[/color][color=#000000]isLoadedObject[/color][color=#666600]([/color][color=#000000]$shop[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $link [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Link[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li'[/color][color=#666600].[/color][color=#000000]$selected[/color][color=#666600].[/color][color=#008800]'><a href="'[/color][color=#666600].[/color][color=#000000]$shop[/color][color=#666600]->[/color][color=#000000]getBaseURL[/color][color=#666600]().[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$shop[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</a></li>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]case[/color][color=#000000] [/color][color=#008800]'LNK'[/color][color=#666600]:[/color]
[color=#000000] $link [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_shop[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]isset[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'label'[/color][color=#666600]])[/color][color=#000000] [/color][color=#666600]||[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'label'[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $default_language [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_LANG_DEFAULT'[/color][color=#666600]);[/color]
[color=#000000] $link [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]MenuTopLinks[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'id_linksmenutop'[/color][color=#666600]],[/color][color=#000000] $default_language[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getContextShopID[/color][color=#666600]());[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li><a href="'[/color][color=#666600].[/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'link'[/color][color=#666600]].[/color][color=#008800]'"'[/color][color=#666600].(([/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'new_window'[/color][color=#666600]])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' target="_blank"'[/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]).[/color][color=#008800]'>'[/color][color=#666600].[/color][color=#000000]$link[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'label'[/color][color=#666600]].[/color][color=#008800]'</a></li>'[/color][color=#666600].[/color][color=#000000]PHP_EOL[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]break[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] getCategoryOption[/color][color=#666600]([/color][color=#000000]$id_category [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] $id_shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] $recursive [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] $id_lang [/color][color=#666600]?[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang [/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Context[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]()->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] $category [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Category[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_category[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_shop[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]is_null[/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$recursive[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $children [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Category[/color][color=#666600]::[/color][color=#000000]getChildren[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_category[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_shop[/color][color=#666600]);[/color]
[color=#000000] $spacer [/color][color=#666600]=[/color][color=#000000] str_repeat[/color][color=#666600]([/color][color=#008800]'&nbsp;'[/color][color=#666600],[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]spacer_size [/color][color=#666600]*[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]level_depth[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]object[/color][color=#666600])[/color][color=#000000] [/color][color=#660066]Shop[/color][color=#666600]::[/color][color=#000000]getShop[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]getShopID[/color][color=#666600]());[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="CAT'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].([/color][color=#000000]isset[/color][color=#666600]([/color][color=#000000]$spacer[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] $spacer [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]).[/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]' ('[/color][color=#666600].[/color][color=#000000]$shop[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]')</option>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]isset[/color][color=#666600]([/color][color=#000000]$children[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] count[/color][color=#666600]([/color][color=#000000]$children[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$children [/color][color=#000088]as[/color][color=#000000] $child[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCategoryOption[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$child[/color][color=#666600][[/color][color=#008800]'id_category'[/color][color=#666600]],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$child[/color][color=#666600][[/color][color=#008800]'id_shop'[/color][color=#666600]]);[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] getCategory[/color][color=#666600]([/color][color=#000000]$id_category[/color][color=#666600],[/color][color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] $id_shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] $id_lang [/color][color=#666600]?[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang [/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Context[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]()->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] $category [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Category[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_category[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]level_depth [/color][color=#666600]>[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600])[/color]
[color=#000000] $category_link [/color][color=#666600]=[/color][color=#000000] $category[/color][color=#666600]->[/color][color=#000000]getLink[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] $category_link [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]link[/color][color=#666600]->[/color][color=#000000]getPageLink[/color][color=#666600]([/color][color=#008800]'index'[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]is_null[/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#666600];[/color]
[color=#000000] $children [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Category[/color][color=#666600]::[/color][color=#000000]getChildren[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_category[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_shop[/color][color=#666600]);[/color]
[color=#000000] $selected [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]page_name [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]'category'[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] [/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_category'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] $id_category[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' class="sfHoverForce"'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] $is_intersected [/color][color=#666600]=[/color][color=#000000] array_intersect[/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]getGroups[/color][color=#666600](),[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]user_groups[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#880000]// filter the categories that the user is allowed to see and browse[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]empty[/color][color=#666600]([/color][color=#000000]$is_intersected[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li '[/color][color=#666600].[/color][color=#000000]$selected[/color][color=#666600].[/color][color=#008800]'>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<a href="'[/color][color=#666600].[/color][color=#000000]$category_link[/color][color=#666600].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$category[/color][color=#666600]->[/color][color=#000000]name[/color][color=#666600].[/color][color=#008800]'</a>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$children[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<ul>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$children [/color][color=#000088]as[/color][color=#000000] $child[/color][color=#666600])[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCategory[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$child[/color][color=#666600][[/color][color=#008800]'id_category'[/color][color=#666600]],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$child[/color][color=#666600][[/color][color=#008800]'id_shop'[/color][color=#666600]]);[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</ul>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</li>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] getCMSMenuItems[/color][color=#666600]([/color][color=#000000]$parent[/color][color=#666600],[/color][color=#000000] $depth [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] $id_lang [/color][color=#666600]?[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang [/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Context[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]()->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$depth [/color][color=#666600]>[/color][color=#000000] [/color][color=#006666]3[/color][color=#666600])[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#666600];[/color]
[color=#000000] $categories [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCMSCategories[/color][color=#666600]([/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$parent[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] $pages [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCMSPages[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$parent[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]count[/color][color=#666600]([/color][color=#000000]$categories[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]||[/color][color=#000000] count[/color][color=#666600]([/color][color=#000000]$pages[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<ul>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$categories [/color][color=#000088]as[/color][color=#000000] $category[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<a href="#">'[/color][color=#666600].[/color][color=#000000]$category[/color][color=#666600][[/color][color=#008800]'name'[/color][color=#666600]].[/color][color=#008800]'</a>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCMSMenuItems[/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600][[/color][color=#008800]'id_cms_category'[/color][color=#666600]],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$depth [/color][color=#666600]+[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600]);[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</li>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$pages [/color][color=#000088]as[/color][color=#000000] $page[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $cms [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] CMS[/color][color=#666600]([/color][color=#000000]$page[/color][color=#666600][[/color][color=#008800]'id_cms'[/color][color=#666600]],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] $links [/color][color=#666600]=[/color][color=#000000] $cms[/color][color=#666600]->[/color][color=#000000]getLinks[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600],[/color][color=#000000] array[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$cms[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600]));[/color]
[color=#000000] $selected [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]page_name [/color][color=#666600]==[/color][color=#000000] [/color][color=#008800]'cms'[/color][color=#000000] [/color][color=#666600]&&[/color][color=#000000] [/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_cms'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] $page[/color][color=#666600][[/color][color=#008800]'id_cms'[/color][color=#666600]]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#008800]' class="sfHoverForce"'[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<li '[/color][color=#666600].[/color][color=#000000]$selected[/color][color=#666600].[/color][color=#008800]'>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<a href="'[/color][color=#666600].[/color][color=#000000]$links[/color][color=#666600][[/color][color=#006666]0[/color][color=#666600]][[/color][color=#008800]'link'[/color][color=#666600]].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$cms[/color][color=#666600]->[/color][color=#000000]meta_title[/color][color=#666600].[/color][color=#008800]'</a>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</li>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'</ul>'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] getCMSOptions[/color][color=#666600]([/color][color=#000000]$parent [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600],[/color][color=#000000] $depth [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] $id_lang [/color][color=#666600]?[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang [/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Context[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]()->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] $categories [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCMSCategories[/color][color=#666600]([/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$parent[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] $pages [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCMSPages[/color][color=#666600](([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$parent[/color][color=#666600],[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] $spacer [/color][color=#666600]=[/color][color=#000000] str_repeat[/color][color=#666600]([/color][color=#008800]'&nbsp;'[/color][color=#666600],[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]spacer_size [/color][color=#666600]*[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$depth[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$categories [/color][color=#000088]as[/color][color=#000000] $category[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="CMS_CAT'[/color][color=#666600].[/color][color=#000000]$category[/color][color=#666600][[/color][color=#008800]'id_cms_category'[/color][color=#666600]].[/color][color=#008800]'" style="font-weight: bold;">'[/color][color=#666600].[/color][color=#000000]$spacer[/color][color=#666600].[/color][color=#000000]$category[/color][color=#666600][[/color][color=#008800]'name'[/color][color=#666600]].[/color][color=#008800]'</option>'[/color][color=#666600];[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCMSOptions[/color][color=#666600]([/color][color=#000000]$category[/color][color=#666600][[/color][color=#008800]'id_cms_category'[/color][color=#666600]],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$depth [/color][color=#666600]+[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$pages [/color][color=#000088]as[/color][color=#000000] $page[/color][color=#666600])[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_html [/color][color=#666600].=[/color][color=#000000] [/color][color=#008800]'<option value="CMS'[/color][color=#666600].[/color][color=#000000]$page[/color][color=#666600][[/color][color=#008800]'id_cms'[/color][color=#666600]].[/color][color=#008800]'">'[/color][color=#666600].[/color][color=#000000]$spacer[/color][color=#666600].[/color][color=#000000]$page[/color][color=#666600][[/color][color=#008800]'meta_title'[/color][color=#666600]].[/color][color=#008800]'</option>'[/color][color=#666600];[/color]
[color=#666600]}[/color]
[color=#000088]protected[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] getCacheId[/color][color=#666600]([/color][color=#000000]$name [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]null[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] parent[/color][color=#666600]::[/color][color=#000000]getCacheId[/color][color=#666600]([/color][color=#000000]$name[/color][color=#666600]);[/color]
[color=#000000] $page_name [/color][color=#666600]=[/color][color=#000000] in_array[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]page_name[/color][color=#666600],[/color][color=#000000] array[/color][color=#666600]([/color][color=#008800]'category'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'supplier'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'manufacturer'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'cms'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'product'[/color][color=#666600]))[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]page_name [/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]'index'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#008800]'blocktopmenu|'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]usingSecureMode[/color][color=#666600]().[/color][color=#008800]'|'[/color][color=#666600].[/color][color=#000000]$page_name[/color][color=#666600].[/color][color=#008800]'|'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]shop[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600].[/color][color=#008800]'|'[/color][color=#666600].[/color][color=#000000]implode[/color][color=#666600]([/color][color=#008800]', '[/color][color=#666600],[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]user_groups[/color][color=#666600]).[/color][color=#008800]'|'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600].[/color][color=#008800]'|'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_category'[/color][color=#666600]).[/color][color=#008800]'|'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_manufacturer'[/color][color=#666600]).[/color][color=#008800]'|'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_supplier'[/color][color=#666600]).[/color][color=#008800]'|'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_cms'[/color][color=#666600]).[/color][color=#008800]'|'[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]getValue[/color][color=#666600]([/color][color=#008800]'id_product'[/color][color=#666600]);[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookDisplayTop[/color][color=#666600]([/color][color=#000000]$param[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]user_groups [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]customer[/color][color=#666600]->[/color][color=#000000]isLogged[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]customer[/color][color=#666600]->[/color][color=#000000]getGroups[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]:[/color][color=#000000] array[/color][color=#666600]([/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_UNIDENTIFIED_GROUP'[/color][color=#666600])));[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]page_name [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Dispatcher[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]getController[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600](![/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]isCached[/color][color=#666600]([/color][color=#008800]'blocktopmenu.tpl'[/color][color=#666600],[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCacheId[/color][color=#666600]()))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]makeMenu[/color][color=#666600]();[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]smarty[/color][color=#666600]->[/color][color=#000000]assign[/color][color=#666600]([/color][color=#008800]'MENU_SEARCH'[/color][color=#666600],[/color][color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_SEARCH'[/color][color=#666600]));[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]smarty[/color][color=#666600]->[/color][color=#000000]assign[/color][color=#666600]([/color][color=#008800]'MENU'[/color][color=#666600],[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_menu[/color][color=#666600]);[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]smarty[/color][color=#666600]->[/color][color=#000000]assign[/color][color=#666600]([/color][color=#008800]'this_path'[/color][color=#666600],[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_path[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#666600]([/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'MOD_BLOCKTOPMENU_SEARCH'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]==[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600]){[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]calculHookCommon[/color][color=#666600]([/color][color=#000000]$param[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]controller[/color][color=#666600]->[/color][color=#000000]addJS[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]_path[/color][color=#666600].[/color][color=#008800]'js/hoverIntent.js'[/color][color=#666600]);[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]controller[/color][color=#666600]->[/color][color=#000000]addJS[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]_path[/color][color=#666600].[/color][color=#008800]'js/superfish-modified.js'[/color][color=#666600]);[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]controller[/color][color=#666600]->[/color][color=#000000]addCSS[/color][color=#666600]([/color][color=#000000]$this[/color][color=#666600]->[/color][color=#000000]_path[/color][color=#666600].[/color][color=#008800]'css/superfish-modified.css'[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_SEARCH_AJAX'[/color][color=#666600]))[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]context[/color][color=#666600]->[/color][color=#000000]controller[/color][color=#666600]->[/color][color=#000000]addJqueryPlugin[/color][color=#666600]([/color][color=#008800]'autocomplete'[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $html [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]display[/color][color=#666600]([/color][color=#000000]__FILE__[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'blocktopmenu.tpl'[/color][color=#666600],[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCacheId[/color][color=#666600]());[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] $html[/color][color=#666600];[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] calculHookCommon[/color][color=#666600]([/color][color=#000000]$param[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]smarty[/color][color=#666600]->[/color][color=#000000]assign[/color][color=#666600]([/color][color=#000000]array[/color][color=#666600]([/color]
[color=#000000] [/color][color=#008800]'ENT_QUOTES'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] ENT_QUOTES[/color][color=#666600],[/color]
[color=#000000] [/color][color=#008800]'search_ssl'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] [/color][color=#660066]Tools[/color][color=#666600]::[/color][color=#000000]usingSecureMode[/color][color=#666600](),[/color]
[color=#000000] [/color][color=#008800]'ajaxsearch'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_SEARCH_AJAX'[/color][color=#666600]),[/color]
[color=#000000] [/color][color=#008800]'instantsearch'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] [/color][color=#660066]Configuration[/color][color=#666600]::[/color][color=#000088]get[/color][color=#666600]([/color][color=#008800]'PS_INSTANT_SEARCH'[/color][color=#666600]),[/color]
[color=#000000] [/color][color=#008800]'self'[/color][color=#000000] [/color][color=#666600]=>[/color][color=#000000] dirname[/color][color=#666600]([/color][color=#000000]__FILE__[/color][color=#666600]),[/color]
[color=#000000] [/color][color=#666600]));[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] getCMSCategories[/color][color=#666600]([/color][color=#000000]$recursive [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] $parent [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color][color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] $id_lang [/color][color=#666600]?[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang [/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Context[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]()->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$recursive [/color][color=#666600]===[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $sql [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'SELECT bcp.`id_cms_category`, bcp.`id_parent`, bcp.`level_depth`, bcp.`active`, bcp.`position`, cl.`name`, cl.`link_rewrite`
FROM `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'cms_category` bcp
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'cms_category_lang` cl
ON (bcp.`id_cms_category` = cl.`id_cms_category`)
WHERE cl.`id_lang` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#008800]'
AND bcp.`id_parent` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$parent[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]executeS[/color][color=#666600]([/color][color=#000000]$sql[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $sql [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'SELECT bcp.`id_cms_category`, bcp.`id_parent`, bcp.`level_depth`, bcp.`active`, bcp.`position`, cl.`name`, cl.`link_rewrite`
FROM `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'cms_category` bcp
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'cms_category_lang` cl
ON (bcp.`id_cms_category` = cl.`id_cms_category`)
WHERE cl.`id_lang` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#008800]'
AND bcp.`id_parent` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$parent[/color][color=#666600];[/color]
[color=#000000] $results [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]executeS[/color][color=#666600]([/color][color=#000000]$sql[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$results [/color][color=#000088]as[/color][color=#000000] $result[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $sub_categories [/color][color=#666600]=[/color][color=#000000] $this[/color][color=#666600]->[/color][color=#000000]getCMSCategories[/color][color=#666600]([/color][color=#000088]true[/color][color=#666600],[/color][color=#000000] $result[/color][color=#666600][[/color][color=#008800]'id_cms_category'[/color][color=#666600]],[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$sub_categories [/color][color=#666600]&&[/color][color=#000000] count[/color][color=#666600]([/color][color=#000000]$sub_categories[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]>[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600])[/color]
[color=#000000] $result[/color][color=#666600][[/color][color=#008800]'sub_categories'[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] $sub_categories[/color][color=#666600];[/color]
[color=#000000] $categories[/color][color=#666600][][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] $result[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] isset[/color][color=#666600]([/color][color=#000000]$categories[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] $categories [/color][color=#666600]:[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] getCMSPages[/color][color=#666600]([/color][color=#000000]$id_cms_category[/color][color=#666600],[/color][color=#000000] $id_shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color][color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $id_shop [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$id_shop [/color][color=#666600]!==[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]?[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_shop [/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Context[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]()->[/color][color=#000000]shop[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] $id_lang [/color][color=#666600]=[/color][color=#000000] $id_lang [/color][color=#666600]?[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang [/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]int[/color][color=#666600])[/color][color=#660066]Context[/color][color=#666600]::[/color][color=#000000]getContext[/color][color=#666600]()->[/color][color=#000000]language[/color][color=#666600]->[/color][color=#000000]id[/color][color=#666600];[/color]
[color=#000000] $sql [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'SELECT c.`id_cms`, cl.`meta_title`, cl.`link_rewrite`
FROM `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'cms` c
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'cms_shop` cs
ON (c.`id_cms` = cs.`id_cms`)
INNER JOIN `'[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'cms_lang` cl
ON (c.`id_cms` = cl.`id_cms`)
WHERE c.`id_cms_category` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_cms_category[/color][color=#666600].[/color][color=#008800]'
AND cs.`id_shop` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_shop[/color][color=#666600].[/color][color=#008800]'
AND cl.`id_lang` = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$id_lang[/color][color=#666600].[/color][color=#008800]'
AND c.`active` = 1
ORDER BY `position`'[/color][color=#666600];[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]executeS[/color][color=#666600]([/color][color=#000000]$sql[/color][color=#666600]);[/color]
[color=#666600]}[/color]

[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectCategoryUpdateAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectCategoryDeleteAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectCmsUpdateAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectCmsDeleteAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectSupplierUpdateAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectSupplierDeleteAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectManufacturerUpdateAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectManufacturerDeleteAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectProductUpdateAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionObjectProductDeleteAfter[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookCategoryUpdate[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]clearMenuCache[/color][color=#666600]();[/color]
[color=#666600]}[/color]
[color=#000088]private[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] clearMenuCache[/color][color=#666600]()[/color]
[color=#666600]{[/color]
[color=#000000] $this[/color][color=#666600]->[/color][color=#000000]_clearCache[/color][color=#666600]([/color][color=#008800]'blocktopmenu.tpl'[/color][color=#666600]);[/color]
[color=#666600]}[/color]
[color=#000088]public[/color][color=#000000] [/color][color=#000088]function[/color][color=#000000] hookActionShopDataDuplication[/color][color=#666600]([/color][color=#000000]$params[/color][color=#666600])[/color]
[color=#666600]{[/color]
[color=#000000] $linksmenutop [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]executeS[/color][color=#666600]([/color][color=#008800]'
SELECT *
FROM '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'linksmenutop
WHERE id_shop = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$params[/color][color=#666600][[/color][color=#008800]'old_id_shop'[/color][color=#666600]][/color]
[color=#000000] [/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#666600]([/color][color=#000000]$linksmenutop [/color][color=#000088]as[/color][color=#000000] $id [/color][color=#666600]=>[/color][color=#000000] $link[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]execute[/color][color=#666600]([/color][color=#008800]'
INSERT IGNORE INTO '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'linksmenutop (id_linksmenutop, id_shop, new_window)
VALUES (null, '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$params[/color][color=#666600][[/color][color=#008800]'new_id_shop'[/color][color=#666600]].[/color][color=#008800]', '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'new_window'[/color][color=#666600]].[/color][color=#008800]')'[/color][color=#666600]);[/color]
[color=#000000] $linksmenutop[/color][color=#666600][[/color][color=#000000]$id[/color][color=#666600]][[/color][color=#008800]'new_id_linksmenutop'[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#660066]Insert_ID[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#666600]([/color][color=#000000]$linksmenutop [/color][color=#000088]as[/color][color=#000000] $id [/color][color=#666600]=>[/color][color=#000000] $link[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $lang [/color][color=#666600]=[/color][color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]executeS[/color][color=#666600]([/color][color=#008800]'
SELECT id_lang, '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$params[/color][color=#666600][[/color][color=#008800]'new_id_shop'[/color][color=#666600]].[/color][color=#008800]', label, link
FROM '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'linksmenutop_lang
WHERE id_linksmenutop = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'id_linksmenutop'[/color][color=#666600]].[/color][color=#008800]' AND id_shop = '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$params[/color][color=#666600][[/color][color=#008800]'old_id_shop'[/color][color=#666600]]);[/color]
[color=#000000] [/color][color=#000088]foreach[/color][color=#666600]([/color][color=#000000]$lang [/color][color=#000088]as[/color][color=#000000] $l[/color][color=#666600])[/color]
[color=#000000] [/color][color=#660066]Db[/color][color=#666600]::[/color][color=#000000]getInstance[/color][color=#666600]()->[/color][color=#000000]execute[/color][color=#666600]([/color][color=#008800]'
INSERT IGNORE INTO '[/color][color=#666600].[/color][color=#000000]_DB_PREFIX_[/color][color=#666600].[/color][color=#008800]'linksmenutop_lang (id_linksmenutop, id_lang, id_shop, label, link)
VALUES ('[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$link[/color][color=#666600][[/color][color=#008800]'new_id_linksmenutop'[/color][color=#666600]].[/color][color=#008800]', '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$l[/color][color=#666600][[/color][color=#008800]'id_lang'[/color][color=#666600]].[/color][color=#008800]', '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$params[/color][color=#666600][[/color][color=#008800]'new_id_shop'[/color][color=#666600]].[/color][color=#008800]', '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$l[/color][color=#666600][[/color][color=#008800]'label'[/color][color=#666600]].[/color][color=#008800]', '[/color][color=#666600].([/color][color=#000088]int[/color][color=#666600])[/color][color=#000000]$l[/color][color=#666600][[/color][color=#008800]'link'[/color][color=#666600]].[/color][color=#008800]' )'[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#666600]}[/color]

[color=#666600]}[/color]
[color=#666600]}[/color]
Ahora reemplazamos todo el contenido del blocktopmenu.tpl por este:

[color=#666600]{[/color][color=#000088]if[/color][color=#000000] $MENU [/color][color=#666600]!=[/color][color=#000000] [/color][color=#008800]''[/color][color=#666600]}[/color]
[color=#666600]<!--[/color][color=#000000] [/color][color=#660066]Menu[/color][color=#000000] [/color][color=#666600]-->[/color]
[color=#666600]<[/color][color=#000000]div [/color][color=#000088]class[/color][color=#666600]=[/color][color=#008800]"sf-contener clearfix"[/color][color=#666600]>[/color]
[color=#000000] [/color][color=#666600]<[/color][color=#000000]ul [/color][color=#000088]class[/color][color=#666600]=[/color][color=#008800]"sf-menu clearfix"[/color][color=#666600]>[/color]
[color=#000000] [/color][color=#666600]{[/color][color=#000000]$MENU[/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]{[/color][color=#000088]if[/color][color=#000000] $MENU_SEARCH[/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]<[/color][color=#000000]li [/color][color=#000088]class[/color][color=#666600]=[/color][color=#008800]"sf-search noBack"[/color][color=#000000] style[/color][color=#666600]=[/color][color=#008800]"float:right"[/color][color=#666600]>[/color]
[color=#000000] [/color][color=#666600]<[/color][color=#000000]form id[/color][color=#666600]=[/color][color=#008800]"searchbox"[/color][color=#000000] action[/color][color=#666600]=[/color][color=#008800]"{$link->getPageLink('search')}"[/color][color=#000000] method[/color][color=#666600]=[/color][color=#008800]"get"[/color][color=#666600]>[/color]
[color=#000000] [/color][color=#008800]<p>[/color]
[color=#000000] [/color][color=#666600]<[/color][color=#000000]input type[/color][color=#666600]=[/color][color=#008800]"hidden"[/color][color=#000000] name[/color][color=#666600]=[/color][color=#008800]"controller"[/color][color=#000000] value[/color][color=#666600]=[/color][color=#008800]"search"[/color][color=#000000] [/color][color=#666600]/>[/color]
[color=#000000] [/color][color=#666600]<[/color][color=#000000]input type[/color][color=#666600]=[/color][color=#008800]"hidden"[/color][color=#000000] value[/color][color=#666600]=[/color][color=#008800]"position"[/color][color=#000000] name[/color][color=#666600]=[/color][color=#008800]"orderby"[/color][color=#666600]/>[/color]
[color=#000000] [/color][color=#666600]<[/color][color=#000000]input type[/color][color=#666600]=[/color][color=#008800]"hidden"[/color][color=#000000] value[/color][color=#666600]=[/color][color=#008800]"desc"[/color][color=#000000] name[/color][color=#666600]=[/color][color=#008800]"orderway"[/color][color=#666600]/>[/color]
[color=#000000] [/color][color=#666600]<[/color][color=#000000]input type[/color][color=#666600]=[/color][color=#008800]"text"[/color][color=#000000] id[/color][color=#666600]=[/color][color=#008800]"menu-search-query"[/color][color=#000000] name[/color][color=#666600]=[/color][color=#008800]"search_query"[/color][color=#000000] value[/color][color=#666600]=[/color][color=#008800]"{if isset($smarty.get.search_query)}{$smarty.get.search_query|escape:'htmlall':'UTF-8'}{/if}"[/color][color=#000000] [/color][color=#666600]/>[/color]
[color=#000000] [/color][color=#666600]<[/color][color=#008800]/p>
</[/color][color=#000000]form[/color][color=#666600]>[/color]
[color=#000000] [/color][color=#666600]<[/color][color=#008800]/li>
{if $ajaxsearch}
<script type="text/[/color][color=#000000]javascript[/color][color=#008800]">
// <![CDATA[
$('document').ready( function() {
$("[/color][color=#880000]#menu-search-query").autocomplete([/color]
[color=#000000] [/color][color=#008800]'{if $search_ssl == 1}{$link->getPageLink('[/color][color=#000000]search[/color][color=#008800]', true)}{else}{$link->getPageLink('[/color][color=#000000]search[/color][color=#008800]')}{/if}'[/color][color=#666600],[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000] minChars[/color][color=#666600]:[/color][color=#000000] [/color][color=#006666]3[/color][color=#666600],[/color]
[color=#000000] max[/color][color=#666600]:[/color][color=#000000] [/color][color=#006666]10[/color][color=#666600],[/color]
[color=#000000] width[/color][color=#666600]:[/color][color=#000000] [/color][color=#006666]250[/color][color=#666600],[/color]
[color=#000000] selectFirst[/color][color=#666600]:[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600],[/color]
[color=#000000] scroll[/color][color=#666600]:[/color][color=#000000] [/color][color=#000088]true[/color][color=#666600],[/color]
[color=#000000] dataType[/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]"json"[/color][color=#666600],[/color]
[color=#000000] inputClass[/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]"ac-input"[/color][color=#666600],[/color]
[color=#000000] resultsClass[/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]"ac-results"[/color][color=#666600],[/color]
[color=#000000] loadingClass[/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]"ac-loading"[/color][color=#666600],[/color]
[color=#000000] formatItem[/color][color=#666600]:[/color][color=#000000] [/color][color=#000088]function[/color][color=#666600]([/color][color=#000000]data[/color][color=#666600],[/color][color=#000000] i[/color][color=#666600],[/color][color=#000000] max[/color][color=#666600],[/color][color=#000000] value[/color][color=#666600],[/color][color=#000000] term[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#666600]([/color][color=#000000]data[/color][color=#666600].[/color][color=#000000]id_image [/color][color=#666600]!=[/color][color=#000000] [/color][color=#000088]null[/color][color=#666600]){[/color]
[color=#000000] thisValue [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'<img src="{$link->getImageLink("'[/color][color=#000000] [/color][color=#666600]+[/color][color=#000000] data[/color][color=#666600].[/color][color=#000000]prewrite [/color][color=#666600]+[/color][color=#000000] [/color][color=#008800]'", "'[/color][color=#000000] [/color][color=#666600]+[/color][color=#000000] data[/color][color=#666600].[/color][color=#000000]id_image [/color][color=#666600]+[/color][color=#000000] [/color][color=#008800]'", '[/color][color=#000000]small_default[/color][color=#008800]')}" alt="'[/color][color=#000000] [/color][color=#666600]+[/color][color=#000000] data[/color][color=#666600].[/color][color=#000000]pname [/color][color=#666600]+[/color][color=#000000] [/color][color=#008800]'" />'[/color][color=#666600]+[/color][color=#000000] value[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color][color=#666600]{[/color]
[color=#000000] thisValue [/color][color=#666600]=[/color][color=#000000] [/color][color=#008800]'<img src="{$base_uri}img/p/{$lang_iso}-default-small_default.jpg" alt="" />'[/color][color=#000000] [/color][color=#666600]+[/color][color=#000000] value[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] thisValue[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]},[/color]
[color=#000000] parse[/color][color=#666600]:[/color][color=#000000] [/color][color=#000088]function[/color][color=#666600]([/color][color=#000000]data[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]var[/color][color=#000000] mytab [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Array[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]for[/color][color=#000000] [/color][color=#666600]([/color][color=#000088]var[/color][color=#000000] i [/color][color=#666600]=[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600];[/color][color=#000000] i [/color][color=#666600]<[/color][color=#000000] data[/color][color=#666600].[/color][color=#000000]length[/color][color=#666600];[/color][color=#000000] i[/color][color=#666600]++)[/color]
[color=#000000] mytab[/color][color=#666600][[/color][color=#000000]mytab[/color][color=#666600].[/color][color=#000000]length[/color][color=#666600]][/color][color=#000000] [/color][color=#666600]=[/color][color=#000000] [/color][color=#666600]{[/color][color=#000000] data[/color][color=#666600]:[/color][color=#000000] data[/color][color=#666600][[/color][color=#000000]i[/color][color=#666600]],[/color][color=#000000] value[/color][color=#666600]:[/color][color=#000000] data[/color][color=#666600][[/color][color=#000000]i[/color][color=#666600]].[/color][color=#000000]cname [/color][color=#666600]+[/color][color=#000000] [/color][color=#008800]' > '[/color][color=#000000] [/color][color=#666600]+[/color][color=#000000] data[/color][color=#666600][[/color][color=#000000]i[/color][color=#666600]].[/color][color=#000000]pname [/color][color=#666600]};[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] mytab[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]},[/color]
[color=#000000] extraParams[/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000] ajaxSearch[/color][color=#666600]:[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color]
[color=#000000] id_lang[/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]{[/color][color=#000000]$cookie[/color][color=#666600]->[/color][color=#000000]id_lang[/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600].[/color][color=#000000]result[/color][color=#666600]([/color][color=#000088]function[/color][color=#666600]([/color][color=#000088]event[/color][color=#666600],[/color][color=#000000] data[/color][color=#666600],[/color][color=#000000] formatted[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]'#menu-search-query'[/color][color=#666600]).[/color][color=#000000]val[/color][color=#666600]([/color][color=#000000]data[/color][color=#666600].[/color][color=#000000]pname[/color][color=#666600]);[/color]
[color=#000000] document[/color][color=#666600].[/color][color=#000000]location[/color][color=#666600].[/color][color=#000000]href [/color][color=#666600]=[/color][color=#000000] data[/color][color=#666600].[/color][color=#000000]product_link[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]})[/color]
[color=#000000] [/color][color=#666600]});[/color]
[color=#000000] [/color][color=#880000]// ]]>[/color]
[color=#666600]<[/color][color=#008800]/script>
{/[/color][color=#000088]if[/color][color=#666600]}[/color]
[color=#666600]{[/color][color=#000088]if[/color][color=#000000] $instantsearch[/color][color=#666600]}[/color]
[color=#666600]<[/color][color=#000000]script type[/color][color=#666600]=[/color][color=#008800]"text/javascript"[/color][color=#666600]>[/color]
[color=#880000]// <![CDATA[[/color]
[color=#000000] [/color][color=#000088]function[/color][color=#000000] tryToCloseInstantSearch[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#000000] [/color][color=#666600]([/color][color=#000000]$[/color][color=#666600]([/color][color=#008800]'#old_center_column'[/color][color=#666600]).[/color][color=#000000]length [/color][color=#666600]>[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]'#center_column'[/color][color=#666600]).[/color][color=#000000]remove[/color][color=#666600]();[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]'#old_center_column'[/color][color=#666600]).[/color][color=#000000]attr[/color][color=#666600]([/color][color=#008800]'id'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'center_column'[/color][color=#666600]);[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]'#center_column'[/color][color=#666600]).[/color][color=#000000]show[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] instantSearchQueries [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Array[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#000088]function[/color][color=#000000] stopInstantSearchQueries[/color][color=#666600](){[/color]
[color=#000000] [/color][color=#000088]for[/color][color=#666600]([/color][color=#000000]i[/color][color=#666600]=[/color][color=#006666]0[/color][color=#666600];[/color][color=#000000]i[/color][color=#666600]<[/color][color=#000000]instantSearchQueries[/color][color=#666600].[/color][color=#000000]length[/color][color=#666600];[/color][color=#000000]i[/color][color=#666600]++)[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000] instantSearchQueries[/color][color=#666600][[/color][color=#000000]i[/color][color=#666600]].[/color][color=#000000]abort[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] instantSearchQueries [/color][color=#666600]=[/color][color=#000000] [/color][color=#000088]new[/color][color=#000000] [/color][color=#660066]Array[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]"#menu-search-query"[/color][color=#666600]).[/color][color=#000000]keyup[/color][color=#666600]([/color][color=#000088]function[/color][color=#666600](){[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#666600]([/color][color=#000000]$[/color][color=#666600]([/color][color=#000088]this[/color][color=#666600]).[/color][color=#000000]val[/color][color=#666600]().[/color][color=#000000]length [/color][color=#666600]>[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600]){[/color]
[color=#000000] stopInstantSearchQueries[/color][color=#666600]();[/color]
[color=#000000] instantSearchQuery [/color][color=#666600]=[/color][color=#000000] $[/color][color=#666600].[/color][color=#000000]ajax[/color][color=#666600]({[/color]
[color=#000000] url[/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]'{if $search_ssl == 1}{$link->getPageLink('[/color][color=#000000]search[/color][color=#008800]', true)}{else}{$link->getPageLink('[/color][color=#000000]search[/color][color=#008800]')}{/if}'[/color][color=#666600],[/color]
[color=#000000] data[/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000] instantSearch[/color][color=#666600]:[/color][color=#000000] [/color][color=#006666]1[/color][color=#666600],[/color]
[color=#000000] id_lang[/color][color=#666600]:[/color][color=#000000] [/color][color=#666600]{[/color][color=#000000]$cookie[/color][color=#666600]->[/color][color=#000000]id_lang[/color][color=#666600]},[/color]
[color=#000000] q[/color][color=#666600]:[/color][color=#000000] $[/color][color=#666600]([/color][color=#000088]this[/color][color=#666600]).[/color][color=#000000]val[/color][color=#666600]()[/color]
[color=#000000] [/color][color=#666600]},[/color]
[color=#000000] dataType[/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]'html'[/color][color=#666600],[/color]
[color=#000000] type[/color][color=#666600]:[/color][color=#000000] [/color][color=#008800]'POST'[/color][color=#666600],[/color]
[color=#000000] success[/color][color=#666600]:[/color][color=#000000] [/color][color=#000088]function[/color][color=#666600]([/color][color=#000000]data[/color][color=#666600]){[/color]
[color=#000000] [/color][color=#000088]if[/color][color=#666600]([/color][color=#000000]$[/color][color=#666600]([/color][color=#008800]"#menu-search-query"[/color][color=#666600]).[/color][color=#000000]val[/color][color=#666600]().[/color][color=#000000]length [/color][color=#666600]>[/color][color=#000000] [/color][color=#006666]0[/color][color=#666600])[/color]
[color=#000000] [/color][color=#666600]{[/color]
[color=#000000] tryToCloseInstantSearch[/color][color=#666600]();[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]'#center_column'[/color][color=#666600]).[/color][color=#000000]attr[/color][color=#666600]([/color][color=#008800]'id'[/color][color=#666600],[/color][color=#000000] [/color][color=#008800]'old_center_column'[/color][color=#666600]);[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]'#old_center_column'[/color][color=#666600]).[/color][color=#000000]after[/color][color=#666600]([/color][color=#008800]'<div id="center_column" class="'[/color][color=#000000] [/color][color=#666600]+[/color][color=#000000] $[/color][color=#666600]([/color][color=#008800]'#old_center_column'[/color][color=#666600]).[/color][color=#000000]attr[/color][color=#666600]([/color][color=#008800]'class'[/color][color=#666600])[/color][color=#000000] [/color][color=#666600]+[/color][color=#000000] [/color][color=#008800]'">'[/color][color=#666600]+[/color][color=#000000]data[/color][color=#666600]+[/color][color=#008800]'</div>'[/color][color=#666600]);[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]'#old_center_column'[/color][color=#666600]).[/color][color=#000000]hide[/color][color=#666600]();[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]"#instant_search_results a.close"[/color][color=#666600]).[/color][color=#000000]click[/color][color=#666600]([/color][color=#000088]function[/color][color=#666600]()[/color][color=#000000] [/color][color=#666600]{[/color]
[color=#000000] $[/color][color=#666600]([/color][color=#008800]"#menu-search-query"[/color][color=#666600]).[/color][color=#000000]val[/color][color=#666600]([/color][color=#008800]''[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] tryToCloseInstantSearch[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#666600]});[/color]
[color=#000000] [/color][color=#000088]return[/color][color=#000000] [/color][color=#000088]false[/color][color=#666600];[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] tryToCloseInstantSearch[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]});[/color]
[color=#000000] instantSearchQueries[/color][color=#666600].[/color][color=#000000]push[/color][color=#666600]([/color][color=#000000]instantSearchQuery[/color][color=#666600]);[/color]
[color=#000000] [/color][color=#666600]}[/color]
[color=#000000] [/color][color=#000088]else[/color]
[color=#000000] tryToCloseInstantSearch[/color][color=#666600]();[/color]
[color=#000000] [/color][color=#666600]});[/color]
[color=#880000]// ]]>[/color]
[color=#666600]<[/color][color=#008800]/script>
{/[/color][color=#000088]if[/color][color=#666600]}[/color]
[color=#000000] [/color][color=#666600]{[/color][color=#008800]/if}
</[/color][color=#000000]ul[/color][color=#666600]>[/color]
[color=#666600]<[/color][color=#008800]/div>
<div class="sf-right">&nbsp;</[/color][color=#000000]div[/color][color=#666600]>[/color]
[color=#666600]<!--/[/color][color=#000000] [/color][color=#660066]Menu[/color][color=#000000] [/color][color=#666600]-->[/color]
[color=#666600]{/[/color][color=#000088]if[/color][color=#666600]}[/color]
Añadir esto al superfish-modified.css para que se muestre correctamente el [b]ac_results[/b]:

[color=#000000]div[/color][color=#666600].[/color][color=#000000]ac[/color][color=#666600]-[/color][color=#000000]results [/color][color=#666600]{[/color]
[color=#000000]text[/color][color=#666600]-[/color][color=#000000]align[/color][color=#666600]:[/color][color=#000000] left[/color][color=#666600];[/color]
[color=#000000]padding[/color][color=#666600]:[/color][color=#000000] [/color][color=#006666]0px[/color][color=#666600];[/color]
[color=#000000]border[/color][color=#666600]:[/color][color=#000000] [/color][color=#006666]1px[/color][color=#000000] solid black[/color][color=#666600];[/color]
[color=#000000]background[/color][color=#666600]-[/color][color=#000000]color[/color][color=#666600]:[/color][color=#000000] white[/color][color=#666600];[/color]
[color=#000000]overflow[/color][color=#666600]:[/color][color=#000000] hidden[/color][color=#666600];[/color]
[color=#000000]z[/color][color=#666600]-[/color][color=#000000]index[/color][color=#666600]:[/color][color=#000000] [/color][color=#006666]99999[/color][color=#666600];[/color]
[color=#666600]}[/color]
Una ves hechos los cambios ya tenemos tanto el autocomplete con la imagenes de los productos y tambien la busqueda instantánea...

[color=#00FF00][b]Demo:[/b][/color] [url="http://www.kik-off.com/demo/prestashop_1.4.9.0/es/"]http://www.kik-off.c...hop_1.4.9.0/es/[/url]

Saludos y espero que os sea de utilidad.

PD: El css ya queda de vuestra mano, para que lo adapteis a vuestro gusto.[/i][/size][/font][/color]

[color=#343943][font=Arial, Helvetica, sans-serif][size=3]¿Cómo se aplicaría esto en mi caso nadie o statictic?[/size][/font][/color][/quote]
Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...