diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40da3e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/config_*.xml +/translations/*.php diff --git a/CHANGELOG.txt b/CHANGELOG.txt deleted file mode 100644 index 58b6dc3..0000000 --- a/CHANGELOG.txt +++ /dev/null @@ -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 diff --git a/Readme.md b/Readme.md index 965c3cc..da1c952 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,4 @@ -# Top horizontal menu +# Main Menu ## 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 [2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message [3]: https://help.github.com/articles/using-pull-requests - diff --git a/composer.json b/composer.json index 86bd4b3..1c75edf 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { - "name": "prestashop/blocktopmenu", - "description": "PrestaShop module blocktopmenu", - "homepage": "https://github.com/PrestaShop/blocktopmenu", + "name": "prestashop/ps_mainmenu", + "description": "PrestaShop - Main menu", + "homepage": "https://github.com/PrestaShop/ps_mainmenu", "license": "AFL - Academic Free License (AFL 3.0)", "authors": [ { @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=5.3.2" + "php": ">=5.4.0" }, "config": { "preferred-install": "dist" diff --git a/config.xml b/config.xml index 1b3cc45..10e40db 100644 --- a/config.xml +++ b/config.xml @@ -1,9 +1,9 @@ - blocktopmenu - - - + ps_mainmenu + + + 1 diff --git a/logo.gif b/logo.gif deleted file mode 100644 index 5e0095b..0000000 Binary files a/logo.gif and /dev/null differ diff --git a/logo.png b/logo.png index 743bdf9..b1e889f 100644 Binary files a/logo.png and b/logo.png differ diff --git a/blocktopmenu.php b/ps_mainmenu.php similarity index 98% rename from blocktopmenu.php rename to ps_mainmenu.php index d499f4b..06e2b4a 100644 --- a/blocktopmenu.php +++ b/ps_mainmenu.php @@ -28,7 +28,7 @@ use PrestaShop\PrestaShop\Core\Module\WidgetInterface; 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'; @@ -54,16 +54,16 @@ class Blocktopmenu extends Module implements WidgetInterface public function __construct() { - $this->name = 'blocktopmenu'; + $this->name = 'ps_mainmenu'; $this->tab = 'front_office_features'; - $this->version = '4.0.0'; + $this->version = '1.0.0'; $this->author = 'PrestaShop'; $this->bootstrap = true; parent::__construct(); - $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->displayName = $this->l('Main menu'); + $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_); } @@ -788,15 +788,6 @@ class Blocktopmenu extends Module implements WidgetInterface 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) { $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() { - return _PS_CACHE_DIR_ . DIRECTORY_SEPARATOR . 'blocktopmenu'; + return _PS_CACHE_DIR_ . DIRECTORY_SEPARATOR . 'ps_mainmenu'; } protected function clearMenuCache() @@ -1430,6 +1421,6 @@ class Blocktopmenu extends Module implements WidgetInterface $this->smarty->assign([ 'menu' => $this->getWidgetVariables($hookName, $configuration) ]); - return $this->display(__FILE__, 'blocktopmenu.tpl'); + return $this->display(__FILE__, 'ps_mainmenu.tpl'); } } diff --git a/blocktopmenu.tpl b/ps_mainmenu.tpl similarity index 100% rename from blocktopmenu.tpl rename to ps_mainmenu.tpl diff --git a/upgrade/install-2.1.1.php b/upgrade/index.php similarity index 72% rename from upgrade/install-2.1.1.php rename to upgrade/index.php index 95dd18a..d8f7de2 100644 --- a/upgrade/install-2.1.1.php +++ b/upgrade/index.php @@ -23,11 +23,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_PS_VERSION_')) { - exit; -} - -function upgrade_module_2_1_1($object) -{ - return ($object->registerHook('header')); -} + +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/upgrade/install-1.6.php b/upgrade/install-1.6.php deleted file mode 100644 index 948aee7..0000000 --- a/upgrade/install-1.6.php +++ /dev/null @@ -1,10 +0,0 @@ -registerHook('actionObjectCategoryAddAfter')); -} diff --git a/views/templates/admin/_configure/helpers/form/form.tpl b/views/templates/admin/_configure/helpers/form/form.tpl index 80f23a5..c2fc40c 100644 --- a/views/templates/admin/_configure/helpers/form/form.tpl +++ b/views/templates/admin/_configure/helpers/form/form.tpl @@ -50,10 +50,10 @@ function add() text = text.replace(/(^\s*)|(\s*$)/gi,""); 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)) 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; } $("#items").append(''); @@ -82,7 +82,7 @@ function move(up) var tomove = $('#items option:selected'); 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; } if (up) @@ -99,25 +99,25 @@ function move(up) {if $input.type == 'link_choice'}
-

{l s='Change position' mod='blocktopmenu'}

+

{l s='Change position' mod='ps_mainmenu'}



-

{l s='Selected items' mod='blocktopmenu'}

+

{l s='Selected items' mod='ps_mainmenu'}

{$selected_links}
-

{l s='Available items' mod='blocktopmenu'}

+

{l s='Available items' mod='ps_mainmenu'}

{$choices}
- +

- - + +
{else} {$smarty.block.parent}