Version Notes
Убрал опцию Replace spaces with non-breaking spaces (думаю, она мало кому нужна, если будет нужна, ее легко можно будет вернуть). Исправил багу с выделением текущей категории, если включена подгрузка через аякс. Убрал кодирование контента меню в base64 как потенциальную проблему для SEO.
Download this release
Release Info
Developer | WebAndPeople |
Extension | wp_custom_menu |
Version | 2.9.0 |
Comparing to | |
See all releases |
Code changes from version 2.8.0 to 2.9.0
- app/code/community/WP/CustomMenu/Block/About.php +203 -0
- app/code/community/WP/CustomMenu/Block/Toggle.php +0 -1
- app/code/community/WP/CustomMenu/Helper/Data.php +24 -0
- app/code/community/WP/CustomMenu/controllers/AjaxmenucontentController.php +1 -0
- app/code/community/WP/CustomMenu/controllers/AjaxmobilemenucontentController.php +1 -0
- app/code/community/WP/CustomMenu/etc/config.xml +123 -99
- app/code/community/WP/CustomMenu/etc/system.xml +219 -200
- app/design/frontend/default/default/template/webandpeople/custommenu/menucontent.phtml +7 -5
- app/design/frontend/default/default/template/webandpeople/custommenu/top.phtml +5 -2
- package.xml +14 -14
- skin/frontend/default/default/js/webandpeople/custommenu/custommenu.js +12 -10
- skin/frontend/default/default/js/webandpeople/custommenu/webtoolkit.base64.js +0 -142
app/code/community/WP/CustomMenu/Block/About.php
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WP_CustomMenu_Block_About
|
4 |
+
extends Mage_Adminhtml_Block_Abstract
|
5 |
+
implements Varien_Data_Form_Element_Renderer_Interface
|
6 |
+
{
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Render fieldset html
|
10 |
+
*
|
11 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
12 |
+
* @return string
|
13 |
+
*/
|
14 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
15 |
+
{
|
16 |
+
$default = <<<HTML
|
17 |
+
<div style="background-color:#EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:20px;">
|
18 |
+
<p>
|
19 |
+
<b style="font-size:12px;">WebAndPeople</b>, a family of niche sites, provides small businesses with everything they need to start selling online.
|
20 |
+
</p>
|
21 |
+
<p>
|
22 |
+
<strong>PREMIUM and FREE MAGENTO TEMPALTES and EXTENSIONS</strong><br />
|
23 |
+
<a href="http://web-experiment.info" target="_blank">Web-Experiment.info</a> offers a wide choice of nice-looking and easily editable free and premium Magento Themes. At Web-Experiment, you can find free downloads or buy premium tempaltes for the extremely popular Magento eCommerce platform.<br />
|
24 |
+
<strong>MAGENTO HOSTING</strong></strong><br />
|
25 |
+
<a href="http://magenting.com" target="_blank">Magenting.com</a>, a new and improved hosting solution, is allowing you to easily create, promote, and manage your online store with Magento. Magenting users will receive a valuable set of tools and features, including automatic Magento eCommerce installation, automatic Magento template installation and a free or paid professional Magento hosting account.<br />
|
26 |
+
<strong>WEB DEVELOPMENT</strong><br />
|
27 |
+
<a href="http://webandpeople.com" target="_blank">WebAndPeople.com</a> is a team of professional Web developers and designers who are some of the best in the industry. WebAndPeople provides Web application development, custom Magento theme designs, and Website design services.<br />
|
28 |
+
<br />
|
29 |
+
</p>
|
30 |
+
<p>
|
31 |
+
Our themes and extensions on <a href="http://www.magentocommerce.com/magento-connect/developer/WebAndPeople" target="_blank">MagentoConnect</a><br />
|
32 |
+
Should you have any questions <a href="http://web-experiment.info/support" target="_blank">Contact Us</a> or email at <a href="mailto:support@web-experiment.info">support@web-experiment.info</a>
|
33 |
+
<br />
|
34 |
+
</p>
|
35 |
+
</div>
|
36 |
+
HTML;
|
37 |
+
$default = json_encode($default);
|
38 |
+
$html = '<div id="wp_aboutus_content"></div>
|
39 |
+
|
40 |
+
<script type="text/javascript"> //<![CDATA[
|
41 |
+
|
42 |
+
/* JSON-P implementation for Prototype.js somewhat by Dan Dean (http://www.dandean.com)
|
43 |
+
*
|
44 |
+
* *HEAVILY* based on Tobie Langel\'s version: http://gist.github.com/145466.
|
45 |
+
* Might as well just call this an iteration.
|
46 |
+
*
|
47 |
+
* This version introduces:
|
48 |
+
* - Support for predefined callbacks (Necessary for OAuth signed requests, by @rboyce)
|
49 |
+
* - Partial integration with Ajax.Responders (Thanks to @sr3d for the kick in this direction)
|
50 |
+
* - Compatibility with Prototype 1.7 (Thanks to @soung3 for the bug report)
|
51 |
+
* - Will not break if page lacks a <head> element
|
52 |
+
*
|
53 |
+
* See examples in README for usage
|
54 |
+
*
|
55 |
+
* VERSION 1.1.2
|
56 |
+
*
|
57 |
+
* new Ajax.JSONRequest(url, options);
|
58 |
+
* - url (String): JSON-P endpoint url.
|
59 |
+
* - options (Object): Configuration options for the request.
|
60 |
+
*/
|
61 |
+
Ajax.JSONRequest = Class.create(Ajax.Base, (function() {
|
62 |
+
var id = 0, head = document.getElementsByTagName(\'head\')[0] || document.body;
|
63 |
+
return {
|
64 |
+
initialize: function($super, url, options) {
|
65 |
+
$super(options);
|
66 |
+
this.options.url = url;
|
67 |
+
this.options.callbackParamName = this.options.callbackParamName || \'callback\';
|
68 |
+
this.options.timeout = this.options.timeout || 10; // Default timeout: 10 seconds
|
69 |
+
this.options.invokeImmediately = (!Object.isUndefined(this.options.invokeImmediately)) ? this.options.invokeImmediately : true ;
|
70 |
+
|
71 |
+
if (!Object.isUndefined(this.options.parameters) && Object.isString(this.options.parameters)) {
|
72 |
+
this.options.parameters = this.options.parameters.toQueryParams();
|
73 |
+
}
|
74 |
+
|
75 |
+
if (this.options.invokeImmediately) {
|
76 |
+
this.request();
|
77 |
+
}
|
78 |
+
},
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Ajax.JSONRequest#_cleanup() -> undefined
|
82 |
+
* Cleans up after the request
|
83 |
+
**/
|
84 |
+
_cleanup: function() {
|
85 |
+
if (this.timeout) {
|
86 |
+
clearTimeout(this.timeout);
|
87 |
+
this.timeout = null;
|
88 |
+
}
|
89 |
+
if (this.transport && Object.isElement(this.transport)) {
|
90 |
+
this.transport.remove();
|
91 |
+
this.transport = null;
|
92 |
+
}
|
93 |
+
},
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Ajax.JSONRequest#request() -> undefined
|
97 |
+
* Invokes the JSON-P request lifecycle
|
98 |
+
**/
|
99 |
+
request: function() {
|
100 |
+
|
101 |
+
// Define local vars
|
102 |
+
var response = new Ajax.JSONResponse(this);
|
103 |
+
var key = this.options.callbackParamName,
|
104 |
+
name = \'_prototypeJSONPCallback_\' + (id++),
|
105 |
+
complete = function() {
|
106 |
+
if (Object.isFunction(this.options.onComplete)) {
|
107 |
+
this.options.onComplete.call(this, response);
|
108 |
+
}
|
109 |
+
Ajax.Responders.dispatch(\'onComplete\', this, response);
|
110 |
+
}.bind(this);
|
111 |
+
|
112 |
+
// If the callback parameter is already defined, use that
|
113 |
+
if (this.options.parameters[key] !== undefined) {
|
114 |
+
name = this.options.parameters[key];
|
115 |
+
}
|
116 |
+
// Otherwise, add callback as a parameter
|
117 |
+
else {
|
118 |
+
this.options.parameters[key] = name;
|
119 |
+
}
|
120 |
+
|
121 |
+
// Build request URL
|
122 |
+
this.options.parameters[key] = name;
|
123 |
+
var url = this.options.url + ((this.options.url.include(\'?\') ? \'&\' : \'?\') + Object.toQueryString(this.options.parameters));
|
124 |
+
|
125 |
+
// Define callback function
|
126 |
+
window[name] = function(json) {
|
127 |
+
this._cleanup(); // Garbage collection
|
128 |
+
window[name] = undefined;
|
129 |
+
|
130 |
+
response.status = 200;
|
131 |
+
response.statusText = "OK";
|
132 |
+
response.setResponseContent(json);
|
133 |
+
|
134 |
+
if (Object.isFunction(this.options.onSuccess)) {
|
135 |
+
this.options.onSuccess.call(this, response);
|
136 |
+
}
|
137 |
+
Ajax.Responders.dispatch(\'onSuccess\', this, response);
|
138 |
+
|
139 |
+
complete();
|
140 |
+
|
141 |
+
}.bind(this);
|
142 |
+
|
143 |
+
this.transport = new Element(\'script\', { type: \'text/javascript\', src: url });
|
144 |
+
|
145 |
+
if (Object.isFunction(this.options.onCreate)) {
|
146 |
+
this.options.onCreate.call(this, response);
|
147 |
+
}
|
148 |
+
Ajax.Responders.dispatch(\'onCreate\', this);
|
149 |
+
|
150 |
+
head.appendChild(this.transport);
|
151 |
+
|
152 |
+
this.timeout = setTimeout(function() {
|
153 |
+
this._cleanup();
|
154 |
+
window[name] = Prototype.emptyFunction;
|
155 |
+
if (Object.isFunction(this.options.onFailure)) {
|
156 |
+
response.status = 504;
|
157 |
+
response.statusText = "Gateway Timeout";
|
158 |
+
this.options.onFailure.call(this, response);
|
159 |
+
}
|
160 |
+
complete();
|
161 |
+
}.bind(this), this.options.timeout * 1000);
|
162 |
+
},
|
163 |
+
toString: function() { return "[object Ajax.JSONRequest]"; }
|
164 |
+
};
|
165 |
+
})());
|
166 |
+
|
167 |
+
Ajax.JSONResponse = Class.create({
|
168 |
+
initialize: function(request) {
|
169 |
+
this.request = request;
|
170 |
+
},
|
171 |
+
request: undefined,
|
172 |
+
status: 0,
|
173 |
+
statusText: \'\',
|
174 |
+
responseJSON: undefined,
|
175 |
+
responseText: undefined,
|
176 |
+
setResponseContent: function(json) {
|
177 |
+
this.responseJSON = json;
|
178 |
+
this.responseText = Object.toJSON(json);
|
179 |
+
},
|
180 |
+
getTransport: function() {
|
181 |
+
if (this.request) return this.request.transport;
|
182 |
+
},
|
183 |
+
toString: function() { return "[object Ajax.JSONResponse]"; }
|
184 |
+
});
|
185 |
+
|
186 |
+
window.onload = function(){
|
187 |
+
var html = ' . $default . ';
|
188 |
+
|
189 |
+
new Ajax.JSONRequest(\'http://web-experiment.info/about-us.php\', {
|
190 |
+
callbackParamName: "jsoncallback",
|
191 |
+
timeout: 2,
|
192 |
+
onComplete: function(response) {
|
193 |
+
if (response.responseJSON && response.responseJSON.html) {
|
194 |
+
html = response.responseJSON.html;
|
195 |
+
}
|
196 |
+
Element.replace(\'wp_aboutus_content\', html);
|
197 |
+
}
|
198 |
+
});
|
199 |
+
};
|
200 |
+
//]]></script>';
|
201 |
+
return $html;
|
202 |
+
}
|
203 |
+
}
|
app/code/community/WP/CustomMenu/Block/Toggle.php
CHANGED
@@ -10,7 +10,6 @@ class WP_CustomMenu_Block_Toggle extends Mage_Core_Block_Template
|
|
10 |
if (is_object($topnav)) {
|
11 |
$topnav->setTemplate('webandpeople/custommenu/top.phtml');
|
12 |
$head = $layout->getBlock('head');
|
13 |
-
$head->addItem('skin_js', 'js/webandpeople/custommenu/webtoolkit.base64.js');
|
14 |
$head->addItem('skin_js', 'js/webandpeople/custommenu/custommenu.js');
|
15 |
$head->addItem('skin_css', 'css/webandpeople/custommenu/custommenu.css');
|
16 |
// --- Insert menu content ---
|
10 |
if (is_object($topnav)) {
|
11 |
$topnav->setTemplate('webandpeople/custommenu/top.phtml');
|
12 |
$head = $layout->getBlock('head');
|
|
|
13 |
$head->addItem('skin_js', 'js/webandpeople/custommenu/custommenu.js');
|
14 |
$head->addItem('skin_css', 'css/webandpeople/custommenu/custommenu.css');
|
15 |
// --- Insert menu content ---
|
app/code/community/WP/CustomMenu/Helper/Data.php
CHANGED
@@ -4,6 +4,30 @@ class WP_CustomMenu_Helper_Data extends Mage_Core_Helper_Abstract
|
|
4 |
{
|
5 |
private $_menuData = null;
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
public function getMenuData()
|
8 |
{
|
9 |
if (!is_null($this->_menuData)) return $this->_menuData;
|
4 |
{
|
5 |
private $_menuData = null;
|
6 |
|
7 |
+
public function saveCurrentCategoryIdToSession()
|
8 |
+
{
|
9 |
+
$currentCategory = Mage::registry('current_category');
|
10 |
+
$currentCategoryId = 0;
|
11 |
+
if (is_object($currentCategory)) {
|
12 |
+
$currentCategoryId = $currentCategory->getId();
|
13 |
+
}
|
14 |
+
Mage::getSingleton('catalog/session')
|
15 |
+
->setCustomMenuCurrentCategoryId($currentCategoryId);
|
16 |
+
}
|
17 |
+
|
18 |
+
public function initCurrentCategory()
|
19 |
+
{
|
20 |
+
$currentCategoryId = Mage::getSingleton('catalog/session')->getCustomMenuCurrentCategoryId();
|
21 |
+
$currentCategory = null;
|
22 |
+
if ($currentCategoryId) {
|
23 |
+
$currentCategory = Mage::getModel('catalog/category')
|
24 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
25 |
+
->load($currentCategoryId);
|
26 |
+
}
|
27 |
+
Mage::unregister('current_category');
|
28 |
+
Mage::register('current_category', $currentCategory);
|
29 |
+
}
|
30 |
+
|
31 |
public function getMenuData()
|
32 |
{
|
33 |
if (!is_null($this->_menuData)) return $this->_menuData;
|
app/code/community/WP/CustomMenu/controllers/AjaxmenucontentController.php
CHANGED
@@ -5,6 +5,7 @@ class WP_CustomMenu_AjaxmenucontentController extends Mage_Core_Controller_Front
|
|
5 |
public function indexAction()
|
6 |
{
|
7 |
if ($this->getRequest()->isXmlHttpRequest()) {
|
|
|
8 |
$menu = Mage::helper('custommenu')->getMenuContent();
|
9 |
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($menu));
|
10 |
}
|
5 |
public function indexAction()
|
6 |
{
|
7 |
if ($this->getRequest()->isXmlHttpRequest()) {
|
8 |
+
Mage::helper('custommenu')->initCurrentCategory();
|
9 |
$menu = Mage::helper('custommenu')->getMenuContent();
|
10 |
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($menu));
|
11 |
}
|
app/code/community/WP/CustomMenu/controllers/AjaxmobilemenucontentController.php
CHANGED
@@ -5,6 +5,7 @@ class WP_CustomMenu_AjaxmobilemenucontentController extends Mage_Core_Controller
|
|
5 |
public function indexAction()
|
6 |
{
|
7 |
if ($this->getRequest()->isXmlHttpRequest()) {
|
|
|
8 |
$menu = Mage::helper('custommenu')->getMobileMenuContent();
|
9 |
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($menu));
|
10 |
}
|
5 |
public function indexAction()
|
6 |
{
|
7 |
if ($this->getRequest()->isXmlHttpRequest()) {
|
8 |
+
Mage::helper('custommenu')->initCurrentCategory();
|
9 |
$menu = Mage::helper('custommenu')->getMobileMenuContent();
|
10 |
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($menu));
|
11 |
}
|
app/code/community/WP/CustomMenu/etc/config.xml
CHANGED
@@ -1,99 +1,123 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<WP_CustomMenu>
|
5 |
-
<version>2.
|
6 |
-
</WP_CustomMenu>
|
7 |
-
</modules>
|
8 |
-
<frontend>
|
9 |
-
<routers>
|
10 |
-
<custommenu>
|
11 |
-
<use>standard</use>
|
12 |
-
<args>
|
13 |
-
<frontName>custommenu</frontName>
|
14 |
-
<module>WP_CustomMenu</module>
|
15 |
-
</args>
|
16 |
-
</custommenu>
|
17 |
-
</routers>
|
18 |
-
<layout>
|
19 |
-
<updates>
|
20 |
-
<custommenu>
|
21 |
-
<file>webandpeople/custommenu.xml</file>
|
22 |
-
</custommenu>
|
23 |
-
</updates>
|
24 |
-
</layout>
|
25 |
-
</frontend>
|
26 |
-
<adminhtml>
|
27 |
-
<acl>
|
28 |
-
<resources>
|
29 |
-
<all>
|
30 |
-
<title>Allow Everything</title>
|
31 |
-
</all>
|
32 |
-
<admin>
|
33 |
-
<children>
|
34 |
-
<system>
|
35 |
-
<children>
|
36 |
-
<config>
|
37 |
-
<children>
|
38 |
-
<custom_menu translate="title" module="custommenu">
|
39 |
-
<title><![CDATA[Web & People: Custom Menu]]></title>
|
40 |
-
<sort_order>2000</sort_order>
|
41 |
-
</custom_menu>
|
42 |
-
</children>
|
43 |
-
</config>
|
44 |
-
</children>
|
45 |
-
</system>
|
46 |
-
</children>
|
47 |
-
</admin>
|
48 |
-
</resources>
|
49 |
-
</acl>
|
50 |
-
</adminhtml>
|
51 |
-
<global>
|
52 |
-
<blocks>
|
53 |
-
<catalog>
|
54 |
-
<rewrite>
|
55 |
-
<navigation>WP_CustomMenu_Block_Navigation</navigation
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
<
|
79 |
-
<
|
80 |
-
<
|
81 |
-
<
|
82 |
-
<
|
83 |
-
<
|
84 |
-
<
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
<
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
<
|
95 |
-
<
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<WP_CustomMenu>
|
5 |
+
<version>2.9.0</version>
|
6 |
+
</WP_CustomMenu>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<custommenu>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<frontName>custommenu</frontName>
|
14 |
+
<module>WP_CustomMenu</module>
|
15 |
+
</args>
|
16 |
+
</custommenu>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<custommenu>
|
21 |
+
<file>webandpeople/custommenu.xml</file>
|
22 |
+
</custommenu>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
</frontend>
|
26 |
+
<adminhtml>
|
27 |
+
<acl>
|
28 |
+
<resources>
|
29 |
+
<all>
|
30 |
+
<title>Allow Everything</title>
|
31 |
+
</all>
|
32 |
+
<admin>
|
33 |
+
<children>
|
34 |
+
<system>
|
35 |
+
<children>
|
36 |
+
<config>
|
37 |
+
<children>
|
38 |
+
<custom_menu translate="title" module="custommenu">
|
39 |
+
<title><![CDATA[Web & People: Custom Menu]]></title>
|
40 |
+
<sort_order>2000</sort_order>
|
41 |
+
</custom_menu>
|
42 |
+
</children>
|
43 |
+
</config>
|
44 |
+
</children>
|
45 |
+
</system>
|
46 |
+
</children>
|
47 |
+
</admin>
|
48 |
+
</resources>
|
49 |
+
</acl>
|
50 |
+
</adminhtml>
|
51 |
+
<global>
|
52 |
+
<blocks>
|
53 |
+
<catalog>
|
54 |
+
<rewrite>
|
55 |
+
<navigation>WP_CustomMenu_Block_Navigation</navigation>
|
56 |
+
<!-- v1.4-1.6 -->
|
57 |
+
</rewrite>
|
58 |
+
</catalog>
|
59 |
+
<page>
|
60 |
+
<rewrite>
|
61 |
+
<html_topmenu>WP_CustomMenu_Block_Topmenu</html_topmenu>
|
62 |
+
<!-- v1.7 -->
|
63 |
+
</rewrite>
|
64 |
+
</page>
|
65 |
+
<custommenu>
|
66 |
+
<class>WP_CustomMenu_Block</class>
|
67 |
+
</custommenu>
|
68 |
+
</blocks>
|
69 |
+
<helpers>
|
70 |
+
<custommenu>
|
71 |
+
<class>WP_CustomMenu_Helper</class>
|
72 |
+
</custommenu>
|
73 |
+
</helpers>
|
74 |
+
</global>
|
75 |
+
<default>
|
76 |
+
<custom_menu>
|
77 |
+
<general>
|
78 |
+
<enabled>1</enabled>
|
79 |
+
<ajax_load_content>0</ajax_load_content>
|
80 |
+
<mobile_menu>1</mobile_menu>
|
81 |
+
<display_empty_categories>1</display_empty_categories>
|
82 |
+
<max_level>3</max_level>
|
83 |
+
<show_home_link>1</show_home_link>
|
84 |
+
<non_breaking_space>0</non_breaking_space>
|
85 |
+
<rtl>0</rtl>
|
86 |
+
<version>2.9.0</version>
|
87 |
+
</general>
|
88 |
+
<columns>
|
89 |
+
<count>3</count>
|
90 |
+
<divided_horizontally>0</divided_horizontally>
|
91 |
+
<integrate>1</integrate>
|
92 |
+
</columns>
|
93 |
+
<popup>
|
94 |
+
<width>0</width>
|
95 |
+
<top_offset>0</top_offset>
|
96 |
+
<delay_displaying>150</delay_displaying>
|
97 |
+
<delay_hiding>100</delay_hiding>
|
98 |
+
</popup>
|
99 |
+
</custom_menu>
|
100 |
+
</default>
|
101 |
+
<adminhtml>
|
102 |
+
<acl>
|
103 |
+
<resources>
|
104 |
+
<admin>
|
105 |
+
<children>
|
106 |
+
<system>
|
107 |
+
<children>
|
108 |
+
<config>
|
109 |
+
<children>
|
110 |
+
<about_webandpeople translate="title" module="custommenu">
|
111 |
+
<title><![CDATA[Web & People: About Us]]></title>
|
112 |
+
<sort_order>1000</sort_order>
|
113 |
+
</about_webandpeople>
|
114 |
+
</children>
|
115 |
+
</config>
|
116 |
+
</children>
|
117 |
+
</system>
|
118 |
+
</children>
|
119 |
+
</admin>
|
120 |
+
</resources>
|
121 |
+
</acl>
|
122 |
+
</adminhtml>
|
123 |
+
</config>
|
app/code/community/WP/CustomMenu/etc/system.xml
CHANGED
@@ -1,200 +1,219 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<tabs>
|
4 |
-
<web_and_people translate="label" module="custommenu">
|
5 |
-
<label>Web-And-People</label>
|
6 |
-
<sort_order>150</sort_order>
|
7 |
-
</web_and_people>
|
8 |
-
</tabs>
|
9 |
-
<sections>
|
10 |
-
<custom_menu translate="label" module="custommenu">
|
11 |
-
<label>Custom Menu</label>
|
12 |
-
<tab>web_and_people</tab>
|
13 |
-
<frontend_type>text</frontend_type>
|
14 |
-
<sort_order>200</sort_order>
|
15 |
-
<show_in_default>1</show_in_default>
|
16 |
-
<show_in_website>1</show_in_website>
|
17 |
-
<show_in_store>1</show_in_store>
|
18 |
-
<groups>
|
19 |
-
<general translate="label">
|
20 |
-
<label>General</label>
|
21 |
-
<frontend_type>text</frontend_type>
|
22 |
-
<sort_order>10</sort_order>
|
23 |
-
<show_in_default>1</show_in_default>
|
24 |
-
<show_in_website>1</show_in_website>
|
25 |
-
<show_in_store>1</show_in_store>
|
26 |
-
<
|
27 |
-
|
28 |
-
|
29 |
-
<
|
30 |
-
<
|
31 |
-
<
|
32 |
-
<
|
33 |
-
<
|
34 |
-
<
|
35 |
-
<
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
<
|
40 |
-
<
|
41 |
-
<
|
42 |
-
<
|
43 |
-
<
|
44 |
-
<
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
<
|
49 |
-
<
|
50 |
-
<
|
51 |
-
<
|
52 |
-
<
|
53 |
-
<
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
<
|
58 |
-
<
|
59 |
-
<
|
60 |
-
<
|
61 |
-
<
|
62 |
-
<
|
63 |
-
<
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
<
|
68 |
-
<
|
69 |
-
<
|
70 |
-
<
|
71 |
-
<
|
72 |
-
<
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
<
|
77 |
-
<
|
78 |
-
<
|
79 |
-
<
|
80 |
-
<
|
81 |
-
<
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
<
|
96 |
-
<
|
97 |
-
<
|
98 |
-
<
|
99 |
-
<
|
100 |
-
<
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
<
|
105 |
-
<
|
106 |
-
<
|
107 |
-
<
|
108 |
-
<
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
<
|
115 |
-
<
|
116 |
-
<
|
117 |
-
<
|
118 |
-
<
|
119 |
-
<
|
120 |
-
|
121 |
-
|
122 |
-
<
|
123 |
-
<
|
124 |
-
<
|
125 |
-
<
|
126 |
-
<
|
127 |
-
<
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
<
|
132 |
-
<
|
133 |
-
<
|
134 |
-
<
|
135 |
-
<
|
136 |
-
<
|
137 |
-
<
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
<
|
142 |
-
<
|
143 |
-
<
|
144 |
-
<
|
145 |
-
<
|
146 |
-
<
|
147 |
-
<
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
<
|
154 |
-
<
|
155 |
-
<
|
156 |
-
<
|
157 |
-
<
|
158 |
-
<
|
159 |
-
|
160 |
-
|
161 |
-
<
|
162 |
-
<
|
163 |
-
<
|
164 |
-
<
|
165 |
-
<
|
166 |
-
<
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
<
|
171 |
-
<
|
172 |
-
<
|
173 |
-
<
|
174 |
-
<
|
175 |
-
<
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
<
|
180 |
-
<
|
181 |
-
<
|
182 |
-
<
|
183 |
-
<
|
184 |
-
<
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
<
|
189 |
-
<
|
190 |
-
<
|
191 |
-
<
|
192 |
-
<
|
193 |
-
<
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<web_and_people translate="label" module="custommenu">
|
5 |
+
<label>Web-And-People</label>
|
6 |
+
<sort_order>150</sort_order>
|
7 |
+
</web_and_people>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<custom_menu translate="label" module="custommenu">
|
11 |
+
<label>Custom Menu</label>
|
12 |
+
<tab>web_and_people</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>200</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<general translate="label">
|
20 |
+
<label>General</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>10</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<expanded>1</expanded>
|
27 |
+
<fields>
|
28 |
+
<enabled translate="label comment">
|
29 |
+
<label>Enable</label>
|
30 |
+
<comment><![CDATA[In order to display a custom block with images or other html content in the popup, use the <b>Static Block</b> (<strong>CMS->Static Blocks</strong> section) with the ID like "<b>wp_custom_menu_83</b>", where "<b>83</b>" is the Category ID of this category]]></comment>
|
31 |
+
<frontend_type>select</frontend_type>
|
32 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
33 |
+
<sort_order>1</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
</enabled>
|
38 |
+
<ajax_load_content translate="label comment">
|
39 |
+
<label>Load content through ajax</label>
|
40 |
+
<frontend_type>select</frontend_type>
|
41 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
42 |
+
<sort_order>2</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</ajax_load_content>
|
47 |
+
<mobile_menu translate="label comment">
|
48 |
+
<label>Mobile menu</label>
|
49 |
+
<frontend_type>select</frontend_type>
|
50 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
51 |
+
<sort_order>4</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
</mobile_menu>
|
56 |
+
<display_empty_categories translate="label comment">
|
57 |
+
<label>Display empty categories</label>
|
58 |
+
<comment><![CDATA[An empty category is a category that has no products]]></comment>
|
59 |
+
<frontend_type>select</frontend_type>
|
60 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
61 |
+
<sort_order>5</sort_order>
|
62 |
+
<show_in_default>1</show_in_default>
|
63 |
+
<show_in_website>1</show_in_website>
|
64 |
+
<show_in_store>1</show_in_store>
|
65 |
+
</display_empty_categories>
|
66 |
+
<max_level translate="label comment">
|
67 |
+
<label>Visible menu depth</label>
|
68 |
+
<comment><![CDATA[e.g. 1, 2, 3, 4 (0 - disable limits). For example, if you set this value to <b>2</b>, only second level categories will be displayed]]></comment>
|
69 |
+
<frontend_type>text</frontend_type>
|
70 |
+
<sort_order>10</sort_order>
|
71 |
+
<show_in_default>1</show_in_default>
|
72 |
+
<show_in_website>1</show_in_website>
|
73 |
+
<show_in_store>1</show_in_store>
|
74 |
+
</max_level>
|
75 |
+
<show_home_link translate="label">
|
76 |
+
<label>Show the link "Home"</label>
|
77 |
+
<frontend_type>select</frontend_type>
|
78 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
79 |
+
<sort_order>15</sort_order>
|
80 |
+
<show_in_default>1</show_in_default>
|
81 |
+
<show_in_website>1</show_in_website>
|
82 |
+
<show_in_store>1</show_in_store>
|
83 |
+
</show_home_link>
|
84 |
+
<!--non_breaking_space translate="label comment">
|
85 |
+
<label>Replace spaces with non-breaking spaces</label>
|
86 |
+
<comment><![CDATA[Insert <b>&nbsp;</b> instead of a space in a name of a menu item]]></comment>
|
87 |
+
<frontend_type>select</frontend_type>
|
88 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
89 |
+
<sort_order>20</sort_order>
|
90 |
+
<show_in_default>1</show_in_default>
|
91 |
+
<show_in_website>1</show_in_website>
|
92 |
+
<show_in_store>1</show_in_store>
|
93 |
+
</non_breaking_space-->
|
94 |
+
<rtl translate="label">
|
95 |
+
<label>Enable RTL Text mode</label>
|
96 |
+
<frontend_type>select</frontend_type>
|
97 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
98 |
+
<sort_order>35</sort_order>
|
99 |
+
<show_in_default>1</show_in_default>
|
100 |
+
<show_in_website>1</show_in_website>
|
101 |
+
<show_in_store>1</show_in_store>
|
102 |
+
</rtl>
|
103 |
+
<version translate="label">
|
104 |
+
<label>Extension Release</label>
|
105 |
+
<frontend_type>label</frontend_type>
|
106 |
+
<sort_order>100</sort_order>
|
107 |
+
<show_in_default>1</show_in_default>
|
108 |
+
<show_in_website>1</show_in_website>
|
109 |
+
<show_in_store>1</show_in_store>
|
110 |
+
</version>
|
111 |
+
</fields>
|
112 |
+
</general>
|
113 |
+
<columns translate="label">
|
114 |
+
<label>Columns</label>
|
115 |
+
<frontend_type>text</frontend_type>
|
116 |
+
<sort_order>15</sort_order>
|
117 |
+
<show_in_default>1</show_in_default>
|
118 |
+
<show_in_website>1</show_in_website>
|
119 |
+
<show_in_store>1</show_in_store>
|
120 |
+
<fields>
|
121 |
+
<count translate="label comment">
|
122 |
+
<label>Number of columns</label>
|
123 |
+
<comment>e.g. 1, 2, 3. The maximum number of columns in the popup</comment>
|
124 |
+
<frontend_type>text</frontend_type>
|
125 |
+
<sort_order>1</sort_order>
|
126 |
+
<show_in_default>1</show_in_default>
|
127 |
+
<show_in_website>1</show_in_website>
|
128 |
+
<show_in_store>1</show_in_store>
|
129 |
+
</count>
|
130 |
+
<divided_horizontally translate="label comment">
|
131 |
+
<label>Split categories left to right into columns</label>
|
132 |
+
<comment><![CDATA[Next Sub-category is placed to the next column]]></comment>
|
133 |
+
<frontend_type>select</frontend_type>
|
134 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
135 |
+
<sort_order>3</sort_order>
|
136 |
+
<show_in_default>1</show_in_default>
|
137 |
+
<show_in_website>1</show_in_website>
|
138 |
+
<show_in_store>1</show_in_store>
|
139 |
+
</divided_horizontally>
|
140 |
+
<integrate translate="label comment">
|
141 |
+
<label>Merge small subcategories</label>
|
142 |
+
<comment><![CDATA[Merge small subcategory lists into one column (except the extream left categories)]]></comment>
|
143 |
+
<frontend_type>select</frontend_type>
|
144 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
145 |
+
<sort_order>5</sort_order>
|
146 |
+
<show_in_default>1</show_in_default>
|
147 |
+
<show_in_website>1</show_in_website>
|
148 |
+
<show_in_store>1</show_in_store>
|
149 |
+
</integrate>
|
150 |
+
</fields>
|
151 |
+
</columns>
|
152 |
+
<popup translate="label">
|
153 |
+
<label>Popup settings</label>
|
154 |
+
<frontend_type>text</frontend_type>
|
155 |
+
<sort_order>20</sort_order>
|
156 |
+
<show_in_default>1</show_in_default>
|
157 |
+
<show_in_website>1</show_in_website>
|
158 |
+
<show_in_store>1</show_in_store>
|
159 |
+
<fields>
|
160 |
+
<width translate="label comment">
|
161 |
+
<label>Width</label>
|
162 |
+
<comment>in pixels, (0 - no fixed width)</comment>
|
163 |
+
<frontend_type>text</frontend_type>
|
164 |
+
<sort_order>1</sort_order>
|
165 |
+
<show_in_default>1</show_in_default>
|
166 |
+
<show_in_website>1</show_in_website>
|
167 |
+
<show_in_store>1</show_in_store>
|
168 |
+
</width>
|
169 |
+
<top_offset translate="label comment">
|
170 |
+
<label>Top offset</label>
|
171 |
+
<comment>in pixels, (0 - to calculate the offset automatically)</comment>
|
172 |
+
<frontend_type>text</frontend_type>
|
173 |
+
<sort_order>3</sort_order>
|
174 |
+
<show_in_default>1</show_in_default>
|
175 |
+
<show_in_website>1</show_in_website>
|
176 |
+
<show_in_store>1</show_in_store>
|
177 |
+
</top_offset>
|
178 |
+
<delay_displaying translate="label comment">
|
179 |
+
<label>Delay before displaying</label>
|
180 |
+
<comment>in milliseconds</comment>
|
181 |
+
<frontend_type>text</frontend_type>
|
182 |
+
<sort_order>15</sort_order>
|
183 |
+
<show_in_default>1</show_in_default>
|
184 |
+
<show_in_website>1</show_in_website>
|
185 |
+
<show_in_store>1</show_in_store>
|
186 |
+
</delay_displaying>
|
187 |
+
<delay_hiding translate="label comment">
|
188 |
+
<label>Delay before hiding</label>
|
189 |
+
<comment>in milliseconds</comment>
|
190 |
+
<frontend_type>text</frontend_type>
|
191 |
+
<sort_order>20</sort_order>
|
192 |
+
<show_in_default>1</show_in_default>
|
193 |
+
<show_in_website>1</show_in_website>
|
194 |
+
<show_in_store>1</show_in_store>
|
195 |
+
</delay_hiding>
|
196 |
+
</fields>
|
197 |
+
</popup>
|
198 |
+
</groups>
|
199 |
+
</custom_menu>
|
200 |
+
<about_webandpeople translate="label" module="custommenu">
|
201 |
+
<label>About Us</label>
|
202 |
+
<tab>web_and_people</tab>
|
203 |
+
<frontend_type>text</frontend_type>
|
204 |
+
<sort_order>99</sort_order>
|
205 |
+
<show_in_default>1</show_in_default>
|
206 |
+
<show_in_website>1</show_in_website>
|
207 |
+
<show_in_store>1</show_in_store>
|
208 |
+
<groups>
|
209 |
+
<info>
|
210 |
+
<frontend_model>custommenu/about</frontend_model>
|
211 |
+
<sort_order>10</sort_order>
|
212 |
+
<show_in_default>1</show_in_default>
|
213 |
+
<show_in_website>1</show_in_website>
|
214 |
+
<show_in_store>1</show_in_store>
|
215 |
+
</info>
|
216 |
+
</groups>
|
217 |
+
</about_webandpeople>
|
218 |
+
</sections>
|
219 |
+
</config>
|
app/design/frontend/default/default/template/webandpeople/custommenu/menucontent.phtml
CHANGED
@@ -1,14 +1,16 @@
|
|
1 |
-
<?php $menuContent = Mage::helper('custommenu')->getMenuContent(); ?>
|
2 |
<script type="text/javascript">
|
3 |
//<![CDATA[
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
6 |
//]]>
|
7 |
</script>
|
8 |
-
<?php $mobileMenuContent = Mage::helper('custommenu')->getMobileMenuContent(); ?>
|
9 |
<script type="text/javascript">
|
10 |
//<![CDATA[
|
11 |
-
|
|
|
12 |
wpCustomMenuMobileToggle();
|
13 |
Event.observe(window, 'resize', function() {
|
14 |
wpCustomMenuMobileToggle();
|
|
|
1 |
<script type="text/javascript">
|
2 |
//<![CDATA[
|
3 |
+
<?php $menuContent = Mage::helper('custommenu')->getMenuContent(); ?>
|
4 |
+
if ($('custommenu') != undefined) {
|
5 |
+
$('custommenu').update(<?php echo Mage::helper('core')->jsonEncode($menuContent['topMenu']); ?>);
|
6 |
+
}
|
7 |
+
wpPopupMenuContent = <?php echo Mage::helper('core')->jsonEncode($menuContent['popupMenu']); ?>;
|
8 |
//]]>
|
9 |
</script>
|
|
|
10 |
<script type="text/javascript">
|
11 |
//<![CDATA[
|
12 |
+
<?php $mobileMenuContent = Mage::helper('custommenu')->getMobileMenuContent(); ?>
|
13 |
+
wpMobileMenuContent = <?php echo Mage::helper('core')->jsonEncode($mobileMenuContent); ?>;
|
14 |
wpCustomMenuMobileToggle();
|
15 |
Event.observe(window, 'resize', function() {
|
16 |
wpCustomMenuMobileToggle();
|
app/design/frontend/default/default/template/webandpeople/custommenu/top.phtml
CHANGED
@@ -1,8 +1,9 @@
|
|
1 |
<?php
|
|
|
2 |
$menuData = Mage::helper('custommenu')->getMenuData();
|
3 |
extract($menuData);
|
4 |
// ---
|
5 |
-
$txtLoading =
|
6 |
$txtMenu = $this->__('Menu');
|
7 |
$xRtl = $_rtl ? ' rtl' : '';
|
8 |
$wpInitContent = <<<HTML
|
@@ -61,7 +62,9 @@ var wpMenuAjaxUrl = '<?php echo $_menuAjaxUrl; ?>';
|
|
61 |
var wpMoblieMenuAjaxUrl = '<?php echo $_moblieMenuAjaxUrl; ?>';
|
62 |
var wpPopupMenuContent = '';
|
63 |
var wpMobileMenuContent = '';
|
64 |
-
$('wp-nav-container')
|
|
|
|
|
65 |
<?php if (Mage::getStoreConfig('custom_menu/general/ajax_load_content')) : ?>
|
66 |
wpCustomMenuMobileToggle();
|
67 |
Event.observe(window, 'resize', function() {
|
1 |
<?php
|
2 |
+
Mage::helper('custommenu')->saveCurrentCategoryIdToSession();
|
3 |
$menuData = Mage::helper('custommenu')->getMenuData();
|
4 |
extract($menuData);
|
5 |
// ---
|
6 |
+
$txtLoading = '';
|
7 |
$txtMenu = $this->__('Menu');
|
8 |
$xRtl = $_rtl ? ' rtl' : '';
|
9 |
$wpInitContent = <<<HTML
|
62 |
var wpMoblieMenuAjaxUrl = '<?php echo $_moblieMenuAjaxUrl; ?>';
|
63 |
var wpPopupMenuContent = '';
|
64 |
var wpMobileMenuContent = '';
|
65 |
+
if ($('wp-nav-container') != undefined) {
|
66 |
+
$('wp-nav-container').update(<?php echo Mage::helper('core')->jsonEncode($wpInitContent); ?>);
|
67 |
+
}
|
68 |
<?php if (Mage::getStoreConfig('custom_menu/general/ajax_load_content')) : ?>
|
69 |
wpCustomMenuMobileToggle();
|
70 |
Event.observe(window, 'resize', function() {
|
package.xml
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<package>
|
3 |
<name>wp_custom_menu</name>
|
4 |
-
<version>2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://web-experiment.info/regular_free_license">Web-Experiment.Info Regular Free License</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</summary>
|
10 |
<description>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</description>
|
11 |
-
<notes
|
12 |
<authors>
|
13 |
<author>
|
14 |
<name>WebAndPeople</name>
|
@@ -21,8 +21,8 @@
|
|
21 |
<email>y.gerassimenko@webandpeople.com</email>
|
22 |
</author>
|
23 |
</authors>
|
24 |
-
<date>2014-
|
25 |
-
<time>
|
26 |
<contents>
|
27 |
<target name="mageweb">
|
28 |
<dir name="app">
|
@@ -31,20 +31,21 @@
|
|
31 |
<dir name="WP">
|
32 |
<dir name="CustomMenu">
|
33 |
<dir name="Block">
|
|
|
34 |
<file name="Navigation.php" hash="f1ec03151889346c5193c3296b556d5b"/>
|
35 |
-
<file name="Toggle.php" hash="
|
36 |
<file name="Topmenu.php" hash="baf91d07f38b733b3e09957ccab4db4d"/>
|
37 |
</dir>
|
38 |
<dir name="Helper">
|
39 |
-
<file name="Data.php" hash="
|
40 |
</dir>
|
41 |
<dir name="controllers">
|
42 |
-
<file name="AjaxmenucontentController.php" hash="
|
43 |
-
<file name="AjaxmobilemenucontentController.php" hash="
|
44 |
</dir>
|
45 |
<dir name="etc">
|
46 |
-
<file name="config.xml" hash="
|
47 |
-
<file name="system.xml" hash="
|
48 |
</dir>
|
49 |
</dir>
|
50 |
</dir>
|
@@ -62,8 +63,8 @@
|
|
62 |
<dir name="template">
|
63 |
<dir name="webandpeople">
|
64 |
<dir name="custommenu">
|
65 |
-
<file name="menucontent.phtml" hash="
|
66 |
-
<file name="top.phtml" hash="
|
67 |
</dir>
|
68 |
</dir>
|
69 |
</dir>
|
@@ -91,8 +92,7 @@
|
|
91 |
<dir name="js">
|
92 |
<dir name="webandpeople">
|
93 |
<dir name="custommenu">
|
94 |
-
<file name="custommenu.js" hash="
|
95 |
-
<file name="webtoolkit.base64.js" hash="d464b20d386bdc75f1eb05ff4963f446"/>
|
96 |
</dir>
|
97 |
</dir>
|
98 |
</dir>
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<package>
|
3 |
<name>wp_custom_menu</name>
|
4 |
+
<version>2.9.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://web-experiment.info/regular_free_license">Web-Experiment.Info Regular Free License</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</summary>
|
10 |
<description>Magento Extension - Magento Custom Menu (Web-Experiment.Info)</description>
|
11 |
+
<notes>Убрал опцию Replace spaces with non-breaking spaces (думаю, она мало кому нужна, если будет нужна, ее легко можно будет вернуть). Исправил багу с выделением текущей категории, если включена подгрузка через аякс. Убрал кодирование контента меню в base64 как потенциальную проблему для SEO.</notes>
|
12 |
<authors>
|
13 |
<author>
|
14 |
<name>WebAndPeople</name>
|
21 |
<email>y.gerassimenko@webandpeople.com</email>
|
22 |
</author>
|
23 |
</authors>
|
24 |
+
<date>2014-08-26</date>
|
25 |
+
<time>12:00:33</time>
|
26 |
<contents>
|
27 |
<target name="mageweb">
|
28 |
<dir name="app">
|
31 |
<dir name="WP">
|
32 |
<dir name="CustomMenu">
|
33 |
<dir name="Block">
|
34 |
+
<file name="About.php" hash="c7770064d9bbd15f841b8f8d65aafe19"/>
|
35 |
<file name="Navigation.php" hash="f1ec03151889346c5193c3296b556d5b"/>
|
36 |
+
<file name="Toggle.php" hash="27b97285b80efbe1922547941cc79ecb"/>
|
37 |
<file name="Topmenu.php" hash="baf91d07f38b733b3e09957ccab4db4d"/>
|
38 |
</dir>
|
39 |
<dir name="Helper">
|
40 |
+
<file name="Data.php" hash="28b88362cdaf2f337ee3eabc39dd4dcb"/>
|
41 |
</dir>
|
42 |
<dir name="controllers">
|
43 |
+
<file name="AjaxmenucontentController.php" hash="8149156483648c590da7d4e977b6829e"/>
|
44 |
+
<file name="AjaxmobilemenucontentController.php" hash="38ca4e28579d38d697b22e5940c7ecc6"/>
|
45 |
</dir>
|
46 |
<dir name="etc">
|
47 |
+
<file name="config.xml" hash="d5af612c000cdc90d6a5e832c98d5492"/>
|
48 |
+
<file name="system.xml" hash="b881024be49d8ef0772249ca5828db97"/>
|
49 |
</dir>
|
50 |
</dir>
|
51 |
</dir>
|
63 |
<dir name="template">
|
64 |
<dir name="webandpeople">
|
65 |
<dir name="custommenu">
|
66 |
+
<file name="menucontent.phtml" hash="3394e31c66923ebef82c53b89abad333"/>
|
67 |
+
<file name="top.phtml" hash="0d2fc647d43c5d1bd6cade292a107fe8"/>
|
68 |
</dir>
|
69 |
</dir>
|
70 |
</dir>
|
92 |
<dir name="js">
|
93 |
<dir name="webandpeople">
|
94 |
<dir name="custommenu">
|
95 |
+
<file name="custommenu.js" hash="3706c9450bda973c17a233321efdf401"/>
|
|
|
96 |
</dir>
|
97 |
</dir>
|
98 |
</dir>
|
skin/frontend/default/default/js/webandpeople/custommenu/custommenu.js
CHANGED
@@ -215,13 +215,15 @@ function wpSubMenuToggle(obj, activeMenuId, activeSubMenuId)
|
|
215 |
|
216 |
function wpResetMobileMenuState()
|
217 |
{
|
218 |
-
$('menu-content').hide();
|
219 |
$$('.wp-custom-menu-submenu').each(function(item) {
|
220 |
$(item).hide();
|
221 |
});
|
222 |
-
$('custommenu-mobile')
|
223 |
-
$(
|
224 |
-
|
|
|
|
|
225 |
}
|
226 |
|
227 |
function wpCustomMenuMobileToggle()
|
@@ -235,8 +237,8 @@ function wpCustomMenuMobileToggle()
|
|
235 |
|
236 |
if ((x < 800 || wpIsMobile.any()) && wpMobileMenuEnabled) {
|
237 |
wpInitMobileMenuContent();
|
238 |
-
$('custommenu').hide();
|
239 |
-
$('custommenu-mobile').show();
|
240 |
// --- ajax load ---
|
241 |
if (wpMoblieMenuAjaxUrl) {
|
242 |
new Ajax.Request(
|
@@ -260,9 +262,9 @@ function wpCustomMenuMobileToggle()
|
|
260 |
wpMoblieMenuAjaxUrl = null;
|
261 |
}
|
262 |
} else {
|
263 |
-
$('custommenu-mobile').hide();
|
264 |
wpResetMobileMenuState();
|
265 |
-
$('custommenu').show();
|
266 |
// --- ajax load ---
|
267 |
if (wpMenuAjaxUrl) {
|
268 |
new Ajax.Request(
|
@@ -277,7 +279,7 @@ function wpCustomMenuMobileToggle()
|
|
277 |
response = {};
|
278 |
}
|
279 |
}
|
280 |
-
if ($('custommenu')) $('custommenu').update(response.topMenu);
|
281 |
wpPopupMenuContent = response.popupMenu;
|
282 |
}
|
283 |
}
|
@@ -286,7 +288,7 @@ function wpCustomMenuMobileToggle()
|
|
286 |
}
|
287 |
}
|
288 |
|
289 |
-
if ($('custommenu-loading')) $('custommenu-loading').remove();
|
290 |
}
|
291 |
|
292 |
var wpIsMobile = {
|
215 |
|
216 |
function wpResetMobileMenuState()
|
217 |
{
|
218 |
+
if ($('menu-content') != undefined) $('menu-content').hide();
|
219 |
$$('.wp-custom-menu-submenu').each(function(item) {
|
220 |
$(item).hide();
|
221 |
});
|
222 |
+
if ($('custommenu-mobile') != undefined) {
|
223 |
+
$('custommenu-mobile').select('span.button').each(function(item) {
|
224 |
+
$(item).removeClassName('open');
|
225 |
+
});
|
226 |
+
}
|
227 |
}
|
228 |
|
229 |
function wpCustomMenuMobileToggle()
|
237 |
|
238 |
if ((x < 800 || wpIsMobile.any()) && wpMobileMenuEnabled) {
|
239 |
wpInitMobileMenuContent();
|
240 |
+
if ($('custommenu') != undefined) $('custommenu').hide();
|
241 |
+
if ($('custommenu-mobile') != undefined) $('custommenu-mobile').show();
|
242 |
// --- ajax load ---
|
243 |
if (wpMoblieMenuAjaxUrl) {
|
244 |
new Ajax.Request(
|
262 |
wpMoblieMenuAjaxUrl = null;
|
263 |
}
|
264 |
} else {
|
265 |
+
if ($('custommenu-mobile') != undefined) $('custommenu-mobile').hide();
|
266 |
wpResetMobileMenuState();
|
267 |
+
if ($('custommenu') != undefined) $('custommenu').show();
|
268 |
// --- ajax load ---
|
269 |
if (wpMenuAjaxUrl) {
|
270 |
new Ajax.Request(
|
279 |
response = {};
|
280 |
}
|
281 |
}
|
282 |
+
if ($('custommenu') != undefined) $('custommenu').update(response.topMenu);
|
283 |
wpPopupMenuContent = response.popupMenu;
|
284 |
}
|
285 |
}
|
288 |
}
|
289 |
}
|
290 |
|
291 |
+
if ($('custommenu-loading') != undefined) $('custommenu-loading').remove();
|
292 |
}
|
293 |
|
294 |
var wpIsMobile = {
|
skin/frontend/default/default/js/webandpeople/custommenu/webtoolkit.base64.js
DELETED
@@ -1,142 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
*
|
3 |
-
* Base64 encode / decode
|
4 |
-
* http://www.webtoolkit.info/javascript-base64.html
|
5 |
-
*
|
6 |
-
**/
|
7 |
-
|
8 |
-
var Base64 = {
|
9 |
-
|
10 |
-
// private property
|
11 |
-
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
12 |
-
|
13 |
-
// public method for encoding
|
14 |
-
encode : function (input) {
|
15 |
-
var output = "";
|
16 |
-
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
|
17 |
-
var i = 0;
|
18 |
-
|
19 |
-
input = Base64._utf8_encode(input);
|
20 |
-
|
21 |
-
while (i < input.length) {
|
22 |
-
|
23 |
-
chr1 = input.charCodeAt(i++);
|
24 |
-
chr2 = input.charCodeAt(i++);
|
25 |
-
chr3 = input.charCodeAt(i++);
|
26 |
-
|
27 |
-
enc1 = chr1 >> 2;
|
28 |
-
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
|
29 |
-
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
|
30 |
-
enc4 = chr3 & 63;
|
31 |
-
|
32 |
-
if (isNaN(chr2)) {
|
33 |
-
enc3 = enc4 = 64;
|
34 |
-
} else if (isNaN(chr3)) {
|
35 |
-
enc4 = 64;
|
36 |
-
}
|
37 |
-
|
38 |
-
output = output +
|
39 |
-
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
|
40 |
-
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
|
41 |
-
|
42 |
-
}
|
43 |
-
|
44 |
-
return output;
|
45 |
-
},
|
46 |
-
|
47 |
-
// public method for decoding
|
48 |
-
decode : function (input) {
|
49 |
-
var output = "";
|
50 |
-
var chr1, chr2, chr3;
|
51 |
-
var enc1, enc2, enc3, enc4;
|
52 |
-
var i = 0;
|
53 |
-
|
54 |
-
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
55 |
-
|
56 |
-
while (i < input.length) {
|
57 |
-
|
58 |
-
enc1 = this._keyStr.indexOf(input.charAt(i++));
|
59 |
-
enc2 = this._keyStr.indexOf(input.charAt(i++));
|
60 |
-
enc3 = this._keyStr.indexOf(input.charAt(i++));
|
61 |
-
enc4 = this._keyStr.indexOf(input.charAt(i++));
|
62 |
-
|
63 |
-
chr1 = (enc1 << 2) | (enc2 >> 4);
|
64 |
-
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
65 |
-
chr3 = ((enc3 & 3) << 6) | enc4;
|
66 |
-
|
67 |
-
output = output + String.fromCharCode(chr1);
|
68 |
-
|
69 |
-
if (enc3 != 64) {
|
70 |
-
output = output + String.fromCharCode(chr2);
|
71 |
-
}
|
72 |
-
if (enc4 != 64) {
|
73 |
-
output = output + String.fromCharCode(chr3);
|
74 |
-
}
|
75 |
-
|
76 |
-
}
|
77 |
-
|
78 |
-
output = Base64._utf8_decode(output);
|
79 |
-
|
80 |
-
return output;
|
81 |
-
|
82 |
-
},
|
83 |
-
|
84 |
-
// private method for UTF-8 encoding
|
85 |
-
_utf8_encode : function (string) {
|
86 |
-
string = string.replace(/\r\n/g,"\n");
|
87 |
-
var utftext = "";
|
88 |
-
|
89 |
-
for (var n = 0; n < string.length; n++) {
|
90 |
-
|
91 |
-
var c = string.charCodeAt(n);
|
92 |
-
|
93 |
-
if (c < 128) {
|
94 |
-
utftext += String.fromCharCode(c);
|
95 |
-
}
|
96 |
-
else if((c > 127) && (c < 2048)) {
|
97 |
-
utftext += String.fromCharCode((c >> 6) | 192);
|
98 |
-
utftext += String.fromCharCode((c & 63) | 128);
|
99 |
-
}
|
100 |
-
else {
|
101 |
-
utftext += String.fromCharCode((c >> 12) | 224);
|
102 |
-
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
103 |
-
utftext += String.fromCharCode((c & 63) | 128);
|
104 |
-
}
|
105 |
-
|
106 |
-
}
|
107 |
-
|
108 |
-
return utftext;
|
109 |
-
},
|
110 |
-
|
111 |
-
// private method for UTF-8 decoding
|
112 |
-
_utf8_decode : function (utftext) {
|
113 |
-
var string = "";
|
114 |
-
var i = 0;
|
115 |
-
var c = c1 = c2 = 0;
|
116 |
-
|
117 |
-
while ( i < utftext.length ) {
|
118 |
-
|
119 |
-
c = utftext.charCodeAt(i);
|
120 |
-
|
121 |
-
if (c < 128) {
|
122 |
-
string += String.fromCharCode(c);
|
123 |
-
i++;
|
124 |
-
}
|
125 |
-
else if((c > 191) && (c < 224)) {
|
126 |
-
c2 = utftext.charCodeAt(i+1);
|
127 |
-
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
|
128 |
-
i += 2;
|
129 |
-
}
|
130 |
-
else {
|
131 |
-
c2 = utftext.charCodeAt(i+1);
|
132 |
-
c3 = utftext.charCodeAt(i+2);
|
133 |
-
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
|
134 |
-
i += 3;
|
135 |
-
}
|
136 |
-
|
137 |
-
}
|
138 |
-
|
139 |
-
return string;
|
140 |
-
}
|
141 |
-
|
142 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|