diff --git a/blocktopmenu.php b/blocktopmenu.php
index 5994b13..1815ed8 100644
--- a/blocktopmenu.php
+++ b/blocktopmenu.php
@@ -24,9 +24,11 @@
* International Registered Trademark & Property of PrestaShop SA
*/
+use PrestaShop\PrestaShop\Core\Business\Module\WidgetInterface;
+
require(dirname(__FILE__).'/menutoplinks.class.php');
-class Blocktopmenu extends Module
+class Blocktopmenu extends Module implements WidgetInterface
{
protected $_menu = '';
protected $_html = '';
@@ -52,7 +54,7 @@ class Blocktopmenu extends Module
{
$this->name = 'blocktopmenu';
$this->tab = 'front_office_features';
- $this->version = '2.2.3';
+ $this->version = '4.0.0';
$this->author = 'PrestaShop';
$this->bootstrap = true;
@@ -60,14 +62,14 @@ class Blocktopmenu extends Module
$this->displayName = $this->l('Top horizontal menu');
$this->description = $this->l('Adds a new horizontal menu to the top of your e-commerce website.');
- $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
+ $this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
+
+ $this->clearMenuCache();
}
public function install($delete_params = true)
{
if (!parent::install() ||
- !$this->registerHook('header') ||
- !$this->registerHook('displayTop') ||
!$this->registerHook('actionObjectCategoryUpdateAfter') ||
!$this->registerHook('actionObjectCategoryDeleteAfter') ||
!$this->registerHook('actionObjectCategoryAddAfter') ||
@@ -461,189 +463,16 @@ class Blocktopmenu extends Module
return $html.'';
}
- protected function makeMenu()
+ protected function getCMSMenuItems($id, $id_lang)
{
- $menu_items = $this->getMenuItems();
- $id_lang = (int)$this->context->language->id;
- $id_shop = (int)Shop::getContextShopID();
+ $nodes = [];
- foreach ($menu_items as $item) {
- if (!$item) {
- continue;
- }
+ $categories = $this->getCMSCategories(false, (int)$id, (int)$id_lang);
+ ddd($categories);
- preg_match($this->pattern, $item, $value);
- $id = (int)substr($item, strlen($value[1]), strlen($item));
+ return $nodes;
- switch (substr($item, 0, strlen($value[1]))) {
- case 'CAT':
- $this->_menu .= $this->generateCategoriesMenu(Category::getNestedCategories($id, $id_lang, false, $this->user_groups));
- break;
-
- case 'PRD':
- $selected = ($this->page_name == 'product' && (Tools::getValue('id_product') == $id)) ? ' class="sfHover"' : '';
- $product = new Product((int)$id, true, (int)$id_lang);
- if (!is_null($product->id)) {
- $this->_menu .= '
'.$product->name.''.PHP_EOL;
- }
- break;
-
- case 'CMS':
- $selected = ($this->page_name == 'cms' && (Tools::getValue('id_cms') == $id)) ? ' class="sfHover"' : '';
- $cms = CMS::getLinks((int)$id_lang, array($id));
- if (count($cms)) {
- $this->_menu .= ''.Tools::safeOutput($cms[0]['meta_title']).''.PHP_EOL;
- }
- break;
-
- case 'CMS_CAT':
- $category = new CMSCategory((int)$id, (int)$id_lang);
- if (count($category)) {
- $this->_menu .= ''.$category->name.'';
- $this->getCMSMenuItems($category->id);
- $this->_menu .= ''.PHP_EOL;
- }
- break;
-
- // Case to handle the option to show all Manufacturers
- case 'ALLMAN':
- $link = new Link;
- $this->_menu .= ''.$this->l('All manufacturers').'';
- break;
-
- case 'MAN':
- $selected = ($this->page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : '';
- $manufacturer = new Manufacturer((int)$id, (int)$id_lang);
- if (!is_null($manufacturer->id)) {
- if (intval(Configuration::get('PS_REWRITING_SETTINGS'))) {
- $manufacturer->link_rewrite = Tools::link_rewrite($manufacturer->name);
- } else {
- $manufacturer->link_rewrite = 0;
- }
- $link = new Link;
- $this->_menu .= ''.Tools::safeOutput($manufacturer->name).''.PHP_EOL;
- }
- break;
-
- // Case to handle the option to show all Suppliers
- case 'ALLSUP':
- $link = new Link;
- $this->_menu .= ''.$this->l('All suppliers').'';
- break;
-
- case 'SUP':
- $selected = ($this->page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : '';
- $supplier = new Supplier((int)$id, (int)$id_lang);
- if (!is_null($supplier->id)) {
- $link = new Link;
- $this->_menu .= ''.$supplier->name.''.PHP_EOL;
- }
- break;
-
- case 'SHOP':
- $selected = ($this->page_name == 'index' && ($this->context->shop->id == $id)) ? ' class="sfHover"' : '';
- $shop = new Shop((int)$id);
- if (Validate::isLoadedObject($shop)) {
- $link = new Link;
- $this->_menu .= ''.$shop->name.''.PHP_EOL;
- }
- break;
- case 'LNK':
- $link = MenuTopLinks::get((int)$id, (int)$id_lang, (int)$id_shop);
- if (count($link)) {
- if (!isset($link[0]['label']) || ($link[0]['label'] == '')) {
- $default_language = Configuration::get('PS_LANG_DEFAULT');
- $link = MenuTopLinks::get($link[0]['id_linksmenutop'], $default_language, (int)Shop::getContextShopID());
- }
- $this->_menu .= ''.Tools::safeOutput($link[0]['label']).''.PHP_EOL;
- }
- break;
- }
- }
- }
-
- protected function generateCategoriesOption($categories, $items_to_skip = null)
- {
- $html = '';
-
- foreach ($categories as $key => $category) {
- if (isset($items_to_skip) /*&& !in_array('CAT'.(int)$category['id_category'], $items_to_skip)*/) {
- $shop = (object) Shop::getShop((int)$category['id_shop']);
- $html .= '';
- }
-
- if (isset($category['children']) && !empty($category['children'])) {
- $html .= $this->generateCategoriesOption($category['children'], $items_to_skip);
- }
- }
- return $html;
- }
-
- protected function generateCategoriesMenu($categories, $is_children = 0)
- {
- $html = '';
-
- foreach ($categories as $key => $category) {
- if ($category['level_depth'] > 1) {
- $cat = new Category($category['id_category']);
- $link = Tools::HtmlEntitiesUTF8($cat->getLink());
- } else {
- $link = $this->context->link->getPageLink('index');
- }
-
- /* Whenever a category is not active we shouldnt display it to customer */
- if ((bool)$category['active'] === false) {
- continue;
- }
-
- $html .= 'page_name == 'category'
- && (int)Tools::getValue('id_category') == (int)$category['id_category']) ? ' class="sfHoverForce"' : '').'>';
- $html .= ''.$category['name'].'';
-
- if (isset($category['children']) && !empty($category['children'])) {
- $html .= '';
- $html .= $this->generateCategoriesMenu($category['children'], 1);
-
- if ((int)$category['level_depth'] > 1 && !$is_children) {
- $files = scandir(_PS_CAT_IMG_DIR_);
-
- if (count(preg_grep('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $files)) > 0) {
- $html .= '- ';
-
- foreach ($files as $file) {
- if (preg_match('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $file) === 1) {
- $html .= '';
- }
- }
-
- $html .= '
';
- }
- }
-
- $html .= '
';
- }
-
- $html .= '';
- }
-
- return $html;
- }
-
- protected function getCMSMenuItems($parent, $depth = 1, $id_lang = false)
- {
+ /*
$id_lang = $id_lang ? (int)$id_lang : (int)Context::getContext()->language->id;
if ($depth > 3) {
@@ -676,7 +505,290 @@ class Blocktopmenu extends Module
}
$this->_menu .= '';
+ }*/
+ }
+
+ protected function generateCMSCategoriesMenu($id_cms_category, $id_lang)
+ {
+ $selected = false; // FIXME
+ $category = new CMSCategory($id_cms_category, $id_lang);
+
+ $rawSubCategories = $this->getCMSCategories(false, $id_cms_category, $id_lang);
+ $rawSubPages = $this->getCMSPages($id_cms_category);
+
+ $subCategories = array_map(function ($category) use ($id_lang) {
+ return $this->generateCMSCategoriesMenu($category['id_cms_category'], $id_lang);
+ }, $rawSubCategories);
+
+ $subPages = array_map(function ($page) use ($id_lang) {
+ $selected = false; // FIXME
+ return [
+ 'type' => 'cms-page',
+ 'label' => $page['meta_title'],
+ 'url' => $this->context->link->getCMSLink(
+ new CMS($page['id_cms'], $id_lang),
+ null, null,
+ $id_lang
+ ),
+ 'current' => $selected
+ ];
+ }, $rawSubPages);
+
+ $node = [
+ 'type' => 'cms-category',
+ 'label' => $category->name,
+ 'url' => $category->getLink(),
+ 'current' => $selected,
+ 'children' => array_merge($subCategories, $subPages)
+ ];
+
+ return $node;
+ }
+
+ protected function makeMenu()
+ {
+ $root_node = [
+ 'label' => null,
+ 'type' => 'root',
+ 'children' => []
+ ];
+
+ $menu_items = $this->getMenuItems();
+ $id_lang = (int)$this->context->language->id;
+ $id_shop = (int)Shop::getContextShopID();
+
+ foreach ($menu_items as $item) {
+ if (!$item) {
+ continue;
+ }
+
+ preg_match($this->pattern, $item, $value);
+ $id = (int)substr($item, strlen($value[1]), strlen($item));
+
+ switch (substr($item, 0, strlen($value[1]))) {
+ case 'CAT':
+ $categories = $this->generateCategoriesMenu(
+ Category::getNestedCategories($id, $id_lang, false, $this->user_groups)
+ );
+ $root_node['children'] = array_merge($root_node['children'], $categories);
+ break;
+
+ case 'PRD':
+ $selected = ($this->page_name == 'product' && (Tools::getValue('id_product') == $id)) ? ' class="sfHover"' : '';
+ $product = new Product((int)$id, true, (int)$id_lang);
+ if ($product->id) {
+ $root_node['children'][] = [
+ 'type' => 'product',
+ 'label' => $product->name,
+ 'url' => $product->getLink(),
+ 'current' => $selected
+ ];
+ }
+ break;
+
+ case 'CMS':
+ $selected = ($this->page_name == 'cms' && (Tools::getValue('id_cms') == $id)) ? ' class="sfHover"' : '';
+ $cms = CMS::getLinks((int)$id_lang, array($id));
+ if (count($cms)) {
+ $root_node['children'][] = [
+ 'type' => 'cms-page',
+ 'label' => $cms[0]['meta_title'],
+ 'url' => $cms[0]['link'],
+ 'current' => $selected
+ ];
+ }
+ break;
+
+ case 'CMS_CAT':
+ $root_node['children'][] = $this->generateCMSCategoriesMenu((int)$id, (int)$id_lang);
+ break;
+
+ // Case to handle the option to show all Manufacturers
+ case 'ALLMAN':
+ $current = false; // FIXME
+
+ $children = array_map(function ($manufacturer) use ($id_lang) {
+ $current = false; // FIXME
+ return [
+ 'type' => 'manufacturer',
+ 'label' => $manufacturer['name'],
+ 'url' => $this->context->link->getManufacturerLink(
+ new Manufacturer($manufacturer['id_manufacturer'], $id_lang),
+ null,
+ $id_lang
+ ),
+ 'current' => false
+ ];
+ }, Manufacturer::getManufacturers());
+
+ $root_node['children'][] = [
+ 'type' => 'manufacturers',
+ 'label' => $this->l('All manufacturers'),
+ 'url' => $this->context->link->getPageLink('manufacturer'),
+ 'current' => $current,
+ 'children' => $children
+ ];
+ break;
+
+ case 'MAN':
+ $current = ($this->page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id));
+ $manufacturer = new Manufacturer($id, $id_lang);
+ if ($manufacturer->id) {
+ $root_node['children'][] = [
+ 'type' => 'manufacturer',
+ 'label' => $manufacturer->name,
+ 'url' => $this->context->link->getManufacturerLink(
+ $manufacturer,
+ null,
+ $id_lang
+ ),
+ 'current' => $current
+ ];
+ }
+ break;
+
+ // Case to handle the option to show all Suppliers
+ case 'ALLSUP':
+ $current = false; // FIXME
+
+ $children = array_map(function ($supplier) use ($id_lang) {
+ $current = false; // FIXME
+ return [
+ 'type' => 'supplier',
+ 'label' => $supplier['name'],
+ 'url' => $this->context->link->getManufacturerLink(
+ new Manufacturer($supplier['id_manufacturer'], $id_lang),
+ null,
+ $id_lang
+ ),
+ 'current' => false
+ ];
+ }, Supplier::getSuppliers());
+
+ $root_node['children'][] = [
+ 'type' => 'suppliers',
+ 'label' => $this->l('All suppliers'),
+ 'url' => $this->context->link->getPageLink('supplier'),
+ 'current' => $current,
+ 'children' => $children
+ ];
+ break;
+
+ case 'SUP':
+ $current = ($this->page_name == 'supplier' && (Tools::getValue('id_supplier') == $id));
+ $supplier = new Supplier($id, $id_lang);
+ if ($supplier->id) {
+ $root_node['children'][] = [
+ 'type' => 'supplier',
+ 'label' => $supplier->name,
+ 'url' => $this->context->link->getSupplierLink(
+ $supplier,
+ null,
+ $id_lang
+ ),
+ 'current' => $current
+ ];
+ }
+ break;
+
+ case 'SHOP':
+ $current = ($this->page_name == 'index' && ($this->context->shop->id == $id));
+ $shop = new Shop((int)$id);
+ if (Validate::isLoadedObject($shop)) {
+ $root_node['children'][] = [
+ 'type' => 'shop',
+ 'label' => $shop->name,
+ 'url' => $shop->getBaseURL(),
+ 'current' => $current
+ ];
+ }
+ break;
+ case 'LNK':
+ $link = MenuTopLinks::get($id, $id_lang, $id_shop);
+ if (!empty($link)) {
+ if (!isset($link[0]['label']) || ($link[0]['label'] == '')) {
+ $default_language = Configuration::get('PS_LANG_DEFAULT');
+ $link = MenuTopLinks::get($link[0]['id_linksmenutop'], $default_language, (int)Shop::getContextShopID());
+ }
+ $root_node['children'][] = [
+ 'type' => 'link',
+ 'label' => $link[0]['label'],
+ 'url' => $link[0]['link'],
+ 'current' => false,
+ 'open_in_new_window' => $link[0]['new_window']
+ ];
+ }
+ break;
+ }
}
+
+ return $root_node;
+ }
+
+ protected function generateCategoriesOption($categories, $items_to_skip = null)
+ {
+ $html = '';
+
+ foreach ($categories as $key => $category) {
+ if (isset($items_to_skip) /*&& !in_array('CAT'.(int)$category['id_category'], $items_to_skip)*/) {
+ $shop = (object) Shop::getShop((int)$category['id_shop']);
+ $html .= '';
+ }
+
+ if (isset($category['children']) && !empty($category['children'])) {
+ $html .= $this->generateCategoriesOption($category['children'], $items_to_skip);
+ }
+ }
+ return $html;
+ }
+
+ protected function generateCategoriesMenu($categories, $is_children = 0)
+ {
+ $nodes = [];
+
+ foreach ($categories as $key => $category) {
+ $node = [];
+
+ if ($category['level_depth'] > 1) {
+ $cat = new Category($category['id_category']);
+ $link = Tools::HtmlEntitiesUTF8($cat->getLink());
+ } else {
+ $link = $this->context->link->getPageLink('index');
+ }
+
+ $node['url'] = $link;
+ $node['type'] = 'category';
+
+ /* Whenever a category is not active we shouldnt display it to customer */
+ if ((bool)$category['active'] === false) {
+ continue;
+ }
+
+ $current = $this->page_name == 'category' && (int)Tools::getValue('id_category') == (int)$category['id_category'];
+ $node['current'] = $current;
+ $node['label'] = $category['name'];
+ $node['image_urls'] = [];
+
+ if (isset($category['children']) && !empty($category['children'])) {
+ $node['children'] = $this->generateCategoriesMenu($category['children'], 1);
+
+ $files = scandir(_PS_CAT_IMG_DIR_);
+
+ if (count(preg_grep('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $files)) > 0) {
+ foreach ($files as $file) {
+ if (preg_match('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $file) === 1) {
+ $image_url = $this->context->link->getMediaLink(_THEME_CAT_DIR_.$file);
+ $node['image_urls'][] = $image_url;
+ }
+ }
+ }
+ }
+
+ $nodes[] = $node;
+ }
+
+ return $nodes;
}
protected function getCMSOptions($parent = 0, $depth = 1, $id_lang = false, $items_to_skip = null, $id_shop = false)
@@ -720,33 +832,6 @@ class Blocktopmenu extends Module
$this->context->controller->addCSS($this->_path.'css/superfish-modified.css');
}
- public function hookDisplayTop($param)
- {
- $this->user_groups = ($this->context->customer->isLogged() ?
- $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP')));
- $this->page_name = Dispatcher::getInstance()->getController();
- if (!$this->isCached('blocktopmenu.tpl', $this->getCacheId())) {
- if (Tools::isEmpty($this->_menu)) {
- $this->makeMenu();
- }
-
- $shop_id = (int)$this->context->shop->id;
- $shop_group_id = Shop::getGroupFromShop($shop_id);
-
- $this->smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH', null, $shop_group_id, $shop_id));
- $this->smarty->assign('MENU', $this->_menu);
- $this->smarty->assign('this_path', $this->_path);
- }
-
- $html = $this->display(__FILE__, 'blocktopmenu.tpl', $this->getCacheId());
- return $html;
- }
-
- public function hookDisplayNav($params)
- {
- return $this->hookDisplayTop($params);
- }
-
protected function getCMSCategories($recursive = false, $parent = 1, $id_lang = false, $id_shop = false)
{
$id_lang = $id_lang ? (int)$id_lang : (int)Context::getContext()->language->id;
@@ -1358,4 +1443,32 @@ class Blocktopmenu extends Module
return $helper->generateList($links, $fields_list);
}
+
+ public function getWidgetVariables($hookName, array $configuration)
+ {
+ ddd($this->makeMenu());
+ }
+
+ public function renderWidget($hookName, array $configuration)
+ {
+ $variables = $this->getWidgetVariables($hookName, $configuration);
+ /*$this->user_groups = ($this->context->customer->isLogged() ?
+ $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP')));
+ $this->page_name = Dispatcher::getInstance()->getController();
+ if (!$this->isCached('blocktopmenu.tpl', $this->getCacheId())) {
+ if (Tools::isEmpty($this->_menu)) {
+ $this->makeMenu();
+ }
+
+ $shop_id = (int)$this->context->shop->id;
+ $shop_group_id = Shop::getGroupFromShop($shop_id);
+
+ $this->smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH', null, $shop_group_id, $shop_id));
+ $this->smarty->assign('MENU', $this->_menu);
+ $this->smarty->assign('this_path', $this->_path);
+ }
+
+ $html = $this->display(__FILE__, 'blocktopmenu.tpl', $this->getCacheId());
+ return $html;*/
+ }
}
diff --git a/css/blocktopmenu.css b/css/blocktopmenu.css
deleted file mode 100644
index e69de29..0000000
diff --git a/css/index.php b/css/index.php
deleted file mode 100644
index 2d4b752..0000000
--- a/css/index.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-* @copyright 2007-2015 PrestaShop SA
-* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
-* International Registered Trademark & Property of PrestaShop SA
-*/
-
-header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
-header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
-
-header("Cache-Control: no-store, no-cache, must-revalidate");
-header("Cache-Control: post-check=0, pre-check=0", false);
-header("Pragma: no-cache");
-
-header("Location: ../");
-exit;
diff --git a/css/superfish-modified.css b/css/superfish-modified.css
deleted file mode 100644
index ff46789..0000000
--- a/css/superfish-modified.css
+++ /dev/null
@@ -1,172 +0,0 @@
-/*** ESSENTIAL STYLES ***/
-.sf-contener {
- clear: both;
-}
-.sf-right {
- margin-right: 14px;
- float: right;
- width: 7px;
-}
-.sf-menu, .sf-menu * {
- margin: 0;
- padding: 0;
- list-style: none;
-}
-.sf-menu {
- margin: 10px 0;
- padding:0;
- width:980px;/* 980 */
- background: #383838;
-}
-.sf-menu ul {
- position: absolute;
- top: -999em;
- width: 10em; /* left offset of submenus need to match (see below) */
-}
-.sf-menu ul li {
- width: 100%;
-}
-.sf-menu li:hover {
- visibility: inherit; /* fixes IE7 'sticky bug' */
-}
-.sf-menu li {
- float: left;
- position: relative;
- border-right: 1px solid #777;
-}
-.sf-menu a {
- display: block;
- position: relative;
- color:#fff;
- text-shadow:0 1px 0 #333;
-}
-.sf-menu li:hover ul,
-.sf-menu li.sfHover ul {
- left: 0;
- top: 34px; /* match top ul list item height */
- z-index: 99;
- width:auto
-}
-ul.sf-menu li:hover li ul,
-ul.sf-menu li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li:hover ul,
-ul.sf-menu li li.sfHover ul {
- left: 200px; /* match ul width */
- top: 0;
-}
-ul.sf-menu li li:hover li ul,
-ul.sf-menu li li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li li:hover ul,
-ul.sf-menu li li li.sfHover ul {
- left: 200px; /* match ul width */
- top: 0;
-}
-
-/*** DEMO SKIN ***/
-.sf-menu {
- float: left;
- margin-bottom: 1em;
-}
-.sf-menu a {
- display:block;
- margin-right:2px;
- padding: 0 22px 0 20px;
- line-height:34px;
- border: 0;
- text-decoration:none;
-}
-.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
- color: #fff;
- white-space:nowrap;
-}
-.sf-menu li li {
- background: rgba(113, 113, 113, 0.9);
-}
-.sf-menu li li li {
- background: rgba(113, 113, 113, 0.9);
-}
-.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
- background: #4E4E4E;
-}
-.sf-menu ul li:hover, .sf-menu ul li.sfHover,
-.sf-menu ul li a:focus, .sf-menu ul li a:hover, .sf-menu ul li a:active {
- background: #4e4e4e;
- outline: 0;
-}
-/*** arrows **/
-.sf-menu a.sf-with-ul {
- padding-right: 2.25em;
- min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
-}
-.sf-sub-indicator {
- position: absolute;
- display: block;
- right: 10px;
- top: 1.05em; /* IE6 only */
- width: 10px;
- height: 10px;
- text-indent: -999em;
- overflow: hidden;
- background: url('../img/arrows-ffffff.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
-}
-a > .sf-sub-indicator { /* give all except IE6 the correct values */
- top: 11px;
- background-position: 0 -100px; /* use translucent arrow for modern browsers*/
-}
-/* apply hovers to modern browsers */
-a:focus > .sf-sub-indicator,
-a:hover > .sf-sub-indicator,
-a:active > .sf-sub-indicator,
-li:hover > a > .sf-sub-indicator,
-li.sfHover > a > .sf-sub-indicator {
- background-position: -10px -100px; /* arrow hovers for modern browsers*/
-}
-
-/* point right for anchors in subs */
-.sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
-.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
-/* apply hovers to modern browsers */
-.sf-menu ul a:focus > .sf-sub-indicator,
-.sf-menu ul a:hover > .sf-sub-indicator,
-.sf-menu ul a:active > .sf-sub-indicator,
-.sf-menu ul li:hover > a > .sf-sub-indicator,
-.sf-menu ul li.sfHover > a > .sf-sub-indicator {
- background-position: -10px 0; /* arrow hovers for modern browsers*/
-}
-
-/*** shadows for all but IE6 ***/
-.sf-shadow ul {
- background: url('../img/shadow.png') no-repeat bottom right;
- padding: 0 8px 9px 0;
- -moz-border-bottom-left-radius: 17px;
- -moz-border-top-right-radius: 17px;
- -webkit-border-top-right-radius: 17px;
- -webkit-border-bottom-left-radius: 17px;
-}
-.sf-shadow ul.sf-shadow-off {
- background: transparent;
-}
-li.sf-search {
- background: inherit;
- float: right;
- line-height: 25px;
-}
-li.sf-search input {
- -moz-border-radius: 0 5px 5px 0;
- padding: 3px 0;
- padding-left: 20px;
- margin: 6px 6px 0 0;
- background: #fff url('../img/search.gif') no-repeat left center;
- border:1px solid #777
-}
-
-/* hack IE7 */
-.sf-menu a, .sf-menu a:visited {height:34px !IE;}
-.sf-menu li li {
- width:200px;
- background:#726f72 !IE;
-}
diff --git a/img/arrows-ffffff.png b/img/arrows-ffffff.png
deleted file mode 100644
index 246dd91..0000000
Binary files a/img/arrows-ffffff.png and /dev/null differ
diff --git a/img/bg_blocktopmenu_li_seleted.png b/img/bg_blocktopmenu_li_seleted.png
deleted file mode 100644
index 57fe03c..0000000
Binary files a/img/bg_blocktopmenu_li_seleted.png and /dev/null differ
diff --git a/img/blocktopmenu.gif b/img/blocktopmenu.gif
deleted file mode 100644
index b4b507d..0000000
Binary files a/img/blocktopmenu.gif and /dev/null differ
diff --git a/img/blocktopmenu_hover.gif b/img/blocktopmenu_hover.gif
deleted file mode 100644
index 09f9c0a..0000000
Binary files a/img/blocktopmenu_hover.gif and /dev/null differ
diff --git a/img/blocktopmenu_left.gif b/img/blocktopmenu_left.gif
deleted file mode 100644
index 5898043..0000000
Binary files a/img/blocktopmenu_left.gif and /dev/null differ
diff --git a/img/blocktopmenu_right.gif b/img/blocktopmenu_right.gif
deleted file mode 100644
index d8ab241..0000000
Binary files a/img/blocktopmenu_right.gif and /dev/null differ
diff --git a/img/index.php b/img/index.php
deleted file mode 100644
index 2d4b752..0000000
--- a/img/index.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-* @copyright 2007-2015 PrestaShop SA
-* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
-* International Registered Trademark & Property of PrestaShop SA
-*/
-
-header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
-header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
-
-header("Cache-Control: no-store, no-cache, must-revalidate");
-header("Cache-Control: post-check=0, pre-check=0", false);
-header("Pragma: no-cache");
-
-header("Location: ../");
-exit;
diff --git a/img/search.gif b/img/search.gif
deleted file mode 100644
index e32a989..0000000
Binary files a/img/search.gif and /dev/null differ
diff --git a/img/shadow.png b/img/shadow.png
deleted file mode 100644
index 87c54bd..0000000
Binary files a/img/shadow.png and /dev/null differ
diff --git a/js/blocktopmenu.js b/js/blocktopmenu.js
deleted file mode 100644
index e69de29..0000000
diff --git a/js/hoverIntent.js b/js/hoverIntent.js
deleted file mode 100644
index 91da57b..0000000
--- a/js/hoverIntent.js
+++ /dev/null
@@ -1,84 +0,0 @@
-(function($){
- /* hoverIntent by Brian Cherne */
- $.fn.hoverIntent = function(f,g) {
- // default configuration options
- var cfg = {
- sensitivity: 7,
- interval: 100,
- timeout: 0
- };
- // override configuration options with user supplied object
- cfg = $.extend(cfg, g ? { over: f, out: g } : f );
-
- // instantiate variables
- // cX, cY = current X and Y position of mouse, updated by mousemove event
- // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
- var cX, cY, pX, pY;
-
- // A private function for getting mouse position
- var track = function(ev) {
- cX = ev.pageX;
- cY = ev.pageY;
- };
-
- // A private function for comparing current and previous mouse position
- var compare = function(ev,ob) {
- ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
- // compare mouse positions to see if they've crossed the threshold
- if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
- $(ob).unbind("mousemove",track);
- // set hoverIntent state to true (so mouseOut can be called)
- ob.hoverIntent_s = 1;
- return cfg.over.apply(ob,[ev]);
- } else {
- // set previous coordinates for next time
- pX = cX; pY = cY;
- // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
- ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
- }
- };
-
- // A private function for delaying the mouseOut function
- var delay = function(ev,ob) {
- ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
- ob.hoverIntent_s = 0;
- return cfg.out.apply(ob,[ev]);
- };
-
- // A private function for handling mouse 'hovering'
- var handleHover = function(e) {
- // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
- var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
- while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
- if ( p == this ) { return false; }
-
- // copy objects to be passed into t (required for event object to be passed in IE)
- var ev = jQuery.extend({},e);
- var ob = this;
-
- // cancel hoverIntent timer if it exists
- if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
-
- // else e.type == "onmouseover"
- if (e.type == "mouseover") {
- // set "previous" X and Y position based on initial entry point
- pX = ev.pageX; pY = ev.pageY;
- // update "current" X and Y position based on mousemove
- $(ob).bind("mousemove",track);
- // start polling interval (self-calling timeout) to compare mouse coordinates over time
- if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
-
- // else e.type == "onmouseout"
- } else {
- // unbind expensive mousemove event
- $(ob).unbind("mousemove",track);
- // if hoverIntent state is true, then call the mouseOut function after the specified delay
- if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
- }
- };
-
- // bind the function to the two event listeners
- return this.mouseover(handleHover).mouseout(handleHover);
- };
-
-})(jQuery);
\ No newline at end of file
diff --git a/js/index.php b/js/index.php
deleted file mode 100644
index 2d4b752..0000000
--- a/js/index.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
-* @copyright 2007-2015 PrestaShop SA
-* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
-* International Registered Trademark & Property of PrestaShop SA
-*/
-
-header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
-header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
-
-header("Cache-Control: no-store, no-cache, must-revalidate");
-header("Cache-Control: post-check=0, pre-check=0", false);
-header("Pragma: no-cache");
-
-header("Location: ../");
-exit;
diff --git a/js/superfish-modified.js b/js/superfish-modified.js
deleted file mode 100644
index 0635741..0000000
--- a/js/superfish-modified.js
+++ /dev/null
@@ -1,124 +0,0 @@
-
-/*
- * Superfish v1.4.8 - jQuery menu widget
- * Copyright (c) 2008 Joel Birch
- *
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
- */
-
-(function($){
- $.fn.superfish = function(op){
-
- var sf = $.fn.superfish,
- c = sf.c,
- $arrow = $([' »'].join('')),
- over = function(){
- var $$ = $(this), menu = getMenu($$);
- clearTimeout(menu.sfTimer);
- $$.showSuperfishUl().siblings().hideSuperfishUl();
- },
- out = function(){
- var $$ = $(this), menu = getMenu($$), o = sf.op;
- clearTimeout(menu.sfTimer);
- menu.sfTimer=setTimeout(function(){
- o.retainPath=($.inArray($$[0],o.$path)>-1);
- $$.hideSuperfishUl();
- if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
- },o.delay);
- },
- getMenu = function($menu){
- var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
- sf.op = sf.o[menu.serial];
- return menu;
- },
- addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
-
- return this.each(function() {
- var s = this.serial = sf.o.length;
- var o = $.extend({},sf.defaults,op);
- o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
- $(this).addClass([o.hoverClass,c.bcClass].join(' '))
- .filter('li:has(ul)').removeClass(o.pathClass);
- });
- sf.o[s] = sf.op = o;
-
- $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
- if (o.autoArrows) addArrow( $('>a:first-child',this) );
- })
- .not('.'+c.bcClass)
- .hideSuperfishUl();
-
- var $a = $('a',this);
- $a.each(function(i){
- var $li = $a.eq(i).parents('li');
- $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
- });
- o.onInit.call(this);
-
- }).each(function() {
- menuClasses = [c.menuClass];
- if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
- $(this).addClass(menuClasses.join(' '));
- });
- };
-
- var sf = $.fn.superfish;
- sf.o = [];
- sf.op = {};
- sf.IE7fix = function(){
- var o = sf.op;
- if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
- this.toggleClass(sf.c.shadowClass+'-off');
- };
- sf.c = {
- bcClass : 'sf-breadcrumb',
- menuClass : 'sf-js-enabled',
- anchorClass : 'sf-with-ul',
- arrowClass : 'sf-sub-indicator',
- shadowClass : 'sf-shadow'
- };
- sf.defaults = {
- hoverClass : 'sfHover',
- pathClass : 'overideThisToUse',
- pathLevels : 1,
- delay : 800,
- animation : {opacity:'show'},
- speed : 'fast',
- autoArrows : true,
- dropShadows : true,
- disableHI : false, // true disables hoverIntent detection
- onInit : function(){}, // callback functions
- onBeforeShow: function(){},
- onShow : function(){},
- onHide : function(){}
- };
- $.fn.extend({
- hideSuperfishUl : function(){
- var o = sf.op,
- not = (o.retainPath===true) ? o.$path : '';
- o.retainPath = false;
- var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
- .find('>ul').hide().css('visibility','hidden');
- o.onHide.call($ul);
- return this;
- },
- showSuperfishUl : function(){
- var o = sf.op,
- sh = sf.c.shadowClass+'-off',
- $ul = this.addClass(o.hoverClass)
- .find('>ul:hidden').css('visibility','visible');
- sf.IE7fix.call($ul);
- o.onBeforeShow.call($ul);
- $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
- return this;
- }
- });
-
-})(jQuery);
-jQuery(function(){
- jQuery('ul.sf-menu').superfish();
-});
\ No newline at end of file