Cybage_Megamenu - Version 1.0.0

Version Notes

After installation of the Megamenu plug-in, please clear the cache.

Download this release

Release Info

Developer Cybage Software Pvt. Ltd.
Extension Cybage_Megamenu
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (92) hide show
  1. app/code/community/Cybage/Megamenu/Block/Adminhtml/Catalog/Category/Checkboxes/Tree.php +9 -0
  2. app/code/community/Cybage/Megamenu/Block/Adminhtml/Category.php +44 -0
  3. app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu.php +36 -0
  4. app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit.php +58 -0
  5. app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Content.php +34 -0
  6. app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Form.php +35 -0
  7. app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Tab/Content.php +272 -0
  8. app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Tab/Form.php +95 -0
  9. app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Tabs.php +47 -0
  10. app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Grid.php +149 -0
  11. app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Promo/Widget/Chooser/Sku.php +209 -0
  12. app/code/community/Cybage/Megamenu/Block/Adminhtml/System/Config/Form/Field/Colorpicker.php +69 -0
  13. app/code/community/Cybage/Megamenu/Block/Html/Topmenu.php +179 -0
  14. app/code/community/Cybage/Megamenu/Block/Megamenu.php +30 -0
  15. app/code/community/Cybage/Megamenu/Helper/Data.php +87 -0
  16. app/code/community/Cybage/Megamenu/Model/Adminhtml/Source/Columnsize.php +23 -0
  17. app/code/community/Cybage/Megamenu/Model/Adminhtml/Source/Contentsize.php +23 -0
  18. app/code/community/Cybage/Megamenu/Model/Adminhtml/Source/Fontsize.php +23 -0
  19. app/code/community/Cybage/Megamenu/Model/Attributes.php +62 -0
  20. app/code/community/Cybage/Megamenu/Model/Megamenu.php +138 -0
  21. app/code/community/Cybage/Megamenu/Model/Menuattributes.php +39 -0
  22. app/code/community/Cybage/Megamenu/Model/Menuattributevalues.php +108 -0
  23. app/code/community/Cybage/Megamenu/Model/Menutemplate.php +45 -0
  24. app/code/community/Cybage/Megamenu/Model/Menutype.php +34 -0
  25. app/code/community/Cybage/Megamenu/Model/Observer.php +40 -0
  26. app/code/community/Cybage/Megamenu/Model/Resource/Attributes.php +20 -0
  27. app/code/community/Cybage/Megamenu/Model/Resource/Attributes/Collection.php +20 -0
  28. app/code/community/Cybage/Megamenu/Model/Resource/Megamenu.php +20 -0
  29. app/code/community/Cybage/Megamenu/Model/Resource/Megamenu/Collection.php +20 -0
  30. app/code/community/Cybage/Megamenu/Model/Resource/Menuattributes.php +20 -0
  31. app/code/community/Cybage/Megamenu/Model/Resource/Menuattributes/Collection.php +20 -0
  32. app/code/community/Cybage/Megamenu/Model/Resource/Menuattributevalues.php +20 -0
  33. app/code/community/Cybage/Megamenu/Model/Resource/Menuattributevalues/Collection.php +20 -0
  34. app/code/community/Cybage/Megamenu/Model/Resource/Menutemplate.php +19 -0
  35. app/code/community/Cybage/Megamenu/Model/Resource/Menutemplate/Collection.php +20 -0
  36. app/code/community/Cybage/Megamenu/Model/Resource/Menutype.php +19 -0
  37. app/code/community/Cybage/Megamenu/Model/Resource/Menutype/Collection.php +20 -0
  38. app/code/community/Cybage/Megamenu/Model/Resource/Stores.php +20 -0
  39. app/code/community/Cybage/Megamenu/Model/Resource/Stores/Collection.php +20 -0
  40. app/code/community/Cybage/Megamenu/Model/Status.php +25 -0
  41. app/code/community/Cybage/Megamenu/Model/Stores.php +88 -0
  42. app/code/community/Cybage/Megamenu/controllers/Adminhtml/MegamenuController.php +303 -0
  43. app/code/community/Cybage/Megamenu/controllers/Adminhtml/WidgetController.php +69 -0
  44. app/code/community/Cybage/Megamenu/controllers/IndexController.php +20 -0
  45. app/code/community/Cybage/Megamenu/data/megamenu_setup/data-install-0.1.0.php +87 -0
  46. app/code/community/Cybage/Megamenu/etc/adminhtml.xml +50 -0
  47. app/code/community/Cybage/Megamenu/etc/config.xml +131 -0
  48. app/code/community/Cybage/Megamenu/etc/system.xml +109 -0
  49. app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-install-0.1.0.php +103 -0
  50. app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.10-0.1.11.php +29 -0
  51. app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.11-0.1.11.1.php +28 -0
  52. app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.11.3-0.1.11.4.php +30 -0
  53. app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.11.4-0.1.11.5.php +28 -0
  54. app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.9-0.1.10.php +31 -0
  55. app/design/adminhtml/default/default/layout/cybage_megamenu.xml +47 -0
  56. app/design/frontend/base/default/layout/cybage_megamenu.xml +24 -0
  57. app/design/frontend/base/default/template/megamenu/topmenu.phtml +37 -0
  58. app/design/frontend/base/default/template/megamenu/topmenu/anchorText.phtml +15 -0
  59. app/design/frontend/base/default/template/megamenu/topmenu/categories.phtml +79 -0
  60. app/design/frontend/base/default/template/megamenu/topmenu/contactus.phtml +25 -0
  61. app/design/frontend/base/default/template/megamenu/topmenu/contentText.phtml +26 -0
  62. app/design/frontend/base/default/template/megamenu/topmenu/groupMenuItems.phtml +48 -0
  63. app/design/frontend/base/default/template/megamenu/topmenu/productsListing.phtml +50 -0
  64. app/design/frontend/rwd/default/layout/cybage_megamenu.xml +19 -0
  65. app/design/frontend/rwd/default/template/megamenu/topmenu.phtml +47 -0
  66. app/design/frontend/rwd/default/template/megamenu/topmenu/anchorText.phtml +15 -0
  67. app/design/frontend/rwd/default/template/megamenu/topmenu/categories.phtml +89 -0
  68. app/design/frontend/rwd/default/template/megamenu/topmenu/contactus.phtml +29 -0
  69. app/design/frontend/rwd/default/template/megamenu/topmenu/contentText.phtml +26 -0
  70. app/design/frontend/rwd/default/template/megamenu/topmenu/groupMenuItems.phtml +47 -0
  71. app/design/frontend/rwd/default/template/megamenu/topmenu/productsListing.phtml +53 -0
  72. app/etc/modules/Cybage_Megamenu.xml +9 -0
  73. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_bars.png +0 -0
  74. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_bg.gif +0 -0
  75. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_bg.png +0 -0
  76. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_boxes.png +0 -0
  77. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_close.png +0 -0
  78. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_drop.png +0 -0
  79. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_palette_raw.png +0 -0
  80. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_sel_circle.gif +0 -0
  81. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_sel_circle.png +0 -0
  82. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_sel_rect.gif +0 -0
  83. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_sel_rect.png +0 -0
  84. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_wheel_black.png +0 -0
  85. js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_wheel_rgb.jpg +0 -0
  86. js/megamenu/systemcolorpicker/procolor-1.0/procolor.compressed.js +1 -0
  87. package.xml +18 -0
  88. skin/adminhtml/default/default/js/megamenu.js +331 -0
  89. skin/adminhtml/default/default/js/productselect.js +407 -0
  90. skin/adminhtml/default/default/megamenu/megamenu.css +38 -0
  91. skin/frontend/base/default/css/megamenu.css +467 -0
  92. skin/frontend/rwd/default/css/megamenu.css +566 -0
app/code/community/Cybage/Megamenu/Block/Adminhtml/Catalog/Category/Checkboxes/Tree.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Cybage_Megamenu_Block_Adminhtml_Catalog_Category_Checkboxes_Tree extends Mage_Adminhtml_Block_Catalog_Category_Tree {
4
+
5
+ protected function _prepareLayout() {
6
+ $this->setTemplate('megamenu/catalog/category/checkboxes/tree.phtml');
7
+ }
8
+
9
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Category.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * return's the category tree html
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Category {
14
+
15
+ /**
16
+ * Generate Categort list in Html
17
+ * @param type $parentId
18
+ * @param type $isChild
19
+ * @return type
20
+ */
21
+ function getTreeCategories($parentId, $isChild) {
22
+ $html = "";
23
+ $allCats = Mage::getModel('catalog/category')->getCollection()
24
+ ->addAttributeToSelect('*')
25
+ ->addAttributeToFilter('is_active', '1')
26
+ ->addAttributeToFilter('include_in_menu', '1')
27
+ ->addAttributeToFilter('parent_id', array('eq' => $parentId))
28
+ ->addAttributeToSort('position', 'asc');
29
+
30
+ $class = ($isChild) ? "sub-cat-list" : "cat-list";
31
+ $html .= '<ul class="' . $class . '">';
32
+ foreach ($allCats as $category) {
33
+ $html .= '<li><span>' . $category->getName() . "</span>";
34
+ $subcats = $category->getChildren();
35
+ if ($subcats != '') {
36
+ $html .= $this->getTreeCategories($category->getId(), true);
37
+ }
38
+ $html .= '</li>';
39
+ }
40
+ $html .= '</ul>';
41
+ return (string) $html;
42
+ }
43
+
44
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * return's the category tree
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Megamenu extends Mage_Adminhtml_Block_Widget_Grid_Container {
14
+
15
+ /**
16
+ * Initializing menamenu Grid View
17
+ */
18
+ public function __construct() {
19
+ $this->_controller = 'adminhtml_megamenu';
20
+ $this->_blockGroup = 'megamenu';
21
+ $this->_headerText = Mage::helper('megamenu')->__('Menu Item Manager');
22
+ $this->_addButtonLabel = Mage::helper('megamenu')->__('Add Menu Item');
23
+ parent::__construct();
24
+ }
25
+
26
+ /**
27
+ * return categories
28
+ * @return type object
29
+ */
30
+ public function getCategories() {
31
+ $rootCatId = Mage::app()->getWebsite(true)->getDefaultStore()->getRootCategoryId();
32
+ $catlistHtml = $this->getTreeCategories($rootCatId, false);
33
+ return $catlistHtml;
34
+ }
35
+
36
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu add/edit menu items form header
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Megamenu_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
14
+
15
+ public function __construct() {
16
+ parent::__construct();
17
+
18
+ $this->_objectId = 'id';
19
+ $this->_blockGroup = 'megamenu';
20
+ $this->_controller = 'adminhtml_megamenu';
21
+
22
+ $this->_updateButton('save', 'label', Mage::helper('megamenu')->__('Save Menu Item'));
23
+ $this->_updateButton('delete', 'label', Mage::helper('megamenu')->__('Delete Menu Item'));
24
+
25
+ $this->_addButton('saveandcontinue', array(
26
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
27
+ 'onclick' => 'saveAndContinueEdit()',
28
+ 'class' => 'save',
29
+ ), -100);
30
+
31
+ $this->_formScripts[] = "
32
+ function toggleEditor() {
33
+ if (tinyMCE.getInstanceById('megamenu_content') == null) {
34
+ tinyMCE.execCommand('mceAddControl', false, 'megamenu_content');
35
+ } else {
36
+ tinyMCE.execCommand('mceRemoveControl', false, 'megamenu_content');
37
+ }
38
+ }
39
+
40
+ function saveAndContinueEdit(){
41
+ editForm.submit($('edit_form').action+'back/edit/');
42
+ }
43
+ ";
44
+ }
45
+
46
+ /**
47
+ * Generating Header Text
48
+ * @return type String
49
+ */
50
+ public function getHeaderText() {
51
+ if (Mage::registry('megamenu_data') && Mage::registry('megamenu_data')->getId()) {
52
+ return Mage::helper('megamenu')->__("Edit Menu '%s'", $this->htmlEscape(Mage::registry('megamenu_data')->getName()));
53
+ } else {
54
+ return Mage::helper('megamenu')->__('Add Menu');
55
+ }
56
+ }
57
+
58
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Content.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu menu edit form content
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Megamenu_Edit_Content extends Mage_Adminhtml_Block_Widget_Form {
14
+
15
+ /**
16
+ *
17
+ * @return type Parent Function Object
18
+ */
19
+ protected function _prepareForm() {
20
+ $form = new Varien_Data_Form(array(
21
+ 'id' => 'edit_content_form',
22
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))
23
+ ),
24
+ 'method' => 'post',
25
+ 'enctype' => 'multipart/form-data'
26
+ )
27
+ );
28
+
29
+ $form->setUseContainer(true);
30
+ $this->setForm($form);
31
+ return parent::_prepareForm();
32
+ }
33
+
34
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Form.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu edit form
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Megamenu_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
14
+
15
+ /**
16
+ *
17
+ * @return type Parent function object
18
+ */
19
+ protected function _prepareForm() {
20
+ $form = new Varien_Data_Form(array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl(
23
+ '*/*/save', array('id' => $this->getRequest()->getParam('id')
24
+ )),
25
+ 'method' => 'post',
26
+ 'enctype' => 'multipart/form-data'
27
+ )
28
+ );
29
+
30
+ $form->setUseContainer(true);
31
+ $this->setForm($form);
32
+ return parent::_prepareForm();
33
+ }
34
+
35
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Tab/Content.php ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu add/edit form content
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Megamenu_Edit_Tab_Content extends Mage_Adminhtml_Block_Widget_Form {
14
+
15
+ /**
16
+ * Prepare Layout
17
+ */
18
+ protected function _prepareLayout() {
19
+ parent::_prepareLayout();
20
+ if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
21
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
22
+ }
23
+ }
24
+
25
+ /**
26
+ * Prepare From
27
+ * @return type
28
+ */
29
+ protected function _prepareForm() {
30
+ $form = new Varien_Data_Form();
31
+ $this->setForm($form);
32
+
33
+
34
+ $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array('tab_id' => 'form_section'));
35
+ $wysiwygConfig["files_browser_window_url"] = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index');
36
+ $wysiwygConfig["directives_url"] = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
37
+ $wysiwygConfig["directives_url_quoted"] = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive');
38
+ $wysiwygConfig["widget_window_url"] = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/widget/index');
39
+ $wysiwygConfig["files_browser_window_width"] = (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width');
40
+ $wysiwygConfig["files_browser_window_height"] = (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height');
41
+
42
+ $plugins = $wysiwygConfig->getData("plugins");
43
+ $plugins[0]["options"]["url"] = Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/system_variable/wysiwygPlugin');
44
+ $plugins[0]["options"]["onclick"]["subject"] = "MagentovariablePlugin.loadChooser('" . Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/system_variable/wysiwygPlugin') . "', '{{html_id}}');";
45
+ $plugins = $wysiwygConfig->setData("plugins", $plugins);
46
+
47
+
48
+ $fieldset = $form->addFieldset('megamenu_form', array(
49
+ 'legend' => Mage::helper('megamenu')->__('Content Information')
50
+ ));
51
+ $menuList = Mage::getModel('megamenu/menutype')->getMenuList();
52
+
53
+ $adminUrl = Mage::helper("adminhtml")
54
+ ->getUrl("megamenu/adminhtml_megamenu/getTemplate");
55
+
56
+ $fieldset->addField('type_id', 'select', array(
57
+ 'label' => Mage::helper('megamenu')->__('Menu type'),
58
+ 'name' => 'type_id',
59
+ 'onchange' => "getTemplates(this.value,'$adminUrl')",
60
+ 'class' => 'required-entry',
61
+ 'required' => true,
62
+ 'values' => $menuList,
63
+ 'data-adminurl' => $adminUrl
64
+ ));
65
+
66
+ $adminUrl = Mage::helper("adminhtml")
67
+ ->getUrl("megamenu/adminhtml_megamenu/getLayoutImage");
68
+
69
+ if ($this->getRequest()->getParam('id')) {
70
+
71
+ $id = $this->getRequest()->getParam('id');
72
+ $menuData = Mage::getModel('megamenu/megamenu')->load($id);
73
+ $menuTypeId = $menuData->getTypeId();
74
+ $templatesData = Mage::getModel('megamenu/menutemplate')->filterTtemplate($menuTypeId);
75
+ $templateId = $menuData->getTemplateId();
76
+ $mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . "megamenu" . DS;
77
+
78
+ $templates = Mage::helper('megamenu')->toOptionsArray($templatesData);
79
+ $fieldset->addField('template_id', 'select', array(
80
+ 'label' => Mage::helper('megamenu')->__('Template'),
81
+ 'name' => 'template_id',
82
+ 'class' => 'required-entry',
83
+ 'onchange' => "getLayoutImage(this.value,'$adminUrl')",
84
+ 'required' => true,
85
+ 'values' => $templates,
86
+ ));
87
+ } else {
88
+ $fieldset->addField('admin_url', 'hidden', array(
89
+ 'name' => 'admin_url',
90
+ )
91
+ );
92
+ $fieldset->addField('template_id', 'select', array(
93
+ 'label' => Mage::helper('megamenu')->__('Template'),
94
+ 'name' => 'template_id',
95
+ 'class' => 'required-entry',
96
+ 'onchange' => "getLayoutImage(this.value,'$adminUrl')",
97
+ 'required' => true,
98
+ 'values' => array(
99
+ array(
100
+ 'value' => '',
101
+ 'label' => $this->__('Select Template Type'),
102
+ ),
103
+ ),
104
+ ));
105
+ }
106
+
107
+
108
+ if (Mage::getSingleton('adminhtml/session')->getMegamenuData()) {
109
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getMegamenuData());
110
+ Mage::getSingleton('adminhtml/session')->setMegamenuData(null);
111
+ } elseif (Mage::registry('megamenu_data')) {
112
+ $form->setValues(Mage::registry('megamenu_data')->getData());
113
+ }
114
+ $columnsize = Mage::helper('megamenu')->getMaximumColumnSize();
115
+ $fieldset->addField('column_count', 'text', array(
116
+ 'label' => Mage::helper('megamenu')->__('Number of columns'),
117
+ 'class' => 'required-entry'
118
+ . ' validate-digits-range digits-range-1-' . $columnsize,
119
+ 'required' => true,
120
+ 'name' => 'column_count',
121
+ 'after_element_html' => $this->__('<small>Please use numbers '
122
+ . 'only between 1-' . $columnsize . ' in this field</small>')
123
+ ));
124
+ $fieldset->addField('target_url', 'text', array(
125
+ 'label' => Mage::helper('megamenu')->__('Target Url'),
126
+ 'class' => 'validate-url validate-clean-url',
127
+ 'name' => 'target_url',
128
+ 'after_element_html' => '<small>Target Url</small>',
129
+ ));
130
+ $headerCotent = $form->addFieldset('megamenu_headercontent_form', array(
131
+ 'legend' => Mage::helper('megamenu')
132
+ ->__('Static Blocks')
133
+ )
134
+ );
135
+
136
+ $blockcollection = Mage::getModel('cms/block')->getCollection()
137
+ ->addFieldToFilter('identifier', array('like' => '%megamenu%'))
138
+ ->addFieldToFilter('is_active', 1);
139
+
140
+ $blocks[''] = $this->__('Please select a block');
141
+
142
+ foreach ($blockcollection as $block) {
143
+
144
+ $block_id = $block->getBlockId();
145
+ $blocktitle = $block->getTitle();
146
+ $blocks[] = array('value' => $block_id, 'label' => $blocktitle);
147
+ }
148
+
149
+ $headerCotent->addField('header', 'select', array(
150
+ 'label' => Mage::helper('megamenu')->__('Header Content'),
151
+ 'values' => $blocks,
152
+ 'name' => 'header',
153
+ ));
154
+
155
+ $headerCotent->addField('footer', 'select', array(
156
+ 'label' => Mage::helper('megamenu')->__('Footer Content'),
157
+ 'values' => $blocks,
158
+ 'name' => 'footer',
159
+ ));
160
+
161
+ //feature products
162
+ $featureProduct = $form->addFieldset('megamenu_feature_form', array(
163
+ 'legend' => Mage::helper('megamenu')->__('Feature Product')
164
+ )
165
+ );
166
+
167
+ $featureProduct->addField('feature_type', 'select', array(
168
+ 'label' => Mage::helper('megamenu')->__('Feature type'),
169
+ 'name' => 'feature_type',
170
+ 'onchange' => "toggleInputs(this.value)",
171
+ 'values' => array(
172
+ array(
173
+ 'value' => 20,
174
+ 'label' => Mage::helper('megamenu')->__('None'),
175
+ ),
176
+ array(
177
+ 'value' => 22,
178
+ 'label' => Mage::helper('megamenu')->__('Product'),
179
+ ),
180
+ ),
181
+ ));
182
+
183
+ $featureProduct->addField('feature_category_box_title', 'text', array(
184
+ 'label' => Mage::helper('megamenu')->__('Feature Category box title'),
185
+ 'name' => 'feature_category_box_title',
186
+ ));
187
+ $featureProduct->addField('feature_product_box_title', 'text', array(
188
+ 'label' => Mage::helper('megamenu')->__('Feature Product box title'),
189
+ 'name' => 'feature_product_box_title',
190
+ ));
191
+
192
+ $ProductUrl = 'getFeatureProductChooser(\'' . Mage::getUrl(
193
+ 'megamenu/adminhtml_widget/chooser/attribute/sku/form/feature_product_ids', array('_secure' => Mage::app()->getStore()->isAdminUrlSecure())
194
+ ) . '?isAjax=true\'); return false;';
195
+ $featureProduct->addField('feature_product_ids', 'text', array(
196
+ 'label' => Mage::helper('megamenu')->__('Feature Products'),
197
+ 'name' => 'feature_product_ids',
198
+ 'readonly' => 'readonly',
199
+ 'after_element_html' => '<br /><button type="button" class="product_button" onclick="' . $ProductUrl . '">Products</button>'
200
+ . '<div id="featureproduct-chosser-container"></div>',
201
+ ));
202
+
203
+
204
+
205
+
206
+ //main content
207
+ $mainCotent = $form->addFieldset('megamenu_maincontent_form', array('legend' => Mage::helper('megamenu')->__('Main Content')));
208
+
209
+
210
+ $mainCotent->addField('category_box_title', 'text', array(
211
+ 'label' => Mage::helper('megamenu')->__('Categories box title'),
212
+ 'name' => 'category_box_title',
213
+ ));
214
+
215
+ $mainCotent->addField('prodct_box_title', 'text', array(
216
+ 'label' => Mage::helper('megamenu')->__('Product box title'),
217
+ 'name' => 'prodct_box_title',
218
+ ));
219
+ //category chooser
220
+
221
+ $categoryUrl = 'getMaincategoryChooser(\'' . Mage::getUrl(
222
+ 'adminhtml/promo_widget/chooser/attribute/category_ids/form/main_content_category_ids', array('_secure' => Mage::app()->getStore()->isAdminUrlSecure())
223
+ ) . '?isAjax=true\'); return false;';
224
+ $mainCotent->addField('main_content_category_ids', 'text', array(
225
+ 'label' => Mage::helper('megamenu')->__('Categories'),
226
+ 'name' => 'main_content_category_ids',
227
+ 'readonly' => 'readonly',
228
+ 'after_element_html' => '<br /><button type="button" onclick="' . $categoryUrl . '">'
229
+ . 'Categories</button><div id="main-chosser-container"></div>',
230
+ ));
231
+
232
+
233
+
234
+ $MainProductUrl = 'getMainProductChooser(\'' . Mage::getUrl(
235
+ 'megamenu/adminhtml_widget/chooser/attribute/sku/form/main_content_product_ids', array('_secure' => Mage::app()->getStore()->isAdminUrlSecure())
236
+ ) . '?isAjax=true\'); return false;';
237
+
238
+ $mainCotent->addField('main_content_product_ids', 'text', array(
239
+ 'label' => Mage::helper('megamenu')->__('Products'),
240
+ 'name' => 'main_content_product_ids',
241
+ 'after_element_html' => '<br />'
242
+ . '<button type="button" onclick="' . $MainProductUrl . '">Products</button>'
243
+ . '<div id="mainproduct-chosser-container"></div>',
244
+ 'readonly' => 'readonly',
245
+ ));
246
+
247
+
248
+
249
+ $mainCotent->addField('content_container', 'editor', array(
250
+ 'name' => 'content_container',
251
+ 'label' => Mage::helper('megamenu')->__('Main Content'),
252
+ 'title' => Mage::helper('megamenu')->__('Main Content'),
253
+ 'style' => 'width:540px; height:300px;',
254
+ 'wysiwyg' => true,
255
+ 'required' => true,
256
+ 'config' => $wysiwygConfig,
257
+ ));
258
+
259
+
260
+
261
+ if (Mage::registry('megamenu_data')) {
262
+ $getData = Mage::registry('megamenu_data')->getData();
263
+ if ($this->getRequest()->getParam('id')) {
264
+ $id = $this->getRequest()->getParam('id');
265
+ $newData = Mage::getModel('megamenu/attributes')->getValues($id, $getData);
266
+ $form->setValues($newData);
267
+ }
268
+ }
269
+ return parent::_prepareForm();
270
+ }
271
+
272
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Tab/Form.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu add/edit form
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Megamenu_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
14
+
15
+ /**
16
+ *
17
+ * @return type Parent Function Object
18
+ */
19
+ protected function _prepareForm() {
20
+ $form = new Varien_Data_Form();
21
+ $this->setForm($form);
22
+ $fieldset = $form->addFieldset('megamenu_form', array('legend' => Mage::helper('megamenu')->__('General information')));
23
+
24
+ $fieldset->addField('name', 'text', array(
25
+ 'label' => Mage::helper('megamenu')->__('Name'),
26
+ 'class' => 'required-entry',
27
+ 'required' => true,
28
+ 'name' => 'name',
29
+ ));
30
+ $fieldset->addField('titel', 'text', array(
31
+ 'label' => Mage::helper('megamenu')->__('Title'),
32
+ 'name' => 'titel',
33
+ ));
34
+
35
+ if (!Mage::app()->isSingleStoreMode()) {
36
+ $field = $fieldset->addField('store_id', 'multiselect', array(
37
+ 'name' => 'store_id[]',
38
+ 'label' => Mage::helper('megamenu')->__('Store View'),
39
+ 'title' => Mage::helper('megamenu')->__('Store View'),
40
+ 'required' => true,
41
+ 'values' => Mage::getSingleton('adminhtml/system_store')
42
+ ->getStoreValuesForForm(false, true),
43
+ ));
44
+ $renderer = $this->getLayout()
45
+ ->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
46
+ $field->setRenderer($renderer);
47
+ } else {
48
+ $fieldset->addField('store_id', 'hidden', array(
49
+ 'name' => 'store_id[]',
50
+ 'value' => Mage::app()->getStore(true)->getId()
51
+ ));
52
+ }
53
+
54
+ $fieldset->addField('is_active', 'select', array(
55
+ 'label' => Mage::helper('megamenu')->__('Status'),
56
+ 'name' => 'is_active',
57
+ 'values' => array(
58
+ array(
59
+ 'value' => 1,
60
+ 'label' => Mage::helper('megamenu')->__('Enabled'),
61
+ ),
62
+ array(
63
+ 'value' => 2,
64
+ 'label' => Mage::helper('megamenu')->__('Disabled'),
65
+ ),
66
+ ),
67
+ ));
68
+
69
+ $fieldset->addField('menu_order', 'text', array(
70
+ 'label' => Mage::helper('megamenu')->__('Order'),
71
+ 'class' => 'required-entry validate-digits',
72
+ 'required' => true,
73
+ 'name' => 'order',
74
+ ));
75
+
76
+ if (Mage::getSingleton('adminhtml/session')->getMegamenuData()) {
77
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getMegamenuData());
78
+ Mage::getSingleton('adminhtml/session')->setMegamenuData(null);
79
+ } elseif (Mage::registry('megamenu_data')) {
80
+ $getData = Mage::registry('megamenu_data')->getData();
81
+ if ($this->getRequest()->getParam('id')) {
82
+ $id = $this->getRequest()->getParam('id');
83
+ $newData = Mage::getModel('megamenu/stores')->getStores($id, $getData);
84
+ $form->setValues($newData);
85
+ } else {
86
+ if (!$form->getStoreId()) {
87
+ Mage::registry('megamenu_data')->setData('store_id', Mage::app()->getStore(true)->getId());
88
+ }
89
+ $form->setValues(Mage::registry('megamenu_data')->getData());
90
+ }
91
+ }
92
+ return parent::_prepareForm();
93
+ }
94
+
95
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Edit/Tabs.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu admin tab
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Megamenu_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
14
+
15
+ public function __construct() {
16
+ parent::__construct();
17
+ $this->setId('megamenu_tabs');
18
+ $this->setDestElementId('edit_form');
19
+ $this->setTitle(Mage::helper('megamenu')->__('Menu Item Information'));
20
+ }
21
+
22
+ /**
23
+ *
24
+ * @return type Parent Constructor Object
25
+ */
26
+ protected function _beforeToHtml() {
27
+ $this->addTab('form_section', array(
28
+ 'label' => Mage::helper('megamenu')->__('General Information'),
29
+ 'title' => Mage::helper('megamenu')->__('General Information'),
30
+ 'content' => $this->getLayout()
31
+ ->createBlock('megamenu/adminhtml_megamenu_edit_tab_form')
32
+ ->toHtml(),
33
+ ));
34
+
35
+
36
+ $this->addTab('content_section', array(
37
+ 'label' => Mage::helper('megamenu')->__('Content'),
38
+ 'title' => Mage::helper('megamenu')->__('Content'),
39
+ 'content' => $this->getLayout()
40
+ ->createBlock('megamenu/adminhtml_megamenu_edit_tab_content')
41
+ ->toHtml(),
42
+ ));
43
+
44
+ return parent::_beforeToHtml();
45
+ }
46
+
47
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Grid.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Megamenu menu items grid
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Megamenu_Grid extends Mage_Adminhtml_Block_Widget_Grid {
14
+
15
+ public function __construct() {
16
+ parent::__construct();
17
+ $this->setId('megamenuGrid');
18
+ $this->setDefaultSort('entity_id');
19
+ $this->setDefaultDir('ASC');
20
+ $this->setSaveParametersInSession(true);
21
+ }
22
+
23
+ /**
24
+ * Prepare Collection
25
+ * @return type object
26
+ */
27
+ protected function _prepareCollection() {
28
+
29
+ $collection = Mage::getModel('megamenu/megamenu')->getCollection();
30
+ $collection->getSelect()
31
+ ->join(Mage::getConfig()
32
+ ->getTablePrefix() . 'megamenu_type', 'main_table.type_id =' . Mage::getConfig()
33
+ ->getTablePrefix() . 'megamenu_type.entity_id', array('type'));
34
+
35
+ $this->setCollection($collection);
36
+
37
+ return parent::_prepareCollection();
38
+ }
39
+
40
+ /**
41
+ * Prepare column
42
+ * @return type object
43
+ */
44
+ protected function _prepareColumns() {
45
+ $this->addColumn('entity_id', array(
46
+ 'header' => Mage::helper('megamenu')->__('ID'),
47
+ 'align' => 'right',
48
+ 'width' => '50px',
49
+ 'index' => 'entity_id',
50
+ ));
51
+
52
+ $this->addColumn('name', array(
53
+ 'header' => Mage::helper('megamenu')->__('Name'),
54
+ 'align' => 'left',
55
+ 'index' => 'name',
56
+ ));
57
+
58
+ $this->addColumn('menu_order', array(
59
+ 'header' => Mage::helper('megamenu')->__('Order'),
60
+ 'align' => 'left',
61
+ 'width' => '80px',
62
+ 'index' => 'menu_order',
63
+ ));
64
+ $this->addColumn('type', array(
65
+ 'header' => Mage::helper('megamenu')->__('Menu Type'),
66
+ 'align' => 'left',
67
+ 'index' => 'type',
68
+ ));
69
+
70
+
71
+ $this->addColumn('is_active', array(
72
+ 'header' => Mage::helper('megamenu')->__('Status'),
73
+ 'align' => 'left',
74
+ 'width' => '80px',
75
+ 'index' => 'is_active',
76
+ 'type' => 'options',
77
+ 'options' => array(
78
+ 1 => 'Enabled',
79
+ 2 => 'Disabled',
80
+ ),
81
+ ));
82
+
83
+ $this->addColumn('action', array(
84
+ 'header' => Mage::helper('megamenu')->__('Action'),
85
+ 'width' => '100',
86
+ 'type' => 'action',
87
+ 'getter' => 'getId',
88
+ 'actions' => array(
89
+ array(
90
+ 'caption' => Mage::helper('megamenu')->__('Edit'),
91
+ 'url' => array('base' => '*/*/edit'),
92
+ 'field' => 'id'
93
+ )
94
+ ),
95
+ 'filter' => false,
96
+ 'sortable' => false,
97
+ 'index' => 'stores',
98
+ 'is_system' => true,
99
+ ));
100
+
101
+ $this->addExportType('*/*/exportCsv', Mage::helper('megamenu')->__('CSV'));
102
+ $this->addExportType('*/*/exportXml', Mage::helper('megamenu')->__('XML'));
103
+
104
+ return parent::_prepareColumns();
105
+ }
106
+
107
+ /**
108
+ *
109
+ * @return \Cybage_Megamenu_Block_Adminhtml_Megamenu_Grid
110
+ */
111
+ protected function _prepareMassaction() {
112
+ $this->setMassactionIdField('entity_id');
113
+ $this->getMassactionBlock()->setFormFieldName('megamenu');
114
+
115
+ $this->getMassactionBlock()->addItem('delete', array(
116
+ 'label' => Mage::helper('megamenu')->__('Delete'),
117
+ 'url' => $this->getUrl('*/*/massDelete'),
118
+ 'confirm' => Mage::helper('megamenu')->__('Are you sure?')
119
+ ));
120
+
121
+ $statuses = Mage::getSingleton('megamenu/status')->getOptionArray();
122
+
123
+ array_unshift($statuses, array('label' => '', 'value' => ''));
124
+ $this->getMassactionBlock()->addItem('status', array(
125
+ 'label' => Mage::helper('megamenu')->__('Change status'),
126
+ 'url' => $this->getUrl('*/*/massStatus', array('_current' => true)),
127
+ 'additional' => array(
128
+ 'visibility' => array(
129
+ 'name' => 'status',
130
+ 'type' => 'select',
131
+ 'class' => 'required-entry',
132
+ 'label' => Mage::helper('megamenu')->__('Status'),
133
+ 'values' => $statuses
134
+ )
135
+ )
136
+ ));
137
+ return $this;
138
+ }
139
+
140
+ /**
141
+ * Get Row URL
142
+ * @param type $row
143
+ * @return type STRING
144
+ */
145
+ public function getRowUrl($row) {
146
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
147
+ }
148
+
149
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/Megamenu/Promo/Widget/Chooser/Sku.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * return's the category and product to slelct
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 02-June-2015 04:28 PM [IST]
11
+ * @modified_at 02-June-2015 04:28 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_Megamenu_Promo_Widget_Chooser_Sku extends Mage_Adminhtml_Block_Widget_Grid {
14
+
15
+ /**
16
+ * Construct Method
17
+ * @param type $arguments
18
+ */
19
+ public function __construct($arguments = array()) {
20
+ parent::__construct($arguments);
21
+
22
+ if ($this->getRequest()->getParam('current_grid_id')) {
23
+ $this->setId($this->getRequest()->getParam('current_grid_id'));
24
+ } else {
25
+ $this->setId('skuChooserGrid_' . $this->getId());
26
+ }
27
+
28
+ $form = $this->getJsFormObject();
29
+ $this->setRowClickCallback("$form.chooserGridRowClick.bind($form)");
30
+ $this->setCheckboxCheckCallback("$form.chooserGridCheckboxCheck.bind($form)");
31
+ $this->setRowInitCallback("$form.chooserGridRowInit.bind($form)");
32
+ $this->setDefaultSort('sku');
33
+ $this->setUseAjax(true);
34
+ if ($this->getRequest()->getParam('collapse')) {
35
+ $this->setIsCollapsed(true);
36
+ }
37
+ // $this->setPagerVisibility(false);
38
+ // $this->setFilterVisibility(false);
39
+ }
40
+
41
+ /**
42
+ * Returns store object
43
+ * @return type Store Object
44
+ */
45
+ protected function _getStore() {
46
+ $storeId = (int) $this->getRequest()->getParam('store', 0);
47
+ return Mage::app()->getStore($storeId);
48
+ }
49
+
50
+ /**
51
+ *
52
+ * @param type $column
53
+ * @return \Cybage_Megamenu_Block_Adminhtml_Megamenu_Promo_Widget_Chooser_Sku
54
+ */
55
+ protected function _addColumnFilterToCollection($column) {
56
+ // Set custom filter for in product flag
57
+ if ($column->getId() == 'in_products') {
58
+ $selected = $this->_getSelectedProducts();
59
+ if (empty($selected)) {
60
+ $selected = '';
61
+ }
62
+ if ($column->getFilter()->getValue()) {
63
+ $this->getCollection()->addFieldToFilter('sku', array('in' => $selected));
64
+ } else {
65
+ $this->getCollection()->addFieldToFilter('sku', array('nin' => $selected));
66
+ }
67
+ } else {
68
+ parent::_addColumnFilterToCollection($column);
69
+ }
70
+ return $this;
71
+ }
72
+
73
+ /**
74
+ * Prepare Catalog Product Collection for attribute SKU in Promo Conditions SKU chooser
75
+ *
76
+ * @return Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku
77
+ */
78
+ protected function _prepareCollection() {
79
+ $store = $this->_getStore();
80
+ $collection = Mage::getResourceModel('catalog/product_collection')
81
+ ->setStoreId(0)
82
+ ->addAttributeToSelect('name', 'type_id', 'attribute_set_id');
83
+ if ($store->getId()) {
84
+ $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;
85
+ $collection->addStoreFilter($store);
86
+ $collection->joinAttribute(
87
+ 'name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore
88
+ );
89
+ $collection->joinAttribute(
90
+ 'custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId()
91
+ );
92
+ $collection->joinAttribute(
93
+ 'status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId()
94
+ );
95
+ $collection->joinAttribute(
96
+ 'visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId()
97
+ );
98
+ $collection->joinAttribute(
99
+ 'price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId()
100
+ );
101
+ } else {
102
+ $collection->addAttributeToSelect('price');
103
+ $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
104
+ $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
105
+ }
106
+ $this->setCollection($collection);
107
+
108
+ return parent::_prepareCollection();
109
+ }
110
+
111
+ /**
112
+ * Define Cooser Grid Columns and filters
113
+ *
114
+ * @return Mage_Adminhtml_Block_Promo_Widget_Chooser_Sku
115
+ */
116
+ protected function _prepareColumns() {
117
+
118
+ $this->addColumn('in_products', array(
119
+ 'header_css_class' => 'a-center',
120
+ 'type' => 'checkbox',
121
+ 'name' => 'in_products',
122
+ 'values' => $this->_getSelectedProducts(),
123
+ 'align' => 'center',
124
+ 'index' => 'sku',
125
+ 'use_index' => true,
126
+ ));
127
+
128
+ $this->addColumn('entity_id', array(
129
+ 'header' => Mage::helper('sales')->__('ID'),
130
+ 'sortable' => true,
131
+ 'width' => '60px',
132
+ 'index' => 'entity_id'
133
+ ));
134
+
135
+ $this->addColumn('type', array(
136
+ 'header' => Mage::helper('catalog')->__('Type'),
137
+ 'width' => '60px',
138
+ 'index' => 'type_id',
139
+ 'type' => 'options',
140
+ 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),
141
+ ));
142
+
143
+ $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
144
+ ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
145
+ ->load()
146
+ ->toOptionHash();
147
+
148
+ $this->addColumn('set_name', array(
149
+ 'header' => Mage::helper('catalog')->__('Attrib. Set Name'),
150
+ 'width' => '100px',
151
+ 'index' => 'attribute_set_id',
152
+ 'type' => 'options',
153
+ 'options' => $sets,
154
+ ));
155
+
156
+ $this->addColumn('chooser_sku', array(
157
+ 'header' => Mage::helper('sales')->__('SKU'),
158
+ 'name' => 'chooser_sku',
159
+ 'width' => '80px',
160
+ 'index' => 'sku'
161
+ ));
162
+ $this->addColumn('chooser_name', array(
163
+ 'header' => Mage::helper('sales')->__('Product Name'),
164
+ 'name' => 'chooser_name',
165
+ 'index' => 'name'
166
+ ));
167
+ $this->addColumn('visibility', array(
168
+ 'header' => Mage::helper('catalog')->__('Visibility'),
169
+ 'width' => '70px',
170
+ 'index' => 'visibility',
171
+ 'type' => 'options',
172
+ 'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),
173
+ ));
174
+
175
+ $this->addColumn('status', array(
176
+ 'header' => Mage::helper('catalog')->__('Status'),
177
+ 'width' => '70px',
178
+ 'index' => 'status',
179
+ 'type' => 'options',
180
+ 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),
181
+ ));
182
+
183
+
184
+ //return $this;
185
+ }
186
+
187
+ /**
188
+ *
189
+ * @return type String
190
+ */
191
+ public function getGridUrl() {
192
+ return $this->getUrl('*/*/chooser', array(
193
+ '_current' => true,
194
+ 'current_grid_id' => $this->getId(),
195
+ 'collapse' => null
196
+ ));
197
+ }
198
+
199
+ /**
200
+ *
201
+ * @return type Product Object
202
+ */
203
+ protected function _getSelectedProducts() {
204
+ $products = $this->getRequest()->getPost('selected', array());
205
+
206
+ return $products;
207
+ }
208
+
209
+ }
app/code/community/Cybage/Megamenu/Block/Adminhtml/System/Config/Form/Field/Colorpicker.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * return's the category tree html
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 11-May-2015 04:28 PM [IST]
11
+ * @modified_at 11-May-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Adminhtml_System_Config_Form_Field_Colorpicker extends Mage_Adminhtml_Block_System_Config_Form_Field {
14
+
15
+ /**
16
+ * Generate HTML code for color picker
17
+ *
18
+ * @param Varien_Data_Form_Element_Abstract $element
19
+ * @return string
20
+ */
21
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
22
+
23
+ $html = '<script type="text/javascript" src="' . Mage::getBaseUrl('js') . 'megamenu/systemcolorpicker/procolor-1.0/procolor.compressed.js' . '"></script>';
24
+
25
+ // Use Varien text element as a basis
26
+ $input = new Varien_Data_Form_Element_Text();
27
+
28
+ // Set data from config element on Varien text element
29
+ $input->setForm($element->getForm())
30
+ ->setElement($element)
31
+ ->setValue($element->getValue())
32
+ ->setHtmlId($element->getHtmlId())
33
+ ->setName($element->getName())
34
+ ->setStyle('width: 60px') // Update style in order to shrink width
35
+ ->addClass('validate-hex'); // Add some Prototype validation to make sure color code is correct
36
+ // Inject uddated Varien text element HTML in our current HTML
37
+ $html .= $input->getHtml();
38
+
39
+ // Inject Procolor JS code to display color picker
40
+ $html .= $this->_getProcolorJs($element->getHtmlId());
41
+
42
+ // Inject Prototype validation
43
+ //$html .= $this->_addHexValidator();
44
+
45
+ return $html;
46
+ }
47
+
48
+ /**
49
+ * Procolor JS code to display color picker
50
+ *
51
+ * @param string $htmlId
52
+ * @return string
53
+ */
54
+ protected function _getProcolorJs($htmlId) {
55
+ return '<script type="text/javascript">ProColor.prototype.attachButton(\'' . $htmlId . '\', { imgPath:\'' . Mage::getBaseUrl('js') . 'megamenu/systemcolorpicker/procolor-1.0/' . 'img/procolor_win_\', showInField: true });</script>';
56
+ }
57
+
58
+ /**
59
+ * Prototype validation
60
+ *
61
+ * @return string
62
+ */
63
+ protected function _addHexValidator() {
64
+ return '<script type="text/javascript">Validation.add(\'validate-hex\', \'' . $this->__('Please enter a valid hex color code') . '\', function(v) {
65
+ return /^#(?:[0-9a-fA-F]{3}){1,2}$/.test(v);
66
+ });</script>';
67
+ }
68
+
69
+ }
app/code/community/Cybage/Megamenu/Block/Html/Topmenu.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * return's the menu items to display in front end and also return template layout based on template_id
4
+ * @category megamenu community plugin
5
+ * @module Cybage_Megamenu
6
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
7
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
8
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
9
+ * @created_at 17-April-2015 04:28 PM [IST]
10
+ * @modified_at 17-April-2015 04:40 PM [IST]
11
+ */
12
+
13
+ class Cybage_Megamenu_Block_Html_Topmenu extends Mage_Core_Block_Template {
14
+
15
+ /**
16
+ * return megamenu collection
17
+ * @return type obhect
18
+ */
19
+ public function getMenus() {
20
+
21
+ $currentStore = $this->getCurrentStore();
22
+
23
+ $storeId = Mage::app()->getStore()->getId();
24
+
25
+ $cache = Mage::getSingleton('core/cache');
26
+ $key = 'homepage-mega-menu-' . $storeId;
27
+
28
+ if(! $data = $cache->load($key)){
29
+ $menuCollection = Mage::getModel('megamenu/megamenu')->getCollection()
30
+ ->addFieldToFilter('is_active', array('eq' => 1))
31
+ ->join(array("stores" => 'megamenu/stores'),
32
+ "main_table.entity_id = stores.menu_id and store_id in (0, $currentStore) ", array())
33
+ ->setOrder('menu_order','asc');
34
+
35
+ $data = serialize($menuCollection->getData());
36
+ $cache->save(urlencode($data), $key, array("homepage_cache"), 60*60*24);
37
+ }
38
+ else{
39
+ $data = urldecode($data);
40
+ }
41
+
42
+ $this->setConfigAttribute();
43
+ return unserialize($data);
44
+ }
45
+
46
+ /**
47
+ * return template layout based on template_id
48
+ * @param type $menuId
49
+ * @param type $templateId
50
+ * @return type layout object
51
+ */
52
+ public function generateMenu($menuId, $templateId) {
53
+ $this->clearMenuRegister();
54
+ $this->setMenuId($menuId);
55
+ $this->setTemplateId($templateId);
56
+
57
+ switch ($templateId) {
58
+ case '1':
59
+ return $this->getLayout()->createBlock('megamenu/html_topmenu')->setTemplate('megamenu/topmenu/categories.phtml')->toHtml();
60
+ break;
61
+ case '2':
62
+ return $this->getLayout()->createBlock('megamenu/html_topmenu')->setTemplate('megamenu/topmenu/productsListing.phtml')->toHtml();
63
+ break;
64
+ case '3':
65
+ return $this->getLayout()->createBlock('megamenu/html_topmenu')->setTemplate('megamenu/topmenu/groupMenuItems.phtml')->toHtml();
66
+ break;
67
+ case '4':
68
+ return $this->getLayout()->createBlock('megamenu/html_topmenu')->setTemplate('megamenu/topmenu/contactus.phtml')->toHtml();
69
+ break;
70
+ case '5':
71
+ return $this->getLayout()->createBlock('megamenu/html_topmenu')->setTemplate('megamenu/topmenu/anchorText.phtml')->toHtml();
72
+ break;
73
+ case '6':
74
+ return $this->getLayout()->createBlock('megamenu/html_topmenu')->setTemplate('megamenu/topmenu/contentText.phtml')->toHtml();
75
+ break;
76
+ }
77
+
78
+ }
79
+
80
+ /**
81
+ * set menu_id in register
82
+ * @param type $menuId
83
+ */
84
+ public function setMenuId($menuId) {
85
+ Mage::register('menu_id', $menuId);
86
+ }
87
+
88
+ /**
89
+ * set template_id in register
90
+ * @param type $templateId
91
+ */
92
+ public function setTemplateId($templateId) {
93
+ Mage::register('template_id', $templateId);
94
+ }
95
+
96
+ /**
97
+ * return menu_id
98
+ * @return type
99
+ */
100
+ public function getMenuId() {
101
+ return Mage::registry('menu_id');
102
+ }
103
+
104
+ /**
105
+ * return template_id
106
+ * @return type int
107
+ */
108
+ public function getTemplateId() {
109
+ return Mage::registry('template_id');
110
+ }
111
+
112
+ /**
113
+ * clear registry
114
+ */
115
+ public function clearMenuRegister() {
116
+ Mage::unregister('menu_id');
117
+ Mage::unregister('template_id');
118
+ }
119
+
120
+ /**
121
+ * return current store
122
+ * @return type int
123
+ */
124
+ public function getCurrentStore() {
125
+ return Mage::app()->getStore()->getStoreId();
126
+ }
127
+
128
+ /**
129
+ * return template data
130
+ * @return type object
131
+ */
132
+ public function getTemplateData() {
133
+ $menuId = $this->getMenuId();
134
+ $templateId = $this->getTemplateId();
135
+ $curremtStore = $this->getCurrentStore();
136
+ $test = Mage::getModel('megamenu/megamenu')
137
+ ->getTemplateCollection($menuId, $templateId, $curremtStore);
138
+ return $test;
139
+ }
140
+
141
+ /**
142
+ * Seting Menu Background Color
143
+ * Font Color
144
+ * Font Size
145
+ * Font Family
146
+ *
147
+ */
148
+ public function setConfigAttribute(){
149
+
150
+ $backgroundColor = Mage::Helper('megamenu')->getBackgroundColor();
151
+ $backgroundColor = !empty($backgroundColor)?
152
+ 'background:none repeat scroll 0 0'.$backgroundColor.'!important;':'';
153
+
154
+ Mage::unregister('backgroundColor');
155
+ Mage::register('backgroundColor', $backgroundColor);
156
+
157
+ $fontSize = Mage::Helper('megamenu')->getFontSize();
158
+ $fontSize = (!empty($fontSize)||($fontSize >0))?
159
+ 'font-size:'.$fontSize.'px !important;':'';
160
+
161
+ Mage::unregister('fontSize');
162
+ Mage::register('fontSize', $fontSize);
163
+
164
+ $fontFamily = Mage::Helper('megamenu')->getFontFamily();
165
+ $fontFamily = !empty($fontFamily)?
166
+ 'font-family:'.$fontFamily.'!important;':'';
167
+
168
+ Mage::unregister('fontFamily');
169
+ Mage::register('fontFamily', $fontFamily);
170
+
171
+ $fontColor = Mage::Helper('megamenu')->getFontColor();
172
+ $fontColor = !empty($fontColor)?
173
+ 'color:'.$fontColor.'!important;':'';
174
+
175
+ Mage::unregister('fontColor');
176
+ Mage::register('fontColor', $fontColor);
177
+ }
178
+ }
179
+
app/code/community/Cybage/Megamenu/Block/Megamenu.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu block
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Block_Megamenu extends Mage_Core_Block_Template {
14
+
15
+ public function _prepareLayout() {
16
+ return parent::_prepareLayout();
17
+ }
18
+
19
+ /**
20
+ *
21
+ * @return type array
22
+ */
23
+ public function getMegamenu() {
24
+ if (!$this->hasData('megamenu')) {
25
+ $this->setData('megamenu', Mage::registry('megamenu'));
26
+ }
27
+ return $this->getData('megamenu');
28
+ }
29
+
30
+ }
app/code/community/Cybage/Megamenu/Helper/Data.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * return's the array in the form of key value paire
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Helper_Data extends Mage_Core_Helper_Abstract {
14
+
15
+ const XML_PATH_MEGAMENU_ENABLE = 'megamenu/settings/enable';
16
+ const XML_PATH_MEGAMENU_BACKGROUND_COLOR = 'megamenu/megamenu_configuration/background_color';
17
+ const XML_PATH_MEGAMENU_FONT_COLOR = 'megamenu/megamenu_configuration/font_color';
18
+ const XML_PATH_MEGAMENU_FONT_FAMILY = 'megamenu/megamenu_configuration/font_family';
19
+ const XML_PATH_MEGAMENU_FONT_SIZE = 'megamenu/megamenu_configuration/font_size';
20
+ const XML_PATH_MEGAMENU_MAXIMUM_CONTENT_SIZE = 'megamenu/megamenu_configuration/maximum_content_size';
21
+ const XML_PATH_MEGAMENU_MAXIMUM_COLUMN_SIZE = 'megamenu/megamenu_configuration/maximum_column_size';
22
+
23
+ /**
24
+ * Check wherther it is enable or not
25
+ *
26
+ * @return boolean
27
+ */
28
+ public function isMegamenuModuleEnabled() {
29
+ return Mage::getStoreConfig(self::XML_PATH_MEGAMENU_ENABLE);
30
+ }
31
+
32
+ /**
33
+ * @return string Background Color
34
+ */
35
+ public function getBackgroundColor() {
36
+ return Mage::getStoreConfig(self::XML_PATH_MEGAMENU_BACKGROUND_COLOR);
37
+ }
38
+
39
+ /**
40
+ * @return string Font Color
41
+ */
42
+ public function getFontColor() {
43
+ return Mage::getStoreConfig(self::XML_PATH_MEGAMENU_FONT_COLOR);
44
+ }
45
+
46
+ /**
47
+ * @return string Font Family
48
+ */
49
+ public function getFontFamily() {
50
+ return Mage::getStoreConfig(self::XML_PATH_MEGAMENU_FONT_FAMILY);
51
+ }
52
+
53
+ /**
54
+ * @return int Font Size
55
+ */
56
+ public function getFontSize() {
57
+ return Mage::getStoreConfig(self::XML_PATH_MEGAMENU_FONT_SIZE);
58
+ }
59
+
60
+ /**
61
+ * @return int Maximum Content Size
62
+ */
63
+ public function getMaximumContentSize() {
64
+
65
+ $contentSize = Mage::getStoreConfig(self::XML_PATH_MEGAMENU_MAXIMUM_CONTENT_SIZE);
66
+ return (!empty($contentSize)) ? $contentSize : 800;
67
+ }
68
+
69
+ /**
70
+ * @return int Maximum Column Size
71
+ */
72
+ public function getMaximumColumnSize() {
73
+ $columnSize = Mage::getStoreConfig(self::XML_PATH_MEGAMENU_MAXIMUM_COLUMN_SIZE);
74
+ return (!empty($columnSize)) ? $columnSize : 11;
75
+ }
76
+
77
+ function toOptionsArray($data) {
78
+ foreach ($data as $key) {
79
+ $newData[] = array(
80
+ 'value' => $key['entity_id'],
81
+ 'label' => $key['name']
82
+ );
83
+ }
84
+ return $newData;
85
+ }
86
+
87
+ }
app/code/community/Cybage/Megamenu/Model/Adminhtml/Source/Columnsize.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu Adminhtml Source Columnsize return Adminhtml Source Columnsize
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 11-May-2015 04:28 PM [IST]
11
+ * @modified_at 11-May-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Adminhtml_Source_Columnsize {
14
+
15
+ /**
16
+ * Megamenu COnfig Fontsize list
17
+ * @return array
18
+ */
19
+ public function toOptionArray() {
20
+ return array_combine(range(2, 20), range(2, 20));
21
+ }
22
+
23
+ }
app/code/community/Cybage/Megamenu/Model/Adminhtml/Source/Contentsize.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu Adminhtml Source Contentsize return Adminhtml Source Contentsize
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 11-May-2015 04:28 PM [IST]
11
+ * @modified_at 11-May-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Adminhtml_Source_Contentsize {
14
+
15
+ /**
16
+ * Megamenu COnfig Column Size list
17
+ * @return type array
18
+ */
19
+ public function toOptionArray() {
20
+ return array_combine(range(100, 2048), range(100, 2048));
21
+ }
22
+
23
+ }
app/code/community/Cybage/Megamenu/Model/Adminhtml/Source/Fontsize.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu Adminhtml Source Fontsize return Adminhtml Source Fontsize
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 11-May-2015 04:28 PM [IST]
11
+ * @modified_at 11-May-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Adminhtml_Source_Fontsize {
14
+
15
+ /**
16
+ * Megamenu COnfig Font Size list
17
+ * @return type array
18
+ */
19
+ public function toOptionArray() {
20
+ return range(0, 72);
21
+ }
22
+
23
+ }
app/code/community/Cybage/Megamenu/Model/Attributes.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu attributes model return attributeId and it's value
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Attributes extends Mage_Core_Model_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/attributes');
18
+ }
19
+
20
+ /**
21
+ *
22
+ * @param type $attribute
23
+ * @return type Int
24
+ */
25
+ public function getAttributeId($attribute) {
26
+
27
+ $collection = parent::getCollection()
28
+ ->addFieldToSelect('entity_id')
29
+ ->addFieldToFilter('atribute_code', array(array('eq' => $attribute)));
30
+ $data = $collection->getData();
31
+ foreach ($data as $row) {
32
+ return $row['entity_id'];
33
+ }
34
+ }
35
+
36
+ /**
37
+ * append attribute values to data array and return array
38
+ * @param type $id
39
+ * @param type $data
40
+ * @return type array
41
+ */
42
+ public function getValues($id, $data) {
43
+
44
+ $collection = parent::getCollection();
45
+ $collection->addFieldToSelect('atribute_code');
46
+ $collection->getSelect()->joinLeft(array('mapping' => 'megamenu_template_attributes'), 'main_table.entity_id = mapping.attribute_id', array());
47
+ $collection->getSelect()->joinLeft(array('attributeValues' => 'megamenu_template_attributes_values'), 'mapping.entity_id = attributeValues.template_attribute_id', array('attributeValues.value'));
48
+ $collection->getSelect()->where('attributeValues.menu_id=?', $id);
49
+
50
+
51
+
52
+ foreach ($collection->getData() as $row) {
53
+
54
+ $key = $row['atribute_code'];
55
+ $val = $row['value'];
56
+ $data[$key] = $val;
57
+ }
58
+
59
+ return $data;
60
+ }
61
+
62
+ }
app/code/community/Cybage/Megamenu/Model/Megamenu.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu model
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Megamenu extends Mage_Core_Model_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/megamenu');
18
+ }
19
+
20
+ /**
21
+ *
22
+ * @param type $menuId
23
+ * @param type $templateId
24
+ * @param type $storeId
25
+ * @return type collection object
26
+ */
27
+ public function getTemplateCollection($menuId, $templateId, $storeId) {
28
+ $menuData = parent::load($menuId);
29
+ $templateData = $menuData->getData();
30
+
31
+ $attributeData = Mage::getModel('megamenu/attributes')->getValues($menuId, $templateData);
32
+
33
+ Mage::log($attributeData, null, 'mega.log');
34
+
35
+ //get category information
36
+ if (!empty($attributeData['main_content_category_ids'])) {
37
+
38
+ $attributeData['categories'] = $this->getCategoryDetails($attributeData['main_content_category_ids']);
39
+ }
40
+
41
+ //get featured category information
42
+ if (!empty($attributeData['feature_category_ids'])) {
43
+ $attributeData['feature_categories'] = $this->getFeatureCategories($attributeData['feature_category_ids']);
44
+ }
45
+
46
+ //get product information
47
+ if (!empty($attributeData['main_content_product_ids'])) {
48
+ $attributeData['products'] = $this->getFeatureProducts($attributeData['main_content_product_ids']);
49
+ }
50
+
51
+ //get feature product information
52
+ if (!empty($attributeData['feature_product_ids'])) {
53
+ $featureProdutsIds = $attributeData['feature_product_ids'];
54
+ $featureproducts = explode(",", $featureProdutsIds);
55
+
56
+ foreach ($featureproducts as $productSku) {
57
+ $featureproduct = Mage::getModel('catalog/product')->loadByAttribute('sku', trim($productSku));
58
+ $path = Mage::getBaseUrl() . $featureproduct->getUrlPath();
59
+ $name = $featureproduct->getName();
60
+ $price = $featureproduct->getPrice();
61
+ $image = Mage::helper('catalog/image')->init($featureproduct, 'image')->keepFrame(false)->resize(100, 100)->__toString();
62
+ $featureprodDetailArray[] = array('name' => $name, 'path' => $path, 'price' => $price, 'image' => $image);
63
+ }
64
+ $attributeData['feature_products'] = $featureprodDetailArray;
65
+ }
66
+ return $attributeData;
67
+ }
68
+
69
+ /**
70
+ *
71
+ * @param type $categoryIds
72
+ * @return string
73
+ */
74
+ public function getCategoryDetails($categoryIds) {
75
+
76
+ $mainCategoryIds = $categoryIds;
77
+ $categories = explode(",", $mainCategoryIds);
78
+ $categoryDetailArray = array();
79
+ foreach ($categories as $catId) {
80
+
81
+ $catetory = Mage::getModel('catalog/category')->load($catId);
82
+ $path = Mage::getBaseUrl() . $catetory->getUrlPath();
83
+ // print_r($catetory->getData());
84
+ $name = $catetory->getName();
85
+ if($catetory->getParentId()!=1 && $catetory->getIsActive()==1)
86
+ $categoryDetailArray[] = array('name' => $name, 'path' => $path);
87
+ }
88
+
89
+ return $categoryDetailArray;
90
+ }
91
+
92
+ /**
93
+ *
94
+ * @param type $categoryIds
95
+ * @return type array
96
+ */
97
+ public function getFeatureCategories($categoryIds) {
98
+ $featureCategoryIds = $categoryIds;
99
+ $featurecategories = explode(",", $featureCategoryIds);
100
+ $featurecategoryDetailArray = array();
101
+ foreach ($featurecategories as $fcatId) {
102
+ $featurecatetory = Mage::getModel('catalog/category')->load($fcatId);
103
+ $name = $featurecatetory->getName();
104
+ $url = $featurecatetory->getUrl();
105
+ if($catetory->getParentId()!=1 && $catetory->getIsActive()==1)
106
+ $featurecategoryDetailArray[] = array('name' => $name,'path'=>$url);
107
+ }
108
+
109
+ return $featurecategoryDetailArray;
110
+ }
111
+
112
+ /**
113
+ *
114
+ * @param type $productIds
115
+ * @return Array
116
+ */
117
+ public function getFeatureProducts($productIds) {
118
+ $featureProdutsIds = $productIds;
119
+ $featureproducts = explode(",", $featureProdutsIds);
120
+ $featureprodDetailArray = array();
121
+ foreach ($featureproducts as $productSku) {
122
+ $featureproduct = Mage::getModel('catalog/product')->loadByAttribute('sku', trim($productSku));
123
+ $path = Mage::getBaseUrl() . $featureproduct->getUrlPath();
124
+ $name = $featureproduct->getName();
125
+ $price = $featureproduct->getPrice();
126
+ $visiblity = $featureproduct->getVisibility();
127
+ $status = $featureproduct->getStatus();
128
+ $image = Mage::helper('catalog/image')->init($featureproduct, 'thumbnail')->keepFrame(false)->resize(120, 120)->__toString();
129
+ //$this->helper('catalog/image')->init($featureproduct, 'thumbnail', $image->getFile())->resize(100,100);
130
+ if($status==1 && $visiblity!=1){
131
+ $featureprodDetailArray[] = array('name' => $name, 'path' => $path, 'price' => $price, 'image' => $image);
132
+ }
133
+ }
134
+
135
+ return $featureprodDetailArray;
136
+ }
137
+
138
+ }
app/code/community/Cybage/Megamenu/Model/Menuattributes.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu menuattributes model return mapping id
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Menuattributes extends Mage_Core_Model_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/menuattributes');
18
+ }
19
+
20
+ /**
21
+ *
22
+ * @param type $attributeId
23
+ * @param type $templateId
24
+ * @return string
25
+ */
26
+ public function getMappingId($attributeId, $templateId) {
27
+ $collection = parent::getCollection()
28
+ ->addFieldToSelect('entity_id')
29
+ ->addFieldToFilter('attribute_id', array(array('eq' => $attributeId)))
30
+ ->addFieldToFilter('template_id', array(array('eq' => $templateId)));
31
+ $data = $collection->getData();
32
+ if (count($data) > 0) {
33
+ return $data[0]['entity_id'];
34
+ } else {
35
+ return " ";
36
+ }
37
+ }
38
+
39
+ }
app/code/community/Cybage/Megamenu/Model/Menuattributevalues.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu menuattribute values model save attrubute values
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Menuattributevalues extends Mage_Core_Model_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/menuattributevalues');
18
+ }
19
+
20
+ /**
21
+ * save attrubute values
22
+ * @param type $menuId
23
+ * @param type $mappingId
24
+ * @param type $value
25
+ * @return type
26
+ */
27
+ public function saveValue($menuId, $mappingId, $value) {
28
+
29
+ // check if old value exists for this record
30
+ $vaild = $this->validate($menuId, $mappingId, $value);
31
+ // save value if valid returns 0
32
+ if ($vaild == 0) {
33
+ try{
34
+ parent::setData(
35
+ array(
36
+ 'template_attribute_id' => $mappingId,
37
+ 'menu_id' => $menuId,
38
+ 'value' => $value,
39
+ 'created_time' => now(),
40
+ 'update_time' => now()));
41
+ parent::save();
42
+ }catch(Exception $e){
43
+ Mage::log($e);
44
+ }
45
+
46
+ }
47
+ }
48
+
49
+ /**
50
+ * update if record found
51
+ * @param type $menuId
52
+ * @param type $mappingId
53
+ * @param type $value
54
+ * @return int
55
+ */
56
+ public function validate($menuId, $mappingId, $value) {
57
+ $collection = parent::getCollection()
58
+ ->addFieldToSelect('entity_id')
59
+ ->addFieldToFilter('template_attribute_id', array(array('eq' => $mappingId)))
60
+ ->addFieldToFilter('menu_id', array(array('eq' => $menuId)));
61
+ $data = $collection->getData();
62
+ if (count($data) > 0) {
63
+ $entityId = $data[0]['entity_id'];
64
+ try{
65
+ $rowData = parent::load($entityId);
66
+ $rowData->setValue($value);
67
+ $rowData->save();
68
+ return 1;
69
+ }catch(Exception $e){
70
+ Mage::log($e);
71
+ }
72
+ } else {
73
+ return 0;
74
+ }
75
+ }
76
+
77
+ /**
78
+ * skip comman attribute values and send other for saving purpose from post data
79
+ * @param type $menuId
80
+ * @param type $data
81
+ */
82
+ public function processData($menuId, $data) {
83
+
84
+
85
+ foreach ($data as $key => $value) {
86
+ if (!empty($value)) {
87
+ $continuearray = array(
88
+ 'form_key','name','store_id','status','type_id','template_id',
89
+ 'header','footer','menu_icon'
90
+ );
91
+ if (in_array($key, $continuearray)) {
92
+ continue;
93
+ } else {
94
+ $typeId = $data['type_id'];
95
+ $templateId = $data['template_id'];
96
+ $attributeId = Mage::getModel('megamenu/attributes')->getAttributeId($key);
97
+ $mappingId = Mage::getModel('megamenu/menuattributes')
98
+ ->getMappingId($attributeId, $templateId);
99
+
100
+ if (trim($mappingId) != '') {
101
+ Mage::getModel('megamenu/menuattributevalues')->saveValue($menuId, $mappingId, $value);
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ }
app/code/community/Cybage/Megamenu/Model/Menutemplate.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu menutemplate model return template based on selected menu type
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Menutemplate extends Mage_Core_Model_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/menutemplate');
18
+ }
19
+
20
+ /**
21
+ * return template based on selected menu type;
22
+ * @param type $id
23
+ * @return type array
24
+ */
25
+ public function filterTtemplate($id) {
26
+
27
+ $templateList = parent::getCollection()
28
+ ->addFieldToSelect('entity_id')
29
+ ->addFieldToSelect('name')
30
+ ->addFieldToFilter('type_id', array(array('eq' => $id)));
31
+ return $templateList->getData();
32
+ }
33
+
34
+ /**
35
+ *
36
+ * @param type $templateId
37
+ * @return type string
38
+ */
39
+ public function getImage($templateId) {
40
+
41
+ $templateData = parent::load($templateId);
42
+ return $templateData->getLayoutImage();
43
+ }
44
+
45
+ }
app/code/community/Cybage/Megamenu/Model/Menutype.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu menutype model
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Menutype extends Mage_Core_Model_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/menutype');
18
+ }
19
+
20
+ /**
21
+ * Return menu typle list for select
22
+ * @return array
23
+ */
24
+ public function getMenuList() {
25
+ $menuTypes = parent::getCollection();
26
+ $menuTypes->addFieldToFilter('is_active', 1);
27
+ $menuAarray[] = array('value' => '', 'label' => "Select menu type");
28
+ foreach ($menuTypes as $menu) {
29
+ $menuAarray[] = array('value' => $menu->getId(), 'label' => $menu->getType());
30
+ }
31
+ return $menuAarray;
32
+ }
33
+
34
+ }
app/code/community/Cybage/Megamenu/Model/Observer.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu observer resnders cache refresh button on menu item grid
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Observer {
14
+
15
+ public function addHandler(Varien_Event_Observer $observer) {
16
+
17
+ /* @var $update Mage_Core_Model_Layout_Update */
18
+ $update = $observer->getEvent()->getLayout()->getUpdate();
19
+ $update->addHandle('editor');
20
+ }
21
+
22
+ /**
23
+ * Add refresh buttion in admin menu management section
24
+ * @param type $observer
25
+ * @return \Cybage_Megamenu_Model_Observer
26
+ */
27
+ public function addButtonRefresh($observer) {
28
+ $container = $observer->getBlock();
29
+ $url = Mage::helper('adminhtml')->getUrl('*/*/clearCache');
30
+ if (null !== $container && $container->getType() == 'megamenu/adminhtml_megamenu') {
31
+ $data = array(
32
+ 'label' => 'Refresh Menu Cache',
33
+ 'class' => 'some-class',
34
+ 'onclick' => 'setLocation(\'' . $url . '\')',
35
+ );
36
+ $container->addButton('refresh_cache', $data);
37
+ }
38
+ }
39
+
40
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Attributes.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * megamenu attributes model
4
+ * @category megamenu community plugin
5
+ * @module Cybage_Megamenu
6
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
7
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
8
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
9
+ * @created_at 17-April-2015 04:28 PM [IST]
10
+ * @modified_at 17-April-2015 04:40 PM [IST]
11
+ */
12
+
13
+ class Cybage_Megamenu_Model_Resource_Attributes extends Mage_Core_Model_Mysql4_Abstract
14
+ {
15
+ public function _construct()
16
+ {
17
+ // Note that the megamenu_store_id refers to the key field in your database table.
18
+ $this->_init('megamenu/attributes', 'entity_id');
19
+ }
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Attributes/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu attributes collection
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Resource_Attributes_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/attributes');
18
+ }
19
+
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Megamenu.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * megamenu model
4
+ * @category megamenu community plugin
5
+ * @module Cybage_Megamenu
6
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
7
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
8
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
9
+ * @created_at 17-April-2015 04:28 PM [IST]
10
+ * @modified_at 17-April-2015 04:40 PM [IST]
11
+ */
12
+
13
+ class Cybage_Megamenu_Model_Resource_Megamenu extends Mage_Core_Model_Mysql4_Abstract
14
+ {
15
+ public function _construct()
16
+ {
17
+ // Note that the megamenu_id refers to the key field in your database table.
18
+ $this->_init('megamenu/megamenu', 'entity_id');
19
+ }
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Megamenu/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu megamenu collection
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Resource_Megamenu_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/megamenu');
18
+ }
19
+
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Menuattributes.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * megamenu menuattributes model
4
+ * @category megamenu community plugin
5
+ * @module Cybage_Megamenu
6
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
7
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
8
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
9
+ * @created_at 17-April-2015 04:28 PM [IST]
10
+ * @modified_at 17-April-2015 04:40 PM [IST]
11
+ */
12
+
13
+ class Cybage_Megamenu_Model_Resource_Menuattributes extends Mage_Core_Model_Mysql4_Abstract
14
+ {
15
+ public function _construct()
16
+ {
17
+ // Note that the megamenu_store_id refers to the key field in your database table.
18
+ $this->_init('megamenu/menuattributes', 'entity_id');
19
+ }
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Menuattributes/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu menuattributes collection
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Resource_Menuattributes_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/menuattributes');
18
+ }
19
+
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Menuattributevalues.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * megamenu menuattribute values model
4
+ * @category megamenu community plugin
5
+ * @module Cybage_Megamenu
6
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
7
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
8
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
9
+ * @created_at 17-April-2015 04:28 PM [IST]
10
+ * @modified_at 17-April-2015 04:40 PM [IST]
11
+ */
12
+
13
+ class Cybage_Megamenu_Model_Resource_Menuattributevalues extends Mage_Core_Model_Mysql4_Abstract
14
+ {
15
+ public function _construct()
16
+ {
17
+ // Note that the megamenu_store_id refers to the key field in your database table.
18
+ $this->_init('megamenu/menuattributevalues', 'entity_id');
19
+ }
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Menuattributevalues/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu menuattributevalues collection
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Resource_Menuattributevalues_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/menuattributevalues');
18
+ }
19
+
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Menutemplate.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * megamenu menutemplate model
4
+ * @category megamenu community plugin
5
+ * @module Cybage_Megamenu
6
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
7
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
8
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
9
+ * @created_at 17-April-2015 04:28 PM [IST]
10
+ * @modified_at 17-April-2015 04:40 PM [IST]
11
+ */
12
+
13
+ class Cybage_Megamenu_Model_Resource_Menutemplate extends Mage_Core_Model_Mysql4_Abstract
14
+ {
15
+ public function _construct()
16
+ {
17
+ $this->_init('megamenu/menutemplate', 'entity_id');
18
+ }
19
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Menutemplate/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu menutemplate collection
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Resource_Menutemplate_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/menutemplate');
18
+ }
19
+
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Menutype.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * megamenu menutype model
4
+ * @category megamenu community plugin
5
+ * @module Cybage_Megamenu
6
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
7
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
8
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
9
+ * @created_at 17-April-2015 04:28 PM [IST]
10
+ * @modified_at 17-April-2015 04:40 PM [IST]
11
+ */
12
+
13
+ class Cybage_Megamenu_Model_Resource_Menutype extends Mage_Core_Model_Mysql4_Abstract
14
+ {
15
+ public function _construct()
16
+ {
17
+ $this->_init('megamenu/menutype', 'entity_id');
18
+ }
19
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Menutype/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu menutype collection
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Resource_Menutype_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/menutype');
18
+ }
19
+
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Stores.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * megamenu store model
4
+ * @category megamenu community plugin
5
+ * @module Cybage_Megamenu
6
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
7
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
8
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
9
+ * @created_at 17-April-2015 04:28 PM [IST]
10
+ * @modified_at 17-April-2015 04:40 PM [IST]
11
+ */
12
+
13
+ class Cybage_Megamenu_Model_Resource_Stores extends Mage_Core_Model_Mysql4_Abstract
14
+ {
15
+ public function _construct()
16
+ {
17
+ // Note that the megamenu_store_id refers to the key field in your database table.
18
+ $this->_init('megamenu/stores', 'megamenu_store_id');
19
+ }
20
+ }
app/code/community/Cybage/Megamenu/Model/Resource/Stores/Collection.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu store collection
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Resource_Stores_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/stores');
18
+ }
19
+
20
+ }
app/code/community/Cybage/Megamenu/Model/Status.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * megamenu status model
4
+ * @category megamenu community plugin
5
+ * @module Cybage_Megamenu
6
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
7
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
8
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
9
+ * @created_at 17-April-2015 04:28 PM [IST]
10
+ * @modified_at 17-April-2015 04:40 PM [IST]
11
+ */
12
+
13
+ class Cybage_Megamenu_Model_Status extends Varien_Object
14
+ {
15
+ const STATUS_ENABLED = 1;
16
+ const STATUS_DISABLED = 2;
17
+
18
+ static public function getOptionArray()
19
+ {
20
+ return array(
21
+ self::STATUS_ENABLED => Mage::helper('megamenu')->__('Enabled'),
22
+ self::STATUS_DISABLED => Mage::helper('megamenu')->__('Disabled')
23
+ );
24
+ }
25
+ }
app/code/community/Cybage/Megamenu/Model/Stores.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu store model retrives and updates stores data
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Model_Stores extends Mage_Core_Model_Abstract {
14
+
15
+ public function _construct() {
16
+ parent::_construct();
17
+ $this->_init('megamenu/stores');
18
+ }
19
+
20
+ /**
21
+ * save stores ids
22
+ * @param type $menuId
23
+ * @param type $data *
24
+ */
25
+ public function saveStore($menuId, $data) {
26
+
27
+ foreach ($data['store_id'] as $storeId) {
28
+ try{
29
+ parent::setData(array('menu_id' => $menuId, 'store_id' => $storeId));
30
+ parent::save();
31
+ } catch (Exception $e){
32
+ Mage::log($e);
33
+ }
34
+ }
35
+ }
36
+
37
+ /**
38
+ * return comma separeted store ids
39
+ * @param type $id
40
+ * @param array $data
41
+ * @return type string
42
+ */
43
+ public function getStores($id, $data) {
44
+ $megaMenuStores = Mage::getSingleton('core/resource')->getTableName('megamenu/stores');
45
+ $model = Mage::getModel('megamenu/stores')->getCollection()
46
+ ->addFieldToSelect('store_id')
47
+ ->addFieldToFilter('menu_id', array(array('eq' => $id)));
48
+
49
+ foreach ($model->getData() as $storeId) {
50
+ $stores[] = $storeId['store_id'];
51
+ }
52
+
53
+ $data['store_id'] = implode(',', $stores);
54
+ return $data;
55
+ }
56
+
57
+ /**
58
+ * update existing stores
59
+ * @param type $id
60
+ * @param type $data
61
+ */
62
+ public function updateStores($id, $data) {
63
+
64
+ //delete existing stores
65
+ $this->deleteStore($id);
66
+ $this->saveStore($id, $data);
67
+ }
68
+
69
+ /**
70
+ * delete existing stores prior saving
71
+ * @param type $id
72
+ */
73
+ public function deleteStore($id) {
74
+ $stores = $this->getCollection()
75
+ ->addFieldToFilter('menu_id', array('eq' => $id));
76
+
77
+ if (!empty($stores)) {
78
+ foreach ($stores as $store) {
79
+ try{
80
+ $store->delete();
81
+ }catch (Exception $e){
82
+ Mage::log($e);
83
+ }
84
+ }
85
+ }
86
+ }
87
+
88
+ }
app/code/community/Cybage/Megamenu/controllers/Adminhtml/MegamenuController.php ADDED
@@ -0,0 +1,303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu admin controller
5
+ * @category Megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_Adminhtml_MegamenuController extends Mage_Adminhtml_Controller_Action {
14
+
15
+ /**
16
+ * Initializing menamenu in admin
17
+ * @return \Cybage_Megamenu_Adminhtml_MegamenuController
18
+ */
19
+ protected function _initAction() {
20
+ $this->loadLayout()
21
+ ->_setActiveMenu('megamenu/items')
22
+ ->_addBreadcrumb(Mage::helper('adminhtml')
23
+ ->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
24
+
25
+ return $this;
26
+ }
27
+
28
+ /**
29
+ * Inde Action
30
+ * Display Grid Page
31
+ */
32
+ public function indexAction() {
33
+ $this->_initAction()
34
+ ->renderLayout();
35
+ }
36
+
37
+ /**
38
+ * Edit Action
39
+ */
40
+ public function editAction() {
41
+ $id = $this->getRequest()->getParam('id');
42
+ $model = Mage::getModel('megamenu/megamenu')->load($id);
43
+
44
+ if ($model->getId() || $id == 0) {
45
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
46
+ if (!empty($data)) {
47
+ $model->setData($data);
48
+ }
49
+
50
+ Mage::register('megamenu_data', $model);
51
+
52
+ $this->loadLayout();
53
+ $this->_setActiveMenu('megamenu/items');
54
+
55
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
56
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
57
+
58
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
59
+
60
+ $this->_addContent($this->getLayout()->createBlock('megamenu/adminhtml_megamenu_edit'))
61
+ ->_addLeft($this->getLayout()->createBlock('megamenu/adminhtml_megamenu_edit_tabs'));
62
+
63
+ $this->renderLayout();
64
+ } else {
65
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('megamenu')->__('Item does not exist'));
66
+ $this->_redirect('*/*/');
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Add new Menu action
72
+ */
73
+ public function newAction() {
74
+ $this->_forward('edit');
75
+ }
76
+
77
+ /**
78
+ * Save Menu
79
+ */
80
+ public function saveAction() {
81
+
82
+ if ($data = $this->getRequest()->getPost()) {
83
+ if (!empty($data['type_id']) &&
84
+ intval($data['type_id']) &&
85
+ !empty($data['template_id']) &&
86
+ intval($data['template_id'])
87
+ ) {
88
+
89
+ if ($this->getRequest()->getParam('id')) {
90
+ $id = $this->getRequest()->getParam('id');
91
+ $model = Mage::getModel('megamenu/megamenu');
92
+ try {
93
+ $model->setData(array(
94
+ 'entity_id' => $id,
95
+ 'name' => $data['name'],
96
+ 'titel' => $data['titel'],
97
+ 'type_id' => $data['type_id'],
98
+ 'template_id' => $data['template_id'],
99
+ 'menu_order' => $data['order'],
100
+ 'is_active' => $data['is_active'],
101
+ 'header' => $data['header'],
102
+ 'footer' => $data['footer'],
103
+ 'update_time' => now(),
104
+ ));
105
+ $model->save();
106
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('megamenu')
107
+ ->__('The menu has been saved.'));
108
+ if ($this->getRequest()->getParam('back') == 'edit') {
109
+ $this->_redirect('*/*/edit', array('id' => Mage::app()->getRequest()->getParam('id')));
110
+ } else {
111
+ $this->_redirect('*/*/');
112
+ }
113
+ } catch (Exception $e) {
114
+ $this->_redirect('*/*/edit', array('id' => Mage::app()->getRequest()->getParam('id')));
115
+
116
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('megamenu')
117
+ ->__('Duplicate entry for order'));
118
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
119
+ }
120
+
121
+ //save stores for menu
122
+ Mage::getModel('megamenu/stores')->updateStores($id, $data);
123
+
124
+ // process post data and save attribute values
125
+ Mage::getModel('megamenu/menuattributevalues')->processData($id, $data);
126
+ } else {
127
+
128
+ // save megamenu comman data
129
+ $model = Mage::getModel('megamenu/megamenu');
130
+ $model->setData(array(
131
+ 'type_id' => $data['type_id'],
132
+ 'template_id' => $data['template_id'],
133
+ 'name' => $data['name'],
134
+ 'titel' => $data['titel'],
135
+ 'is_active' => $data['is_active'],
136
+ 'menu_order' => $data['order'],
137
+ 'header' => $data['header'],
138
+ 'footer' => $data['footer'],
139
+ ))->setId($this->getRequest()->getParam('id'));
140
+
141
+
142
+ try {
143
+ if ($model->getCreatedTime == NULL ||
144
+ $model->getUpdateTime() == NULL) {
145
+ $model->setCreatedTime(now())
146
+ ->setUpdateTime(now());
147
+ } else {
148
+ $model->setUpdateTime(now());
149
+ }
150
+ $model->save();
151
+ $menuId = $model->getId();
152
+
153
+ //save stores for menu
154
+ Mage::getModel('megamenu/stores')->updateStores($menuId, $data);
155
+
156
+ // process post data and save attribute values
157
+ Mage::getModel('megamenu/menuattributevalues')->processData($menuId, $data);
158
+
159
+ Mage::getSingleton('adminhtml/session')
160
+ ->addSuccess(Mage::helper('megamenu')
161
+ ->__('The menu has been saved.'));
162
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
163
+ if ($this->getRequest()->getParam('back')) {
164
+ $this->_redirect('*/*/edit', array('id' => $menuId));
165
+ } else {
166
+ $this->_redirect('*/*/');
167
+ }
168
+ } catch (Exception $e) {
169
+ Mage::getSingleton('adminhtml/session')->addError('Duplicate entry for order');
170
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
171
+ }
172
+ }
173
+ } else {
174
+ Mage::getSingleton('adminhtml/session')->addError('Invalid Data type');
175
+ }
176
+ } else {
177
+ $this->_redirect('*/*/');
178
+ }
179
+ }
180
+
181
+ /**
182
+ * Delete Menu
183
+ */
184
+ public function deleteAction() {
185
+ if ($this->getRequest()->getParam('id') > 0) {
186
+ try {
187
+ $model = Mage::getModel('megamenu/megamenu');
188
+
189
+ $model->setId($this->getRequest()->getParam('id'))
190
+ ->delete();
191
+
192
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
193
+ $this->_redirect('*/*/');
194
+ } catch (Exception $e) {
195
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
196
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
197
+ }
198
+ }
199
+ $this->_redirect('*/*/');
200
+ }
201
+
202
+ /**
203
+ * Mass Delete Action
204
+ */
205
+ public function massDeleteAction() {
206
+ $megamenuIds = $this->getRequest()->getParam('megamenu');
207
+ if (!is_array($megamenuIds)) {
208
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
209
+ } else {
210
+ try {
211
+ $megamenu = Mage::getModel('megamenu/megamenu')
212
+ ->getCollection()
213
+ ->addFieldToFilter('entity_id', array('in' => $megamenuIds));
214
+
215
+ foreach ($megamenu as $megamenuId) {
216
+ $megamenuId->delete();
217
+ }
218
+ Mage::getSingleton('adminhtml/session')->addSuccess(
219
+ Mage::helper('adminhtml')->__(
220
+ 'Total of %d record(s) were successfully deleted', count($megamenuIds)
221
+ )
222
+ );
223
+ } catch (Exception $e) {
224
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
225
+ }
226
+ }
227
+ $this->_redirect('*/*/index');
228
+ }
229
+
230
+ /**
231
+ * Mass Status Change Action
232
+ */
233
+ public function massStatusAction() {
234
+ $megamenuIds = $this->getRequest()->getParam('megamenu');
235
+ if (!is_array($megamenuIds)) {
236
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
237
+ } else {
238
+ try {
239
+ foreach ($megamenuIds as $megamenuId) {
240
+ $megamenu = Mage::getSingleton('megamenu/megamenu')
241
+ ->load($megamenuId)
242
+ ->setIs_active($this->getRequest()->getParam('status'))
243
+ ->setIsMassupdate(true)
244
+ ->save();
245
+ }
246
+ $this->_getSession()->addSuccess(
247
+ $this->__('Total of %d record(s) were successfully updated', count($megamenuIds))
248
+ );
249
+ } catch (Exception $e) {
250
+ $this->_getSession()->addError($e->getMessage());
251
+ }
252
+ }
253
+ $this->_redirect('*/*/index');
254
+ }
255
+
256
+ /**
257
+ * Get Template Action
258
+ */
259
+ public function getTemplateAction() {
260
+
261
+ $postData = $this->getRequest()->getPost();
262
+ $menuTypeId = $postData['type_id'];
263
+ $templates = Mage::getModel('megamenu/menutemplate')->filterTtemplate($menuTypeId);
264
+ $this->getResponse()->setHeader('Content-type', 'application/json');
265
+ $this->getResponse()->setBody(json_encode($templates));
266
+ }
267
+
268
+ /**
269
+ * Get Layout Image Action
270
+ */
271
+ public function getLayoutImageAction() {
272
+ $postData = $this->getRequest()->getPost();
273
+ $layoutId = $postData['template_id'];
274
+ $mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
275
+ $imageName = $mediaUrl . 'megamenu/' . Mage::getModel('megamenu/menutemplate')->load($layoutId)->getLayoutImage();
276
+ $this->getResponse()->setBody($imageName);
277
+ }
278
+
279
+ /**
280
+ * Get Categories Action
281
+ */
282
+ public function getCategoriesAction() {
283
+ $this->loadLayout();
284
+ $this->renderLayout();
285
+ }
286
+
287
+ /**
288
+ * Clear Menu Cache Action
289
+ */
290
+ public function clearCacheAction() {
291
+ $storeId = Mage::app()->getStore()->getId();
292
+ $cache = Mage::getSingleton('core/cache');
293
+ $key = 'homepage-mega-menu-' . $storeId;
294
+
295
+ $data = $cache->clean('homepage_cache');
296
+ if ($data) {
297
+ Mage::getSingleton('adminhtml/session')
298
+ ->addSuccess(Mage::helper('adminhtml')->__('Menu cache cleared successfully'));
299
+ }
300
+ $this->_redirect('*/*/index');
301
+ }
302
+
303
+ }
app/code/community/Cybage/Megamenu/controllers/Adminhtml/WidgetController.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu admin controller
5
+ * @category Megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ require_once(Mage::getModuleDir('controllers','Mage_Adminhtml').DS.'Promo'.DS.'WidgetController.php');
14
+ class Cybage_Megamenu_Adminhtml_WidgetController extends Mage_Adminhtml_Promo_WidgetController{
15
+ //put your code here
16
+
17
+ /**
18
+ * Prepare block for chooser
19
+ *
20
+ * @return void
21
+ */
22
+ public function chooserAction()
23
+ {
24
+
25
+ $request = $this->getRequest();
26
+
27
+ switch ($request->getParam('attribute')) {
28
+ case 'sku':
29
+
30
+ $block = $this->getLayout()->createBlock(
31
+ 'megamenu/adminhtml_megamenu_promo_widget_chooser_sku', 'promo_widget_chooser_sku',
32
+ array('js_form_object' => $request->getParam('form'),
33
+ ));
34
+ break;
35
+
36
+ case 'category_ids':
37
+ $ids = $request->getParam('selected', array());
38
+ if (is_array($ids)) {
39
+ foreach ($ids as $key => &$id) {
40
+ $id = (int) $id;
41
+ if ($id <= 0) {
42
+ unset($ids[$key]);
43
+ }
44
+ }
45
+
46
+ $ids = array_unique($ids);
47
+ } else {
48
+ $ids = array();
49
+ }
50
+
51
+
52
+ $block = $this->getLayout()->createBlock(
53
+ 'adminhtml/catalog_category_checkboxes_tree', 'promo_widget_chooser_category_ids',
54
+ array('js_form_object' => $request->getParam('form'))
55
+ )
56
+ ->setCategoryIds($ids)
57
+ ;
58
+ break;
59
+
60
+ default:
61
+ $block = false;
62
+ break;
63
+ }
64
+
65
+ if ($block) {
66
+ $this->getResponse()->setBody($block->toHtml());
67
+ }
68
+ }
69
+ }
app/code/community/Cybage/Megamenu/controllers/IndexController.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu index controller
5
+ * @category Megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ class Cybage_Megamenu_IndexController extends Mage_Core_Controller_Front_Action {
14
+
15
+ public function indexAction() {
16
+ $this->loadLayout();
17
+ $this->renderLayout();
18
+ }
19
+
20
+ }
app/code/community/Cybage/Megamenu/data/megamenu_setup/data-install-0.1.0.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu predefined data insertion and template attribute mapping script
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ $installer = $this;
14
+
15
+ $installer->startSetup();
16
+
17
+ $installer->run("
18
+ insert into {$this->getTable('megamenu_type')}
19
+ (`type`,`is_active`) values ('Category Listing',1),('Product Listing',1),
20
+ ('Group Menu Items',0),('Contact Us',1),('Anchor Text',1),('Content Text',1);
21
+
22
+ insert into {$this->getTable('megamenu_template')}
23
+ (`type_id`,`name`,`is_active`) values (1,'Category Listing',1),(2,'Product Listing',1),(3,'Group Menu Items',1),(4,'Contact Us',1),(5,'Anchor Text',1),(6,'Content Text',1);
24
+
25
+ insert into {$this->getTable('megamenu_content_blocks')}
26
+ (`block_name`) values ('General'),('Main Content'),('Feature Content');
27
+
28
+ insert into {$this->getTable('megamenu_attribute')} ( `atribute_code`,`atribute_label`,`content_block_id`,`is_active`,`atribute_type`,`is_visible`) values('menu_type','Menu Type',1,1,'select',1),
29
+ ('template','Template',1,1,'select',1),
30
+ ('column_count','Number Of Columns',1,1,'text',1),
31
+ ('content_size','Content Size',1,1,'text',1),
32
+ ('column_size','Size Of Columns',1,1,'text',1),
33
+ ('feature_type','Featured Type',2,1,'select',1),
34
+ ('feature_product_box_title','Featured Product Box Title',2,1,'text',1),
35
+ ('feature_category_box_title','Featured Category Box Title',2,1,'text',1),
36
+ ('feature_product_ids','Featured Products',2,1,'button',1),
37
+ ('feature_category_ids','Featured Categories',2,1,'button',1),
38
+ ('category_box_title','Categories Box Title',3,1,'text',1),
39
+ ('prodct_box_title','Prodcts Box Title',3,1,'text',1),
40
+ ('main_content_category_ids','Categories',3,1,'button',1),
41
+ ('main_content_product_ids','Products',3,1,'button',1),
42
+ ('target_url','Target Url',1,1,'button',1),
43
+ ('content_container','Content Container',1,1,'container',1);
44
+
45
+
46
+ insert into {$this->getTable('megamenu_template_attributes')} (`template_id`, `attribute_id`, `is_active`) values('1','1','1'),
47
+ ('1','2','1'),
48
+ ('1','3','1'),
49
+ ('1','4','1'),
50
+ ('1','5','1'),
51
+ ('1','6','1'),
52
+ ('1','7','1'),
53
+ ('1','8','1'),
54
+ ('1','9','1'),
55
+ ('1','10','1'),
56
+ ('1','13','1'),
57
+ ('2','1','1'),
58
+ ('2','2','1'),
59
+ ('2','3','1'),
60
+ ('2','4','1'),
61
+ ('2','5','1'),
62
+ ('2','14','1'),
63
+ ('3','1','1'),
64
+ ('3','2','1'),
65
+ ('3','3','1'),
66
+ ('3','4','1'),
67
+ ('3','5','1'),
68
+ ('3','6','1'),
69
+ ('3','8','1'),
70
+ ('3','10','1'),
71
+ ('3','13','1'),
72
+ ('4','1','1'),
73
+ ('4','2','1'),
74
+ ('4','4','1'),
75
+ ('5','1','1'),
76
+ ('5','2','1'),
77
+ ('5','3','1'),
78
+ ('5','15','1'),
79
+ ('6','1','1'),
80
+ ('6','2','1'),
81
+ ('6','4','1'),
82
+ ('6','16','1');
83
+
84
+
85
+ ");
86
+
87
+ $installer->endSetup();
app/code/community/Cybage/Megamenu/etc/adminhtml.xml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <menu>
3
+ <cms>
4
+ <children>
5
+ <megamenu module="megamenu">
6
+ <title>Megamenu</title>
7
+ <sort_order>71</sort_order>
8
+ <action>megamenu/adminhtml_megamenu</action>
9
+ </megamenu>
10
+ </children>
11
+ </cms>
12
+ </menu>
13
+ <acl>
14
+ <resources>
15
+ <all>
16
+ <title>Allow Everything</title>
17
+ </all>
18
+ <admin>
19
+ <children>
20
+ <cms>
21
+ <children>
22
+ <megamenu>
23
+ <title>Megamenu</title>
24
+ <sort_order>40</sort_order>
25
+ <children>
26
+ <stalls translate = 'label'>
27
+ <sort_order>2</sort_order>
28
+ <action>megamenu/adminhtml_megamenu</action>
29
+ </stalls>
30
+ </children>
31
+ </megamenu>
32
+ </children>
33
+ </cms>
34
+ <system>
35
+ <children>
36
+ <config>
37
+ <children>
38
+ <megamenu translate="title" module="megamenu">
39
+ <title>Megamenu</title>
40
+ <sort_order>555</sort_order>
41
+ </megamenu>
42
+ </children>
43
+ </config>
44
+ </children>
45
+ </system>
46
+ </children>
47
+ </admin>
48
+ </resources>
49
+ </acl>
50
+ </config>
app/code/community/Cybage/Megamenu/etc/config.xml ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Cybage_Megamenu>
5
+ <version>0.1.11.5</version>
6
+ </Cybage_Megamenu>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <megamenu>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Cybage_Megamenu</module>
14
+ <frontName>megamenu</frontName>
15
+ </args>
16
+ </megamenu>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <megamenu>
21
+ <file>cybage_megamenu.xml</file>
22
+ </megamenu>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <megamenu>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Cybage_Megamenu</module>
32
+ <frontName>megamenu</frontName>
33
+ </args>
34
+ </megamenu>
35
+
36
+
37
+ </routers>
38
+ </admin>
39
+ <adminhtml>
40
+ <layout>
41
+ <updates>
42
+ <megamenu>
43
+ <file>cybage_megamenu.xml</file>
44
+ </megamenu>
45
+ </updates>
46
+ </layout>
47
+ </adminhtml>
48
+ <global>
49
+ <models>
50
+ <megamenu>
51
+ <class>Cybage_Megamenu_Model</class>
52
+ <resourceModel>megamenu_resource</resourceModel>
53
+ </megamenu>
54
+ <megamenu_resource>
55
+ <class>Cybage_Megamenu_Model_Resource</class>
56
+ <entities>
57
+ <megamenu>
58
+ <table>megamenu_main</table>
59
+ </megamenu>
60
+ <stores>
61
+ <table>megamenu_stores</table>
62
+ </stores>
63
+ <menutype>
64
+ <table>megamenu_type</table>
65
+ </menutype>
66
+ <menutemplate>
67
+ <table>megamenu_template</table>
68
+ </menutemplate>
69
+ <attributes>
70
+ <table>megamenu_attribute</table>
71
+ </attributes>
72
+ <menuattributes>
73
+ <table>megamenu_template_attributes</table>
74
+ </menuattributes>
75
+ <menuattributevalues>
76
+ <table>megamenu_template_attributes_values</table>
77
+ </menuattributevalues>
78
+ </entities>
79
+ </megamenu_resource>
80
+ </models>
81
+ <resources>
82
+ <megamenu_setup>
83
+ <setup>
84
+ <module>Cybage_Megamenu</module>
85
+ </setup>
86
+ <connection>
87
+ <use>core_setup</use>
88
+ </connection>
89
+ </megamenu_setup>
90
+ <megamenu_write>
91
+ <connection>
92
+ <use>core_write</use>
93
+ </connection>
94
+ </megamenu_write>
95
+ <megamenu_read>
96
+ <connection>
97
+ <use>core_read</use>
98
+ </connection>
99
+ </megamenu_read>
100
+ </resources>
101
+ <blocks>
102
+ <megamenu>
103
+ <class>Cybage_Megamenu_Block</class>
104
+ </megamenu>
105
+ </blocks>
106
+ <helpers>
107
+ <megamenu>
108
+ <class>Cybage_Megamenu_Helper</class>
109
+ </megamenu>
110
+ </helpers>
111
+ <events>
112
+ <adminhtml_widget_container_html_before>
113
+ <observers>
114
+ <add_button_refresh>
115
+ <class>Cybage_Megamenu_Model_observer</class>
116
+ <method>addButtonRefresh</method>
117
+ </add_button_refresh>
118
+ </observers>
119
+ </adminhtml_widget_container_html_before>
120
+
121
+ <controller_action_layout_load_before>
122
+ <observers>
123
+ <attributesethandle>
124
+ <class>Cybage_Megamenu_Model_Observer</class>
125
+ <method>addHandler</method>
126
+ </attributesethandle>
127
+ </observers>
128
+ </controller_action_layout_load_before>
129
+ </events>
130
+ </global>
131
+ </config>
app/code/community/Cybage/Megamenu/etc/system.xml ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <megamenu translate="label" module = 'megamenu'>
5
+ <label>Cybage</label>
6
+ <sort_order>100</sort_order>
7
+ </megamenu>
8
+ </tabs>
9
+ <sections>
10
+ <megamenu translate="label">
11
+ <label>Megamenu</label>
12
+ <tab>megamenu</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>1000</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
+ <settings translate="label" module='megamenu'>
20
+ <label>General Settings</label>
21
+ <sort_order>1</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <enable translate="label">
27
+ <label>Enable</label>
28
+ <comment>
29
+ <![CDATA[Enable or Disable this extension.]]>
30
+ </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
+ </enable>
38
+ </fields>
39
+ </settings>
40
+ <megamenu_configuration translation='label' module='megamenu'>
41
+ <label>Megameu Settings</label>
42
+ <sort_order>10</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
+ <fields>
47
+ <background_color>
48
+ <label>Background Color</label>
49
+ <comment><![CDATA[Please Select Color]]></comment>
50
+ <frontend_model>megamenu/adminhtml_system_config_form_field_colorpicker</frontend_model>
51
+
52
+ <sort_order>1</sort_order>
53
+ <show_in_default>1</show_in_default>
54
+ <show_inwebsite>1</show_inwebsite>
55
+ <show_in_store>1</show_in_store>
56
+ </background_color>
57
+
58
+ <font_color>
59
+ <label>Font Color</label>
60
+ <comment><![CDATA[Please Select Color]]></comment>
61
+ <frontend_model>
62
+ megamenu/adminhtml_system_config_form_field_colorpicker
63
+ </frontend_model>
64
+ <sort_order>2</sort_order>
65
+ <show_in_default>1</show_in_default>
66
+ <show_inwebsite>1</show_inwebsite>
67
+ <show_in_store>1</show_in_store>
68
+ </font_color>
69
+
70
+ <font_family>
71
+ <label>Font Family</label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>3</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ </font_family>
78
+
79
+ <font_size>
80
+ <label>Font Size</label>
81
+ <frontend_type>select</frontend_type>
82
+ <source_model>megamenu/adminhtml_source_fontsize</source_model>
83
+ <sort_order>4</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ </font_size>
88
+ <maximum_column_size>
89
+ <label>Maximum number of columns</label>
90
+ <frontend_type>select</frontend_type>
91
+ <source_model>megamenu/adminhtml_source_columnsize</source_model>
92
+ <sort_order>6</sort_order>
93
+ <show_in_default>1</show_in_default>
94
+ <show_in_website>1</show_in_website>
95
+ <show_in_store>1</show_in_store>
96
+ <comment><![CDATA[Maximum number of column]]></comment>
97
+ <!-- <depends>
98
+ <settings>
99
+ <enable>1</enable>
100
+ </settings>
101
+ </depends>-->
102
+ </maximum_column_size>
103
+
104
+ </fields>
105
+ </megamenu_configuration>
106
+ </groups>
107
+ </megamenu>
108
+ </sections>
109
+ </config>
app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * megamenu setup
5
+ * @category megamenu community plugin
6
+ * @module Cybage_Megamenu
7
+ * @created Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
8
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
9
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
10
+ * @created_at 17-April-2015 04:28 PM [IST]
11
+ * @modified_at 17-April-2015 04:40 PM [IST]
12
+ */
13
+ $installer = $this;
14
+
15
+ $installer->startSetup();
16
+
17
+ $installer->run("
18
+
19
+ DROP TABLE IF EXISTS {$this->getTable('megamenu_type')};
20
+ CREATE TABLE {$this->getTable('megamenu_type')} (
21
+ `entity_id` int(11) NOT NULL auto_increment,
22
+ `type` varchar(255) NOT NULL default '',
23
+ `is_active` boolean NOT NULL,
24
+ PRIMARY KEY (`entity_id`)
25
+ ) ENGINE=InnoDB;
26
+
27
+ DROP TABLE IF EXISTS {$this->getTable('megamenu_template')};
28
+ CREATE TABLE {$this->getTable('megamenu_template')} (
29
+ `entity_id` int(11) NOT NULL auto_increment,
30
+ `type_id` int(11) NOT NULL ,
31
+ `name` varchar(255) NOT NULL default '',
32
+ `is_active` boolean NOT NULL,
33
+ PRIMARY KEY (`entity_id`),
34
+ CONSTRAINT `FK_megamenu_template_typeid`FOREIGN KEY (`type_id`) REFERENCES megamenu_type (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
35
+ ) ENGINE=InnoDB;
36
+
37
+
38
+ DROP TABLE IF EXISTS {$this->getTable('megamenu_main')};
39
+ CREATE TABLE {$this->getTable('megamenu_main')} (
40
+ `entity_id` int(11) NOT NULL auto_increment,
41
+ `type_id` int(11) NOT NULL,
42
+ `template_id` int(11) NOT NULL,
43
+ `name` varchar(255) NOT NULL default '',
44
+ `header` text NULL ,
45
+ `footer` text NULL ,
46
+ `is_active` boolean NOT NULL,
47
+ `created_time` datetime NULL,
48
+ `update_time` datetime NULL,
49
+ PRIMARY KEY (`entity_id`)
50
+ )ENGINE=InnoDB;
51
+
52
+ DROP TABLE IF EXISTS {$this->getTable('megamenu_attribute')};
53
+ CREATE TABLE {$this->getTable('megamenu_attribute')} (
54
+ `entity_id` int(11) NOT NULL auto_increment,
55
+ `atribute_code` varchar(255) NOT NULL default '',
56
+ `atribute_label` varchar(255) NOT NULL default '',
57
+ `content_block_id` int(11) NOT NULL ,
58
+ `is_active` boolean NOT NULL,
59
+ `atribute_type` varchar(255) NOT NULL default '',
60
+ `is_visible` boolean NOT NULL,
61
+ PRIMARY KEY (`entity_id`),
62
+ CONSTRAINT `FK_megamenu_attribute_contentblockid` FOREIGN KEY (`content_block_id`) REFERENCES megamenu_content_blocks (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB;
63
+
64
+ DROP TABLE IF EXISTS {$this->getTable('megamenu_template_attributes')};
65
+ CREATE TABLE {$this->getTable('megamenu_template_attributes')} (
66
+ `entity_id` int(11) NOT NULL auto_increment,
67
+ `template_id` int(11) NOT NULL,
68
+ `attribute_id` int(11) NOT NULL,
69
+ `is_active` boolean NOT NULL,
70
+ PRIMARY KEY (`entity_id`),
71
+ CONSTRAINT `FK_megamenu_template_attributes_templateid` FOREIGN KEY (`template_id`) REFERENCES megamenu_template (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
72
+ CONSTRAINT `FK_megamenu_template_attributes_attributeid` FOREIGN KEY (`attribute_id`) REFERENCES megamenu_attribute (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE)ENGINE=InnoDB;
73
+
74
+ DROP TABLE IF EXISTS {$this->getTable('megamenu_template_attributes_values')};
75
+ CREATE TABLE {$this->getTable('megamenu_template_attributes_values')} (
76
+ `entity_id` int(11) NOT NULL auto_increment,
77
+ `template_attribute_id` int(11) NOT NULL,
78
+ `menu_id` int(11) NOT NULL,
79
+ `value` varchar(255) NOT NULL default '',
80
+ `created_time` datetime NULL,
81
+ `update_time` datetime NULL,
82
+ PRIMARY KEY (`entity_id`),
83
+ CONSTRAINT `FK_megamenu_template_attributes_values_mapping` FOREIGN KEY (`template_attribute_id`) REFERENCES megamenu_template_attributes (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
84
+ CONSTRAINT `FK_megamenu_template_attributes_values_menuid` FOREIGN KEY (`menu_id`) REFERENCES megamenu_main (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
85
+ )ENGINE=InnoDB;
86
+
87
+ DROP TABLE IF EXISTS {$this->getTable('megamenu_stores')};
88
+ CREATE TABLE {$this->getTable('megamenu_stores')} (
89
+ `menu_id` int(11) NOT NULL,
90
+ `store_id` int(11) NOT NULL,
91
+ CONSTRAINT `FK_megamenu_stores_menuid` FOREIGN KEY (`menu_id`) REFERENCES megamenu_main (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
92
+ ) ENGINE=InnoDB;
93
+
94
+ DROP TABLE IF EXISTS {$this->getTable('megamenu_content_blocks')};
95
+ CREATE TABLE {$this->getTable('megamenu_content_blocks')} (
96
+ `entity_id` int(11) NOT NULL auto_increment,
97
+ `block_name` varchar(255) NOT NULL default '',
98
+ PRIMARY KEY (`entity_id`)
99
+ ) ENGINE=InnoDB;
100
+
101
+ ");
102
+
103
+ $installer->endSetup();
app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.10-0.1.11.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Cybage Rewardpoint Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Rewardpoint Plugin
15
+ * @package Cybage_Rewardpoint
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ $installer = $this;
22
+
23
+ $installer->startSetup();
24
+
25
+ $installer->run("
26
+ ALTER TABLE {$this->getTable('megamenu_template_attributes_values')}
27
+ CHANGE `value` `value` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '';");
28
+
29
+ $installer->endSetup();
app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.11-0.1.11.1.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Cybage Rewardpoint Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Rewardpoint Plugin
15
+ * @package Cybage_Rewardpoint
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ $installer = $this;
22
+
23
+ $installer->startSetup();
24
+
25
+ $installer->run("ALTER TABLE {$this->getTable('megamenu_main')} "
26
+ . "ADD `menu_order` INT NOT NULL AFTER `is_active`, ADD UNIQUE (`menu_order`) ;");
27
+
28
+ $installer->endSetup();
app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.11.3-0.1.11.4.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Cybage Rewardpoint Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Rewardpoint Plugin
15
+ * @package Cybage_Rewardpoint
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ $installer = $this;
22
+
23
+ $installer->startSetup();
24
+
25
+ $installer->run("UPDATE {$this->getTable('megamenu_type')} SET `is_active` = '0' WHERE `megamenu_type`.`entity_id` = 3;");
26
+ //$installer->run("UPDATE {$this->getTable('megamenu_type')} "
27
+ //. "SET `is_active` = '0' WHERE `entity_id` = '3';");
28
+
29
+ $installer->endSetup();
30
+
app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.11.4-0.1.11.5.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Cybage Rewardpoint Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Rewardpoint Plugin
15
+ * @package Cybage_Rewardpoint
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ $installer = $this;
22
+
23
+ $installer->startSetup();
24
+
25
+ $installer->run("ALTER TABLE {$this->getTable('megamenu_main')} ADD `titel` VARCHAR(100) NOT NULL AFTER `name`, ADD `alt` VARCHAR(100) NOT NULL AFTER `titel`;");
26
+
27
+ $installer->endSetup();
28
+
app/code/community/Cybage/Megamenu/sql/megamenu_setup/mysql4-upgrade-0.1.9-0.1.10.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Cybage Rewardpoint Plugin
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * It is available on the World Wide Web at:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you are unable to access it on the World Wide Web, please send an email
12
+ * To: Support_Magento@cybage.com. We will send you a copy of the source file.
13
+ *
14
+ * @category Rewardpoint Plugin
15
+ * @package Cybage_Rewardpoint
16
+ * @copyright Copyright (c) 2014 Cybage Software Pvt. Ltd., India
17
+ * http://www.cybage.com/pages/centers-of-excellence/ecommerce/ecommerce.aspx
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ * @author Cybage Software Pvt. Ltd. <Support_Magento@cybage.com>
20
+ */
21
+ $installer = $this;
22
+
23
+ $installer->startSetup();
24
+
25
+ $installer->run("
26
+ ALTER TABLE {$this->getTable('megamenu_stores')}
27
+ ADD `megamenu_store_id` INT NOT NULL AUTO_INCREMENT FIRST,
28
+ ADD PRIMARY KEY (`megamenu_store_id`) ;
29
+ ");
30
+
31
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/cybage_megamenu.xml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <megamenu_adminhtml_megamenu_index>
4
+ <reference name="content">
5
+ <block type="megamenu/adminhtml_megamenu" name="megamenu" />
6
+ </reference>
7
+ </megamenu_adminhtml_megamenu_index>
8
+ <megamenu_adminhtml_megamenu_edit>
9
+ <reference name="head">
10
+ <action method="setCanLoadExtJs">
11
+ <flag>1</flag>
12
+ </action>
13
+ <action method="setCanLoadTinyMce">
14
+ <flag>1</flag>
15
+ </action>
16
+ <action method="addJs">
17
+ <script>mage/adminhtml/wysiwyg/widget.js</script>
18
+ </action>
19
+ <action method="addItem">
20
+ <type>skin_js</type>
21
+ <name>js/megamenu.js</name>
22
+ </action>
23
+ <action method="addItem">
24
+ <type>skin_js</type>
25
+ <name>js/productselect.js</name>
26
+ </action>
27
+ <action method="addItem">
28
+ <type>skin_css</type>
29
+ <name>megamenu/megamenu.css</name>
30
+ </action>
31
+ </reference>
32
+ </megamenu_adminhtml_megamenu_edit>
33
+ <megamenu_adminhtml_megamenu_getcategories>
34
+ <remove name="head"/>
35
+ <remove name="header"/>
36
+ <remove name="menu"/>
37
+ <remove name="footer"/>
38
+ <reference name="content">
39
+ </reference>
40
+ </megamenu_adminhtml_megamenu_getcategories>
41
+ <!-- <reference name="head">
42
+ <action method="addItem">
43
+ <type>css</type>
44
+ <name>megamenu/megamnu.css</name>
45
+ </action>
46
+ </reference>-->
47
+ </layout>
app/design/frontend/base/default/layout/cybage_megamenu.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head" >
5
+ <action method="addCss" ifconfig="megamenu/settings/enable">
6
+ <stylesheet>css/megamenu.css</stylesheet>
7
+ </action>
8
+ </reference>
9
+ <reference name="top.menu" >
10
+ <block type="megamenu/html_topmenu" name="meagemu.topmenu" template="megamenu/topmenu.phtml" ifconfig="megamenu/settings/enable"/>
11
+ </reference>
12
+
13
+ <reference name="catalog.topnav">
14
+ <action method="setTemplate" ifconfig="megamenu/settings/enable">
15
+ <template>route/to/template</template>
16
+ </action>
17
+ </reference>
18
+ </default>
19
+ <!--megamenu_index_index>
20
+ <reference name="content">
21
+ <block type="megamenu/megamenu" name="megamenu" template="megamenu/megamenu.phtml" />
22
+ </reference>
23
+ </megamenu_index_index-->
24
+ </layout>
app/design/frontend/base/default/template/megamenu/topmenu.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if(Mage::helper('megamenu')->isMegamenuModuleEnabled()):
2
+
3
+ $menus = $this->getMenus();
4
+ $backgroundColor = Mage::registry('backgroundColor');
5
+ $fontSize = Mage::registry('fontSize');
6
+ $fontFamily = Mage::registry('fontFamily');
7
+ $fontColor = Mage::registry('fontColor').$fontSize.$fontFamily;
8
+ ?>
9
+ <div class="megamenu nav-container">
10
+ <ul id="nav" style="<?php echo $backgroundColor ?>">
11
+ <?php $menus = $this->getMenus(); ?>
12
+ <?php if(!empty($menus)): $i=1; ?>
13
+ <?php foreach ($menus as $menu) : ?>
14
+ <li class="menu_<?php echo $i++; ?>">
15
+ <?php if($menu['type_id'] == 5): ?>
16
+ <a id="anchor_menu_type_<?php echo $menu['entity_id'];?>"
17
+ class="megamenu-lable" href="" title="<?php echo $menu['titel'];?>"
18
+ style="<?php echo $fontColor; ?>" >
19
+ <?php echo $menu['name'];?>
20
+ </a>
21
+ <?php else: ?>
22
+ <a class="megamenu-lable" href="javascript:void(0)"
23
+ style="<?php echo $fontColor; ?>" title="<?php echo $menu['titel'];?>"
24
+ >
25
+ <?php echo $menu['name'];?>
26
+ </a>
27
+ <?php endif; ?>
28
+ <div class="magestore-megamenu"
29
+ style="<?php echo $backgroundColor.$fontColor ?>">
30
+ <?php echo $template = $this->generateMenu($menu['entity_id'], $menu['template_id']); ?>
31
+ </div>
32
+ </li>
33
+ <?php endforeach; ?>
34
+ <?php endif; ?>
35
+ </ul>
36
+ </div>
37
+ <?php endif; ?>
app/design/frontend/base/default/template/megamenu/topmenu/anchorText.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $targetUrl = $data['target_url'];
4
+ $menuId = $data['entity_id'];
5
+
6
+ ?>
7
+ <script type="text/javascript">
8
+ document.observe("dom:loaded", function() {
9
+ var url = '<?php echo $targetUrl; ?>';
10
+ var menuId = '<?php echo $menuId; ?>';
11
+ $('anchor_menu_type_'+menuId).setAttribute('href', url);
12
+ });
13
+ </script>
14
+
15
+
app/design/frontend/base/default/template/megamenu/topmenu/categories.phtml ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $countCategoriesIds = count($data['categories']);
4
+ $perColumn = round($countCategoriesIds / $data['column_count']);
5
+ $columnSize = (isset($data['column_size']) && !empty($data['column_size'])) ? $data['column_size'] : 100;
6
+ $categoryContentWidth = $data['column_count'] * $columnSize;
7
+ $featureType = $data['feature_type'];
8
+ $buffer = 50; // padding buffer value
9
+
10
+ if ($perColumn <= 0) {
11
+ $perColumn = 1;
12
+ }
13
+ $categoryChunk = array_chunk($data['categories'], $perColumn);
14
+
15
+ $backgroundColor = Mage::registry('backgroundColor');
16
+ $fontSize = Mage::registry('fontSize');
17
+ $fontFamily = Mage::registry('fontFamily');
18
+ $fontColor = Mage::registry('fontColor') . $fontSize . $fontFamily;
19
+ ?>
20
+ <div class="grid-categories-megamenu sub-menu" style="<?php echo $backgroundColor . $fontColor ?>" >
21
+ <h2 id="" class="megamenu-title" >Categories</h2>
22
+ <div class="megamenu-header" ><?php $block = Mage::getModel('cms/block')->load($data['header']); ?><?php echo $block->getContent(); ?></div>
23
+ <ul class="grid-categories">
24
+ <li class="level1-megamenu" >
25
+ <?php foreach ($categoryChunk as $category) { ?>
26
+ <ul >
27
+ <?php foreach ($category as $categoryData) { ?>
28
+ <li>
29
+ <a href="<?php echo $categoryData['path'] ?>"
30
+ style="<?php echo $fontColor; ?>">
31
+ <?php echo $categoryData['name'] ?>
32
+ </a>
33
+ </li>
34
+ <?php } ?>
35
+ </ul>
36
+ <?php } ?>
37
+ </li>
38
+ </ul>
39
+
40
+ <?php if ($featureType == 21 || $featureType == 22): ?>
41
+ <?php if ($featureType == 21): ?>
42
+ <div class="featured_content">
43
+ <h4 id="" class="megamenu-title" ><?php echo $data['feature_category_box_title'] ?></h4>
44
+ <ul >
45
+ <?php foreach ($data['feature_categories'] as $featurecategoryData) { ?>
46
+ <li>
47
+ <a href="<?php echo $featurecategoryData['path']; ?>">
48
+ <?php echo $featurecategoryData['name'] ?>
49
+ </a>
50
+ </li>
51
+ <?php } ?>
52
+ </ul>
53
+ </div>
54
+ <?php endif; ?>
55
+
56
+ <?php if (intval($featureType) == 22): ?>
57
+ <div class="featured_content" >
58
+ <h4 id="" class="megamenu-title" ><?php echo $data['feature_product_box_title'] ?></h4>
59
+ <ul>
60
+ <?php foreach ($data['feature_products'] as $featurproductData) : ?>
61
+
62
+ <li >
63
+ <a href="<?php echo $featurproductData['path']; ?>">
64
+ <h6 class="product_name"><?php echo $featurproductData['name'] ?></h6>
65
+ <div class="product_image"><img src="<?php echo $featurproductData['image'] ?>"/></div>
66
+ <div class="product_price"><?php echo $featurproductData['price'] ?></div>
67
+ </a>
68
+ </li>
69
+ <?php endforeach; ?>
70
+ </ul>
71
+ </div>
72
+ <?php endif; ?>
73
+
74
+ <?php endif; ?>
75
+ <div class="megamenu-footer"><?php $footerblock = Mage::getModel('cms/block')->load($data['footer']); ?>
76
+ <?php echo $footerblock->getContent(); ?>
77
+ </div>
78
+
79
+ </div>
app/design/frontend/base/default/template/megamenu/topmenu/contactus.phtml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $backgroundColor = Mage::registry('backgroundColor');
4
+ $fontSize = Mage::registry('fontSize');
5
+ $fontFamily = Mage::registry('fontFamily');
6
+ $fontColor = Mage::registry('fontColor') . $fontSize . $fontFamily;
7
+ ?>
8
+ <div class="block-megamenu sub-menu" id="menu1" style="<?php echo $backgroundColor . $fontColor ?>">
9
+ <h1 class="megamenu-title">Contact Form</h1>
10
+ <ul class="block-contact">
11
+ <li class="level1-megamenu">
12
+ <div class="megamenu-header">
13
+ <?php $block = Mage::getModel('cms/block')->load($data['header']); ?>
14
+ <?php echo $block->getContent(); ?>
15
+ </div>
16
+ <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('contacts/form.phtml')->toHtml(); ?>
17
+ <div class="footer-megamenu">
18
+ <span>
19
+ <?php $footerblock = Mage::getModel('cms/block')->load($data['footer']); ?>
20
+ <?php echo $footerblock->getContent(); ?>
21
+ </span>
22
+ </div>
23
+ </li>
24
+ </ul>
25
+ </div>
app/design/frontend/base/default/template/megamenu/topmenu/contentText.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $backgroundColor = Mage::registry('backgroundColor');
4
+ $fontSize = Mage::registry('fontSize');
5
+ $fontFamily = Mage::registry('fontFamily');
6
+ $fontColor = Mage::registry('fontColor') . $fontSize . $fontFamily;
7
+ ?>
8
+ <div class="products-megamenu-grid sub-menu" style="<?php echo $backgroundColor . $fontColor ?>" >
9
+ <div class="megamenu-header" >
10
+ <?php $block = Mage::getModel('cms/block')->load($data['header']); ?>
11
+ <?php echo $block->getContent(); ?>
12
+ </div>
13
+ <div class="main_content" >
14
+ <?php
15
+ $helper = Mage::helper('cms');
16
+ $processor = $helper->getPageTemplateProcessor();
17
+ $html = $processor->filter($data['content_container']);
18
+ echo $html;
19
+ ?>
20
+ </div>
21
+ <div id="" class="footer-megamenu">
22
+ <?php $footerblock = Mage::getModel('cms/block')->load($data['footer']); ?>
23
+ <?php echo $footerblock->getContent(); ?>
24
+ </div>
25
+ </div>
26
+
app/design/frontend/base/default/template/megamenu/topmenu/groupMenuItems.phtml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+
4
+ $countCategoriesIds = count($data['categories']);
5
+
6
+ $perColumn = round($countCategoriesIds / $data['column_count']);
7
+ $columnSize = $data['column_size'];
8
+ $categoryContentWidth = $data['column_count'] * $columnSize;
9
+ $featureType = $data['feature_type'];
10
+ $buffer = 50; // padding buffer value
11
+ if ($perColumn <= 0) {
12
+ $perColumn = 1;
13
+ }
14
+
15
+ $backgroundColor = Mage::registry('backgroundColor');
16
+ $fontSize = Mage::registry('fontSize');
17
+ $fontFamily = Mage::registry('fontFamily');
18
+ $fontColor = Mage::registry('fontColor') . $fontSize . $fontFamily;
19
+
20
+ $categoryChunk = array_chunk($data['categories'], $perColumn);
21
+ ?>
22
+ <div class="grid-categories-megamenu sub-menu" style="<?php echo $backgroundColor . $fontColor ?>" >
23
+ <h2 id="" class="megamenu-title">Categories</h2>
24
+ <ul class="grid-categories">
25
+ <div class="megamenu-header" >
26
+ <?php $block = Mage::getModel('cms/block')->load($data['header']); ?>
27
+ <?php echo $block->getContent(); ?></div>
28
+ <li class="level1-megamenu" >
29
+ <?php foreach ($categoryChunk as $category) : ?>
30
+ <ul >
31
+ <?php foreach ($category as $categoryData) : ?>
32
+ <li>
33
+ <a href="<?php echo $categoryData['path'] ?>" style="<?php echo $fontColor; ?>">
34
+ <?php echo $categoryData['name'] ?>
35
+ </a>
36
+ </li>
37
+ <?php endforeach; ?>
38
+ </ul>
39
+ <?php endforeach; ?>
40
+ </li>
41
+
42
+ <div class="megamenu-footer">
43
+ <?php $footerblock = Mage::getModel('cms/block')->load($data['footer']); ?>
44
+ <?php echo $footerblock->getContent(); ?>
45
+ </div>
46
+ </ul>
47
+
48
+ </div>
app/design/frontend/base/default/template/megamenu/topmenu/productsListing.phtml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $countCategoriesIds = count($data['products']);
4
+ $perColumn = round($countCategoriesIds / $data['column_count']);
5
+ $perColumn = ($perColumn <= 0) ? 1 : $perColumn;
6
+ $productChunk = array_chunk($data['products'], $perColumn);
7
+ $backgroundColor = Mage::registry('backgroundColor');
8
+ $fontSize = Mage::registry('fontSize');
9
+ $fontFamily = Mage::registry('fontFamily');
10
+ $fontColor = Mage::registry('fontColor') . $fontSize . $fontFamily;
11
+ ?>
12
+ <div class="products-megamenu-grid sub-menu" style="<?php echo $backgroundColor . $fontColor ?>" >
13
+ <div class="megamenu-header">
14
+ <?php $block = Mage::getModel('cms/block')->load($data['header']); ?>
15
+ <?php echo $block->getContent(); ?>
16
+ </div>
17
+ <?php foreach ($productChunk as $product) : ?>
18
+ <ul class="level0-megamenu">
19
+ <?php foreach ($product as $proData) : ?>
20
+ <li class="item">
21
+ <h1 class="product-name" style="<?php echo $fontColor; ?>">
22
+ <?php echo $proData['name'] ?>
23
+ </h1>
24
+ <a class="product-image" href="<?php echo $proData['path'] ?>">
25
+ <img width="120" height="120" src="<?php echo $proData['image'] ?>" />
26
+ </a>
27
+ <div class="product-shop">
28
+ <div class="price-box">
29
+ <span class="regular-price" id="product-price-16">
30
+ <span class="price" style="<?php echo $fontColor; ?>">
31
+ <?php echo "$" . number_format($proData['price'], 2) ?>
32
+ </span>
33
+ </span>
34
+ </div>
35
+ <button onclick="window.location.href = '<?php echo $proData['path'] ?>'" class="button">
36
+ View Detail
37
+ </button>
38
+ </div>
39
+ </li>
40
+ <?php endforeach; ?>
41
+ </ul>
42
+ <?php endforeach; ?>
43
+
44
+ <div id="" class="footer-megamenu" >
45
+ <?php
46
+ $footerblock = Mage::getModel('cms/block')->load($data['footer']);
47
+ echo $footerblock->getContent();
48
+ ?>
49
+ </div>
50
+ </div>
app/design/frontend/rwd/default/layout/cybage_megamenu.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head" >
5
+ <action method="addCss" ifconfig="megamenu/settings/enable">
6
+ <stylesheet>css/megamenu.css</stylesheet>
7
+ </action>
8
+ </reference>
9
+ <reference name="top.menu" >
10
+ <block type="megamenu/html_topmenu" name="meagemu.topmenu" template="megamenu/topmenu.phtml" ifconfig="megamenu/settings/enable"/>
11
+ </reference>
12
+
13
+ <reference name="catalog.topnav">
14
+ <action method="setTemplate" ifconfig="megamenu/settings/enable">
15
+ <template>route/to/template</template>
16
+ </action>
17
+ </reference>
18
+ </default>
19
+ </layout>
app/design/frontend/rwd/default/template/megamenu/topmenu.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (Mage::helper('megamenu')->isMegamenuModuleEnabled()):
3
+ $menus = $this->getMenus();
4
+ $backgroundColor = Mage::registry('backgroundColor');
5
+ $fontSize = Mage::registry('fontSize');
6
+ $fontFamily = Mage::registry('fontFamily');
7
+ $fontColor = Mage::registry('fontColor') . $fontSize . $fontFamily;
8
+ ?>
9
+ <div class="megamenu nav-container" >
10
+ <ul id="nav" style="<?php echo $backgroundColor . $fontColor ?>">
11
+ <?php
12
+ foreach ($menus as $menu) {
13
+ ?>
14
+ <li>
15
+ <?php if ($menu['type_id'] == 5): ?>
16
+ <a id="anchor_menu_type_<?php echo $menu['entity_id']; ?>"
17
+ class="megamenu-lable" href="" style="<?php echo $fontColor; ?>"
18
+ title="<?php echo $menu['titel'];?>"
19
+ >
20
+ <?php echo $menu['name']; ?>
21
+ </a>
22
+ <?php else: ?>
23
+ <a class="megamenu-lable" href="javascript:void(0)" href=""
24
+ style="<?php echo $fontColor; ?>"
25
+ title="<?php echo $menu['titel'];?>" >
26
+ <?php echo $menu['name']; ?>
27
+ </a>
28
+ <?php endif; ?>
29
+ <div class="magestore-megamenu" style="<?php echo $backgroundColor . $fontColor ?>">
30
+ <?php echo $template = $this->generateMenu($menu['entity_id'], $menu['template_id']); ?>
31
+ </div>
32
+
33
+ </li>
34
+ <?php
35
+ }
36
+ ?>
37
+ </ul>
38
+ </div>
39
+ <?php endif; ?>
40
+ <script>
41
+
42
+ $j('body').on('click','.megamenu-lable',function(){
43
+ $j('.magestore-megamenu').slideUp();
44
+ $j(this).next('.magestore-megamenu').show();
45
+ })
46
+ </script>
47
+ <?php //die(); ?>
app/design/frontend/rwd/default/template/megamenu/topmenu/anchorText.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $targetUrl = $data['target_url'];
4
+ $menuId = $data['entity_id'];
5
+
6
+ ?>
7
+ <script type="text/javascript">
8
+ document.observe("dom:loaded", function() {
9
+ var url = '<?php echo $targetUrl; ?>';
10
+ var menuId = '<?php echo $menuId; ?>';
11
+ $('anchor_menu_type_'+menuId).setAttribute('href', url);
12
+ });
13
+ </script>
14
+
15
+
app/design/frontend/rwd/default/template/megamenu/topmenu/categories.phtml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $countCategoriesIds = count($data['categories']);
4
+ $perColumn = round($countCategoriesIds / $data['column_count']);
5
+ $columnSize = (isset($data['column_size']) && !empty($data['column_size'])) ? $data['column_size'] : 100;
6
+ $categoryContentWidth = $data['column_count'] * $columnSize;
7
+ $featureType = $data['feature_type'];
8
+ $buffer = 50; // padding buffer value
9
+ if ($perColumn <= 0) {
10
+ $perColumn = 1;
11
+ }
12
+ $categoryChunk = array_chunk($data['categories'], $perColumn);
13
+ $fontSize = Mage::registry('fontSize');
14
+ $fontFamily = Mage::registry('fontFamily');
15
+ $fontColor = Mage::registry('fontColor') . $fontSize . $fontFamily;
16
+ ?>
17
+ <div class="grid-categories-megamenu sub-menu" style="">
18
+ <h2 id="" class="megamenu-title" style="">Categories</h2>
19
+
20
+ <div class="megamenu-header" style="">
21
+ <?php $block = Mage::getModel('cms/block')->load($data['header']); ?>
22
+ <?php echo $block->getContent(); ?>
23
+ </div>
24
+
25
+ <div class="grid-categories megamenu-main-content">
26
+ <div class="level1-megamenu" style="">
27
+
28
+ <?php foreach ($categoryChunk as $category): ?>
29
+ <ul style="">
30
+
31
+ <?php foreach ($category as $categoryData): ?>
32
+ <li>
33
+ <a href="<?php echo $categoryData['path'] ?>" style="<?php echo $fontColor; ?>">
34
+ <?php echo $categoryData['name'] ?>
35
+ </a>
36
+ </li>
37
+ <?php endforeach; ?>
38
+ </ul>
39
+ <?php endforeach; ?>
40
+ </div>
41
+ <?php if ($featureType == 21 || $featureType == 22): ?>
42
+ <?php if ($featureType == 21): ?>
43
+ <div class="featured_content" style="">
44
+ <h4 id="" class="megamenu-title" style=""><?php echo $data['feature_category_box_title'] ?></h4>
45
+ <ul style="">
46
+ <?php foreach ($data['feature_categories'] as $featurecategoryData) : ?>
47
+ <li>
48
+ <a href="<?php echo $featurecategoryData['path']; ?>">
49
+ <?php echo $featurecategoryData['name'] ?>
50
+ </a>
51
+ </li>
52
+ <?php endforeach; ?>
53
+ </ul>
54
+ </div>
55
+ <?php endif; ?>
56
+
57
+ <div class="featured_content" style="">
58
+ <h4 id="" class="megamenu-title" style=""><?php echo $data['feature_product_box_title'] ?></h4>
59
+ <ul style="">
60
+ <?php
61
+ $i = 1;
62
+ foreach ($data['feature_products'] as $featurproductData) {
63
+ ?>
64
+ <?php if ($i <= 3): ?>
65
+ <li >
66
+ <a href="<?php echo $featurproductData['path']; ?>">
67
+ <h6 class="product_name"><?php echo $featurproductData['name'] ?></h6>
68
+ <div class="product_image"><img src="<?php echo $featurproductData['image'] ?>"/></div>
69
+ <div class="product_price"><?php echo $featurproductData['price'] ?></div>
70
+ </a>
71
+ </li>
72
+ <?php endif; ?>
73
+ <?php
74
+ $i++;
75
+ }
76
+ ?>
77
+ </ul>
78
+ </div>
79
+ <?php endif; ?>
80
+ </div>
81
+
82
+ <div class="megamenu-footer" style="">
83
+ <?php
84
+ $footerblock = Mage::getModel('cms/block')->load($data['footer']);
85
+ echo $footerblock->getContent();
86
+ ?>
87
+ </div>
88
+
89
+ </div>
app/design/frontend/rwd/default/template/megamenu/topmenu/contactus.phtml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ ?>
4
+ <div class="block-megamenu sub-menu" id="menu1" style="">
5
+ <h1 class="megamenu-title">Contact Form</h1>
6
+
7
+ <div class="megamenu-header">
8
+ <?php $block = Mage::getModel('cms/block')->load($data['header']); ?>
9
+ <?php echo $block->getContent(); ?>
10
+ </div>
11
+ <div class="megamenu-main-content">
12
+ <ul class="block-contact ">
13
+ <li class="level1-megamenu">
14
+
15
+ <?php
16
+ echo $this->getLayout()->createBlock('core/template')
17
+ ->setTemplate('contacts/form.phtml')->toHtml();
18
+ ?>
19
+ </li>
20
+ </ul>
21
+ </div>
22
+
23
+ <div class="megamenu-footer">
24
+ <span>
25
+ <?php $footerblock = Mage::getModel('cms/block')->load($data['footer']); ?>
26
+ <?php echo $footerblock->getContent(); ?>
27
+ </span>
28
+ </div>
29
+ </div>
app/design/frontend/rwd/default/template/megamenu/topmenu/contentText.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $fontSize = Mage::registry('fontSize');
4
+ $fontFamily = Mage::registry('fontFamily');
5
+ $fontColor = Mage::registry('fontColor') . $fontSize . $fontFamily;
6
+ ?>
7
+ <div class="products-megamenu-grid sub-menu" style="">
8
+ <div class="megamenu-header"
9
+ style="">
10
+ <?php $block = Mage::getModel('cms/block')->load($data['header']); ?>
11
+ <?php echo $block->getContent(); ?>
12
+ </div>
13
+ <div class="main_content megamenu-main-content" style="<?php echo $fontColor; ?>" >
14
+ <?php
15
+ $helper = Mage::helper('cms');
16
+ $processor = $helper->getPageTemplateProcessor();
17
+ $html = $processor->filter($data['content_container']);
18
+ echo $html;
19
+ ?>
20
+ </div>
21
+ <div id="" class="megamenu-footer"
22
+ style="">
23
+ <?php $footerblock = Mage::getModel('cms/block')->load($data['footer']); ?>
24
+ <?php echo $footerblock->getContent(); ?>
25
+ </div>
26
+ </div>
app/design/frontend/rwd/default/template/megamenu/topmenu/groupMenuItems.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $countCategoriesIds = count($data['categories']);
4
+ $perColumn = round($countCategoriesIds / $data['column_count']);
5
+ $columnSize = (isset($data['column_size']) && !empty($data['column_size']))?$data['column_size']:100;
6
+ $categoryContentWidth = $data['column_count'] * $columnSize;
7
+ $featureType = $data['feature_type'];
8
+ $buffer = 50 ;
9
+ $featureContentWidth = $featureContentWidth - 50;
10
+ if($perColumn <=0 )
11
+ {
12
+ $perColumn = 1;
13
+ }
14
+ $categoryChunk = array_chunk($data['categories'], $perColumn);
15
+ $fontSize = Mage::registry('fontSize');
16
+ $fontFamily = Mage::registry('fontFamily');
17
+ $fontColor = Mage::registry('fontColor').$fontSize.$fontFamily;
18
+ ?>
19
+ <div class="grid-categories-megamenu sub-menu" style="">
20
+ <h2 id="" class="megamenu-title" style="">Categories</h2>
21
+ <ul class="grid-categories">
22
+ <div class="megamenu-header"
23
+ style="">
24
+ <?php $block = Mage::getModel('cms/block')->load($data['header']); ?>
25
+ <?php echo $block->getContent(); ?>
26
+ </div>
27
+ <li class="level1-megamenu" style="">
28
+ <?php foreach ($categoryChunk as $category): ?>
29
+ <ul style="">
30
+ <?php foreach($category as $categoryData): ?>
31
+ <li>
32
+ <a href="<?php echo $categoryData['path'] ?>" style="<?php echo $fontColor; ?>" >
33
+ <?php echo $categoryData['name'] ?>
34
+ </a>
35
+ </li>
36
+ <?php endforeach; ?>
37
+ </ul>
38
+ <?php endforeach; ?>
39
+ </li>
40
+
41
+ <div class="megamenu-footer"
42
+ style="">
43
+ <?php $footerblock = Mage::getModel('cms/block')->load($data['footer']); ?>
44
+ <?php echo $footerblock->getContent(); ?>
45
+ </div>
46
+ </ul>
47
+ </div>
app/design/frontend/rwd/default/template/megamenu/topmenu/productsListing.phtml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $data = $this->getTemplateData();
3
+ $countCategoriesIds = count($data['products']);
4
+ $perColumn = round($countCategoriesIds / $data['column_count']);
5
+ $perColumn = ($perColumn <= 0) ? 1 : $perColumn;
6
+ $productChunk = array_chunk($data['products'], $perColumn);
7
+ $fontSize = Mage::registry('fontSize');
8
+ $fontFamily = Mage::registry('fontFamily');
9
+ $fontColor = Mage::registry('fontColor') . $fontSize . $fontFamily;
10
+ ?>
11
+ <div class="products-megamenu-grid sub-menu" style="">
12
+ <div class="megamenu-header" style="">
13
+ <?php $block = Mage::getModel('cms/block')->load($data['header']); ?>
14
+ <?php echo $block->getContent(); ?>
15
+ </div>
16
+ <?php foreach ($productChunk as $product): ?>
17
+ <div class="level0-megamenu megamenu-main-content">
18
+ <ul>
19
+ <?php foreach ($product as $proData): ?>
20
+ <li class="item">
21
+ <h1 class="product-name"
22
+ style="<?php echo $fontColor; ?>">
23
+ <?php echo $proData['name'] ?>
24
+ </h1>
25
+
26
+ <a class="product-image" href="<?php echo $proData['path'] ?>">
27
+ <img width="120" src="<?php echo $proData['image'] ?>" />
28
+ </a>
29
+ <div class="product-shop">
30
+ <div class="price-box">
31
+ <span class="regular-price" id="product-price-16">
32
+ <span class="price" style="<?php echo $fontColor; ?>">
33
+ <?php echo "$" . number_format($proData['price'], 2) ?>
34
+ </span>
35
+ </span>
36
+ </div>
37
+ <button onclick="window.location.href = '<?php echo $proData['path'] ?>'" class="button">
38
+ View Detail
39
+ </button>
40
+ </div>
41
+ </li>
42
+ <?php endforeach; ?>
43
+ </ul>
44
+ </div>
45
+ <?php endforeach; ?>
46
+
47
+ <div id="" class="megamenu-footer" style="">
48
+ <?php
49
+ $footerblock = Mage::getModel('cms/block')->load($data['footer']);
50
+ echo $footerblock->getContent();
51
+ ?>
52
+ </div>
53
+ </div>
app/etc/modules/Cybage_Megamenu.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Cybage_Megamenu>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Cybage_Megamenu>
8
+ </modules>
9
+ </config>
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_bars.png ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_bg.gif ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_bg.png ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_boxes.png ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_close.png ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_drop.png ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_palette_raw.png ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_sel_circle.gif ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_sel_circle.png ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_sel_rect.gif ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_sel_rect.png ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_wheel_black.png ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/img/procolor_win_wheel_rgb.jpg ADDED
Binary file
js/megamenu/systemcolorpicker/procolor-1.0/procolor.compressed.js ADDED
@@ -0,0 +1 @@
 
1
+ if(typeof Prototype=="undefined"){alert("ProColor Error: Prototype is not loaded. Please make sure that your page includes prototype.js before it includes procolor.js.")}if(Prototype.Version<"1.6"){alert("ProColor Error: Minimum Prototype 1.6.0 is required; you are using "+Prototype.Version)}Element.addMethods({build:function(a,d,b,c){var f=$(document.createElement(d));$H(b).each(function(e){f[e.key]=e.value});if(c){f.setStyle(c)}a.appendChild(f);return f},isEventIn:function(b,c){var f=b.getDimensions();var e=b.cumulativeOffset();var a=c.pointerX(),g=c.pointerY();return(a>=e.left&&g>=e.top&&a<e.left+f.width&&g<e.top+f.height)}});var MouseCapture=Class.create({initialize:function(){},onEvent:function(a,b){if(b&&a.type!="mouseover"&&a.type!="mouseout"){b(a,a.type)}a.stop()},setCursor:function(a){if(this.div){this.div.setStyle({cursor:a})}},begin:function(c){this.listener=this.onEvent.bindAsEventListener(this,c);Event.observe(document,"mouseup",this.listener);Event.observe(document,"mousemove",this.listener);Event.observe(document,"mousedown",this.listener);Event.observe(document,"mouseover",this.listener);Event.observe(document,"mouseout",this.listener);Event.observe(document,"keyup",this.listener);Event.observe(document,"keydown",this.listener);this.old_body_ondrag=document.body.ondrag;this.old_body_onselectstart=document.body.onselectstart;document.body.ondrag=function(){return false};document.body.onselectstart=function(){return false};var a=Element.extend(document.body);var b=a.getDimensions();this.div=a.build("div",{},{display:"block",position:"absolute",top:"0px",left:"0px",width:b.width+"px",height:b.height+"px",zIndex:999999999,cursor:"default",backgroundColor:"#FFFFFF",opacity:0.0001})},end:function(){this.div.remove();Event.stopObserving(document,"mouseup",this.listener);Event.stopObserving(document,"mousemove",this.listener);Event.stopObserving(document,"mousedown",this.listener);Event.stopObserving(document,"mouseover",this.listener);Event.stopObserving(document,"mouseout",this.listener);Event.stopObserving(document,"keyup",this.listener);Event.stopObserving(document,"keydown",this.listener);document.body.ondrag=this.old_body_ondrag;document.body.onselectstart=this.old_body_onselectstart;delete this.old_body_ondrag;delete this.old_body_onselectstart}});var ProColor=Class.create({palette:["F00C30900633963C63","FC9FC0C93F93F96F60","993CC3FF0FF6FF9FFC","3306639966939C39C6","0F09C99F9CFCCF69F0","3C36960630933C6396","6999CC9FF0FF6FC3C9","36603303936F69F0CF","00666C00F66F99FCCF","C9F90F60C63F30930C","96CC6FC3F90C639306","C9C969C6CF9F909606","F0FF9CC69F39F69F06","F66F99FCC936C36C39"],options:{imgPath:"img/procolor_win_",showInField:true},initialize:function(c){var a=navigator.appVersion.split("MSIE");var d=parseFloat(a[1]);this.old_ie=(d>=5.5&&d<7&&document.body.filters);this.div=null;this.color=null;this.listeners={};this.dblclk={time:0};if(c.parent){this.parent=$(c.parent)}else{this.parent=Element.extend(document.body)}if(c.input){this.input=$(c.input)}else{this.input=null}this.options={mode:"static",width:360,height:192,offsetx:13,offsety:8,input:null,showInField:false,parent:null,closeButton:(c.mode=="popup"),imgPath:"",color:(!this.input?"#FFFFFF":this.input.tagName=="INPUT"?this.input.value:this.input.innerHTML),editbg:"#FFFFFF",edittext:"#4C4C4C",outputFormat:"#{RR}{GG}{BB}",onOpening:null,onOpened:null,onClosing:null,onClosed:null,onCloseButton:null,onChanging:null,onChanged:null,onCancelClick:null,onAcceptClick:null};for(var b in c){this.options[b]=c[b]}if(this.options.onOpening){this.options.onOpening(this,"opening")}this.createDiv();if(this.options.mode=="popup"){this.positionPopup();Event.observe(document,"mousedown",this.closeClickHandler=this.handleCloseClick.bindAsEventListener(this));Event.observe(document,"keypress",this.keyPressHandler=this.handleKeyPress.bindAsEventListener(this))}if(this.options.onOpened){this.options.onOpened(this,"opened")}},positionPopup:function(){var f=this.div.cumulativeOffset(),h=f[0],g=f[1];var c=this.div.getDimensions(),q=c.height,b=c.width;var k=document.viewport.getHeight(),o=document.viewport.getWidth();var n=document.viewport.getScrollOffsets();var p=$(this.input).cumulativeOffset(),d=p[1],m=p[0];var e=$(this.input).getDimensions().height,i=d+e;if(m+b>o-8){m=o-8-b}if(m<8){m=8}var l=(i+q>n.top+k)&&(i-q>n.top);var a=m.toString()+"px";var j=(l?(d-q):(d+e)).toString()+"px";this.div.style.left=a;this.div.style.top=j;this.div.setStyle({visibility:"",display:"block"})},createDiv:function(){var b={display:"block",width:this.options.width+"px",height:this.options.height+"px",backgroundPosition:"0% 0%",backgroundAttachment:"scroll",backgroundRepeat:"no-repeat",backgroundImage:"url("+this.options.imgPath+(this.old_ie?"bg.gif)":"bg.png)"),color:"#BBBBD7",left:0,top:0};if(this.options.mode=="popup"){b.position="absolute";b.display="none";b.visibility="hidden";b.zIndex=999999}else{b.position="relative"}this.div=$(this.parent).build("div",{className:"procolor_box"},b);this.img_palette=this.loadBgImage(this.div,"palette_raw.png",0,1,66,174);this.img_bar_lower=this.loadBgImage(this.div,"bars.png",77,1,20,174,{zIndex:1,opacity:1});this.img_bar_middle=this.loadBgImage(this.div,"bars.png",77,1,20,174,{zIndex:2,opacity:0});this.img_bar_upper=this.loadBgImage(this.div,"bars.png",77,1,20,174,{zIndex:3,opacity:0});this.img_wheel_rgb=this.loadBgImage(this.div,"wheel_rgb.jpg",105,0,176,176,{zIndex:1,opacity:1});this.img_wheel_black=this.loadBgImage(this.div,"wheel_black.png",105,0,176,176,{zIndex:2,opacity:1});this.img_boxes=this.loadBgImage(this.div,"boxes.png",287,25,50,149,{zIndex:1});this.img_bar_dragger=this.createImageButton(this.div,"sel_rect",73+this.options.offsetx,-1+this.options.offsety,24,8,{zIndex:4});this.img_wheel_dragger=this.createImageButton(this.div,"sel_circle",184+this.options.offsetx,79+this.options.offsety,17,17,{zIndex:5});this.listeners.wheel=this.onWheelEvent.bindAsEventListener(this);this.img_wheel_black.observe("mousedown",this.listeners.wheel);this.img_wheel_dragger.observe("mousedown",this.listeners.wheel);this.img_wheel_dragger.observe("keydown",this.listeners.wheel);this.listeners.bar=this.onBarEvent.bindAsEventListener(this);this.img_bar_upper.observe("mousedown",this.listeners.bar);this.img_bar_dragger.observe("mousedown",this.listeners.bar);this.img_bar_dragger.observe("keydown",this.listeners.bar);this.listeners.palette=this.onPaletteEvent.bindAsEventListener(this);this.img_palette.observe("mousedown",this.listeners.palette);this.wheel={left:106+this.options.offsetx,top:1+this.options.offsety,width:174,height:174};this.bar={left:77+this.options.offsetx,top:2+this.options.offsety,width:20,height:172};this.wheelsel={width:17,height:17};this.barsel={width:24,height:8};this.listeners.rgb=this.onNumberBox.bindAsEventListener(this,"rgb",0,255,0);this.r_edit=this.createEdit(this.div,287,25,37,20,this.listeners.rgb);this.g_edit=this.createEdit(this.div,287,47,37,20,this.listeners.rgb);this.b_edit=this.createEdit(this.div,287,69,37,20,this.listeners.rgb);this.listeners.hue=this.onNumberBox.bindAsEventListener(this,"hsb",0,359,360);this.listeners.satbrt=this.onNumberBox.bindAsEventListener(this,"hsb",0,100,0);this.hue_edit=this.createEdit(this.div,287,110,37,20,this.listeners.hue);this.sat_edit=this.createEdit(this.div,287,132,37,20,this.listeners.satbrt);this.brt_edit=this.createEdit(this.div,287,154,37,20,this.listeners.satbrt);if(this.options.closeButton){this.img_close=this.createImageButton(this.div,"close",this.options.width-40,0,24,16);this.listeners.close=this.onCloseEvent.bindAsEventListener(this);this.img_close.observe("mouseover",this.listeners.close);this.img_close.observe("mouseout",this.listeners.close);this.img_close.observe("mousedown",this.listeners.close);this.img_close.observe("keydown",this.listeners.close);this.img_close.trackingMouse=false}if(this.input&&this.input.tagName=="INPUT"){this.listeners.input=this.onInput.bindAsEventListener(this);this.input.observe("keyup",this.listeners.input);this.input.observe("focus",this.listeners.input);this.input.observe("blur",this.listeners.input)}else{this.listeners.input=null}var a=this.decodeHexColor(this.options.color);if(!a){a={r:0,g:0,b:0}}this.update("rgb",a,[])},loadBgImage:function(k,d,g,f,j,c,e){var a={display:"block",position:"absolute",width:j+"px",height:c+"px",left:g+this.options.offsetx+"px",top:f+this.options.offsety+"px",padding:"0",backgroundImage:"url("+this.options.imgPath+d+")"};if(e){for(var b in e){a[b]=e[b]}}return k.build("div",{},a)},createImageButton:function(l,e,j,g,k,d,f){var a={display:"block",position:"absolute",width:k+"px",height:d+"px",left:j+"px",top:g+"px",border:"0",cursor:"default",padding:"0",fontSize:"1px",backgroundImage:"url("+this.options.imgPath+e+(this.old_ie?".gif)":".png)")};if(f){for(var c in f){a[c]=f[c]}}var b=l.build("a",{href:"#"},a);return b},createEdit:function(c,a,i,b,f,g){a+=5;b-=9;i+=2;f-=6;var e={display:"inline",position:"absolute",width:b+"px",height:f+"px",left:a+this.options.offsetx+"px",top:i+this.options.offsety+"px",verticalAlign:"top",backgroundColor:this.options.editbg,padding:"0",color:this.options.edittext,fontFamily:"Verdana,Tahoma,Arial,sans-serif,sans serif,sans",fontSize:"12px",fontStyle:"Normal",fontVariant:"Normal",fontWeight:"Normal",textAlign:"right",direction:"ltr",border:0,zIndex:10};var d=c.build("input",{type:"text",value:"0",maxLength:3},e);d.observe("keypress",g);d.observe("keyup",g);d.observe("focus",g);d.observe("blur",g);return d},close:function(){if(!this.div){return false}if(this.options.onClosing){this.options.onClosing(this,"closing")}if(this.options.closeButton){Event.stopObserving(this.img_close)}Event.stopObserving(this.r_edit);Event.stopObserving(this.g_edit);Event.stopObserving(this.b_edit);Event.stopObserving(this.hue_edit);Event.stopObserving(this.sat_edit);Event.stopObserving(this.brt_edit);Event.stopObserving(this.img_wheel_black);Event.stopObserving(this.img_bar_upper);Event.stopObserving(this.img_palette);Event.stopObserving(this.img_wheel_dragger);Event.stopObserving(this.img_bar_dragger);if(this.listeners.input){Event.stopObserving(this.input,"keyup",this.listeners.input);Event.stopObserving(this.input,"focus",this.listeners.input);Event.stopObserving(this.input,"blur",this.listeners.input)}Event.stopObserving(document,"mousedown",this.closeClickHandler);Event.stopObserving(document,"keypress",this.keyPressHandler);this.div.remove();this.div=null;this.listeners={};this.dblclk={};if(this.input.type!="hidden"&&!this.input.disabled){this.input.focus()}if(this.options.onClosed){this.options.onClosed(this,"closed")}},updateState:{},updateTimeout:false,queuedUpdate:function(d,a,c){if(!Prototype.Browser.IE){this.update(d,a,c)}else{var b=this;b.updateState={mode:d,color:a,sources:c};if(b.updateTimeout==false){b.updateTimeout=setTimeout(function(){b.updateTimeout=false;b.update(b.updateState.mode,b.updateState.color,b.updateState.sources)},25)}}},finalUpdate:function(){if(this.updateTimeout){clearTimeout(this.updateTimeout);this.updateTimeout=false;this.update(this.updateState.mode,this.updateState.color,this.updateState.sources);this.updateState={}}},update:function(i,f,l){if(typeof(f)!="object"){f={r:0,g:0,b:0,hue:0,sat:0,brt:0}}f.r=this.toNumber(f.r);f.g=this.toNumber(f.g);f.b=this.toNumber(f.b);f.hue=this.toNumber(f.hue);f.sat=this.toNumber(f.sat);f.brt=this.toNumber(f.brt);var k,e;if(i=="rgb"){k=f;e=this.RGBtoHSB(k)}else{if(i=="hsb"){e=f;k=this.HSBtoRGB(e)}}if(k.r<0){k.r=0}if(k.r>255){k.r=255}if(k.g<0){k.g=0}if(k.g>255){k.g=255}if(k.b<0){k.b=0}if(k.b>255){k.b=255}e.hue=e.hue%360;if(e.hue<0){e.hue+=360}if(e.sat<0){e.sat=0}if(e.sat>100){e.sat=100}if(e.brt<0){e.brt=0}if(e.brt>100){e.brt=100}source={};l.each(function(c){source[c]=true});var r=this;if(!source.wheel){var a=e.brt/100;if(a>0.9999){a=0.9999}r.img_wheel_black.setOpacity(1-a);var b=((e.hue+270)%360)*(Math.PI*2/360);var j=Math.cos(b);var u=Math.sin(b);var p=Math.floor(j*e.sat*r.wheel.width/200+0.5)+r.wheel.left+((r.wheel.width-4)/2)+2;var m=Math.floor(u*e.sat*r.wheel.height/200+0.5)+r.wheel.top+((r.wheel.height-4)/2)+2;r.img_wheel_dragger.setStyle({left:p-Math.floor(r.wheelsel.width/2)+"px",top:m-Math.floor(r.wheelsel.height/2)+"px"})}if(!source.bar){var g=Math.floor(e.hue/60);var h=(g+1)%6;r.img_bar_lower.setStyle({backgroundPosition:(-g*20-20)+"px 0px"});r.img_bar_middle.setStyle({backgroundPosition:(-h*20-20)+"px 0px"});r.img_bar_middle.setOpacity((e.hue-g*60)/60);var a=(100-e.sat)/100;if(a<0.0001){a=0.0001}r.img_bar_upper.setOpacity(a);r.img_bar_dragger.setStyle({top:r.bar.top-Math.floor(r.barsel.height/2)+Math.floor((100-e.brt)*r.bar.height/100+0.5)+"px",left:r.bar.left+Math.floor(r.bar.width-r.barsel.width)/2+"px"})}k.r=Math.floor(k.r+0.5);k.g=Math.floor(k.g+0.5);k.b=Math.floor(k.b+0.5);e.hue=Math.floor(e.hue+0.5);e.sat=Math.floor(e.sat+0.5);e.brt=Math.floor(e.brt+0.5);e.hue=e.hue%360;this.color="#"+(k.r.toColorPart()+k.g.toColorPart()+k.b.toColorPart()).toUpperCase();if(!source.rgb){this.r_edit.value=k.r;this.g_edit.value=k.g;this.b_edit.value=k.b}if(!source.hsb){this.hue_edit.value=e.hue;this.sat_edit.value=e.sat;this.brt_edit.value=e.brt}if(this.options.input){var n=$(this.options.input);if(!source.input){var q=this.internalFormatOutput(k,e,this.options.outputFormat);if(n.tagName=="INPUT"){n.value=q}else{n.innerHTML=q}}if(this.options.showInField){var d=this.computeTextColor(k);n.setStyle({backgroundColor:this.color,color:"#"+d.r.toColorPart()+d.g.toColorPart()+d.b.toColorPart()})}}},toNumber:function(a){switch(typeof a){case"number":return a;case"string":if(matches=/^[^0-9.+-]*([+-]?(?:[0-9]*\.[0-9]+|[0-9]+(?:\.[0-9]*)?))(?:[^0-9]|$)/.exec(a)){return Number(matches[1])}else{return 0}case"boolean":return a?1:0;case"object":return a?1:0;case"function":return 1;default:case"undefined":return 0}},formatOutput:function(a,c){if(!c){c="#{RR}{GG}{BB}"}var b=this.decodeHexColor(a);if(!b){b={r:0,g:0,b:0}}return this.internalFormatOutput(b,this.RGBtoHSB(b),c)},internalFormatOutput:function(c,b,e){var a=e.match(/(\{\w+\}|[^{]+)/g);var d="";a.each(function(f){var g;switch(f){case"{RR}":g=c.r.toColorPart().toUpperCase();break;case"{GG}":g=c.g.toColorPart().toUpperCase();break;case"{BB}":g=c.b.toColorPart().toUpperCase();break;case"{rr}":g=c.r.toColorPart().toLowerCase();break;case"{gg}":g=c.g.toColorPart().toLowerCase();break;case"{bb}":g=c.b.toColorPart().toLowerCase();break;case"{R}":g=this.halfColorPart(c.r).toUpperCase();break;case"{G}":g=this.halfColorPart(c.g).toUpperCase();break;case"{B}":g=this.halfColorPart(c.b).toUpperCase();break;case"{r}":g=this.halfColorPart(c.r).toLowerCase();break;case"{g}":g=this.halfColorPart(c.g).toLowerCase();break;case"{b}":g=this.halfColorPart(c.b).toLowerCase();break;case"{red}":g=c.r.toString();break;case"{grn}":g=c.g.toString();break;case"{blu}":g=c.b.toString();break;case"{hue}":g=b.hue.toString();break;case"{sat}":g=b.sat.toString();break;case"{brt}":g=b.brt.toString();break;default:g=f;break}d+=g});return d},halfColorPart:function(a){return Math.floor((a+8)/17).toString(16)},decodeHexColor:function(c){var f;if(f=/^[^0-9A-Fa-f]*([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{0,2})(?:[^0-9A-Fa-f]|$)/.exec(c)){return{r:parseInt(f[1],16),g:parseInt(f[2],16),b:parseInt(f[3],16)}}if(f=/^[^0-9A-Fa-f]*([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f])(?:[^0-9A-Fa-f]|$)/.exec(c)){var a=parseInt(f[3],16);return{r:parseInt(f[1],16),g:parseInt(f[2],16),b:a*16+a}}if(f=/^[^0-9A-Fa-f]*([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})(?:[^0-9A-Fa-f]|$)/.exec(c)){var e=parseInt(f[2],16);return{r:parseInt(f[1],16),g:e,b:e}}if(f=/^[^0-9A-Fa-f]*([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]{0,2})(?:[^0-9A-Fa-f]|$)/.exec(c)){var d=parseInt(f[1],16);var e=parseInt(f[2],16);var a=parseInt(f[3],16);return{r:d*16+d,g:e*16+e,b:a*16+a}}if(f=/^[^0-9A-Fa-f]*([0-9A-Fa-f]{2})(?:[^0-9A-Fa-f]|$)/.exec(c)){var e=parseInt(f[1],16);return{r:e,g:e,b:e}}if(f=/^[^0-9A-Fa-f]*([0-9A-Fa-f])(?:[^0-9A-Fa-f]|$)/.exec(c)){var e=parseInt(f[1],16);e=e*16+e;return{r:e,g:e,b:e}}return false},trueBrightness:function(a){return(a.r/255*0.3)+(a.g/255*0.59)+(a.b/255*0.11)},computeTextColor:function(c){var d=this.trueBrightness(c);if(d<0.5){var a=Math.floor(d*20)+3;var b=255*(a-1)}else{var a=Math.floor((1-d)*20)+3;var b=0}return{r:Math.floor((c.r+b)/a),g:Math.floor((c.g+b)/a),b:Math.floor((c.b+b)/a)}},RGBtoHSB:function(f){var a=Math.floor(this.toNumber(f.r)+0.5);var e=Math.floor(this.toNumber(f.g)+0.5);var j=Math.floor(this.toNumber(f.b)+0.5);if(a<0){a=0}if(a>255){a=255}if(e<0){e=0}if(e>255){e=255}if(j<0){j=0}if(j>255){j=255}var i,m,k,c;var d=a,n=e,l=j;if(a>e){if(a>j){l=i=a,c=0,k=e-j}else{l=i=j,c=240,k=a-e}m=i-((e<j)?e:j)}else{if(e>j){l=i=e,c=120,k=j-a}else{l=i=j,c=240,k=a-e}m=i-((a<j)?a:j)}if(i!=0){n=Math.floor((m*100)/i+0.5)}else{n=0}if(n!=0){d=(c+Math.floor(k*120/(m*2)+0.5))%360;if(d<0){d+=360}}else{d=0}l=Math.floor(l*100/255+0.5);return{hue:d,sat:n,brt:l}},HSBtoRGB:function(d){var j=this.toNumber(d.brt);if(j<0){j=0}if(j>100){j=100}j=j*255/100;var l=this.toNumber(d.sat);if(l<=0){j=Math.floor(j+0.5);return{r:j,g:j,b:j}}if(l>100){l=100}var e=this.toNumber(d.hue);e=e%360;if(e<0){e+=360}var k=j*l/100;var c=(k*((e*256/60)%256))/256;var a,f,i;switch(Math.floor(e/60)){case 0:a=j;f=j-k+c;i=j-k;break;case 1:a=j-c;f=j;i=j-k;break;case 2:a=j-k;f=j;i=j-k+c;break;case 3:a=j-k;f=j-c;i=j;break;case 4:a=j-k+c;f=j-k;i=j;break;case 5:a=j;f=j-k;i=j-c;break}a=Math.floor(a+0.5);f=Math.floor(f+0.5);i=Math.floor(i+0.5);if(a<0){a=0}if(a>255){a=255}if(f<0){f=0}if(f>255){f=255}if(i<0){i=0}if(i>255){i=255}return{r:a,g:f,b:i}},acceptAndClose:function(){if(this.options.onAcceptClick){this.options.onAcceptClick(this,"acceptclick")}if(this.options.mode=="popup"){this.close()}},cancelAndClose:function(){if(this.options.onCancelClick){this.options.onCancelClick(this,"cancelclick")}if(this.options.mode=="popup"){this.close()}},closeOnDoubleClick:function(d){var a=d.pointerX(),f=d.pointerY();var b=new Date;var c=b.getTime();if(Math.abs(this.dblclk.x-a)<3&&Math.abs(this.dblclk.y-f)<3&&c-this.dblclk.time<=500){this.dblclk.time=0;this.acceptAndClose();return true}else{this.dblclk.x=a;this.dblclk.y=f;this.dblclk.time=c;return false}},brtFromPoint:function(a,e){var c=this.img_bar_upper.getDimensions();var b=this.img_bar_upper.cumulativeOffset();if(e<b.top){return 100}else{if(e>=b.top+c.height){return 0}else{return((b.top+c.height-1-e)*100/c.height)}}},hueSatFromPoint:function(a,i){var h=this.img_wheel_rgb.getDimensions();var g=this.img_wheel_rgb.cumulativeOffset();var b=(i-(g.top+h.height/2))/((h.height-4)/2);var f=(a-(g.left+h.width/2))/((h.width-4)/2);var e=Math.sqrt(b*b+f*f)*100+0.5;var c=Math.atan2(b,f)*180/Math.PI+90;if(e<=0){c=e=0}if(e>100){e=100}if(c<0){c+=360}return{sat:e,hue:c}},colorFromPalette:function(c,j){var i=this.img_palette.getDimensions();var h=this.img_palette.cumulativeOffset();if(c<h.left||c>=h.left+i.width){return false}c=Math.floor((c-h.left)/11);if(j>=h.top&&j<h.top+12){line="000333666999CCCFFF"}else{if(j>h.top+20&&j<h.top+20+this.palette.length*11){line=this.palette[Math.floor((j-(h.top+20))/11)]}else{return false}}var f=parseInt(line.substr(c*3,1),16);var e=parseInt(line.substr(c*3+1,1),16);var a=parseInt(line.substr(c*3+2,1),16);return{r:f*16+f,g:e*16+e,b:a*16+a}},updateByMode:function(a){this.update(a,{r:this.r_edit.value,g:this.g_edit.value,b:this.b_edit.value,hue:this.hue_edit.value,sat:this.sat_edit.value,brt:this.brt_edit.value},[a])},onCloseEvent:function(c){switch(c.type){case"keydown":switch(c.keyCode){case Event.KEY_RETURN:case 32:if(this.options.onCloseButton){if(!this.options.onCloseButton(this,"closebutton")){break}}if(this.options.mode=="popup"){this.close()}break}break;case"mouseover":if(!this.img_close.trackingMouse){this.img_close.setStyle({backgroundPosition:"0px -16px"})}break;case"mouseout":if(!this.img_close.trackingMouse){this.img_close.setStyle({backgroundPosition:"0px 0px"})}break;case"mousedown":this.img_close.trackingMouse=true;this.img_close.setStyle({backgroundPosition:"0px -32px"});c.stop();if(this.img_close.focus){this.img_close.focus()}var b=true;var a=new MouseCapture;a.setCursor("default");a.begin((function(e,d){switch(d){case"mouseup":case"keyup":a.end();this.img_close.trackingMouse=false;if(!b){this.img_close.setStyle({backgroundPosition:"0px 0px"})}else{this.img_close.setStyle({backgroundPosition:"0px -16px"});if(this.options.onCloseButton){if(!this.options.onCloseButton(this,"closebutton")){break}}if(this.options.mode=="popup"){this.close()}}break;case"mousemove":b=(this.img_close.getStyle("backgroundPosition")=="0px -32px");if(this.img_close.isEventIn(e)!=b){b=!b;if(!b){this.img_close.setStyle({backgroundPosition:"0px 0px"})}else{this.img_close.setStyle({backgroundPosition:"0px -32px"})}}break}}).bind(this));break}},onBarEvent:function(h){switch(h.type){case"keydown":var d=this;var g=this.toNumber(d.brt_edit.value),f=g;var c=h.shiftKey||h.ctrlKey||h.altKey;switch(h.keyCode){case Event.KEY_UP:g+=c?10:1;h.stop();break;case Event.KEY_DOWN:g-=c?10:1;h.stop();break;case Event.KEY_PAGEUP:g+=c?25:10;h.stop();break;case Event.KEY_PAGEDOWN:g-=c?25:10;h.stop();break;case Event.KEY_HOME:g=100;h.stop();break;case Event.KEY_END:g=0;h.stop();break}if(g<0){g=0}if(g>100){g=100}if(d.options.onChanging&&(f!=g)){d.options.onChanging(d,"changing")}d.update("hsb",{hue:d.hue_edit.value,sat:d.sat_edit.value,brt:g},[]);if(d.options.onChanged&&(f!=g)){d.options.onChanged(d,"changed")}break;case"mousedown":h.stop();var d=this;d.oldcolor=d.color;if(d.img_bar_dragger.focus){d.img_bar_dragger.focus()}var b=function(j){var i={hue:d.hue_edit.value,sat:d.sat_edit.value,brt:d.brtFromPoint(j.pointerX(),j.pointerY())};d.queuedUpdate("hsb",i,[]);if(d.options.onChanging){d.options.onChanging(d,"changing")}};b(h);if(this.closeOnDoubleClick(h)){break}var a=new MouseCapture;a.setCursor("default");a.begin(function(i,e){switch(e){case"mouseup":case"keyup":a.end();d.finalUpdate();if(d.options.onChanged&&d.oldcolor!=d.color){d.options.onChanged(d,"changed")}break;case"mousemove":b(i);break}});break}},onWheelEvent:function(f){switch(f.type){case"keydown":var i=this;var d=this.toNumber(i.hue_edit.value),g=d;var b=this.toNumber(i.sat_edit.value),j=b;var a=f.shiftKey||f.ctrlKey||f.altKey;switch(f.keyCode){case Event.KEY_UP:b+=a?10:1;f.stop();break;case Event.KEY_DOWN:b-=a?10:1;f.stop();break;case Event.KEY_LEFT:d-=a?10:1;f.stop();break;case Event.KEY_RIGHT:d+=a?10:1;f.stop();break;case Event.KEY_PAGEUP:b+=a?25:10;f.stop();break;case Event.KEY_PAGEDOWN:b-=a?25:10;f.stop();break;case Event.KEY_HOME:b=100;f.stop();break;case Event.KEY_END:b=0;f.stop();break}if(b<0){b=0}if(b>100){b=100}d=d%360;if(d<0){d+=360}if(i.options.onChanging&&(g!=d||j!=b)){i.options.onChanging(i,"changing")}i.update("hsb",{hue:d,sat:b,brt:i.brt_edit.value},[]);if(i.options.onChanged&&(g!=d||j!=b)){i.options.onChanged(i,"changed")}break;case"mousedown":f.stop();var i=this;i.oldcolor=i.color;if(i.img_wheel_dragger.focus){i.img_wheel_dragger.focus()}var c=function(l){var k=i.hueSatFromPoint(l.pointerX(),l.pointerY());k.brt=i.brt_edit.value;i.queuedUpdate("hsb",k,[]);if(i.options.onChanging){i.options.onChanging(i,"changing")}};c(f);if(this.closeOnDoubleClick(f)){break}var h=new MouseCapture;h.setCursor("default");h.begin(function(k,e){switch(e){case"mouseup":case"keyup":h.end();i.finalUpdate();if(i.options.onChanged&&i.oldcolor!=i.color){i.options.onChanged(i,"changed")}break;case"mousemove":c(k);break}});break}},onPaletteEvent:function(d){switch(d.type){case"mousedown":var c=this;c.oldcolor=c.color;if(c.img_palette.focus){c.img_palette.focus()}var b=function(g){var f=c.colorFromPalette(g.pointerX(),g.pointerY());if(f){c.queuedUpdate("rgb",f,[])}if(c.options.onChanging){c.options.onChanging(c,"changing")}return f};if(!b(d)){break}d.stop();if(this.closeOnDoubleClick(d)){break}var a=new MouseCapture;a.setCursor("default");a.begin(function(f,e){switch(e){case"mouseup":case"keyup":a.end();c.finalUpdate();if(c.options.onChanged&&c.oldcolor!=c.color){c.options.onChanged(c,"changed")}break;case"mousemove":b(f);break}});break}},onNumberBox:function(f,g,e,a,d){var c=Event.element(f);switch(f.type){case"keypress":if(!f||f.ctrlKey||f.altKey){f.stop()}else{if((f.charCode>=48&&f.charCode<=57)||(f.keyCode>=48&&f.keyCode<=57)){}else{if(f.keyCode>0&&f.keyCode<48){}else{f.stop()}}}break;case"keyup":if(f.keyCode!=Event.KEY_TAB){this.updateByMode(g);if(this.options.onChanging){this.options.onChanging(this,"changing")}}if(f.keyCode==Event.KEY_RETURN){this.acceptAndClose();f.stop()}if(f.keyCode==Event.KEY_ESC){this.cancelAndClose();f.stop()}break;case"focus":this.oldcolor=this.color;break;case"blur":var b=this.toNumber(c.value);if(b<e||b>a){if(d){b%=d;if(b<0){b+=d}}else{if(b<e){b=e}else{b=a}}c.value=b;this.updateByMode(g)}if(this.options.onChanged&&this.oldcolor!=this.color){this.options.onChanged(this,"changed")}break}},onInput:function(b){switch(b.type){case"keyup":if(b.keyCode!=Event.KEY_TAB){this.update("rgb",this.decodeHexColor(this.input.value),["input"]);if(this.options.onChanging){this.options.onChanging(this,"changing")}}if(b.keyCode==Event.KEY_RETURN){this.acceptAndClose();b.stop()}if(b.keyCode==Event.KEY_ESC){this.cancelAndClose();b.stop()}break;case"focus":this.oldcolor=this.color;break;case"blur":var a=this.decodeHexColor(this.input.value);this.update("rgb",a,[]);if(this.oldcolor!=this.color){this.input.value=this.internalFormatOutput(a,this.RGBtoHSB(a),this.options.outputFormat);if(this.options.onChanged){this.options.onChanged(this,"changed")}}break}},handleCloseClick:function(b){var a=$(Event.element(b));if(a==this.div||a.descendantOf(this.div)){return}if(a==this.input||a.descendantOf(this.input)){return}this.cancelAndClose()},handleKeyPress:function(a){if(a.keyCode==Event.KEY_ESC){this.cancelAndClose()}},attachButton:function(f,d){f=$(f);if(!f){return}var g;if(d.imgPath){g=d.imgPath}else{g=""}var c=$(document.createElement("a"));c.setStyle({display:"inline-block",visibility:"visible",border:"0px",textDecoration:"none",verticalAlign:"bottom",width:"40px",height:"24px",padding:"0px",marginLeft:"2px",backgroundImage:"url("+g+"drop.png)",backgroundPosition:"0px 0px",backgroundRepeat:"no-repeat",cursor:"default"});c.href="#";for(var a in this.buttonMembers){c[a]=this.buttonMembers[a]}var b=d.color;c.buttonHandler=c.eventHandler.bindAsEventListener(c);c.options=Object.clone(d);c.options.input=f;c.options.pc=this;delete c.options.color;if(!c.options.outputFormat){c.options.outputFormat="#{RR}{GG}{BB}"}Event.observe(c,"click",c.buttonHandler);Event.observe(c,"mouseover",c.buttonHandler);Event.observe(c,"mouseout",c.buttonHandler);Event.observe(c,"mousedown",c.buttonHandler);Event.observe(c,"mouseup",c.buttonHandler);Event.observe(c,"keydown",c.buttonHandler);Event.observe(c,"keyup",c.buttonHandler);if(f.nextSibling){f.parentNode.insertBefore(c,f.nextSibling)}else{f.parentNode.appendChild(c)}c.inputHandler=c.onInput.bindAsEventListener(c);c.observeInput();if(b){f.value=b}c.colorSync(true);return c},buttonMembers:{pressed:false,hovered:false,inputHandler:false,options:{},setImg:function(a){this.setStyle({backgroundPosition:"0px "+(a*-24)+"px"})},observeInput:function(){Event.observe(this.options.input,"keyup",this.inputHandler);Event.observe(this.options.input,"focus",this.inputHandler);Event.observe(this.options.input,"blur",this.inputHandler)},stopObservingInput:function(){Event.stopObserving(this.options.input,"keyup",this.inputHandler);Event.stopObserving(this.options.input,"focus",this.inputHandler);Event.stopObserving(this.options.input,"blur",this.inputHandler)},toggle:function(){if(this.pressed){this.setImg(this.hovered?1:0);this.pressed=false;if(this.popup){this.popup.close();this.popup=null}this.observeInput()}else{var a=this;this.setImg(2);this.pressed=true;this.stopObservingInput();this.popup=new ProColor(Object.extend(Object.clone(this.options),{mode:"popup",closeButton:true,onClosed:function(c,b){a.popup=null;a.setImg(this.hovered?1:0);a.pressed=false;a.observeInput();if(a.options.onClosed){a.options.onClosed(c,b)}},parent:null}))}},colorSync:function(d){var c=this.options.pc.decodeHexColor(this.options.input.value);if(c){if(this.options.showInField){var a=this.options.pc.computeTextColor(c);this.options.input.setStyle({backgroundColor:"#"+c.r.toColorPart()+c.g.toColorPart()+c.b.toColorPart(),color:"#"+a.r.toColorPart()+a.g.toColorPart()+a.b.toColorPart()})}var b=this.options.pc.internalFormatOutput(c,this.options.pc.RGBtoHSB(c),this.options.outputFormat);if(b!=this.options.input.value&&this.options.onChanging){this.options.onChanging(this.options.input,"changing")}if(d){if(b!=this.options.input.value){this.options.input.value=b;if(this.options.onChanged){this.options.onChanged(this.options.input,"changed")}}}}},onInput:function(a){switch(a.type){case"keyup":if(a.keyCode!=Event.KEY_TAB&&this.options.showInField){this.colorSync(false)}break;case"focus":case"blur":this.colorSync(true);break}},eventHandler:function(b){switch(b.type){case"click":b.stop();break;case"keydown":switch(b.keyCode){case Event.KEY_RETURN:case 32:this.toggle();b.stop();break}break;case"keyup":break;case"mousedown":this.focus();var a=this;setTimeout(function(){a.toggle()},20);break;case"mouseup":break;case"mouseover":if(this.pressed){this.setImg(2)}else{this.setImg(1)}this.hovered=true;break;case"mouseout":if(this.pressed){this.setImg(2)}else{this.setImg(0)}this.hovered=false;break}}}});Event.observe(window,"load",function(){$$("input.procolor").each(function(a){ProColor.prototype.attachButton(a,ProColor.prototype.options)})});
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Cybage_Megamenu</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Administrator can use the Megamenu plug-in for Navigation Menu Management at Magento store. For example, you can list category, product,contact us and link in main menu .</summary>
10
+ <description>Administrator can use the Megamenu plug-in for Navigation Menu Management at Magento store. For example, you can list category, product,contact us and link in main menu .</description>
11
+ <notes>After installation of the Megamenu plug-in, please clear the cache.</notes>
12
+ <authors><author><name>Cybage Software Pvt. Ltd.</name><user>cybage</user><email>Support_Magento@cybage.com</email></author></authors>
13
+ <date>2015-07-02</date>
14
+ <time>07:18:18</time>
15
+ <contents><target name="magecommunity"><dir name="Cybage"><dir name="Megamenu"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Category"><dir name="Checkboxes"><file name="Tree.php" hash="5413d09035cdbbc80022bd3e638b6810"/></dir></dir></dir><file name="Category.php" hash="86bd1d4367f730b55bf4c289a09cacdd"/><dir name="Megamenu"><dir name="Edit"><file name="Content.php" hash="3c3aea5cdaf88a4b5b998cc3ea414867"/><file name="Form.php" hash="ae07635e27833c91ee07d49c923880cb"/><dir name="Tab"><file name="Content.php" hash="d9878c2d160dbde5ae396489929571a9"/><file name="Form.php" hash="9da0d6feb21a12a9a6110572d0be7ab3"/></dir><file name="Tabs.php" hash="e22ec91f128e87f919f7f8f6b770cce8"/></dir><file name="Edit.php" hash="22ad5144120be9ce9c40f3eb4b58e56e"/><file name="Grid.php" hash="728ecd0c57420eaa0b10d92afea92c3e"/><dir name="Promo"><dir name="Widget"><dir name="Chooser"><file name="Sku.php" hash="93664f12a840a4faa01c4a8585d1eb93"/></dir></dir></dir></dir><file name="Megamenu.php" hash="5912819a204ff41e23c5a09c464d1b49"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Colorpicker.php" hash="406d4185812d13e48fc635dfc38932c4"/></dir></dir></dir></dir></dir><dir name="Html"><file name="Topmenu.php" hash="d449b4e08dea9f0bd007ea71257be10c"/></dir><file name="Megamenu.php" hash="10ebe1ddb11c3a6578cb8b1379e47cfd"/></dir><dir name="Helper"><file name="Data.php" hash="8ce531a65b203fcaf4e8e0e8ca50c092"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Source"><file name="Columnsize.php" hash="b8f9823da763a5c740676feaee6b1291"/><file name="Contentsize.php" hash="b91bbd1b6095891c2a4b1664a8441dd5"/><file name="Fontsize.php" hash="09acd468ea7882f48e9e47e852fdd3c4"/></dir></dir><file name="Attributes.php" hash="73be68981dc9353d5f7e3b0b997b6d9a"/><file name="Megamenu.php" hash="e2d4583335422a080bdcc7a75c0d06dc"/><file name="Menuattributes.php" hash="ebabcf3ea8fb6c0b0da56cf607a85260"/><file name="Menuattributevalues.php" hash="22b0d217985fc12c023d6752ccff3320"/><file name="Menutemplate.php" hash="1e096cbf5baac2dcdce9fd2a6f162411"/><file name="Menutype.php" hash="3e440228cc82321adafe4faa39096468"/><file name="Observer.php" hash="af034877235f6b626cd81bbc5df9fc42"/><dir name="Resource"><dir name="Attributes"><file name="Collection.php" hash="f43ae7872690a31743070cefa1b55655"/></dir><file name="Attributes.php" hash="7eb3dc1ee46e2a03f87dc2f0c1cccd96"/><dir name="Megamenu"><file name="Collection.php" hash="9afdbde6f074def8acb03b3e3c4c5002"/></dir><file name="Megamenu.php" hash="439b37988c8f9d344c371963c3bb6854"/><dir name="Menuattributes"><file name="Collection.php" hash="cc3ce5f1e2d313318e8b8c194ea50dff"/></dir><file name="Menuattributes.php" hash="6963249cd1042e765f091de0343b6f1f"/><dir name="Menuattributevalues"><file name="Collection.php" hash="3798bb20bf81b04db3f4411dda9a4370"/></dir><file name="Menuattributevalues.php" hash="c63ca4256b31dabb61583f0636e47b89"/><dir name="Menutemplate"><file name="Collection.php" hash="111ed52a8b63e7e4c6ac9a1ebefd62e4"/></dir><file name="Menutemplate.php" hash="89adb72c89891b7f253f581571803e61"/><dir name="Menutype"><file name="Collection.php" hash="9dbc9839b54e3fdb790477b3e31d7388"/></dir><file name="Menutype.php" hash="a87f6e4d62405b62305b23c28e30b558"/><dir name="Stores"><file name="Collection.php" hash="b87b9f383c43742da991572129b6385e"/></dir><file name="Stores.php" hash="731edcb6b96c4139ea5623e4c77f18a5"/></dir><file name="Status.php" hash="0172b604888e11b114a086d5b7b06110"/><file name="Stores.php" hash="045f17aa2cd4ece20872a5a37b2155fd"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MegamenuController.php" hash="638f2a543ad613f46df46a1ac17ddedc"/><file name="WidgetController.php" hash="0ac4cfd74c6edc69635ef3bbb4b838de"/></dir><file name="IndexController.php" hash="b82d6b592a58f1cdab4d932fc3c044da"/></dir><dir name="data"><dir name="megamenu_setup"><file name="data-install-0.1.0.php" hash="17b263ed06bb91bcc97564fe9b7da99e"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="58b918260fd06eeb7fbc5959efa87058"/><file name="config.xml" hash="9196e7b61fb8087d540d49c62f11bbd8"/><file name="system.xml" hash="72a978acbdeca9f6be925a9f015430b0"/></dir><dir name="sql"><dir name="megamenu_setup"><file name="mysql4-install-0.1.0.php" hash="e47c85b61877231a66e9fc193dfc9a5a"/><file name="mysql4-upgrade-0.1.10-0.1.11.php" hash="f0948b0e4a945937536bde43aeeb2aee"/><file name="mysql4-upgrade-0.1.11-0.1.11.1.php" hash="fe21a14fb9e90a7070eec48858c7842c"/><file name="mysql4-upgrade-0.1.11.3-0.1.11.4.php" hash="aea44c4d3da9c3c65bd2d424a796a0a8"/><file name="mysql4-upgrade-0.1.11.4-0.1.11.5.php" hash="79571f733b90e32798023e40e50673ec"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="58d0afc9e4fa964c55eda160c868148f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cybage_Megamenu.xml" hash="bc8d159165eb0c2e9e3e7e44790742dd"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="cybage_megamenu.xml" hash="8bdc0ba98fe1629674223fe4afb61eb3"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cybage_megamenu.xml" hash="108ea2b608a840cd055470e55fb73279"/></dir><dir name="template"><dir name="megamenu"><dir name="topmenu"><file name="anchorText.phtml" hash="90dd00ec9b0704e884de3ccb4ef33559"/><file name="categories.phtml" hash="c8f9f0f148f71426fe2f91846dec24f5"/><file name="contactus.phtml" hash="51756fe669576c569c9ef3da6e367d42"/><file name="contentText.phtml" hash="adb0f561d0fe6e2927d2b1d67c15d001"/><file name="groupMenuItems.phtml" hash="b6244eb500d46f6b74b00893c4bdcd2d"/><file name="productsListing.phtml" hash="fb517edf7c646f21d07a01dfab400fbf"/></dir><file name="topmenu.phtml" hash="52953c98bfaad30f22bf67f2f6ca45e1"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="cybage_megamenu.xml" hash="dd1d781e9330397c1a75efce18e66f93"/><file name="cybage_megamenu.xml" hash="dd1d781e9330397c1a75efce18e66f93"/></dir><dir name="template"><dir name="megamenu"><dir name="topmenu"><file name="anchorText.phtml" hash="90dd00ec9b0704e884de3ccb4ef33559"/><file name="categories.phtml" hash="82acf84e3385badc15c5c6f573e5df78"/><file name="contactus.phtml" hash="2acdcc85d0b1cbf0f3dcecd742a89558"/><file name="contentText.phtml" hash="490e6dbe9ed56bb8ab8848de0f605fb6"/><file name="groupMenuItems.phtml" hash="b240729ec30f3294c092880b6915dc50"/><file name="productsListing.phtml" hash="fc86aa0d658c7e0629ee20a366e6d864"/></dir><file name="topmenu.phtml" hash="16598a9cdd6ebc12ba65726ab315dbed"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="js"><file name="megamenu.js" hash="36130f691e5fcab76f2f82e53cce2b82"/><file name="productselect.js" hash="42f8309ec95bf9fa01437e30bcb06dd5"/></dir><dir name="megamenu"><file name="megamenu.css" hash="512fa635243798127a0e89723a2e75ec"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="megamenu.css" hash="61b33aed3a2f6167e4d374615c56fe62"/></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="css"><file name="megamenu.css" hash="4f900b0ffdad889654a525a8e68fea53"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="megamenu"><dir name="systemcolorpicker"><dir name="procolor-1.0"><dir name="img"><file name="procolor_win_bars.png" hash="a8e41fdddd2253309e0b3e5154668c24"/><file name="procolor_win_bg.gif" hash="c0558cecd0e0ffb9ca89efe00f422261"/><file name="procolor_win_bg.png" hash="4e2a34cc64888fe264fcf6249dfe40da"/><file name="procolor_win_boxes.png" hash="e971c1ca87a0cb52d32408270d00a0da"/><file name="procolor_win_close.png" hash="20a8bb9433157962ab25d86d28d088a3"/><file name="procolor_win_drop.png" hash="9ddce741de330573f082ffe83005d691"/><file name="procolor_win_palette_raw.png" hash="ea98dde528e987029af6e24dbef53922"/><file name="procolor_win_sel_circle.gif" hash="3674b62db5a6eaa4dcedb0749dde4106"/><file name="procolor_win_sel_circle.png" hash="d76195d1777e9a14ebc1a242ab712037"/><file name="procolor_win_sel_rect.gif" hash="b74a72aaf1ea21d55b8751079f283537"/><file name="procolor_win_sel_rect.png" hash="5513589e2b6dc1a980a4e65a746005d0"/><file name="procolor_win_wheel_black.png" hash="62353005bb70bbfa8ffd700112d72582"/><file name="procolor_win_wheel_rgb.jpg" hash="afdd3852c3788a58794ddf1de9557fd8"/></dir><file name="procolor.compressed.js" hash="79e463efad21212e4096d40b9e17d96c"/></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/adminhtml/default/default/js/megamenu.js ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function toggleInputs(type) {
2
+ // alert(type);
3
+ console.log(type);
4
+ switch (type) {
5
+ case '0':
6
+ hideInput('column_count');
7
+ hideInput('target_url');
8
+ hideForm('megamenu_feature_form');
9
+ hideForm('megamenu_maincontent_form');
10
+ showForm('megamenu_headercontent_form');
11
+ removeClass('target_url');
12
+ break;
13
+ case '1':
14
+ showInput('column_count');
15
+ hideInput('category_ids');
16
+ showForm('megamenu_feature_form');
17
+ showForm('megamenu_maincontent_form');
18
+ hideInput('feature_category_box_title');
19
+ hideInput('product_ids');
20
+ hideInput('category_box_title');
21
+ hideInput('prodct_box_title');
22
+ hideInput('main_content_product_ids');
23
+ hideInput('target_url');
24
+ showInput('main_content_category_ids');
25
+ addClass('main_content_category_ids');
26
+ showForm('megamenu_headercontent_form');
27
+ hideInput('content_container');
28
+ removeClass('category_box_title');
29
+ removeClass('prodct_box_title');
30
+ removeClass('prodct_box_title');
31
+ removeClass('main_content_product_ids');
32
+ removeClass('content_container');
33
+ removeClass('prodct_box_title');
34
+ removeClass('main_content_product_ids');
35
+ removeClass('target_url');
36
+ break;
37
+ case '2':
38
+ showInput('column_count');
39
+ hideInput('prodct_box_title');
40
+ hideInput('category_ids');
41
+ showForm('megamenu_maincontent_form');
42
+ showInput('main_content_product_ids');
43
+ hideForm('megamenu_feature_form');
44
+ hideInput('feature_category_box_title');
45
+ hideInput('feature_product_box_title');
46
+ hideInput('main_content_category_ids');
47
+ removeClass('main_content_category_ids');
48
+ hideInput('product_ids');
49
+ hideInput('category_box_title');
50
+ showForm('megamenu_headercontent_form');
51
+ hideInput('target_url');
52
+ hideInput('content_container');
53
+ removeClass('target_url');
54
+ removeClass('category_box_title');
55
+ removeClass('prodct_box_title');
56
+ removeClass('main_content_product_ids');
57
+ removeClass('content_container');
58
+ addClass('main_content_product_ids');
59
+ break;
60
+ case '3':
61
+ showInput('column_count');
62
+ showForm('megamenu_maincontent_form');
63
+ hideInput('category_box_title');
64
+ showInput('megamenu_headercontent_form');
65
+ hideInput('prodct_box_title');
66
+ hideInput('main_content_product_ids');
67
+ showInput('main_content_category_ids');
68
+ addClass('main_content_category_ids');
69
+ showForm('megamenu_headercontent_form');
70
+ hideInput('target_url');
71
+ hideInput('content_container');
72
+ removeClass('content_container');
73
+ removeClass('prodct_box_title');
74
+ removeClass('main_content_product_ids');
75
+ removeClass('target_url');
76
+ break;
77
+ case '4':
78
+ removeClass('column_count');
79
+ removeClass('target_url');
80
+ hideInput('column_count');
81
+ hideInput('target_url');
82
+ showForm('megamenu_headercontent_form');
83
+ removeClass('main_content_category_ids');
84
+ hideForm('megamenu_feature_form');
85
+ hideForm('megamenu_maincontent_form');
86
+ removeClass('content_container');
87
+ removeClass('prodct_box_title');
88
+ removeClass('main_content_product_ids');
89
+ break;
90
+ case '5':
91
+ removeClass('column_count');
92
+ hideInput('column_count');
93
+ showInput('target_url');
94
+ hideForm('megamenu_headercontent_form');
95
+ removeClass('main_content_category_ids');
96
+ hideForm('megamenu_feature_form');
97
+ hideForm('megamenu_maincontent_form');
98
+ removeClass('content_container');
99
+ removeClass('prodct_box_title');
100
+ removeClass('main_content_product_ids');
101
+ addClass('target_url');
102
+
103
+ break;
104
+ case '6':
105
+ removeClass('column_count');
106
+ removeClass('target_url');
107
+ removeClass('header');
108
+ removeClass('footer');
109
+ hideInput('column_count');
110
+ hideForm('megamenu_feature_form');
111
+ showForm('megamenu_maincontent_form');
112
+ showForm('megamenu_headercontent_form');
113
+ hideInput('target_url');
114
+ hideInput('category_box_title');
115
+ hideInput('prodct_box_title');
116
+ hideInput('main_content_category_ids');
117
+ removeClass('main_content_category_ids');
118
+ hideInput('main_content_product_ids');
119
+ showInput('content_container');
120
+ removeClass('prodct_box_title');
121
+ removeClass('main_content_product_ids');
122
+ break;
123
+ case '20':
124
+ hideInput('feature_category_box_title');
125
+ // hideInput('feature_product_box_title');
126
+ hideInput('category_ids');
127
+ hideInput('product_ids');
128
+ removeClass('prodct_box_title');
129
+ removeClass('main_content_product_ids');
130
+ removeClass('target_url');
131
+ removeClass('feature_product_box_title');
132
+ removeClass('feature_product_ids');
133
+ break;
134
+ case '21':
135
+ showInput('feature_category_box_title');
136
+ hideInput('feature_product_box_title');
137
+ showInput('category_ids');
138
+ hideInput('product_ids');
139
+ removeClass('prodct_box_title');
140
+ removeClass('main_content_product_ids');
141
+ removeClass('target_url');
142
+ removeClass('main_content_category_ids');
143
+ break;
144
+ case '22':
145
+ hideInput('feature_category_box_title');
146
+ showInput('feature_product_box_title');
147
+ hideInput('category_ids');
148
+ showInput('product_ids');
149
+ removeClass('prodct_box_title');
150
+ removeClass('main_content_product_ids');
151
+ removeClass('target_url');
152
+ addClass('feature_product_box_title');
153
+ addClass('feature_product_ids');
154
+ break;
155
+
156
+ default:
157
+ hideForm('megamenu_headercontent_form');
158
+ hideForm('megamenu_feature_form');
159
+ hideForm('megamenu_maincontent_form');
160
+ hideInput('column_count');
161
+ hideInput('target_url');
162
+ break;
163
+ }
164
+ }
165
+
166
+ function removeClass(id)
167
+ {
168
+ if (id)
169
+ {
170
+ var ele = document.getElementById(id)
171
+ ele.classList.remove("required-entry");
172
+
173
+ var list = getElementsByAttribute('for', document, id);
174
+ if (list.hasChildNodes()) {
175
+ for (var i = 0; i < list.childNodes.length; i++) {
176
+ if (list.childNodes[i].className == "required") {
177
+ list.removeChild(list.childNodes[i]);
178
+ }
179
+ }
180
+ }
181
+ }
182
+ }
183
+
184
+ function addClass(id)
185
+ {
186
+ if (id)
187
+ {
188
+ var ele = document.getElementById(id)
189
+ ele.classList.add("required-entry");
190
+ var label = ele.parentNode.previousSibling.childNodes;
191
+ var node = document.createElement("SPAN");
192
+ node.className = "required"
193
+ var textnode = document.createTextNode('\ *');
194
+ node.appendChild(textnode);
195
+ getElementsByAttribute('for', document, id).appendChild(node);
196
+
197
+ }
198
+ }
199
+
200
+ function getElementsByAttribute(attribute, context, value) {
201
+ var nodeList = (context || document).getElementsByTagName('*');
202
+ var nodeArray = [];
203
+ var iterator = 0;
204
+ var node = null;
205
+
206
+ while (node = nodeList[iterator++]) {
207
+ if (node.getAttribute(attribute) == value) {
208
+ return node;
209
+ }
210
+ }
211
+ }
212
+
213
+ function showInput(id) {
214
+ if ($(id)) {
215
+ var td = $(id).up();
216
+ var tr = td.up();
217
+ tr.show();
218
+ }
219
+ }
220
+ function showForm(id) {
221
+ if ($(id)) {
222
+ $(id).show();
223
+ $(id).previous().show();
224
+ }
225
+ }
226
+ function hideInput(id) {
227
+ if ($(id)) {
228
+ var td = $(id).up();
229
+ var tr = td.up();
230
+ tr.hide();
231
+ }
232
+ }
233
+ function hideForm(id) {
234
+ if ($(id)) {
235
+ $(id).hide();
236
+ $(id).previous().hide();
237
+ }
238
+ }
239
+ function getTemplates(value, url) {
240
+ new Ajax.Request(url, {
241
+ parameters: $('type_id').serialize(true),
242
+ onSuccess: function (transport) {
243
+ toggleInputs(value);
244
+ if (transport.responseText.isJSON()) {
245
+ var field = transport.responseText.evalJSON();
246
+ var i = 0;
247
+ $('template_id').select('option').invoke('remove');
248
+
249
+ var firstOption = document.createElement('option');
250
+ firstOption.className = 'option template';
251
+ firstOption.text = 'Select Template Type';
252
+ firstOption.value = '';
253
+ $('template_id').appendChild(firstOption);
254
+
255
+ for (i = 0; i < field.length; i++) {
256
+ var newOption = document.createElement('option');
257
+ newOption.className = 'option template';
258
+ newOption.text = field[i].name;
259
+ newOption.value = field[i].entity_id;
260
+ $('template_id').appendChild(newOption);
261
+ }
262
+ }
263
+
264
+ }.bind(this)
265
+ });
266
+ }
267
+
268
+ function getLayoutImage(value, url) {
269
+ new Ajax.Request(url, {
270
+ parameters: $('template_id').serialize(true),
271
+ onSuccess: function (transport) {
272
+ var image = transport.responseText;
273
+ var imgObj = document.getElementById('template_layout_image');
274
+ imgObj.src = image;
275
+ }.bind(this)
276
+ });
277
+ }
278
+ document.observe("dom:loaded", function () {
279
+ var menuType = document.getElementById('type_id');
280
+ var selectedMenuType = menuType.options[menuType.selectedIndex].value;
281
+ toggleInputs(selectedMenuType);
282
+ })
283
+
284
+
285
+ $$('.categories-checkboxes').each(
286
+ function (e) {
287
+
288
+ $('' + e.id).observe('click', function (e2) {
289
+ if (e.checked) {
290
+ addCategories(e.value);
291
+ } else {
292
+ removeCategories(e.value);
293
+ }
294
+ });
295
+ }
296
+ );
297
+
298
+ function addCategories(id) {
299
+ if ($('main_content_category_ids').value != '') {
300
+ var data = $('main_content_category_ids').value;
301
+ data = data + ',' + id;
302
+ $('main_content_category_ids').value = data
303
+ } else {
304
+ $('main_content_category_ids').value = id;
305
+ }
306
+ }
307
+ function removeCategories(id) {
308
+ var data = $('main_content_category_ids').value;
309
+ var n = data.search(id);
310
+
311
+ if (data.search("," + id) >= 0) {
312
+ data = data.replace("," + id, "");
313
+ }
314
+ else if (data.search(id + ",") >= 0) {
315
+ data = data.replace(id + ",", "");
316
+ }
317
+ else if (data.search(id) >= 0) {
318
+ data = data.replace(id, "");
319
+ }
320
+ $('main_content_category_ids').value = data;
321
+ }
322
+ function getCategories(url) {
323
+
324
+ new Ajax.Request(url, {
325
+ onSuccess: function (transport) {
326
+ var data = transport.responseText;
327
+ var categoryDiv = document.getElementById('responsecategories');
328
+ categoryDiv.innerHTML = data;
329
+ }.bind(this)
330
+ });
331
+ }
skin/adminhtml/default/default/js/productselect.js ADDED
@@ -0,0 +1,407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ getFeaturecategoryChooser = function (url) {
2
+ feature_category_ids.updateElement = $("feature_category_ids");
3
+ new Ajax.Request(
4
+ url, {
5
+ method: "post",
6
+ onSuccess: function (b) {
7
+ var a = $('chosser-container');
8
+ a.update(b.responseText);
9
+ a.scrollTo()
10
+ }
11
+ })
12
+ };
13
+
14
+ getFeatureProductChooser = function (url) {
15
+ var feature_product_ids = document.getElementById('feature_product_ids');
16
+ var test = feature_product_ids.value;
17
+ var demo = test.replace(/\s/g, '').split(",");
18
+
19
+ if ($('featureproduct-chosser-container').innerHTML.length) {
20
+ document.getElementById("featureproduct-chosser-container").innerHTML = "";
21
+ } else {
22
+ new Ajax.Request(
23
+ url, {
24
+ method: "post",
25
+ parameters: {
26
+ 'selected[]': demo},
27
+ onSuccess: function (b) {
28
+ var a = $('featureproduct-chosser-container');
29
+ a.update(b.responseText);
30
+ a.scrollTo()
31
+ }
32
+ })
33
+ }
34
+
35
+
36
+ };
37
+
38
+ getMaincategoryChooser = function (url) {
39
+ main_content_category_ids.updateElement = $("main_content_category_ids");
40
+ var demo = main_content_category_ids.value.split(",");
41
+ new Ajax.Request(
42
+ url, {
43
+ method: "post",
44
+ parameters: {
45
+ 'selected[]': demo},
46
+ onSuccess: function (b) {
47
+ //console.log(b);
48
+ var a = $('main-chosser-container');
49
+ a.update(b.responseText);
50
+ a.scrollTo()
51
+ }
52
+ })
53
+
54
+
55
+ };
56
+
57
+ getMainProductChooser = function (url) {
58
+ var main_content_product_ids = document.getElementById('main_content_product_ids');
59
+ var test = main_content_product_ids.value;
60
+ var demo = test.replace(/\s/g, '').split(",");
61
+
62
+ if ($('mainproduct-chosser-container').innerHTML.length) {
63
+ document.getElementById("mainproduct-chosser-container").innerHTML = "";
64
+ } else {
65
+ new Ajax.Request(
66
+ url, {
67
+ method: "post",
68
+ parameters: {
69
+ 'selected[]': demo},
70
+ onSuccess: function (b) {
71
+ var a = $('mainproduct-chosser-container');
72
+ a.update(b.responseText);
73
+ a.scrollTo()
74
+ }
75
+ })
76
+ }
77
+ };
78
+
79
+
80
+ clearDiv = function (id) {
81
+ $(id).update();
82
+ };
83
+
84
+
85
+ var VarienRulesForm = new Class.create();
86
+ VarienRulesForm.prototype = {
87
+ initialize: function (a) {
88
+ this.newChildUrl = a;
89
+ this.shownElement = null;
90
+ this.updateElement = $("skus");
91
+ this.chooserSelectedItems = $H({})
92
+ },
93
+ initParam: function (b) {
94
+ //console.log('initParam');
95
+ b.rulesObject = this;
96
+ var d = Element.down(b, ".label");
97
+ if (d) {
98
+ Event.observe(d, "click", this.showParamInputField.bind(this, b))
99
+ }
100
+ var f = Element.down(b, ".element");
101
+ if (f) {
102
+ var e = f.down(".rule-chooser-trigger");
103
+ if (e) {
104
+ Event.observe(e, "click", this.toggleChooser.bind(this, b))
105
+ }
106
+ var c = f.down(".rule-param-apply");
107
+ if (c) {
108
+ Event.observe(c, "click", this.hideParamInputField.bind(this, b))
109
+ } else {
110
+ f = f.down();
111
+ if (!f.multiple) {
112
+ Event.observe(f, "change", this.hideParamInputField.bind(this, b))
113
+ }
114
+ Event.observe(f, "blur", this.hideParamInputField.bind(this, b))
115
+ }
116
+ }
117
+ var a = Element.down(b, ".rule-param-remove");
118
+ if (a) {
119
+ Event.observe(a, "click", this.removeRuleEntry.bind(this, b))
120
+ }
121
+ },
122
+ showChooserElement: function (c) {
123
+ //console.log('showChooserElement');
124
+ this.chooserSelectedItems = $H({});
125
+ var a = this.updateElement.value.split(","),
126
+ b = "";
127
+ for (i = 0; i < a.length; i++) {
128
+ b = a[i].strip();
129
+ if (b != "") {
130
+ this.chooserSelectedItems.set(b, 1)
131
+ }
132
+ }
133
+ new Ajax.Updater(c, c.getAttribute("url"), {
134
+ evalScripts: true,
135
+ parameters: {
136
+ form_key: FORM_KEY,
137
+ "selected[]": this.chooserSelectedItems.keys()
138
+ },
139
+ onSuccess: this._processSuccess.bind(this) && this.showChooserLoaded.bind(this, c),
140
+ onFailure: this._processFailure.bind(this)
141
+ })
142
+ },
143
+ showChooserLoaded: function (a, b) {
144
+ //console.log('showChooserLoaded');
145
+ a.style.display = "block"
146
+ },
147
+ showChooser: function (a, c) {
148
+ //console.log('showChooser');
149
+ var b = a.up("li");
150
+ if (!b) {
151
+ return
152
+ }
153
+ b = b.down(".rule-chooser");
154
+ if (!b) {
155
+ return
156
+ }
157
+ this.showChooserElement(b)
158
+ },
159
+ hideChooser: function (a, c) {
160
+ //console.log('hideChooser');
161
+ var b = a.up("li");
162
+ if (!b) {
163
+ return
164
+ }
165
+ b = b.down(".rule-chooser");
166
+ if (!b) {
167
+ return
168
+ }
169
+ b.style.display = "none"
170
+ },
171
+ toggleChooser: function (a, c) {
172
+ //console.log('toggleChooser');
173
+ var b = a.up("li").down(".rule-chooser");
174
+ if (!b) {
175
+ return
176
+ }
177
+ if (b.style.display == "block") {
178
+ b.style.display = "none";
179
+ this.cleanChooser(a, c)
180
+ } else {
181
+ this.showChooserElement(b)
182
+ }
183
+ },
184
+ cleanChooser: function (a, c) {
185
+ //console.log('cleanChooser');
186
+ var b = a.up("li").down(".rule-chooser");
187
+ if (!b) {
188
+ return
189
+ }
190
+ b.innerHTML = ""
191
+ },
192
+ showParamInputField: function (a, c) {
193
+ //console.log('showParamInputField');
194
+ if (this.shownElement) {
195
+ this.hideParamInputField(this.shownElement, c)
196
+ }
197
+ Element.addClassName(a, "rule-param-edit");
198
+ var d = Element.down(a, ".element");
199
+ var b = Element.down(d, "input.input-text");
200
+ if (b) {
201
+ b.focus();
202
+ if (b && b.id && b.id.match(/__value$/)) {
203
+ this.updateElement = b
204
+ }
205
+ }
206
+ var b = Element.down(d, "select");
207
+ if (b) {
208
+ b.focus()
209
+ }
210
+ this.shownElement = a
211
+ },
212
+ hideParamInputField: function (a, d) {
213
+ //console.log('hideParamInputField');
214
+ Element.removeClassName(a, "rule-param-edit");
215
+ var b = Element.down(a, ".label"),
216
+ c;
217
+ if (!a.hasClassName("rule-param-new-child")) {
218
+ c = Element.down(a, "select");
219
+ if (c && c.options) {
220
+ var f = [];
221
+ for (i = 0; i < c.options.length; i++) {
222
+ if (c.options[i].selected) {
223
+ f.push(c.options[i].text)
224
+ }
225
+ }
226
+ var e = f.join(", ");
227
+ b.innerHTML = e != "" ? e : "..."
228
+ }
229
+ c = Element.down(a, "input.input-text");
230
+ if (c) {
231
+ var e = c.value.replace(/(^\s+|\s+$)/g, "");
232
+ c.value = e;
233
+ if (e == "") {
234
+ e = "..."
235
+ } else {
236
+ if (e.length > 30) {
237
+ e = e.substr(0, 30) + "..."
238
+ }
239
+ }
240
+ b.innerHTML = e
241
+ }
242
+ } else {
243
+ c = Element.down(a, "select");
244
+ if (c.value) {
245
+ this.addRuleNewChild(c)
246
+ }
247
+ c.value = ""
248
+ }
249
+ if (c && c.id && c.id.match(/__value$/)) {
250
+ this.hideChooser(a, d);
251
+ this.updateElement = null
252
+ }
253
+ this.shownElement = null
254
+ },
255
+ addRuleNewChild: function (b) {
256
+ //console.log('addRuleNewChild');
257
+ var f = b.id.replace(/^.*__(.*)__.*$/, "$1");
258
+ var h = $(b.id.replace(/__/g, ":").replace(/[^:]*$/, "children").replace(/:/g, "__"));
259
+ var d = 0,
260
+ c;
261
+ var a = Selector.findChildElements(h, $A(["input.hidden"]));
262
+ if (a.length) {
263
+ a.each(function (k) {
264
+ if (k.id.match(/__type$/)) {
265
+ c = 1 * k.id.replace(/^.*__.*?([0-9]+)__.*$/, "$1");
266
+ d = c > d ? c : d
267
+ }
268
+ })
269
+ }
270
+ var g = f + "--" + (d + 1);
271
+ var j = b.value;
272
+ var e = document.createElement("LI");
273
+ e.className = "rule-param-wait";
274
+ e.innerHTML = Translator.translate("Please wait, loading...");
275
+ h.insertBefore(e, $(b).up("li"));
276
+ new Ajax.Updater(e, this.newChildUrl, {
277
+ evalScripts: true,
278
+ parameters: {
279
+ form_key: FORM_KEY,
280
+ type: j.replace("/", "-"),
281
+ id: g
282
+ },
283
+ onComplete: this.onAddNewChildComplete.bind(this, e),
284
+ onSuccess: this._processSuccess.bind(this),
285
+ onFailure: this._processFailure.bind(this)
286
+ })
287
+ },
288
+ _processSuccess: function (b) {
289
+ //console.log('_processSuccess');
290
+ var a = b.responseText.evalJSON();
291
+ if (a.ajaxExpired && a.ajaxRedirect) {
292
+ alert(Translator.translate("Your session has been expired, you will be relogged in now."));
293
+ location.href = a.ajaxRedirect
294
+ }
295
+ return true
296
+ },
297
+ _processFailure: function (a) {
298
+ //console.log('_processFailure');
299
+ location.href = BASE_URL
300
+ },
301
+ onAddNewChildComplete: function (c) {
302
+ //console.log('onAddNewChildComplete');
303
+ $(c).removeClassName("rule-param-wait");
304
+ var a = c.getElementsByClassName("rule-param");
305
+ for (var b = 0; b < a.length; b++) {
306
+ this.initParam(a[b])
307
+ }
308
+ },
309
+ removeRuleEntry: function (b, c) {
310
+ //console.log('removeRuleEntry');
311
+ var a = Element.up(b, "li");
312
+ a.parentNode.removeChild(a)
313
+ },
314
+ chooserGridInit: function (a) {
315
+ //console.log('chooserGridInit');
316
+ },
317
+ chooserGridRowInit: function (a, b) {
318
+ var oldval = $(this.newChildUrl).value;
319
+ var oldValArr = oldval.split(',');
320
+ //console.log('chooserGridRowInit');
321
+ if (!a.reloadParams) {
322
+ a.reloadParams = {
323
+ "selected[]": oldValArr.concat(this.chooserSelectedItems.keys()).unique()
324
+ }
325
+ }
326
+ },
327
+ chooserGridRowClick: function (b, d) {
328
+ //console.log('chooserGridRowClick');
329
+ var f = Event.findElement(d, "tr");
330
+ var a = Event.element(d).tagName == "INPUT";
331
+ if (f) {
332
+ var e = Element.select(f, "input");
333
+ if (e[0]) {
334
+ var c = a ? e[0].checked : !e[0].checked;
335
+ b.setCheckboxChecked(e[0], c)
336
+ }
337
+ }
338
+ },
339
+ chooserGridCheckboxCheck: function (b, a, c) {
340
+ //console.log('chooserGridCheckboxCheck');
341
+ var oldval = $(this.newChildUrl).value;
342
+ var oldValArr = oldval.split(',');
343
+ if (c) {
344
+ if (!a.up("th")) {
345
+ this.chooserSelectedItems.set(a.value, 1)
346
+ }
347
+ } else {
348
+ for (var i = 0; i < oldValArr.length; i++) {
349
+ if (oldValArr[i] == a.value) {
350
+ delete oldValArr[i];
351
+ }
352
+ }
353
+ this.chooserSelectedItems.unset(a.value)
354
+ }
355
+ b.reloadParams = {
356
+ "selected[]": oldValArr.concat(this.chooserSelectedItems.keys()).unique()
357
+ };
358
+ if (oldValArr.length > 1) {
359
+ //console.log(oldValArr.length);
360
+ var newVal = oldValArr.concat(this.chooserSelectedItems.keys());
361
+ } else {
362
+ var newVal = this.chooserSelectedItems.keys();
363
+ }
364
+
365
+
366
+ var newVal = newVal.unique();
367
+ var newValStr = '';
368
+ for (var j = 0; j < newVal.length; j++) {
369
+ if (newVal[j]) {
370
+ if (newValStr.length) {
371
+ newValStr += ',' + newVal[j];
372
+ } else {
373
+ if (newVal[j]) {
374
+ newValStr += newVal[j];
375
+ }
376
+
377
+ }
378
+
379
+ }
380
+ }
381
+ $(this.newChildUrl).value = newValStr;
382
+ }
383
+
384
+
385
+ };
386
+
387
+ Array.prototype.contains = function (v) {
388
+ for (var i = 0; i < this.length; i++) {
389
+ if (this[i] === v)
390
+ return true;
391
+ }
392
+ return false;
393
+ };
394
+
395
+ Array.prototype.unique = function () {
396
+ var arr = [];
397
+ for (var i = 0; i < this.length; i++) {
398
+ if (!arr.contains(this[i])) {
399
+ arr.push(this[i]);
400
+ }
401
+ }
402
+ return arr;
403
+ }
404
+
405
+ var feature_product_ids = new VarienRulesForm('feature_product_ids');
406
+ var main_content_product_ids = new VarienRulesForm('main_content_product_ids');
407
+
skin/adminhtml/default/default/megamenu/megamenu.css ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #megamenu_tabs_content_section_content .form-list td.value .grid select{
2
+ max-width: 66px !important;
3
+ width: auto !important;
4
+ }
5
+ #megamenu_tabs_content_section_content .form-list td.value .grid .input-text{
6
+ max-width: 66px !important;
7
+ width: 20px !important;
8
+ }
9
+ #megamenu_tabs_content_section_content .grid th, .grid td{
10
+ padding: 2px !important;
11
+ }
12
+ .megamenu-adminhtml-megamenu-edit .side-col{
13
+ width: auto !important;
14
+ }
15
+
16
+ .megamenu-adminhtml-megamenu-edit .columns {
17
+ background:url(../images/side_col_bg.gif) repeat-y 161px 0 !important;
18
+ }
19
+
20
+ .megamenu-adminhtml-megamenu-edit div.main-col{
21
+ margin-left: 147px !important;
22
+ }
23
+
24
+ .megamenu-adminhtml-megamenu-edit .form-list td.label label{
25
+ width: 108px !important;
26
+ }
27
+
28
+ .megamenu-adminhtml-megamenu-edit .form-list td.label{
29
+ width: 108px !important;
30
+ }
31
+
32
+ .megamenu-adminhtml-megamenu-edit .grid tr.headings th a{
33
+ padding: 0 !important;
34
+ }
35
+
36
+ .megamenu-adminhtml-megamenu-edit .grid tr.headings th span.sort-title{
37
+ padding: 3px 2px 4px 0 !important;
38
+ }
skin/frontend/base/default/css/megamenu.css ADDED
@@ -0,0 +1,467 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ============================================ *
2
+ * Mega Menu
3
+ * ============================================ */
4
+
5
+ *{margin:0; padding:0; font-family:Arial,Helmet,Freesans,sans-serif !important;}
6
+ ul, ol {
7
+ list-style: none outside none;
8
+ }
9
+ .megamenu{clear:both;}
10
+ #nav {
11
+ font-size:11px;
12
+ margin:0 auto;
13
+ width:960px;
14
+ background:#000;
15
+ color:#666;
16
+ }
17
+
18
+ #nav li {
19
+ float: left;
20
+ text-align: left; position:static;
21
+ }
22
+ /* #nav li.menu_2 .magestore-megamenu { left:-134px;}
23
+ #nav li.menu_3 .magestore-megamenu { left:-270px;}
24
+ #nav li.menu_4 .magestore-megamenu { left:-369px;}
25
+ #nav li.menu_5 .magestore-megamenu { left:-477px;}
26
+ #nav li.menu_6 .magestore-megamenu { left:-590px;}*/
27
+ #nav li.menu_5 .magestore-megamenu div { position:static !important; width:930px !important;}
28
+
29
+
30
+ .megamenu #nav a{
31
+ color: #fff;
32
+ text-decoration:none;
33
+ font-size: 11px;
34
+ }
35
+
36
+ .megamenu #nav{
37
+ position : relative;
38
+ height:55px;
39
+ width:950px; padding:0;
40
+ }
41
+ .megamenu #nav .magestore-megamenu{
42
+ background:#fff;
43
+ left: 0;
44
+ width:950px;
45
+ border: 1px solid #d6d6d6;
46
+ z-index: 1000;
47
+ display:none;
48
+ position:absolute;
49
+ top:55px;
50
+ }
51
+ .megamenu #nav .magestore-megamenu .sub-menu{
52
+ left: 0;
53
+ height: auto;
54
+ float: left;
55
+ position: static;
56
+ padding:10px; border:0; width:auto; background:#fff;
57
+ }
58
+ .megamenu #nav .magestore-megamenu .sub-menu .main_content { width:auto; position:static; border:0; top:0; left:0;}
59
+ .megamenu #nav li:hover .magestore-megamenu{
60
+ display:block;
61
+ }
62
+ .megamenu #nav a.megamenu-lable{
63
+ font-weight:bold !important;
64
+ text-transform:uppercase !important;
65
+ line-height:50px !important;
66
+ padding:0 15px;
67
+ font-size:11px;
68
+ height:55px;
69
+ line-height:55px;
70
+ display:inline-block;
71
+ }
72
+ .megamenu #nav li.over a.megamenu-lable.over{background-color:#fff !important;color:#000 !important;}
73
+ .megamenu #nav a.megamenu-lable:hover{color:#ffa800 !important;}
74
+ .megamenu #nav li ul.shown-sub,.megamenu #nav li div.shown-sub{
75
+ padding:0 !important;
76
+ margin:0 !important;
77
+ background:none !important;
78
+ border:none !important;
79
+ }
80
+ .megamenu #nav div ul li {background:none !important;}
81
+ .megamenu #nav div ul li.level1-megamenu { width:740px !important; border:0 !important;}
82
+ .megamenu #nav div ul li.level1-megamenu ul { width:200px; float:left;}
83
+ .megamenu #nav div ul li div{position:static !important;border:none ;}
84
+ .megamenu #nav .magestore-megamenu li a{
85
+ background: none repeat scroll 0 0 transparent !important;
86
+ color: #666666 !important;
87
+ font-size: 11px !important;
88
+ height:auto !important;
89
+ text-align:left !important;
90
+ }
91
+
92
+ .megamenu #nav button.button{
93
+ border: 1px solid #F79343;
94
+ color: #fff;
95
+ float: none;
96
+ font-size: 21px;
97
+ height: 25px;
98
+ padding:0 15px;
99
+ border-radius: 10px;
100
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
101
+ cursor: pointer;
102
+ display: inline-block;
103
+ letter-spacing: -1px;
104
+ outline: medium none;
105
+ position: relative;
106
+ text-decoration: none;
107
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
108
+ background: #fe8900; /* non-CSS3 default background */
109
+ background: -webkit-gradient(linear, left top, left bottom, from(#feb900), to(#fe8900));
110
+ background: -moz-linear-gradient(#feb900, #fe8900);
111
+ background: -ms-linear-gradient(#feb900, #fe8900);
112
+ background: linear-gradient(#feb900, #fe8900);
113
+ font-size:12px;
114
+ -pie-background: linear-gradient(#feb900, #fe8900);
115
+ }
116
+ .megamenu #nav button.button:hover {
117
+ background: #CE662B;
118
+ background: -webkit-gradient(linear, left top, left bottom, from(#F3C812), to(#CE662B));
119
+ background: -moz-linear-gradient(#F3C812, #CE662B);
120
+ background: -ms-linear-gradient(#F3C812, #CE662B);
121
+ background: linear-gradient(#F3C812, #CE662B);
122
+ -pie-background: linear-gradient(#F3C812, #CE662B);
123
+ }
124
+ .megamenu #nav button.button:active {
125
+ color: #ccc;
126
+ border: solid 1px #1D74B9; /* border */
127
+ background: -webkit-gradient(linear, left top, left bottom, from(#003061), to(#0059b2));
128
+ background: -moz-linear-gradient(#003061, #0059b2);
129
+ background: -ms-linear-gradient(#003061, #0059b2);
130
+ background: linear-gradient(#003061, #0059b2);
131
+ -pie-background: linear-gradient(#003061, #0059b2);
132
+ }
133
+
134
+ /* --------------------- Block home-----------------*/
135
+ .megamenu #nav .block-megamenu ul.block-home{
136
+ float: left;
137
+ margin: 0 !important;
138
+ width: 100% !important;
139
+ }
140
+ .megamenu #nav ul.block-home li{float:left !important;margin-bottom:15px !important; background:none !important;}
141
+ .megamenu #nav h1.block-title{
142
+ float:left;
143
+ font-size:11px;
144
+ width:100%;
145
+ text-align:left;
146
+ padding:0 0 10px;
147
+ font-weight:bold;
148
+ text-transform:uppercase;
149
+ border-bottom:1px dashed #d5d5d5;
150
+ border-top:none !important;
151
+ margin-bottom:10px;
152
+ color:#000;
153
+ }
154
+ .megamenu #nav ul.block-home li.first{
155
+ width:40%;
156
+ padding-right:10px;
157
+ border-right:1px solid #d5d5d5;
158
+ text-align:left !important;
159
+ }
160
+ .megamenu #nav ul.block-home li.first img{border:1px solid #d5d5d5; height: auto; width: 95%;}
161
+ .megamenu #nav ul.block-home li.last{
162
+ width:55% !important;
163
+ padding-left: 15px !important;
164
+ }
165
+ .megamenu #nav ul.block-home li.last span{
166
+ line-height:20px;
167
+ padding:0 0 10px 0;
168
+ float:left;
169
+ width:100%;
170
+ }
171
+
172
+ /* -----------------------------Grid Category-----------------------------------*/
173
+ .megamenu #nav .grid-categories-megamenu h1{
174
+ float:left;
175
+ width:100%;
176
+ margin:0;
177
+ padding:10px 0;
178
+ border-bottom:1px dashed #D5D5D5;
179
+ }
180
+ .megamenu #nav .grid-categories-megamenu ul.level0-megamenu{
181
+ float:left;
182
+ width:100%;
183
+ margin:0;
184
+ }
185
+ .megamenu #nav .grid-categories-megamenu ul.level0-megamenu li.level1-megamenu{
186
+ float:left;
187
+ width:21%;
188
+ padding:0 10px;
189
+ margin:10px 0 0 0;
190
+ border-right:1px solid #d5d5d5;
191
+ min-height:405px;
192
+ }
193
+ .megamenu #nav ul li.featured{
194
+ width:25% !important;
195
+ float:right !important;
196
+ border:none !important;
197
+ padding:0 0 0 10px !important;
198
+ }
199
+ .megamenu #nav .grid-categories-megamenu li .level1-title{
200
+ float:left;
201
+ width:100%;
202
+ padding:10px 0;
203
+ border-bottom:1px dashed #d5d5d5;overflow-x:hidden;
204
+ }
205
+ .megamenu #nav .grid-categories-megamenu li .level1-title h2, li.featured h2{
206
+ padding:0 0 5px;
207
+ margin:0;
208
+ width:100%;
209
+ text-transform:uppercase;
210
+ font-weight:bold;
211
+ color: #000000;
212
+ font-size: 11px;
213
+ }
214
+ .megamenu #nav .grid-categories-megamenu li ol.level2-megamenu{
215
+ float:left;
216
+ width:100%;
217
+ padding:10px 0;
218
+ }
219
+ .megamenu #nav li.featured .level1-content{
220
+ float:left;
221
+ width:100%;
222
+ padding:15px 0 !important;
223
+ }
224
+
225
+ .megamenu #nav li.featured .level1-content a.product-image{float:left;width:40%;margin:0; border:none;}
226
+ .megamenu #nav li.featured .level1-content a.product-image img{width:100%;}
227
+ .megamenu #nav li.featured .level1-content .product-shop{float:left;width:50%;padding-left:10px;}
228
+ .megamenu #nav li.featured .level1-content .product-shop h1.product-name{font-weight:bold;border:none; font-size:11px; color:#666;}
229
+ .megamenu #nav li.featured .level1-content .product-shop span{float:left;width:100%;padding:5px 0 0;}
230
+ .megamenu #nav li.featured .level1-content .product-shop .price-box{float:left;width:100%;padding: 5px 0; font-weight:bold; margin:0 0 5px 0;}
231
+ .megamenu #nav li.featured .level1-content .product-shop .price{font-size:18px;color:#000;}
232
+
233
+
234
+ /* -------------------------------------------------------------------*/
235
+
236
+ /* ----------------------------- list Category----------------------------------*/
237
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu{
238
+ float: left !important;
239
+ margin: 0 !important;
240
+ padding: 10px 15px !important;
241
+ width: 96% !important;
242
+ }
243
+ .megamenu #nav .list-categories-megamenu h1.block-title{
244
+ float:left !important;
245
+ width:100% !important;
246
+ margin:0 !important;
247
+ padding:10px 0 !important;
248
+ border-bottom:1px dashed #D5D5D5 !important;
249
+ text-transform:uppercase;
250
+ }
251
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li.level1-megamenu{
252
+ border-right: 1px solid #D5D5D5 !important;
253
+ float: left !important;
254
+ margin: 10px 0 0 !important;
255
+ padding: 0 10px !important;
256
+ width: 15% !important;
257
+ }
258
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li.featured{
259
+ width:220px !important;
260
+ float:left !important;
261
+ border:none !important;
262
+ padding:0 0 0 5px !important;
263
+ }
264
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu,
265
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu ol,
266
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu li .level1-title{float:left;width:100%;}
267
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu li .level1-title{border-top:1px dashed #d5d5d5;padding-top:5px;}
268
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu li.first .level1-title{border-top:none;padding-top:0;}
269
+ .megamenu #nav .list-categories-megamenu li .level1-title h2{
270
+ padding: 5px 0 !important;
271
+ margin:0 0 5px !important;
272
+ float:left !important;
273
+ width:100% !important;
274
+ text-transform:uppercase !important;
275
+ font-weight:bold !important;
276
+ border-bottom:1px dashed #d5d5d5 !important;
277
+ }
278
+ .megamenu #nav li.featured .product-item{float:left;width:100%;padding:15px 0 !important;}
279
+ .megamenu #nav li.featured .product-item a{float:left;width:110px;margin:0;}
280
+ .megamenu #nav li.featured .product-item .product-shop{float:right;width:105px !important;padding: 0 0 0 5px !important;}
281
+ .megamenu #nav li.featured .product-item .product-shop h1.product-name{font-weight:bold;border:none !important; color:#000000; font-size:11px; font-weight:bold; margin:0; padding:0 0 5px; text-transform:uppercase; width: 100%;}
282
+ .megamenu #nav li.featured .product-item .product-shop span{float:left;width:100%;padding: 0;height:38px;overflow:hidden;}
283
+ .megamenu #nav li.featured .product-item .product-shop .price-box{float:left;width:100%;padding: 0;}
284
+ .megamenu #nav li.featured .product-item .product-shop .price{font-size:18px;color:#000;}
285
+ /* -------------------------------------------------------------------*/
286
+
287
+ /* -----------------------------Grid Product----------------------------------*/
288
+ .megamenu #nav .products-megamenu-grid{width:100%;}
289
+ .megamenu #nav .products-megamenu-grid ul.level0-megamenu{
290
+ float: left;
291
+ margin: 0; clear:left;
292
+ }
293
+ .megamenu #nav .products-megamenu-grid li.item{
294
+ float:left;
295
+ width:190px;
296
+ border-right:1px solid #d5d5d5;
297
+ padding-left:5px;
298
+ }
299
+ .megamenu #nav .products-megamenu-grid li.item.last{border:none;}
300
+ .megamenu #nav .products-megamenu-grid li.item h1.product-name{
301
+ border-bottom: 1px dashed #D5D5D5;
302
+ float: left;
303
+ font-weight: bold;
304
+ margin: 0 5% 10px;
305
+ padding: 5px 0;
306
+ text-transform: uppercase;
307
+ width: 90%;
308
+ font-size:11px;
309
+ color:#000;
310
+ height: 13px;
311
+ overflow: hidden;
312
+ }
313
+ .megamenu #nav .products-megamenu-grid li.item a.product-image{float:left;width:100%;text-align: center !important; border:none;}
314
+ .megamenu #nav .products-megamenu-grid li.item .product-shop{float:left;width:80% !important;padding:10px 10%;text-align:center;}
315
+ .megamenu #nav .products-megamenu-grid li.item .product-shop label{float:left;padding-right:10px;}
316
+ .megamenu #nav .products-megamenu-grid li.item .product-shop .price{font-size:18px;color:#000;padding:0;width:auto;}
317
+ .megamenu #nav .products-megamenu-grid li.item .product-shop span{width:100%;padding:5px 43px 0px;text-align:center;display: inline-flex;}
318
+ .megamenu #nav .products-megamenu-grid li.item .product-shop .price-box{float:left;width:100%;padding:0; margin:5px 0;}
319
+ .megamenu #nav .magestore-megamenu img{border:none !important;}
320
+
321
+
322
+ /* -------------------------------------------------------------------*/
323
+
324
+ /* ----------------------------- List Product-----------------------------------*/
325
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu{
326
+ float: left !important;
327
+ margin: 0 !important;
328
+ /* padding: 10px 10px !important;*/
329
+ }
330
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu{float:left !important;width:75%;border-right:1px solid #d5d5d5; padding: 0 15px 0 0;}.megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu h4{
331
+ border-bottom: 1px dashed #D5D5D5 !important;
332
+ float: left !important;
333
+ font-weight: bold !important;
334
+ margin: 0 0 5px !important;
335
+ padding: 5px 0 15px !important;
336
+ text-transform: uppercase !important;
337
+ width: 98% !important;
338
+ }
339
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu ul.level2-megamenu{float:left; width:33%;}
340
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu ul.level2-megamenu li{width:100%;padding:0;margin:0;}
341
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu ul.level2-megamenu li a{display:block;}
342
+ .products-megamenu-list .level2-megamenu li span {display: block; padding:7px 10px;}
343
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.featured{
344
+ float:right !important;
345
+ border:none !important;
346
+ padding:0 0 0 1% !important;
347
+ width:25%;
348
+ }
349
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.featured .level1-title h2{
350
+ border-bottom: 1px dashed #D5D5D5 !important;
351
+ float: left !important;
352
+ font-weight: bold !important;
353
+ padding:15px 0 5px;
354
+ margin:0 0 10px;
355
+ text-transform: uppercase !important;
356
+ width: 100% !important;
357
+ }
358
+ /* ----------------------------- Contact-----------------------------------*/
359
+ .megamenu #nav ul.block-contact{
360
+ float: left !important;
361
+ margin: 0 !important;
362
+ padding: 10px 2% !important;
363
+ width: 96% !important;
364
+ }
365
+ .megamenu #nav ul.block-contact li.first{
366
+ float:left !important;
367
+ width:310px !important;
368
+ border-right:1px solid #d5d5d5 !important;
369
+ padding:15px 15px 0 0 !important;
370
+ margin:0 0 15px ;
371
+ }
372
+ .megamenu #nav ul.block-contact li.last{float:left;width:610px;padding:0 10px;}
373
+ .megamenu #nav h1.megamenu-title{
374
+ float:left;
375
+ width:100%;
376
+ border-bottom:1px dashed #d5d5d5;
377
+ padding:0 0 5px;
378
+ margin:0 0 15px;
379
+ border-bottom: 1px dashed #D5D5D5;
380
+ font-weight: bold;
381
+ text-transform: uppercase;
382
+ font-size:13px;
383
+ color:#000;
384
+ }
385
+ .megamenu #nav ul.block-contact li.first .address{
386
+ float:left !important;
387
+ width:70% !important;
388
+ margin:0 0 15px !important;
389
+ }
390
+ .megamenu #nav ul.block-contact li.first .map{
391
+ float:left !important;
392
+ width:100% !important;
393
+ }
394
+ .megamenu #nav ul.block-contact li.last .contact-form{float:left !important;width:100% !important;}
395
+ .megamenu #nav ul.block-contact li.last span{
396
+ float:left !important;
397
+ width:100% !important;
398
+ padding:0 !important;
399
+ }
400
+ .megamenu #nav ul.block-contact li.last .input-box {float:left !important;width:100% !important;padding:15px 0 !important;}
401
+ .megamenu #nav ul.block-contact li.last .input-box .input{float:left !important;width:160px !important;margin-right:10px !important;}
402
+ .megamenu #nav ul.block-contact li.last .input-box .input input{
403
+ width:160px !important;
404
+ border-radius:5px;
405
+ height:25px !important;
406
+ border:1px solid #d5d5d5 !important;
407
+ background:#efefef !important;
408
+ }
409
+ .megamenu #nav ul.block-contact li.last .comment{float:left !important;width:100% !important;padding:10px 0 !important; }
410
+ .megamenu #nav ul.block-contact li.last .comment label{float:left !important;width:100% !important;}
411
+ .megamenu #nav ul.block-contact li.last .comment textarea{
412
+ width:100% !important;
413
+ float:left !important;
414
+ height:150px !important;
415
+ background:#efefef !important;
416
+ }
417
+ .megamenu #nav ul.block-contact li.last .comment .button-set{float:left !important;width:100% !important;padding:10px 0 0 !important;text-align:right;}
418
+ .megamenu div .footer-megamenu{float:left;width:100%;
419
+ //position:
420
+ }
421
+ #nav ul li, #nav ul li.active {
422
+ float: none;
423
+ margin: 0;
424
+ padding-bottom: 1px;
425
+ }
426
+ ol.level2-megamenu li a span, ol.level2-megamenu li a span {
427
+ padding: 3px 15px 4px;
428
+ display:block;
429
+ }
430
+ .magestore-megamenu .level1-megamenu label{line-height:18px; color: #666666; font-size: 11px; font-weight:normal;}
431
+ .megamenu-footer, .megamenu-header, .featured_content { border:0 !important; clear:both; position: static !important;}
432
+ .featured_content { border:0 !important; width: 100% !important;}
433
+ .featured_content ul li{float: left !important;}
434
+ .featured_content > ul > li > h6{border-bottom: 1px dashed #D5D5D5;
435
+ float: left;
436
+ font-weight: bold;
437
+ margin: 0 5% 10px;
438
+ padding: 5px 0;
439
+ text-transform: uppercase;
440
+ width: 90%;
441
+ font-size:11px;
442
+ color:#000;}
443
+
444
+ .featured_content > ul > li{
445
+ float:left;
446
+ width:190px;
447
+ border-right:1px solid #d5d5d5;
448
+ padding-left:5px;
449
+ }
450
+ .megamenu #nav button.button span{
451
+ border: none !important;
452
+ background: inherit !important;
453
+ padding: 0 !important;
454
+ }
455
+
456
+
457
+ .footer-megamenu{
458
+ border: none !important;
459
+ position: static !important;
460
+ }
461
+ .footer-megamenu span{
462
+ cursor: default !important;
463
+
464
+ }
465
+ #nav li.menu_5 .magestore-megamenu div.buttons-set{
466
+ width: 20% !important;
467
+ }
skin/frontend/rwd/default/css/megamenu.css ADDED
@@ -0,0 +1,566 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ============================================ *
2
+ * Mega Menu
3
+ * ============================================ */
4
+
5
+ *{margin:0; padding:0; font-family:Arial,Helmet,Freesans,sans-serif !important;}
6
+ ul, ol {
7
+ list-style: none outside none;
8
+ }
9
+ .megamenu{clear:both;}
10
+ #nav {
11
+ font-size:11px;
12
+ margin:10px auto 0;
13
+ width:960px;
14
+ color:#666; background:#ededed;
15
+ }
16
+
17
+ #nav li {
18
+ float: left;
19
+ text-align: left;
20
+ }
21
+ .megamenu #nav a{
22
+ color: #fff;
23
+ text-decoration:none;
24
+ font-size: 11px;
25
+ }
26
+
27
+ .megamenu #nav{
28
+ position : relative;
29
+ height:55px;
30
+ width:100%; z-index:999;
31
+ }
32
+ .megamenu #nav .magestore-megamenu{
33
+ background:#fff;
34
+ left: 0;
35
+ width:100%;
36
+ border: 1px solid #d6d6d6;
37
+ z-index: 1000;
38
+ display:none;
39
+ position:absolute;
40
+ top:55px; box-shadow: 2px 2px 2px #888;
41
+ }
42
+ .megamenu #nav .magestore-megamenu .sub-menu{
43
+ left: 0;
44
+ height: auto;
45
+ float: left;
46
+ position: static;
47
+ padding:10px 2%; width:100%;
48
+ }
49
+
50
+ /*.megamenu #nav .magestore-megamenu .sub-menu h2, .megamenu #nav .magestore-megamenu .sub-menu h1 { font-size:14px; font-weight:bold; margin:0; color:#3399cc;}*/
51
+ .megamenu #nav .magestore-megamenu .block-megamenu h1, .megamenu #nav .magestore-megamenu .block-megamenu h2 { display:none;}
52
+ .megamenu #nav li:hover .magestore-megamenu{
53
+ display:block;
54
+ }
55
+ .megamenu #nav a.megamenu-lable{
56
+ text-transform:capitalize;
57
+ line-height:50px !important;
58
+ padding:0 15px;
59
+ font-size:14px;
60
+ height:55px;
61
+ line-height:55px;
62
+ display:inline-block;
63
+ color:#636363; font-family:"Raleway","Helvetica Neue",Verdana,Arial,sans-serif !important;
64
+ }
65
+ .megamenu #nav li.over a.megamenu-lable.over{background-color:#222 !important;color:#3399cc !important;}
66
+ .megamenu #nav a.megamenu-lable:hover{color:#3399cc !important;}
67
+ .megamenu #nav li ul.shown-sub,.megamenu #nav li div.shown-sub{
68
+ padding:0 !important;
69
+ margin:0 !important;
70
+ background:none !important;
71
+ border:none !important;
72
+ }
73
+ .megamenu #nav div ul li {background:none !important; border:0 !important;}
74
+ .megamenu #nav div ul li div{position:static !important;border:none ;}
75
+ .megamenu #nav .magestore-megamenu li a{
76
+ background: none repeat scroll 0 0 transparent !important;
77
+ color: #666666 !important;
78
+ font-size: 12px !important;
79
+ height:auto !important;
80
+ text-align:left !important;
81
+ }
82
+
83
+ .megamenu #nav button.button{
84
+ border: 1px solid #1091d3;
85
+ color: #fff;
86
+ float: none;
87
+ font-size: 21px;
88
+ height: 25px;
89
+ padding:0 15px;
90
+ border-radius: 10px;
91
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
92
+ cursor: pointer;
93
+ display: inline-block;
94
+ letter-spacing: -1px;
95
+ outline: medium none;
96
+ position: relative;
97
+ text-decoration: none;
98
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
99
+ background: #1091d3; /* non-CSS3 default background */
100
+ background: -webkit-gradient(linear, left top, left bottom, from(#52a6d0), to(#1091d3));
101
+ background: -moz-linear-gradient(#52a6d0, #1091d3);
102
+ background: -ms-linear-gradient(#52a6d0, #1091d3);
103
+ background: linear-gradient(#52a6d0, #1091d3);
104
+ font-size:12px;
105
+ -pie-background: linear-gradient(#52a6d0, #1091d3);
106
+ }
107
+ .megamenu #nav button.button:hover {
108
+ background: #CE662B;
109
+ background: -webkit-gradient(linear, left top, left bottom, from(#F3C812), to(#CE662B));
110
+ background: -moz-linear-gradient(#F3C812, #CE662B);
111
+ background: -ms-linear-gradient(#F3C812, #CE662B);
112
+ background: linear-gradient(#F3C812, #CE662B);
113
+ -pie-background: linear-gradient(#F3C812, #CE662B);
114
+ }
115
+ .megamenu #nav button.button:active {
116
+ color: #ccc;
117
+ border: solid 1px #1D74B9; /* border */
118
+ background: -webkit-gradient(linear, left top, left bottom, from(#003061), to(#0059b2));
119
+ background: -moz-linear-gradient(#003061, #0059b2);
120
+ background: -ms-linear-gradient(#003061, #0059b2);
121
+ background: linear-gradient(#003061, #0059b2);
122
+ -pie-background: linear-gradient(#003061, #0059b2);
123
+ }
124
+
125
+ /* --------------------- Block home-----------------*/
126
+ .megamenu #nav .block-megamenu ul.block-home{
127
+ float: left;
128
+ margin: 0 !important;
129
+ width: 100% !important;
130
+ }
131
+ .megamenu #nav ul.block-home li{float:left !important;margin-bottom:15px !important; background:none !important;}
132
+ .megamenu #nav h1.block-title{
133
+ float:left;
134
+ font-size:11px;
135
+ width:100%;
136
+ text-align:left;
137
+ padding:0 0 10px;
138
+ font-weight:bold;
139
+ text-transform:uppercase;
140
+ border-bottom:1px dashed #d5d5d5;
141
+ border-top:none !important;
142
+ margin-bottom:10px;
143
+ color:#000;
144
+ }
145
+ .megamenu #nav ul.block-home li.first{
146
+ width:40%;
147
+ padding-right:10px;
148
+ border-right:1px solid #d5d5d5;
149
+ text-align:left !important;
150
+ }
151
+ .megamenu #nav ul.block-home li.first img{border:1px solid #d5d5d5; height: auto; width: 95%;}
152
+ .megamenu #nav ul.block-home li.last{
153
+ width:55% !important;
154
+ padding-left: 15px !important;
155
+ }
156
+ .megamenu #nav ul.block-home li.last span{
157
+ line-height:20px;
158
+ padding:0 0 10px 0;
159
+ float:left;
160
+ width:100%;
161
+ }
162
+
163
+ /* -----------------------------Grid Category-----------------------------------*/
164
+ .megamenu #nav .grid-categories-megamenu h1{
165
+ float:left;
166
+ width:100%;
167
+ margin:0;
168
+ padding:10px 0;
169
+ border-bottom:1px dashed #D5D5D5;
170
+ }
171
+ .megamenu #nav .grid-categories-megamenu ul.level0-megamenu{
172
+ float:left;
173
+ width:100%;
174
+ margin:0;
175
+ }
176
+ .megamenu #nav .grid-categories-megamenu ul.level0-megamenu li.level1-megamenu{
177
+ float:left;
178
+ width:21%;
179
+ padding:0 10px;
180
+ margin:10px 0 0 0;
181
+ border-right:1px solid #d5d5d5;
182
+ min-height:405px;
183
+ }
184
+ .megamenu #nav ul li.featured{
185
+ width:25% !important;
186
+ float:right !important;
187
+ border:none !important;
188
+ padding:0 0 0 10px !important;
189
+ }
190
+ .megamenu #nav .grid-categories-megamenu li .level1-title{
191
+ float:left;
192
+ width:100%;
193
+ padding:10px 0;
194
+ border-bottom:1px dashed #d5d5d5;overflow-x:hidden;
195
+ }
196
+ .megamenu #nav .grid-categories-megamenu li .level1-title h2, li.featured h2{
197
+ padding:0 0 5px;
198
+ margin:0;
199
+ width:100%;
200
+ text-transform:uppercase;
201
+ font-weight:bold;
202
+ color: #000000;
203
+ font-size: 11px;
204
+ }
205
+ .megamenu #nav .grid-categories-megamenu li ol.level2-megamenu{
206
+ float:left;
207
+ width:100%;
208
+ padding:10px 0;
209
+ }
210
+ .megamenu #nav li.featured .level1-content{
211
+ float:left;
212
+ width:100%;
213
+ padding:15px 0 !important;
214
+ }
215
+
216
+ .megamenu #nav li.featured .level1-content a.product-image{float:left;width:40%;margin:0; border:none;}
217
+ .megamenu #nav li.featured .level1-content a.product-image img{width:100%;}
218
+ .megamenu #nav li.featured .level1-content .product-shop{float:left;width:50%;padding-left:10px;}
219
+ .megamenu #nav li.featured .level1-content .product-shop h1.product-name{font-weight:bold;border:none; font-size:11px; color:#666;}
220
+ .megamenu #nav li.featured .level1-content .product-shop span{float:left;width:100%;padding:5px 0 0;}
221
+ .megamenu #nav li.featured .level1-content .product-shop .price-box{float:left;width:100%;padding: 5px 0; font-weight:bold; margin:0 0 5px 0;}
222
+ .megamenu #nav li.featured .level1-content .product-shop .price{font-size:18px;color:#000;}
223
+
224
+
225
+ /* -------------------------------------------------------------------*/
226
+
227
+ /* ----------------------------- list Category----------------------------------*/
228
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu{
229
+ float: left !important;
230
+ margin: 0 !important;
231
+ padding: 10px 15px !important;
232
+ width: 96% !important;
233
+ }
234
+ .megamenu #nav .list-categories-megamenu h1.block-title{
235
+ float:left !important;
236
+ width:100% !important;
237
+ margin:0 !important;
238
+ padding:10px 0 !important;
239
+ border-bottom:1px dashed #D5D5D5 !important;
240
+ text-transform:uppercase;
241
+ }
242
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li.level1-megamenu{
243
+ border-right: 1px solid #D5D5D5 !important;
244
+ float: left !important;
245
+ margin: 10px 0 0 !important;
246
+ padding: 0 10px !important;
247
+ width: 15% !important;
248
+ }
249
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li.featured{
250
+ width:220px !important;
251
+ float:left !important;
252
+ border:none !important;
253
+ padding:0 0 0 5px !important;
254
+ }
255
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu,
256
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu ol,
257
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu li .level1-title{float:left;width:100%;}
258
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu li .level1-title{border-top:1px dashed #d5d5d5;padding-top:5px;}
259
+ .megamenu #nav .list-categories-megamenu ul.level0-megamenu li ul.level2-megamenu li.first .level1-title{border-top:none;padding-top:0;}
260
+ .megamenu #nav .list-categories-megamenu li .level1-title h2{
261
+ padding: 5px 0 !important;
262
+ margin:0 0 5px !important;
263
+ float:left !important;
264
+ width:100% !important;
265
+ text-transform:uppercase !important;
266
+ font-weight:bold !important;
267
+ border-bottom:1px dashed #d5d5d5 !important;
268
+ }
269
+ .megamenu #nav li.featured .product-item{float:left;width:100%;padding:15px 0 !important;}
270
+ .megamenu #nav li.featured .product-item a{float:left;width:110px;margin:0;}
271
+ .megamenu #nav li.featured .product-item .product-shop{float:right;width:105px !important;padding: 0 0 0 5px !important;}
272
+ .megamenu #nav li.featured .product-item .product-shop h1.product-name{font-weight:bold;border:none !important; color:#000000; font-size:11px; font-weight:bold; margin:0; padding:0 0 5px; text-transform:uppercase; width: 100%;}
273
+ .megamenu #nav li.featured .product-item .product-shop span{float:left;width:100%;padding: 0;height:38px;overflow:hidden;}
274
+ .megamenu #nav li.featured .product-item .product-shop .price-box{float:left;width:100%;padding: 0;}
275
+ .megamenu #nav li.featured .product-item .product-shop .price{font-size:18px;color:#000;}
276
+ /* -------------------------------------------------------------------*/
277
+
278
+ /* -----------------------------Grid Product----------------------------------*/
279
+ .megamenu #nav .products-megamenu-grid{width:100%;}
280
+ .megamenu #nav .products-megamenu-grid ul.level0-megamenu{
281
+ float: left;
282
+ margin: 0;
283
+ }
284
+ /*.megamenu #nav .products-megamenu-grid li.item{
285
+ float:left;
286
+ width:185px;
287
+ border-right:1px solid #d5d5d5;
288
+ padding-left:5px; margin-bottom:10px;
289
+ }*/
290
+ .megamenu #nav .products-megamenu-grid li.item {
291
+ box-shadow: 0 1px 4px -1px #000000;
292
+ float: left;
293
+ margin: 0 6px 5px 0;
294
+ padding-left: 5px;
295
+ width: 170px;
296
+ }
297
+ /*.megamenu #nav .products-megamenu-grid li.item.last{border:none;}
298
+ .megamenu #nav .products-megamenu-grid li.item h1.product-name{
299
+ border-bottom: 1px dashed #D5D5D5;
300
+ float: left;
301
+ font-weight: bold;
302
+ margin: 0 5% 10px;
303
+ padding: 5px 0;
304
+ text-transform: uppercase;
305
+ width: 90%;
306
+ font-size:11px;
307
+ color:#000;
308
+ }*/
309
+ /*.megamenu #nav .products-megamenu-grid li.item a.product-image{float:left;width:100%;text-align: center !important; border:none;}*/
310
+ /*.megamenu #nav .products-megamenu-grid li.item .product-shop{float:left;width:80%;padding:10px 10%;text-align:center;}*/
311
+ .megamenu #nav .products-megamenu-grid li.item .product-shop label{float:left;padding-right:10px;}
312
+ .megamenu #nav .products-megamenu-grid li.item .product-shop .price{font-size:18px;color:#000;padding:0;width:auto;}
313
+ .megamenu #nav .products-megamenu-grid li.item .product-shop span{width:100%;padding:5px 0 0;text-align:center;}
314
+ .megamenu #nav .products-megamenu-grid li.item .product-shop .price-box{float:left;width:100%;padding:0; margin:5px 0;}
315
+ .megamenu #nav .magestore-megamenu img{border:none !important;}
316
+
317
+
318
+ /* -------------------------------------------------------------------*/
319
+
320
+ /* ----------------------------- List Product-----------------------------------*/
321
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu{
322
+ float: left !important;
323
+ margin: 0 !important;
324
+ /* padding: 10px 10px !important;*/
325
+ }
326
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu{float:left !important;width:75%;border-right:1px solid #d5d5d5; padding: 0 15px 0 0;}.megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu h4{
327
+ border-bottom: 1px dashed #D5D5D5 !important;
328
+ float: left !important;
329
+ font-weight: bold !important;
330
+ margin: 0 0 5px !important;
331
+ padding: 5px 0 15px !important;
332
+ text-transform: uppercase !important;
333
+ width: 98% !important;
334
+ }
335
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu ul.level2-megamenu{float:left; width:33%;}
336
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu ul.level2-megamenu li{width:100%;padding:0;margin:0;}
337
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.level1-megamenu ul.level2-megamenu li a{display:block;}
338
+ .products-megamenu-list .level2-megamenu li span {display: block; padding:7px 10px;}
339
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.featured{
340
+ float:right !important;
341
+ border:none !important;
342
+ padding:0 0 0 1% !important;
343
+ width:25%;
344
+ }
345
+ .megamenu #nav .products-megamenu-list ul.level0-megamenu li.featured .level1-title h2{
346
+ border-bottom: 1px dashed #D5D5D5 !important;
347
+ float: left !important;
348
+ font-weight: bold !important;
349
+ padding:15px 0 5px;
350
+ margin:0 0 10px;
351
+ text-transform: uppercase !important;
352
+ width: 100% !important;
353
+ }
354
+ /* ----------------------------- Contact-----------------------------------*/
355
+ .megamenu #nav ul.block-contact{
356
+ margin: 0;
357
+ padding: 10px 0;
358
+ }
359
+ .megamenu #nav ul.block-contact li.first{
360
+ float:left !important;
361
+ width:310px !important;
362
+ border-right:1px solid #d5d5d5 !important;
363
+ padding:15px 15px 0 0 !important;
364
+ margin:0 0 15px ;
365
+ }
366
+ .megamenu #nav ul.block-contact li.last{float:left;width:610px;padding:0 10px;}
367
+ .megamenu #nav h1.megamenu-title{
368
+ float:left;
369
+ width:100%;
370
+ border-bottom:1px dashed #d5d5d5;
371
+ padding:0 0 5px;
372
+ margin:0 0 15px;
373
+ border-bottom: 1px dashed #D5D5D5;
374
+ font-weight: bold;
375
+ text-transform: uppercase;
376
+ font-size:13px;
377
+ color:#000;
378
+ }
379
+ .megamenu #nav ul.block-contact li.first .address{
380
+ float:left !important;
381
+ width:70% !important;
382
+ margin:0 0 15px !important;
383
+ }
384
+ .megamenu #nav ul.block-contact li.first .map{
385
+ float:left !important;
386
+ width:100% !important;
387
+ }
388
+ .megamenu #nav ul.block-contact li.last .contact-form{float:left !important;width:100% !important;}
389
+ .megamenu #nav ul.block-contact li.last span{
390
+ float:left !important;
391
+ width:100% !important;
392
+ padding:0 !important;
393
+ }
394
+ .megamenu #nav ul.block-contact li.last .input-box {float:left !important;width:100% !important;padding:15px 0 !important;}
395
+ .megamenu #nav ul.block-contact li.last .input-box .input{float:left !important;width:160px !important;margin-right:10px !important;}
396
+ .megamenu #nav ul.block-contact li.last .input-box .input input{
397
+ width:160px !important;
398
+ border-radius:5px;
399
+ height:25px !important;
400
+ border:1px solid #d5d5d5 !important;
401
+ background:#efefef !important;
402
+ }
403
+ .megamenu #nav ul.block-contact li.last .comment{float:left !important;width:100% !important;padding:10px 0 !important; }
404
+ .megamenu #nav ul.block-contact li.last .comment label{float:left !important;width:100% !important;}
405
+ .megamenu #nav ul.block-contact li.last .comment textarea{
406
+ width:100% !important;
407
+ float:left !important;
408
+ height:150px !important;
409
+ background:#efefef !important;
410
+ }
411
+ .megamenu #nav ul.block-contact li.last .comment .button-set{float:left !important;width:100% !important;padding:10px 0 0 !important;text-align:right;}
412
+ .megamenu div .footer-megamenu{float:left;width:100%;}
413
+ #nav ul li, #nav ul li.active {
414
+ float: none;
415
+ margin: 0;
416
+ padding-bottom: 1px;
417
+ }
418
+ ol.level2-megamenu li a span, ol.level2-megamenu li a span {
419
+ padding: 3px 15px 4px;
420
+ display:block;
421
+ }
422
+ .magestore-megamenu .level1-megamenu label{line-height:18px; color: #666666; font-size: 11px; font-weight:normal; font-weight:bold;}
423
+ .megamenu #nav .magestore-megamenu form{padding:0;}
424
+ /* ============================================ *
425
+ * Small Viewports - Accordion Style Menu
426
+ * ============================================ */
427
+ @media only screen and (max-width: 770px) {
428
+ #header-nav { padding-bottom:0 !important;}
429
+ #header-nav .megamenu #nav { height:auto;}
430
+ #header-nav .megamenu #nav > li { float:none; display:block; clear:both; border-bottom:1px solid #ccc;}
431
+ .megamenu #nav a.megamenu-lable { height:auto; padding:8px 15px; line-height:20px !important; display:block;}
432
+ .megamenu #nav .magestore-megamenu { position:inherit !important; display:none; clear:both; width:100%; box-shadow:none; background:#fff; float:left; border-bottom:1px solid #ccc;}
433
+ .megamenu #nav .magestore-megamenu .sub-menu { width:100%;}
434
+ .megamenu #nav .magestore-megamenu .grid-categories-megamenu { width:100%;}
435
+ .megamenu #nav .magestore-megamenu .grid-categories-megamenu .level1-megamenu { width:100% !important;}
436
+ .megamenu #nav .magestore-megamenu .grid-categories-megamenu .level1-megamenu ul { float:left; width:20% !important;}
437
+ .megamenu #nav .magestore-megamenu .grid-categories-megamenu .featured_content { width:100%;}
438
+ .megamenu #nav li:hover .magestore-megamenu{ display:none; }
439
+ }
440
+
441
+ @media only screen and (max-width: 768px){
442
+
443
+ }
444
+
445
+ @media only screen and (max-width: 480px) {
446
+ .megamenu #nav .magestore-megamenu .grid-categories-megamenu .level1-megamenu ul { width:50% !important;}
447
+ .megamenu #nav .magestore-megamenu .grid-categories-megamenu { width:100% !important;}
448
+ .megamenu #nav .products-megamenu-grid ul.level0-megamenu { width:100% !important;}
449
+ .megamenu #nav .products-megamenu-grid li.item { clear:none !important; float:left !important; width:48%;}
450
+ .megamenu #nav .magestore-megamenu .featured_content li{margin:0 10px 10px 0 !important; clear:none !important;}
451
+ }
452
+
453
+ /* =============================
454
+ Author :: Nitin
455
+ ============================= */
456
+
457
+ .megamenu #nav .magestore-megamenu .megamenu-title{
458
+ color:#3399cc;
459
+ font-size:14px;
460
+ font-weight:bold;
461
+ margin:10px 0 !important;
462
+ }
463
+ .megamenu-header{
464
+ border-bottom: 1px dashed #000000;
465
+ }
466
+ .megamenu-header, .megamenu-footer{
467
+ color: #666666;
468
+ font-size: 12px;
469
+ padding: 10px 0;
470
+ clear:both;
471
+ }
472
+ .megamenu-footer{
473
+ border-top: 1px dashed #000000;
474
+ }
475
+ .megamenu #nav .magestore-megamenu .megamenu-main-content{
476
+ padding:15px 2px;
477
+ display:table;
478
+ overflow:hidden;
479
+ width: 100%;
480
+ }
481
+ .megamenu #nav .magestore-megamenu .grid-categories ul{
482
+ overflow:hidden;
483
+ }
484
+ .megamenu #nav .magestore-megamenu .grid-categories .level1-megamenu{
485
+ display:table;
486
+ padding:10px 0;
487
+ }
488
+ .megamenu #nav .magestore-megamenu .grid-categories .level1-megamenu ul{
489
+ float: left;
490
+ width: 230px;
491
+ overflow:hidden;
492
+ padding-right:10px;
493
+ margin-bottom:15px;
494
+ }
495
+ .megamenu #nav .magestore-megamenu .grid-categories .level1-megamenu ul li{
496
+ padding:2px 0;
497
+ }
498
+ .megamenu #nav .magestore-megamenu .grid-categories .level1-megamenu ul > li:first-child{
499
+ padding:10px 0;
500
+ font-weight:bold;
501
+ }
502
+ .megamenu #nav .magestore-megamenu .grid-categories .level1-megamenu ul > li:first-child a{
503
+ font-size:13px;
504
+ }
505
+ .megamenu #nav .magestore-megamenu .featured_content {
506
+ clear: both;
507
+ padding-bottom:15px;
508
+ }
509
+ .megamenu #nav .magestore-megamenu .featured_content li{
510
+ border: 1px solid #d8d8d8 !important;
511
+ border-radius: 5px;
512
+ float: left !important;
513
+ margin: 0 10px 0 0;
514
+ min-height: 165px;
515
+ text-align: center !important;
516
+ width: 130px;
517
+ padding:10px 5px;
518
+ }
519
+ .megamenu #nav .magestore-megamenu .featured_content li .product_name,
520
+ .products-megamenu-grid .megamenu-main-content ul li .product-name{
521
+ color: #000000;
522
+ font-size: 12px;
523
+ font-weight: bold;
524
+ line-height: normal;
525
+ margin: 0;
526
+ min-height: 45px;
527
+ text-transform: capitalize !important;
528
+ }
529
+
530
+ .megamenu #nav .magestore-megamenu .featured_content li a, .megamenu #nav .magestore-megamenu .featured_content li a img,
531
+ .products-megamenu-grid .megamenu-main-content ul li, .products-megamenu-grid .megamenu-main-content ul li a img{
532
+ display: table;
533
+ margin: 0 auto;
534
+ text-align: center !important;
535
+ border:none;
536
+ }
537
+ .megamenu #nav .magestore-megamenu .featured_content li a .product_price{font-weight:bold; padding:10px 0 0 0;}
538
+
539
+ /* ===========================================
540
+ * Product Listing :: Author :: Nitin
541
+ * =========================================== */
542
+ .products-megamenu-grid .megamenu-main-content ul li{
543
+ display: inline-block;
544
+ float: left;
545
+ margin-bottom: 10px;
546
+ min-height: 240px;
547
+ padding: 10px;
548
+ width: 185px;
549
+ }
550
+ .products-megamenu-grid .megamenu-main-content ul li a{
551
+ border:none;
552
+ }
553
+ .products-megamenu-grid .megamenu-main-content ul li a img{
554
+ width:100px;
555
+ height:100px;
556
+ }
557
+ /* ===========================================
558
+ * Contact Us :: Author :: Nitin
559
+ * =========================================== */
560
+ input[type="email"], input[type="search"], input[type="number"], input[type="password"], input[type="tel"], input[type="text"]{
561
+ width :100% !important;
562
+ max-width:365px !important;
563
+ }
564
+ .megamenu #nav .buttons-set button.button{
565
+ float:left;
566
+ }