Ma2_Widget_Tabs_Free - Version 1.0.0

Version Notes

Version number: 1.0.0
Stability: Stable
Compatibility: 1.7, 1.8

Download this release

Release Info

Developer Magenmarket.com
Extension Ma2_Widget_Tabs_Free
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (28) hide show
  1. app/code/community/Ma2/WidgetTabsF/Block/Adminhtml/System/Config/Form/Field/Tabitem.php +141 -0
  2. app/code/community/Ma2/WidgetTabsF/Block/Widgettabs.php +46 -0
  3. app/code/community/Ma2/WidgetTabsF/Helper/Data.php +33 -0
  4. app/code/community/Ma2/WidgetTabsF/controllers/Adminhtml/WidgettabsController.php +39 -0
  5. app/code/community/Ma2/WidgetTabsF/controllers/IndexController.php +31 -0
  6. app/code/community/Ma2/WidgetTabsF/etc/config.xml +79 -0
  7. app/code/community/Ma2/WidgetTabsF/etc/widget.xml +29 -0
  8. app/code/local/Ma2/All/Helper/Data.php +4 -0
  9. app/code/local/Ma2/All/etc/adminhtml.xml +43 -0
  10. app/code/local/Ma2/All/etc/config.xml +56 -0
  11. app/code/local/Ma2/All/etc/system.xml +9 -0
  12. app/design/adminhtml/default/default/layout/ma2_all.xml +7 -0
  13. app/design/adminhtml/default/default/layout/ma2_widgettabsf.xml +8 -0
  14. app/design/frontend/default/default/layout/ma2_all.xml +9 -0
  15. app/design/frontend/default/default/layout/ma2_widgettabsf.xml +8 -0
  16. app/design/frontend/default/default/template/ma2_widgettabsf/default.phtml +25 -0
  17. app/etc/modules/Ma2_All.xml +9 -0
  18. app/etc/modules/Ma2_WidgetTabsF.xml +13 -0
  19. js/ma2_all/ma2all.css +30 -0
  20. js/ma2_all/ma2all.js +41 -0
  21. package.xml +20 -0
  22. skin/adminhtml/default/default/css/ma2_widgettabsf/images/add_btn_icon.gif +0 -0
  23. skin/adminhtml/default/default/css/ma2_widgettabsf/images/btn_bg.gif +0 -0
  24. skin/adminhtml/default/default/css/ma2_widgettabsf/images/btn_over_bg.gif +0 -0
  25. skin/adminhtml/default/default/css/ma2_widgettabsf/images/cancel_btn_icon.gif +0 -0
  26. skin/adminhtml/default/default/css/ma2_widgettabsf/images/save_btn_icon.gif +0 -0
  27. skin/adminhtml/default/default/css/ma2_widgettabsf/ma2_widgettabsf_adm.css +72 -0
  28. skin/frontend/default/default/css/ma2_widgettabsf/ma2_widgettabsf.css +41 -0
app/code/community/Ma2/WidgetTabsF/Block/Adminhtml/System/Config/Form/Field/Tabitem.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagenMarket.com
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Edit or modify this file with yourown risk.
15
+ *
16
+ * @category Extensions
17
+ * @package Ma2_WidgetTabsF
18
+ * @copyright Copyright (c) 2013 MagenMarket. (http://www.magenmarket.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ **/
21
+ /* $Id: Tabitem.php 8 2013-11-05 07:29:49Z linhnt $ */
22
+
23
+ class Ma2_WidgetTabsF_Block_Adminhtml_System_Config_Form_Field_Tabitem extends Mage_Adminhtml_Block_System_Config_Form_Field
24
+ implements Varien_Data_Form_Element_Renderer_Interface
25
+ {
26
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
27
+ {
28
+ $html = '';
29
+ $html .= '<form id="tab-items" name="tab-items">';
30
+ $html .= '<div id="tab-items-wrapper">';
31
+ $savedTabs = json_decode($element->getValue(),true);
32
+ if(is_array($savedTabs) && count($savedTabs) > 0)
33
+ {
34
+ foreach($savedTabs as $idx => $savedTab)
35
+ {
36
+ $html .= '<div class="tab-item" id="tab-item-'.$idx.'">';
37
+ $html .= '<div class="tab-item-field"><label>'.$this->__('Tab title').'</label><input id="input-item-'.$idx.'" type="text" name="tabs['.$idx.'][title]" value="'.(isset($savedTab['title']) ? $this->escapeHtml($savedTab['title']) : '').'"/></div>';
38
+ $html .= '<div class="tab-item-field"><label>'.$this->__('Tab Content').'</label>';
39
+ $html .= '
40
+ <textarea id="tabs_'.$idx.'_text" name="tabs['.$idx.'][text]" cols="20" rows="16">'.(isset($savedTab['text']) ? $this->escapeHtml($savedTab['text']) : '').'</textarea>
41
+ <button style="" onclick="widgetTools.openDialog(\''.Mage::getBaseUrl().'admin/widget/index/widget_target_id/tabs_'.$idx.'_text\')" class="scalable add-widget plugin" type="button"><span><span><span>Insert Widget...</span></span></span></button>
42
+ </div>
43
+ <a href="javascript: void(0)" class="form-button delete" onclick="javascript:removeTabItem(\'tab-item-'.$idx.'\',\'input-item-'.$idx.'\',\'tabs_'.$idx.'_text\')"><span>'.$this->__('Remove tab').'</span></a>
44
+ </div>';
45
+ }
46
+ }
47
+ else{
48
+ $html .= '<div class="tab-item" id="tab-item-0">';
49
+ $html .= '<div class="tab-item-field"><label>'.$this->__('Tab title').'</label><input type="text" name="tabs[0][title]" id="input-item-0" value=""/></div>';
50
+ $html .= '<div class="tab-item-field"><label>'.$this->__('Tab Content').'</label>';
51
+ $html .= '
52
+ <textarea id="tabs_0_text" name="tabs[0][text]" cols="20" rows="16">'.(isset($savedTab['text']) ? $this->escapeHtml($savedTab['text']) : '').'</textarea>
53
+ <button style="" onclick="widgetTools.openDialog(\''.Mage::getBaseUrl().'admin/widget/index/widget_target_id/tabs_0_text\')" class="scalable add-widget plugin" type="button"><span><span><span>Insert Widget...</span></span></span></button>
54
+ </div>
55
+ <a href="javascript: void(0)" class="form-button delete" onclick="javascript:removeTabItem(\'tab-item-0\',\'input-item-0\',\'tabs_0_text\')"><span>'.$this->__('Remove tab').'</span></a>
56
+ </div>';
57
+ }
58
+ $html .= '</div>';
59
+ $html .= '<a id="tab-item-add" class="form-button add" onclick="addTabItem()"><span>'.$this->__('Add more tabs...').'</span></a>';
60
+ $html .= '</form>';
61
+ $html .= '<a id="tab-items-save" class="form-button save" onclick="saveTabItems()"><span>'.$this->__('Save tabs').'</span></a>';
62
+ $html .= '<input id="'.$element->getId().'" type="hidden" name="'.$element->getName().'" value="'.$this->escapeHtml($element->getValue()).'" />';
63
+ $html .= '
64
+ <script type="text/javascript">
65
+ String.prototype.replaceAll = function(target, replacement) {
66
+ return this.split(target).join(replacement);
67
+ };
68
+
69
+ window.removeTabItem = function (idtab,idinput,idcontent)
70
+ {
71
+ $(idtab).style.display = "none";
72
+ $(idinput).value = "";
73
+ $(idcontent).value = "";
74
+ }
75
+
76
+ window.addTabItem = function(){
77
+ var addId = $$(".tab-item").length;
78
+ var mystring = ""
79
+ + "<div class=\"tab-item-field\"><label>'.$this->__('Tab title').'</label><input id=\"input-item-REPLACE\" type=\"text\" name=\"tabs[REPLACE][title]\" value=\"\"/></div>"
80
+ + "<div class=\"tab-item-field\"><label>'.$this->__('Tab Content').'</label>"
81
+ + "<textarea id=\"tabs_REPLACE_text\" name=\"tabs[REPLACE][text]\" cols=\"20\" rows=\"8\"></textarea><button onclick=\"widgetTools.openDialog(\''.Mage::getBaseUrl().'admin/widget/index/widget_target_id/tabs_REPLACE_text\')\" class=\"scalable add-widget plugin\" type=\"button\"><span><span><span>Insert Widget...</span></span></span></button>"
82
+ + "</div><a href=\"javascript: void(0)\" class=\"form-button delete\" onclick=\"javascript:removeTabItem(\'tab-item-REPLACE\',\'input-item-REPLACE\',\'tabs_REPLACE_text\')\"><span>'.$this->__('Remove tab').'</span></a>";
83
+ var newElement = document.createElement("div");
84
+ newElement.className = "tab-item";
85
+ newElement.id = "tab-item-" + addId;
86
+ newElement.innerHTML = mystring.replaceAll("REPLACE", addId + "");
87
+ $("tab-items-wrapper").appendChild(newElement);
88
+ }
89
+
90
+ window.saveTabItems = function()
91
+ {
92
+ new Ajax.Request("'.Mage::getBaseUrl().'WidgetTabsF/adminhtml_widgettabs/save/", {
93
+ method:"post",
94
+ parameters:$("tab-items").serialize(),
95
+ onSuccess: function(transport) {
96
+ var response = transport.responseText || "no response text";
97
+ //alert("Success! \n\n" + response);
98
+ $("'.$element->getId().'").setValue(response);
99
+ confirmAfterSave();
100
+ },
101
+ onFailure: function() { alert("'.$this->__('Saving failure!').'"); }
102
+ });
103
+ }
104
+
105
+ window.confirmAfterSave = function(){
106
+ /* Dialog.confirm("'.$this->__('Tabs added. Please click Save now to save the widget now or click Save later to save the widget later!').'", {
107
+ className:"magento",
108
+ closable:true,
109
+ resizable:false,
110
+ draggable:true,
111
+ modal: true,
112
+ title:"'.$this->__('Tabs added successfully').'",
113
+ width:268,
114
+ okLabel: "'.$this->__('Save now').'",
115
+ cancelLabel: "'.$this->__('Save later').'",
116
+ buttonClass: "scalable",
117
+ id: "myDialogId",
118
+ cancel:function(win) {},
119
+ ok:function(win) {
120
+ saveAndContinueEdit();
121
+ return false;
122
+ }
123
+ }); */
124
+ Dialog.alert("'.$this->__('Tabs added. Please click [Save] or [Save and Continue Edit] button to save the widget!').'", {
125
+ className:"magento",
126
+ closable:true,
127
+ resizable:false,
128
+ draggable:true,
129
+ modal: true,
130
+ title:"'.$this->__('Tabs added successfully').'",
131
+ width:268,
132
+ buttonClass: "scalable",
133
+ id: "myDialogId"
134
+ });
135
+ }
136
+ </script>
137
+ ';
138
+ return $html;
139
+ }
140
+ }
141
+ ?>
app/code/community/Ma2/WidgetTabsF/Block/Widgettabs.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagenMarket.com
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Edit or modify this file with yourown risk.
15
+ *
16
+ * @category Extensions
17
+ * @package Ma2_WidgetTabsF
18
+ * @copyright Copyright (c) 2013 MagenMarket. (http://www.magenmarket.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ **/
21
+ /* $Id: Widgettabs.php 8 2013-11-05 07:29:49Z linhnt $ */
22
+
23
+ class Ma2_WidgetTabsF_Block_Widgettabs extends Mage_Catalog_Block_Product_Abstract implements Mage_Widget_Block_Interface
24
+ {
25
+ /**
26
+ * A model to serialize attributes
27
+ * @var Varien_Object
28
+ */
29
+ protected $_serializer = null;
30
+ /**
31
+ * Initialization
32
+ */
33
+ protected function _construct()
34
+ {
35
+ $this->_serializer = new Varien_Object();
36
+ parent::_construct();
37
+ }
38
+ /**
39
+ * Assign variables
40
+ **/
41
+ protected function _toHtml()
42
+ {
43
+ $this->assign('tabsData',json_decode($this->getData('tab_item'),true));
44
+ return parent::_toHtml();
45
+ }
46
+ }
app/code/community/Ma2/WidgetTabsF/Helper/Data.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagenMarket.com
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Edit or modify this file with yourown risk.
15
+ *
16
+ * @category Extensions
17
+ * @package Ma2_WidgetTabsF
18
+ * @copyright Copyright (c) 2013 MagenMarket. (http://www.magenmarket.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ **/
21
+ /* $Id: Data.php 8 2013-11-05 07:29:49Z linhnt $ */
22
+
23
+ class Ma2_WidgetTabsF_Helper_Data extends Mage_Core_Helper_Abstract
24
+ {
25
+ public function randomkeys($length) {
26
+ $pattern = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
27
+ $key = '';
28
+ for($i = 0; $i < $length; $i++) {
29
+ $key .= $pattern{rand(0,strlen($pattern)-1)};
30
+ }
31
+ return $key;
32
+ }
33
+ }
app/code/community/Ma2/WidgetTabsF/controllers/Adminhtml/WidgettabsController.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagenMarket.com
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Edit or modify this file with yourown risk.
15
+ *
16
+ * @category Extensions
17
+ * @package Ma2_WidgetTabsF
18
+ * @copyright Copyright (c) 2013 MagenMarket. (http://www.magenmarket.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ **/
21
+ /* $Id: WidgettabsController.php 8 2013-11-05 07:29:49Z linhnt $ */
22
+
23
+ class Ma2_WidgetTabsF_Adminhtml_WidgettabsController extends Mage_Adminhtml_Controller_Action
24
+ {
25
+ public function saveAction()
26
+ {
27
+ $tabs = $this->getRequest()->getPost('tabs');
28
+ $newTabs = array();
29
+ foreach($tabs as $tab)
30
+ {
31
+ if(trim($tab["title"]) != "" && trim($tab["text"]) != "")
32
+ {
33
+ $newTabs[] = $tab;
34
+ }
35
+ }
36
+ echo json_encode($newTabs);
37
+ }
38
+ }
39
+ ?>
app/code/community/Ma2/WidgetTabsF/controllers/IndexController.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * MagenMarket.com
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * Edit or modify this file with yourown risk.
15
+ *
16
+ * @category Extensions
17
+ * @package Ma2_WidgetTabsF
18
+ * @copyright Copyright (c) 2013 MagenMarket. (http://www.magenmarket.com)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ **/
21
+ /* $Id: IndexController.php 8 2013-11-05 07:29:49Z linhnt $ */
22
+
23
+ class Ma2_WidgetTabsF_IndexController extends Mage_Adminhtml_Controller_Action
24
+ {
25
+ public function indexAction()
26
+ {
27
+ $this->loadLayout();
28
+ $this->renderLayout();
29
+ }
30
+ }
31
+ ?>
app/code/community/Ma2/WidgetTabsF/etc/config.xml ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ma2_WidgetTabsF>
5
+ <version>1.0.0</version>
6
+ </Ma2_WidgetTabsF>
7
+ </modules>
8
+
9
+ <admin>
10
+ <routers>
11
+ <WidgetTabsF>
12
+ <use>admin</use>
13
+ <args>
14
+ <module>Ma2_WidgetTabsF</module>
15
+ <frontName>WidgetTabsF</frontName>
16
+ </args>
17
+ </WidgetTabsF>
18
+ </routers>
19
+ </admin>
20
+
21
+ <adminhtml>
22
+ <layout>
23
+ <updates>
24
+ <WidgetTabsF>
25
+ <file>ma2_widgettabsf.xml</file>
26
+ </WidgetTabsF>
27
+ </updates>
28
+ </layout>
29
+ </adminhtml>
30
+
31
+ <frontend>
32
+ <layout>
33
+ <updates>
34
+ <WidgetTabsF>
35
+ <file>ma2_widgettabsf.xml</file>
36
+ </WidgetTabsF>
37
+ </updates>
38
+ </layout>
39
+ </frontend>
40
+
41
+ <global>
42
+ <helpers>
43
+ <WidgetTabsF>
44
+ <class>Ma2_WidgetTabsF_Helper</class>
45
+ </WidgetTabsF>
46
+ </helpers>
47
+ <blocks>
48
+ <WidgetTabsF>
49
+ <class>Ma2_WidgetTabsF_Block</class>
50
+ </WidgetTabsF>
51
+ </blocks>
52
+ <models>
53
+ <WidgetTabsF>
54
+ <class>Ma2_WidgetTabsF_Model</class>
55
+ </WidgetTabsF>
56
+ </models>
57
+ <resources>
58
+ <WidgetTabsF_setup>
59
+ <setup>
60
+ <module>Ma2_WidgetTabsF</module>
61
+ <class>Mage_Eav_Model_Entity_Setup</class>
62
+ </setup>
63
+ <connection>
64
+ <use>core_setup</use>
65
+ </connection>
66
+ </WidgetTabsF_setup>
67
+ <WidgetTabsF_write>
68
+ <connection>
69
+ <use>core_write</use>
70
+ </connection>
71
+ </WidgetTabsF_write>
72
+ <WidgetTabsF_read>
73
+ <connection>
74
+ <use>core_read</use>
75
+ </connection>
76
+ </WidgetTabsF_read>
77
+ </resources>
78
+ </global>
79
+ </config>
app/code/community/Ma2/WidgetTabsF/etc/widget.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <widgets>
3
+ <widgettabsf type="WidgetTabsF/Widgettabs" module="WidgetTabsF">
4
+ <name>Ma2 Widget Tabs Free</name>
5
+ <description>Widget tabs free version from MagenMarket</description>
6
+ <parameters>
7
+ <tab_item translate="label">
8
+ <visible>1</visible>
9
+ <required>1</required>
10
+ <label></label>
11
+ <type>WidgetTabsF/adminhtml_system_config_form_field_tabitem</type>
12
+ <sort_order>1</sort_order>
13
+ </tab_item>
14
+ <template>
15
+ <required>1</required>
16
+ <visible>1</visible>
17
+ <label>Select template</label>
18
+ <type>select</type>
19
+ <value>ma2_widgettabsf/default.phtml</value>
20
+ <values>
21
+ <default translate="label">
22
+ <value>ma2_widgettabsf/default.phtml</value>
23
+ <label>Default Template</label>
24
+ </default>
25
+ </values>
26
+ </template>
27
+ </parameters>
28
+ </widgettabsf>
29
+ </widgets>
app/code/local/Ma2/All/Helper/Data.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class Ma2_All_Helper_Data extends Mage_Core_Helper_Abstract {
3
+
4
+ }
app/code/local/Ma2/All/etc/adminhtml.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <layout>
4
+ <updates>
5
+ <ma2all module="Ma2_All">
6
+ <file>ma2_all.xml</file>
7
+ </ma2all>
8
+ </updates>
9
+ </layout>
10
+ <menu>
11
+ <ma2 translate="title" module="ma2all">
12
+ <title>MA2</title>
13
+ <sort_order>89</sort_order>
14
+ </ma2>
15
+ </menu>
16
+
17
+ <acl>
18
+ <resources>
19
+ <all>
20
+ <title>Allow Everything</title>
21
+ </all>
22
+ <admin>
23
+ <children>
24
+ <ma2>
25
+ <title>MA2</title>
26
+ <sort_order>89</sort_order>
27
+ </ma2>
28
+ <system>
29
+ <children>
30
+ <config>
31
+ <children>
32
+ <ma2all>
33
+ <title>MagenMarket Extensions</title>
34
+ </ma2all>
35
+ </children>
36
+ </config>
37
+ </children>
38
+ </system>
39
+ </children>
40
+ </admin>
41
+ </resources>
42
+ </acl>
43
+ </config>
app/code/local/Ma2/All/etc/config.xml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ma2_All>
5
+ <version>0.1.0</version>
6
+ </Ma2_All>
7
+ </modules>
8
+
9
+ <frontend>
10
+ <layout>
11
+ <updates>
12
+ <ma2all>
13
+ <file>ma2_all.xml</file>
14
+ </ma2all>
15
+ </updates>
16
+ </layout>
17
+ </frontend>
18
+
19
+ <global>
20
+ <blocks>
21
+ <ma2all>
22
+ <class>Ma2_All_Block</class>
23
+ </ma2all>
24
+ </blocks>
25
+ <resources>
26
+ <ma2all_setup>
27
+ <setup>
28
+ <module>Ma2_All</module>
29
+ </setup>
30
+ <connection>
31
+ <use>core_setup</use>
32
+ </connection>
33
+ </ma2all_setup>
34
+ <ma2all_write>
35
+ <connection>
36
+ <use>core_write</use>
37
+ </connection>
38
+ </ma2all_write>
39
+ <ma2all_read>
40
+ <connection>
41
+ <use>core_read</use>
42
+ </connection>
43
+ </ma2all_read>
44
+ </resources>
45
+ <models>
46
+ <ma2all>
47
+ <class>Ma2_All_Model</class>
48
+ </ma2all>
49
+ </models>
50
+ <helpers>
51
+ <ma2all>
52
+ <class>Ma2_All_Helper</class>
53
+ </ma2all>
54
+ </helpers>
55
+ </global>
56
+ </config>
app/code/local/Ma2/All/etc/system.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <ma2 translate="label" module="ma2all">
5
+ <label>MagenMarket Extensions</label>
6
+ <sort_order>168</sort_order>
7
+ </ma2>
8
+ </tabs>
9
+ </config>
app/design/adminhtml/default/default/layout/ma2_all.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <adminhtml_system_config_edit>
6
+ </adminhtml_system_config_edit>
7
+ </layout>
app/design/adminhtml/default/default/layout/ma2_widgettabsf.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss"><css>css/ma2_widgettabsf/ma2_widgettabsf_adm.css</css></action>
6
+ </reference>
7
+ </default>
8
+ </layout>
app/design/frontend/default/default/layout/ma2_all.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addItem"><type>js_css</type><css>ma2_all/ma2all.css</css></action>
6
+ <action method="addJs"><script>ma2_all/ma2all.js</script></action>
7
+ </reference>
8
+ </default>
9
+ </layout>
app/design/frontend/default/default/layout/ma2_widgettabsf.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss"><css>css/ma2_widgettabsf/ma2_widgettabsf.css</css></action>
6
+ </reference>
7
+ </default>
8
+ </layout>
app/design/frontend/default/default/template/ma2_widgettabsf/default.phtml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $rid = Mage::helper("WidgetTabsF")->randomkeys(16);?>
2
+ <div class="ma2-widgettabs-wrapper">
3
+ <dl id="tabsData<?php echo $rid;?>" class="tabsData">
4
+ <?php foreach($tabsData as $idx => $tab):?>
5
+ <dt id="tab_<?php echo $idx.$rid; ?>" class="tab"><span><?php echo $tab['title'];?></span></dt>
6
+ <dd id="tab_<?php echo $idx.$rid; ?>_contents" class="tab-container">
7
+ <div class="tab-content">
8
+ <?php
9
+ echo Mage::helper('cms')->getBlockTemplateProcessor()->filter($tab['text']);
10
+ ?>
11
+ </div>
12
+ </dd>
13
+ <?php endforeach;?>
14
+ </dl>
15
+ </div>
16
+ <script type="text/javascript">
17
+ //<![CDATA[
18
+ var Ma2Tabs<?php echo $rid;?> = new Ma2All.Tabs('tabsData<?php echo $rid;?>');
19
+ Event.observe(window, 'load', function() {
20
+ Ma2Tabs<?php echo $rid;?>.select();
21
+ });
22
+ //]]>
23
+ </script>
24
+
25
+
app/etc/modules/Ma2_All.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ma2_All>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Ma2_All>
8
+ </modules>
9
+ </config>
app/etc/modules/Ma2_WidgetTabsF.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ma2_WidgetTabsF>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <!-- <depends>
8
+ <Mage_Catalog />
9
+ <Mage_Cms />
10
+ </depends> -->
11
+ </Ma2_WidgetTabsF>
12
+ </modules>
13
+ </config>
js/ma2_all/ma2all.css ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*# TABS - Default pure style #######################################*/
3
+ .tab-list { position:relative; }
4
+ .tab-list .tab { float:left; cursor:pointer; }
5
+ .tab-list .last {}
6
+ .tab-list .active { cursor:default }
7
+ .tab-list .tab-container { position:absolute; left:0; width:100%; }
8
+ .tab-list .tab-content {overflow: hidden;}
9
+
10
+ .tab-list { padding-bottom:15px; margin:0 0 15px; }
11
+ .tab-list .tab { position:relative; z-index:2; margin-right:3px; background:#EEE; border: 1px solid #C4C4C4; color:#888; padding:0 0 0 10px; font-size:14px; }
12
+ .tab-list .tab span { padding:0 10px 0 0; line-height:24px; float:left; font-weight: bold;}
13
+ .tab-list .last {}
14
+ .tab-list .active { color:#000; font-weight:bold; z-index:3; border-bottom:0; background:#fff;
15
+ background-image: -moz-linear-gradient(top, #CDCDCD, #FFFFFF);
16
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#CDCDCD), to(#FFFFFF));
17
+ background-image: -webkit-linear-gradient(top, #CDCDCD, #FFFFFF);
18
+ background-image: -o-linear-gradient(top, #CDCDCD, #FFFFFF);
19
+ background-image: linear-gradient(to bottom, #CDCDCD, #FFFFFF);
20
+
21
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFCDCDCD', endColorstr='#FFFFFFFF', GradientType=0);
22
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
23
+ }
24
+ .tab-list .active span { background-position:100% 0; padding-bottom:1px; }
25
+ .tab-list .tab-container { z-index:1; top:25px; background:#fff; }
26
+ .tab-list .tab-content { padding: 1.2em 1em; background:#fff; border:1px solid #c4c4c4; font-size:12px; }
27
+ .tab-list .tab-content object,
28
+ .tab-list .tab-content embed { width:100% !important; height:auto !important; }
29
+
30
+ /*# #######################################*/
js/ma2_all/ma2all.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if (!window.Ma2All) {
2
+ window.Ma2All = {};
3
+ }
4
+ Ma2All.templatesPattern = /(^|.|\r|\n)(\{\{(.*?)\}\})/;
5
+
6
+ /* Tabs */
7
+ Ma2All.Tabs = Class.create();
8
+ Object.extend(Ma2All.Tabs.prototype, {
9
+ initialize: function (container) {
10
+ this.container = $(container);
11
+ this.container.addClassName('tab-list');
12
+ this.tabs = this.container.select('dt.tab');
13
+ this.activeTab = this.tabs.first();
14
+ this.tabs.first().addClassName('first');
15
+ this.tabs.last().addClassName('last');
16
+ this.onTabClick = this.handleTabClick.bindAsEventListener(this);
17
+ for (var i = 0, l = this.tabs.length; i < l; i ++) {
18
+ this.tabs[i].observe('click', this.onTabClick);
19
+ }
20
+ this.select();
21
+ },
22
+ handleTabClick: function (evt) {
23
+ this.activeTab = Event.findElement(evt, 'dt');
24
+ this.select();
25
+ },
26
+ select: function () {
27
+ for (var i = 0, l = this.tabs.length; i < l; i ++) {
28
+ if (this.tabs[i] == this.activeTab) {
29
+ this.tabs[i].addClassName('active');
30
+ this.tabs[i].style.zIndex = this.tabs.length + 2;
31
+ /*this.tabs[i].next('dd').show();*/
32
+ new Effect.Appear (this.tabs[i].next('dd'), { duration:0.5 });
33
+ this.tabs[i].parentNode.style.height=this.tabs[i].next('dd').getHeight() + 15 + 'px';
34
+ } else {
35
+ this.tabs[i].removeClassName('active');
36
+ this.tabs[i].style.zIndex = this.tabs.length + 1 - i;
37
+ this.tabs[i].next('dd').hide();
38
+ }
39
+ }
40
+ }
41
+ });
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Ma2_Widget_Tabs_Free</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Ma2 WidgetTabs Free for Magento is a widget module from MagenMarket.com which helps you create tabs widget instances to put anywhere in your Magento store. Tab's content can be text or any widget.</summary>
10
+ <description>Ma2 WidgetTabs Free for Magento is a widget module from MagenMarket.com which helps you create tabs widget instances to put anywhere in your Magento store. Tab's content can be text or any widget.</description>
11
+ <notes>Version number: 1.0.0&#xD;
12
+ Stability: Stable &#xD;
13
+ Compatibility: 1.7, 1.8</notes>
14
+ <authors><author><name>Magenmarket.com</name><user>Magen_Market</user><email>trungdt@omegatheme.com</email></author></authors>
15
+ <date>2013-12-16</date>
16
+ <time>08:31:25</time>
17
+ <contents><target name="magecommunity"><dir name="Ma2"><dir name="WidgetTabsF"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Tabitem.php" hash="5c9613d98015766ce710c1e56947e7fd"/></dir></dir></dir></dir></dir><file name="Widgettabs.php" hash="89a00b90aa7304c82602f0c0ea9b53ca"/></dir><dir name="Helper"><file name="Data.php" hash="4e0c2d34a2edc3fb063eeae0cb696b33"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="WidgettabsController.php" hash="cc79b497dbce76a5e9f6643366d980a4"/></dir><file name="IndexController.php" hash="629fa1406e62bb1007a26360027166fe"/></dir><dir name="etc"><file name="config.xml" hash="d17341248a2a5cf27a256c733428a6ff"/><file name="widget.xml" hash="4fc77fce163bd4cf3083edefb20878a0"/></dir></dir></dir></target><target name="magelocal"><dir name="Ma2"><dir name="All"><dir name="Helper"><file name="Data.php" hash="090f4bd5ef8f576332f30e6bfc007c5d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9e1f55ce0e5915b7b22d87e94d4da9ea"/><file name="config.xml" hash="be5bb5343d9525bb292c8e26d2aa68f7"/><file name="system.xml" hash="e687810f26218933731768f75c28e9d6"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ma2_all.xml" hash="f0f2088fe954efa17abc4c138d1c301a"/><file name="ma2_widgettabsf.xml" hash="d4b57cac2dd7884e98e852e6b468e13f"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="ma2_all.xml" hash="60da2a96f1c431e35c409190c269af68"/><file name="ma2_widgettabsf.xml" hash="c6cb955cd0d1443d0fea638ac9da0d8b"/></dir><dir name="template"><dir name="ma2_widgettabsf"><file name="default.phtml" hash="11fa4dc2bfd8ba19bb2463583da50831"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ma2_All.xml" hash="1f6125faeadf108fc81b1a03b4574d59"/><file name="Ma2_WidgetTabsF.xml" hash="e977d70767e57333c503a4fcf8171e95"/></dir></target><target name="mage"><dir name="js"><dir name="ma2_all"><file name="ma2all.css" hash="9c4db2cea69d0b7e2a03c149dc21749e"/><file name="ma2all.js" hash="a0e4d21d363f5b9cdfc4c6c0731f6b69"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><dir name="ma2_widgettabsf"><dir name="images"><file name="add_btn_icon.gif" hash="7300097305b577ee564dc49102822d16"/><file name="btn_bg.gif" hash="37c51a4d48a92da9648dcd3ca011039f"/><file name="btn_over_bg.gif" hash="f91641168454c03d1fa72731ec97a2b3"/><file name="cancel_btn_icon.gif" hash="97e0cd94ed31d6f2a1181f627e60e9a3"/><file name="save_btn_icon.gif" hash="f5da95ac65efff5f5cf9c8830202764d"/></dir><file name="ma2_widgettabsf_adm.css" hash="e8f9443a3fc6b895acc60853d18ee8f3"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="ma2_widgettabsf"><file name="ma2_widgettabsf.css" hash="6125118f257616cba946b6543652d8c5"/></dir></dir></dir></dir></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
+ </package>
skin/adminhtml/default/default/css/ma2_widgettabsf/images/add_btn_icon.gif ADDED
Binary file
skin/adminhtml/default/default/css/ma2_widgettabsf/images/btn_bg.gif ADDED
Binary file
skin/adminhtml/default/default/css/ma2_widgettabsf/images/btn_over_bg.gif ADDED
Binary file
skin/adminhtml/default/default/css/ma2_widgettabsf/images/cancel_btn_icon.gif ADDED
Binary file
skin/adminhtml/default/default/css/ma2_widgettabsf/images/save_btn_icon.gif ADDED
Binary file
skin/adminhtml/default/default/css/ma2_widgettabsf/ma2_widgettabsf_adm.css ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * MagenMarket.com
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Open Software License (OSL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Edit or modify this file with yourown risk.
14
+ *
15
+ * @category Extensions
16
+ * @package Ma2_WidgetTabsF
17
+ * @copyright Copyright (c) 2013 MagenMarket. (http://www.magenmarket.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ **/
20
+ /* $Id: ma2_widgettabsf_adm.css 8 2013-11-05 07:29:49Z linhnt $ */
21
+
22
+ #tab-items-wrapper{}
23
+ .tab-item
24
+ {
25
+ background: none repeat scroll 0 0 #E7EFEF;
26
+ border: 1px solid #CDDDDD;
27
+ margin: 0.5em 0 1.5em;
28
+ overflow: hidden;
29
+ padding: 1em;
30
+ width: 600px;
31
+ }
32
+
33
+ .tab-title{}
34
+ .tab-conent{
35
+ margin-left:25px;
36
+ }
37
+
38
+ #tab-items-wrapper label{display: block; font-weight:bold;}
39
+ #tab-items-wrapper select {width: 90%; max-width: 280px; }
40
+ #tab-items-wrapper input,
41
+ #tab-items-wrapper textarea {padding: 2px 4px; width: 90% !important; }
42
+ #tab-items-wrapper textarea {height:6em;}
43
+
44
+ .tab-item-field {margin-top: 1em;}
45
+ a.form-button {text-decoration: none;}
46
+ a.form-button:hover {color: #FFF; background: url("images/btn_over_bg.gif") repeat-x scroll 0 100% #FFAC47;}
47
+ .form-button.delete {
48
+ float:right;
49
+ margin-right:4.2em;
50
+ }
51
+ .form-button.save span {
52
+ background-image: url("images/save_btn_icon.gif");
53
+ }
54
+ .form-button.add span {
55
+ background-image: url("images/add_btn_icon.gif");
56
+ }
57
+
58
+ .form-button.delete span {
59
+ background-image: url("images/cancel_btn_icon.gif");
60
+ }
61
+ .form-button.delete span,
62
+ .form-button.save span,
63
+ .form-button.add span
64
+ {
65
+ padding-left: 20px;
66
+ background-repeat: no-repeat;
67
+ background-position: left center;
68
+ }
69
+ #tab-items-save,#tab-item-add
70
+ {
71
+ margin-right:1em;
72
+ }
skin/frontend/default/default/css/ma2_widgettabsf/ma2_widgettabsf.css ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * MagenMarket.com
3
+ *
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Open Software License (OSL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * DISCLAIMER
12
+ *
13
+ * Edit or modify this file with yourown risk.
14
+ *
15
+ * @category Extensions
16
+ * @package Ma2_WidgetTabsF
17
+ * @copyright Copyright (c) 2013 MagenMarket. (http://www.magenmarket.com)
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ **/
20
+ /* $Id: ma2_widgettabsf.css 8 2013-11-05 07:29:49Z linhnt $ */
21
+
22
+ /*# Ma2 WidgetTabs #######################################*/
23
+ .tabsData { padding-bottom:15px; margin:0 0 15px; }
24
+ .tabsData .tab { position:relative; z-index:2; margin-right:3px; background:#EEE; border: 1px solid #C4C4C4; color:#888; padding:0 0 0 10px; font-size:14px; }
25
+ .tabsData .tab span { padding:0 10px 0 0; line-height:24px; float:left; font-weight: bold;}
26
+ .tabsData .last {}
27
+ .tabsData .active { color:#000; font-weight:bold; z-index:3; border-bottom:0; background:#fff;
28
+ background-image: -moz-linear-gradient(top, #CDCDCD, #FFFFFF);
29
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#CDCDCD), to(#FFFFFF));
30
+ background-image: -webkit-linear-gradient(top, #CDCDCD, #FFFFFF);
31
+ background-image: -o-linear-gradient(top, #CDCDCD, #FFFFFF);
32
+ background-image: linear-gradient(to bottom, #CDCDCD, #FFFFFF);
33
+
34
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFCDCDCD', endColorstr='#FFFFFFFF', GradientType=0);
35
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
36
+ }
37
+ .tabsData .active span { background-position:100% 0; padding-bottom:1px; }
38
+ .tabsData .tab-container { z-index:1; top:25px; background:#fff; }
39
+ .tabsData .tab-content { padding: 1.2em 1em; background:#fff; border:1px solid #c4c4c4; font-size:12px; }
40
+ .tabsData .tab-content object,
41
+ .tabsData .tab-content embed { width:100% !important; height:auto !important; }