From d8fc4b2486760328a1f60a55eb34c14da872c809 Mon Sep 17 00:00:00 2001 From: Julien Bourdeau Date: Mon, 7 Mar 2016 12:20:49 +0100 Subject: [PATCH] [+] :tada: Introducing Main menu v1.0.0 --- .gitignore | 2 ++ CHANGELOG.txt | 4 --- Readme.md | 3 +-- composer.json | 8 +++--- config.xml | 8 +++--- logo.gif | Bin 595 -> 0 bytes logo.png | Bin 732 -> 264 bytes blocktopmenu.php => ps_mainmenu.php | 23 ++++++------------ blocktopmenu.tpl => ps_mainmenu.tpl | 0 upgrade/{install-2.1.1.php => index.php} | 18 ++++++++------ upgrade/install-1.6.php | 10 -------- .../admin/_configure/helpers/form/form.tpl | 18 +++++++------- 12 files changed, 37 insertions(+), 57 deletions(-) create mode 100644 .gitignore delete mode 100644 CHANGELOG.txt delete mode 100644 logo.gif rename blocktopmenu.php => ps_mainmenu.php (98%) rename blocktopmenu.tpl => ps_mainmenu.tpl (100%) rename upgrade/{install-2.1.1.php => index.php} (72%) delete mode 100644 upgrade/install-1.6.php 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 5e0095b0bc43e1defd14fe78c750fbfd78faf577..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 595 zcmZ?wbhEHb6krfwc$UEM{m0KAKY#uD4FrGw{P}zL!P8v_j!vGvHUXKUcd7&v#@5<_I>I3m6!d!w(dJ|=fRU13sz^BHuOwcSkpH7(8-I( z&Rki&Y3GyYuL^70?>~Chbfs?jx^4O8%?FO0oWFd-qqX8Y_Z@!G*ICotvu4w-il+Yk zM@}?!PJZ?F{laByC(K;5@6d^ghR(Y7iM#h7cG_UqH+BA=14ovw*;-NG@#yKxy+_a0 zwDzyxak#X;d*RAWkDtA)YU-}3FD^{+E)(vJ0+py6|TFQ!7#LLE1ZPnhr&YbZv zhmRaR9Iqo7A9*H{g_((wAtEX~-bnNGxeJ%BgvZ9kTPwz&zj*oTgSdwpcJa^ey?Xu7 z!6p91{m;MR4Flsp#xim7{9rxK&B9~#=fpw>$4UGiTp}wP7M$u}mY8ReILXnKpI=GO PVL}2+*TTuoK+~-O%Rd<^ diff --git a/logo.png b/logo.png index 743bdf945c87eb5d7ee8fd12f7d7a275c1a3c819..b1e889f56dcfde1677d3080c40052736b4860db9 100644 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*A(MJzX3_DsH{GWysZFz{7gM#U`ryzw*}I9FHz&JxMJQl=JM6 z-@MgqQGsmW9)=Khi~M;{AC=p^owN46ITOR1hU>;s*6AVaK!ZTQ`+dU|Mh1o-Vk?S% zzXtN_wll9&6*ggFFgtf!;=WtM-tuyw=vIiT6U-$*&L@V-20?}d_LlmV9tI$r59kTG o1FVdQ&MBb@05Bs{?f?J) literal 732 zcmV<20wev2P) z-)j{|6vsbjcK7CjO>6KMlBzeYP_IAQqyz$*CJ!14@uk#1!M`Feu|DNr5yaq&;6q+S z#JA?54;ET$s!$Ny;Js-{cIM2SKJ4C`P;0p&G%xqSvdhezozL0%&UaSKjQtG9KF1JX z2rvW~0tk?=tgPJ4vh1n=c_uvAaOAG)93%|T1oN$gMq?0fjWOO^T3Y%>fKfB+?(O{L zV39mX^6q!Rr5Rtk@`A5xA9V3RB5i~JzEWhj**eZ zo)vy`)y+Uv0VD^wdGkBG_be~pK-IGy60Q)gFV0eW&-BGPetz-;TdzBO+CI;3FE$t* z{fGjaH2h z5g!6&S@P|*YqVM|PPR@FV`6G*iZ3QVuiGbBTU#T>*#AaHUw67MV@!nLaTdA%;~zAO zoTAadWf_7%tp!V|rywjDQ9}i;k+07jBH<{Cf;`Vbq{_ueb)JZjk`beF$ 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}