// first pass, removed resources and made tree object
@@ -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.'</select>';
|
||||
}
|
||||
|
||||
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 .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($product->getLink()).'" title="'.$product->name.'">'.$product->name.'</a></li>'.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 .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($cms[0]['link']).'" title="'.Tools::safeOutput($cms[0]['meta_title']).'">'.Tools::safeOutput($cms[0]['meta_title']).'</a></li>'.PHP_EOL;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'CMS_CAT':
|
||||
$category = new CMSCategory((int)$id, (int)$id_lang);
|
||||
if (count($category)) {
|
||||
$this->_menu .= '<li><a href="'.Tools::HtmlEntitiesUTF8($category->getLink()).'" title="'.$category->name.'">'.$category->name.'</a>';
|
||||
$this->getCMSMenuItems($category->id);
|
||||
$this->_menu .= '</li>'.PHP_EOL;
|
||||
}
|
||||
break;
|
||||
|
||||
// Case to handle the option to show all Manufacturers
|
||||
case 'ALLMAN':
|
||||
$link = new Link;
|
||||
$this->_menu .= '<li><a href="'.$link->getPageLink('manufacturer').'" title="'.$this->l('All manufacturers').'">'.$this->l('All manufacturers').'</a><ul>'.PHP_EOL;
|
||||
$manufacturers = Manufacturer::getManufacturers();
|
||||
foreach ($manufacturers as $key => $manufacturer) {
|
||||
$this->_menu .= '<li><a href="'.$link->getManufacturerLink((int)$manufacturer['id_manufacturer'], $manufacturer['link_rewrite']).'" title="'.Tools::safeOutput($manufacturer['name']).'">'.Tools::safeOutput($manufacturer['name']).'</a></li>'.PHP_EOL;
|
||||
}
|
||||
$this->_menu .= '</ul>';
|
||||
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 .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($link->getManufacturerLink((int)$id, $manufacturer->link_rewrite)).'" title="'.Tools::safeOutput($manufacturer->name).'">'.Tools::safeOutput($manufacturer->name).'</a></li>'.PHP_EOL;
|
||||
}
|
||||
break;
|
||||
|
||||
// Case to handle the option to show all Suppliers
|
||||
case 'ALLSUP':
|
||||
$link = new Link;
|
||||
$this->_menu .= '<li><a href="'.$link->getPageLink('supplier').'" title="'.$this->l('All suppliers').'">'.$this->l('All suppliers').'</a><ul>'.PHP_EOL;
|
||||
$suppliers = Supplier::getSuppliers();
|
||||
foreach ($suppliers as $key => $supplier) {
|
||||
$this->_menu .= '<li><a href="'.$link->getSupplierLink((int)$supplier['id_supplier'], $supplier['link_rewrite']).'" title="'.Tools::safeOutput($supplier['name']).'">'.Tools::safeOutput($supplier['name']).'</a></li>'.PHP_EOL;
|
||||
}
|
||||
$this->_menu .= '</ul>';
|
||||
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 .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($link->getSupplierLink((int)$id, $supplier->link_rewrite)).'" title="'.$supplier->name.'">'.$supplier->name.'</a></li>'.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 .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($shop->getBaseURL()).'" title="'.$shop->name.'">'.$shop->name.'</a></li>'.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 .= '<li><a href="'.Tools::HtmlEntitiesUTF8($link[0]['link']).'"'.(($link[0]['new_window']) ? ' onclick="return !window.open(this.href);"': '').' title="'.Tools::safeOutput($link[0]['label']).'">'.Tools::safeOutput($link[0]['label']).'</a></li>'.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 .= '<option value="CAT'.(int)$category['id_category'].'">'
|
||||
.str_repeat(' ', $this->spacer_size * (int)$category['level_depth']).$category['name'].' ('.$shop->name.')</option>';
|
||||
}
|
||||
|
||||
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 .= '<li'.(($this->page_name == 'category'
|
||||
&& (int)Tools::getValue('id_category') == (int)$category['id_category']) ? ' class="sfHoverForce"' : '').'>';
|
||||
$html .= '<a href="'.$link.'" title="'.$category['name'].'">'.$category['name'].'</a>';
|
||||
|
||||
if (isset($category['children']) && !empty($category['children'])) {
|
||||
$html .= '<ul>';
|
||||
$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 .= '<li class="category-thumbnail">';
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (preg_match('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $file) === 1) {
|
||||
$html .= '<div><img src="'.$this->context->link->getMediaLink(_THEME_CAT_DIR_.$file)
|
||||
.'" alt="'.Tools::SafeOutput($category['name']).'" title="'
|
||||
.Tools::SafeOutput($category['name']).'" class="imgm" /></div>';
|
||||
}
|
||||
}
|
||||
|
||||
$html .= '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
$html .= '</ul>';
|
||||
}
|
||||
|
||||
$html .= '</li>';
|
||||
}
|
||||
|
||||
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 .= '</ul>';
|
||||
}*/
|
||||
}
|
||||
|
||||
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 .= '<option value="CAT'.(int)$category['id_category'].'">'
|
||||
.str_repeat(' ', $this->spacer_size * (int)$category['level_depth']).$category['name'].' ('.$shop->name.')</option>';
|
||||
}
|
||||
|
||||
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;*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2015 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-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;
|
||||
@@ -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;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 839 B |
|
Before Width: | Height: | Size: 155 B |
|
Before Width: | Height: | Size: 353 B |
|
Before Width: | Height: | Size: 353 B |
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2015 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-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;
|
||||
|
Before Width: | Height: | Size: 662 B |
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -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);
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2015 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-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;
|
||||
@@ -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 = $(['<span class="',c.arrowClass,'"> »</span>'].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();
|
||||
});
|
||||