[+] 🎉 Introducing Main menu v1.0.0

This commit is contained in:
Julien Bourdeau
2016-03-07 12:20:49 +01:00
parent f95668cabf
commit d8fc4b2486
12 changed files with 37 additions and 57 deletions
+2
View File
@@ -0,0 +1,2 @@
/config_*.xml
/translations/*.php
-4
View File
@@ -1,4 +0,0 @@
2014-04-22 18:57:57 +0200 // Changelog updated
2014-03-24 11:43:29 +0100 / MO blocktopmenu : ps_versions_compliancy modified (1.5.6.1 => 1.6)
2014-03-24 11:04:46 +0100 / MO blocktopmenu : ps_versions_compliancy added
2014-03-20 14:28:17 +0100 Initial commit
+1 -2
View File
@@ -1,4 +1,4 @@
# Top horizontal menu # Main Menu
## About ## About
@@ -34,4 +34,3 @@ That's it: you have contributed to this open-source project! Congratulations!
[1]: http://doc.prestashop.com/display/PS16/Coding+Standards [1]: http://doc.prestashop.com/display/PS16/Coding+Standards
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message [2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
[3]: https://help.github.com/articles/using-pull-requests [3]: https://help.github.com/articles/using-pull-requests
+4 -4
View File
@@ -1,7 +1,7 @@
{ {
"name": "prestashop/blocktopmenu", "name": "prestashop/ps_mainmenu",
"description": "PrestaShop module blocktopmenu", "description": "PrestaShop - Main menu",
"homepage": "https://github.com/PrestaShop/blocktopmenu", "homepage": "https://github.com/PrestaShop/ps_mainmenu",
"license": "AFL - Academic Free License (AFL 3.0)", "license": "AFL - Academic Free License (AFL 3.0)",
"authors": [ "authors": [
{ {
@@ -10,7 +10,7 @@
} }
], ],
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.4.0"
}, },
"config": { "config": {
"preferred-install": "dist" "preferred-install": "dist"
+4 -4
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<module> <module>
<name>blocktopmenu</name> <name>ps_mainmenu</name>
<displayName><![CDATA[Top horizontal menu]]></displayName> <displayName><![CDATA[Main menu]]></displayName>
<version><![CDATA[2.2.3]]></version> <version><![CDATA[1.0.0]]></version>
<description><![CDATA[Adds a new horizontal menu to the top of your e-commerce website.]]></description> <description><![CDATA[Adds a new menu to the top of your e-commerce website.]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab> <tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable> <is_configurable>1</is_configurable>
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 264 B

+7 -16
View File
@@ -28,7 +28,7 @@ use PrestaShop\PrestaShop\Core\Module\WidgetInterface;
require(dirname(__FILE__).'/menutoplinks.class.php'); require(dirname(__FILE__).'/menutoplinks.class.php');
class Blocktopmenu extends Module implements WidgetInterface class Ps_MainMenu extends Module implements WidgetInterface
{ {
const MENU_JSON_CACHE_KEY = 'MOD_BLOCKTOPMENU_MENU_JSON'; const MENU_JSON_CACHE_KEY = 'MOD_BLOCKTOPMENU_MENU_JSON';
@@ -54,16 +54,16 @@ class Blocktopmenu extends Module implements WidgetInterface
public function __construct() public function __construct()
{ {
$this->name = 'blocktopmenu'; $this->name = 'ps_mainmenu';
$this->tab = 'front_office_features'; $this->tab = 'front_office_features';
$this->version = '4.0.0'; $this->version = '1.0.0';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->bootstrap = true; $this->bootstrap = true;
parent::__construct(); parent::__construct();
$this->displayName = $this->l('Top horizontal menu'); $this->displayName = $this->l('Main menu');
$this->description = $this->l('Adds a new horizontal menu to the top of your e-commerce website.'); $this->description = $this->l('Adds a new menu to the top of your e-commerce website.');
$this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_); $this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
} }
@@ -788,15 +788,6 @@ class Blocktopmenu extends Module implements WidgetInterface
return parent::getCacheId().'|'.$page_name.($page_name != 'index' ? '|'.(int)Tools::getValue('id_'.$page_name) : ''); return parent::getCacheId().'|'.$page_name.($page_name != 'index' ? '|'.(int)Tools::getValue('id_'.$page_name) : '');
} }
public function hookHeader()
{
$this->context->controller->addJS($this->_path.'js/hoverIntent.js');
$this->context->controller->addJS($this->_path.'js/superfish-modified.js');
$this->context->controller->addJS($this->_path.'js/blocktopmenu.js');
$this->context->controller->addCSS($this->_path.'css/blocktopmenu.css');
$this->context->controller->addCSS($this->_path.'css/superfish-modified.css');
}
protected function getCMSCategories($recursive = false, $parent = 1, $id_lang = false, $id_shop = false) 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; $id_lang = $id_lang ? (int)$id_lang : (int)Context::getContext()->language->id;
@@ -952,7 +943,7 @@ class Blocktopmenu extends Module implements WidgetInterface
protected function getCacheDirectory() protected function getCacheDirectory()
{ {
return _PS_CACHE_DIR_ . DIRECTORY_SEPARATOR . 'blocktopmenu'; return _PS_CACHE_DIR_ . DIRECTORY_SEPARATOR . 'ps_mainmenu';
} }
protected function clearMenuCache() protected function clearMenuCache()
@@ -1430,6 +1421,6 @@ class Blocktopmenu extends Module implements WidgetInterface
$this->smarty->assign([ $this->smarty->assign([
'menu' => $this->getWidgetVariables($hookName, $configuration) 'menu' => $this->getWidgetVariables($hookName, $configuration)
]); ]);
return $this->display(__FILE__, 'blocktopmenu.tpl'); return $this->display(__FILE__, 'ps_mainmenu.tpl');
} }
} }
@@ -23,11 +23,13 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_2_1_1($object) header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
{ header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
return ($object->registerHook('header'));
} 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;
-10
View File
@@ -1,10 +0,0 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_6($object)
{
return ($object->registerHook('actionObjectCategoryAddAfter'));
}
@@ -50,10 +50,10 @@ function add()
text = text.replace(/(^\s*)|(\s*$)/gi,""); text = text.replace(/(^\s*)|(\s*$)/gi,"");
if (val == "PRODUCT") if (val == "PRODUCT")
{ {
val = prompt('{l s="Indicate the ID number for the product" mod='blocktopmenu' js=1}'); val = prompt('{l s="Indicate the ID number for the product" mod='ps_mainmenu' js=1}');
if (val == null || val == "" || isNaN(val)) if (val == null || val == "" || isNaN(val))
return; return;
text = '{l s="Product ID #" mod='blocktopmenu' js=1}'+val; text = '{l s="Product ID #" mod='ps_mainmenu' js=1}'+val;
val = "PRD"+val; val = "PRD"+val;
} }
$("#items").append('<option value="'+val+'" selected="selected">'+text+'</option>'); $("#items").append('<option value="'+val+'" selected="selected">'+text+'</option>');
@@ -82,7 +82,7 @@ function move(up)
var tomove = $('#items option:selected'); var tomove = $('#items option:selected');
if (tomove.length >1) if (tomove.length >1)
{ {
alert('{l s="Please select just one item" mod='blocktopmenu'}'); alert('{l s="Please select just one item" mod='ps_mainmenu'}');
return false; return false;
} }
if (up) if (up)
@@ -99,16 +99,16 @@ function move(up)
{if $input.type == 'link_choice'} {if $input.type == 'link_choice'}
<div class="row"> <div class="row">
<div class="col-lg-1"> <div class="col-lg-1">
<h4 style="margin-top:5px;">{l s='Change position' mod='blocktopmenu'}</h4> <h4 style="margin-top:5px;">{l s='Change position' mod='ps_mainmenu'}</h4>
<a href="#" id="menuOrderUp" class="btn btn-default" style="font-size:20px;display:block;"><i class="icon-chevron-up"></i></a><br/> <a href="#" id="menuOrderUp" class="btn btn-default" style="font-size:20px;display:block;"><i class="icon-chevron-up"></i></a><br/>
<a href="#" id="menuOrderDown" class="btn btn-default" style="font-size:20px;display:block;"><i class="icon-chevron-down"></i></a><br/> <a href="#" id="menuOrderDown" class="btn btn-default" style="font-size:20px;display:block;"><i class="icon-chevron-down"></i></a><br/>
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
<h4 style="margin-top:5px;">{l s='Selected items' mod='blocktopmenu'}</h4> <h4 style="margin-top:5px;">{l s='Selected items' mod='ps_mainmenu'}</h4>
{$selected_links} {$selected_links}
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
<h4 style="margin-top:5px;">{l s='Available items' mod='blocktopmenu'}</h4> <h4 style="margin-top:5px;">{l s='Available items' mod='ps_mainmenu'}</h4>
{$choices} {$choices}
</div> </div>
@@ -116,8 +116,8 @@ function move(up)
<br/> <br/>
<div class="row"> <div class="row">
<div class="col-lg-1"></div> <div class="col-lg-1"></div>
<div class="col-lg-4"><a href="#" id="removeItem" class="btn btn-default"><i class="icon-arrow-right"></i> {l s='Remove' mod='blocktopmenu'}</a></div> <div class="col-lg-4"><a href="#" id="removeItem" class="btn btn-default"><i class="icon-arrow-right"></i> {l s='Remove' mod='ps_mainmenu'}</a></div>
<div class="col-lg-4"><a href="#" id="addItem" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Add' mod='blocktopmenu'}</a></div> <div class="col-lg-4"><a href="#" id="addItem" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Add' mod='ps_mainmenu'}</a></div>
</div> </div>
{else} {else}
{$smarty.block.parent} {$smarty.block.parent}