Version Notes
initial release. Post all issues or bugs at magazento.com/ticket
Download this release
Release Info
Developer | volgodark |
Extension | megabile |
Version | 0.0.2 |
Comparing to | |
See all releases |
Code changes from version 0.0.1 to 0.0.2
- app/code/community/Magazento/Megabile/Block/Admin/Item/Edit/Tab/Form.php +15 -5
- app/code/community/Magazento/Megabile/Block/Admin/Item/Edit/Tab/Related.php +2 -0
- app/code/community/Magazento/Megabile/Block/Admin/Item/Grid.php +4 -0
- app/code/community/Magazento/Megabile/Block/Admin/Item/Grid/Renderer/Category.php +1 -1
- app/code/community/Magazento/Megabile/Block/Admin/Item/Grid/Renderer/Time.php +1 -1
- app/code/community/Magazento/Megabile/Block/Info.php +29 -0
- app/code/community/Magazento/Megabile/Model/Item.php +18 -5
- app/code/community/Magazento/Megabile/etc/system.xml +5 -19
- app/code/community/Magazento/Megabile/sql/megabile_setup/mysql4-install-0.0.1.php +8 -18
- app/design/adminhtml/default/default/layout/magazento_megabile.xml +25 -0
- app/design/adminhtml/default/default/template/magazento_megabile/cattree.phtml +0 -128
- package.xml +3 -3
app/code/community/Magazento/Megabile/Block/Admin/Item/Edit/Tab/Form.php
CHANGED
@@ -25,7 +25,7 @@ class Magazento_Megabile_Block_Admin_Item_Edit_Tab_Form extends Mage_Adminhtml_B
|
|
25 |
|
26 |
$fieldset->addField('filename', 'text', array(
|
27 |
'label' => Mage::helper('megabile')->__('Filename'),
|
28 |
-
'note' => Mage::helper('
|
29 |
'name' => 'filename',
|
30 |
'required' => true,
|
31 |
));
|
@@ -38,6 +38,16 @@ class Magazento_Megabile_Block_Admin_Item_Edit_Tab_Form extends Mage_Adminhtml_B
|
|
38 |
'style' => 'width:100%',
|
39 |
));
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
$fieldset->addField('products_for_export', 'select', array(
|
42 |
'label' => Mage::helper('megabile')->__('Products For Export'),
|
43 |
'name' => 'products_for_export',
|
@@ -46,11 +56,11 @@ class Magazento_Megabile_Block_Admin_Item_Edit_Tab_Form extends Mage_Adminhtml_B
|
|
46 |
'0' => Mage::helper('megabile')->__('All Produdcts'),
|
47 |
'1' => Mage::helper('megabile')->__('Only Selected'),
|
48 |
),
|
49 |
-
'note' => Mage::helper('
|
50 |
));
|
51 |
|
52 |
$fieldset->addField('use_attributes', 'select', array(
|
53 |
-
'label' => Mage::helper('megabile')->__('Use
|
54 |
'name' => 'use_attributes',
|
55 |
'required' => true,
|
56 |
'options' => array(
|
@@ -60,8 +70,8 @@ class Magazento_Megabile_Block_Admin_Item_Edit_Tab_Form extends Mage_Adminhtml_B
|
|
60 |
));
|
61 |
|
62 |
$fieldset->addField('product_attributes', 'multiselect', array(
|
63 |
-
'label' => Mage::helper('megabile')->__('Extra
|
64 |
-
'note' => Mage::helper('
|
65 |
'name' => 'product_attributes',
|
66 |
'values' => Mage::getModel('megabile/data')->storeAttributes4Form(),
|
67 |
'required' => false,
|
25 |
|
26 |
$fieldset->addField('filename', 'text', array(
|
27 |
'label' => Mage::helper('megabile')->__('Filename'),
|
28 |
+
'note' => Mage::helper('megabile')->__('example: megabile_general.xml'),
|
29 |
'name' => 'filename',
|
30 |
'required' => true,
|
31 |
));
|
38 |
'style' => 'width:100%',
|
39 |
));
|
40 |
|
41 |
+
$fieldset->addField('description_field', 'select', array(
|
42 |
+
'label' => Mage::helper('megabile')->__('Description Field'),
|
43 |
+
'name' => 'description_field',
|
44 |
+
'required' => true,
|
45 |
+
'options' => array(
|
46 |
+
'description' => Mage::helper('megabile')->__('Description'),
|
47 |
+
'short_description' => Mage::helper('megabile')->__('Short Description'),
|
48 |
+
),
|
49 |
+
));
|
50 |
+
|
51 |
$fieldset->addField('products_for_export', 'select', array(
|
52 |
'label' => Mage::helper('megabile')->__('Products For Export'),
|
53 |
'name' => 'products_for_export',
|
56 |
'0' => Mage::helper('megabile')->__('All Produdcts'),
|
57 |
'1' => Mage::helper('megabile')->__('Only Selected'),
|
58 |
),
|
59 |
+
'note' => Mage::helper('megabile')->__('If "only selected" you will need to select products'),
|
60 |
));
|
61 |
|
62 |
$fieldset->addField('use_attributes', 'select', array(
|
63 |
+
'label' => Mage::helper('megabile')->__('Use Attributes'),
|
64 |
'name' => 'use_attributes',
|
65 |
'required' => true,
|
66 |
'options' => array(
|
70 |
));
|
71 |
|
72 |
$fieldset->addField('product_attributes', 'multiselect', array(
|
73 |
+
'label' => Mage::helper('megabile')->__('Extra Attributes'),
|
74 |
+
'note' => Mage::helper('megabile')->__('We will put them in the bottom of product description'),
|
75 |
'name' => 'product_attributes',
|
76 |
'values' => Mage::getModel('megabile/data')->storeAttributes4Form(),
|
77 |
'required' => false,
|
app/code/community/Magazento/Megabile/Block/Admin/Item/Edit/Tab/Related.php
CHANGED
@@ -31,11 +31,13 @@ class Magazento_Megabile_Block_Admin_Item_Edit_Tab_Related extends Mage_Adminhtm
|
|
31 |
|
32 |
return parent::_prepareCollection();
|
33 |
}
|
|
|
34 |
protected function _getStore()
|
35 |
{
|
36 |
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
37 |
return Mage::app()->getStore($storeId);
|
38 |
}
|
|
|
39 |
protected function _prepareColumns() {
|
40 |
$this->addColumn('in_products', array(
|
41 |
'header_css_class' => 'a-center',
|
31 |
|
32 |
return parent::_prepareCollection();
|
33 |
}
|
34 |
+
|
35 |
protected function _getStore()
|
36 |
{
|
37 |
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
38 |
return Mage::app()->getStore($storeId);
|
39 |
}
|
40 |
+
|
41 |
protected function _prepareColumns() {
|
42 |
$this->addColumn('in_products', array(
|
43 |
'header_css_class' => 'a-center',
|
app/code/community/Magazento/Megabile/Block/Admin/Item/Grid.php
CHANGED
@@ -63,6 +63,10 @@ class Magazento_Megabile_Block_Admin_Item_Grid extends Mage_Adminhtml_Block_Widg
|
|
63 |
'renderer' => 'megabile/admin_item_grid_renderer_link',
|
64 |
));
|
65 |
|
|
|
|
|
|
|
|
|
66 |
$this->addColumn('root_category', array(
|
67 |
'header' => Mage::helper('megabile')->__('Root Category'),
|
68 |
'renderer' => 'megabile/admin_item_grid_renderer_category',
|
63 |
'renderer' => 'megabile/admin_item_grid_renderer_link',
|
64 |
));
|
65 |
|
66 |
+
$this->addColumn('description_field', array(
|
67 |
+
'header' => Mage::helper('megabile')->__('Description'),
|
68 |
+
'index' => 'description_field',
|
69 |
+
));
|
70 |
$this->addColumn('root_category', array(
|
71 |
'header' => Mage::helper('megabile')->__('Root Category'),
|
72 |
'renderer' => 'megabile/admin_item_grid_renderer_category',
|
app/code/community/Magazento/Megabile/Block/Admin/Item/Grid/Renderer/Category.php
CHANGED
@@ -37,7 +37,7 @@ class Magazento_Megabile_Block_Admin_Item_Grid_Renderer_Category extends Mage_Ad
|
|
37 |
{
|
38 |
$category_id = $row->getData('root_category');
|
39 |
$store_id = $row->getData('store_id');
|
40 |
-
$category = Mage::getModel('catalog/category')
|
41 |
return $category->getName();
|
42 |
}
|
43 |
}
|
37 |
{
|
38 |
$category_id = $row->getData('root_category');
|
39 |
$store_id = $row->getData('store_id');
|
40 |
+
$category = Mage::getModel('catalog/category')->setStoreId($store_id)->load($category_id);
|
41 |
return $category->getName();
|
42 |
}
|
43 |
}
|
app/code/community/Magazento/Megabile/Block/Admin/Item/Grid/Renderer/Time.php
CHANGED
@@ -41,7 +41,7 @@ class Magazento_Megabile_Block_Admin_Item_Grid_Renderer_Time extends Mage_Adminh
|
|
41 |
*/
|
42 |
public function render(Varien_Object $row)
|
43 |
{
|
44 |
-
$time = date('Y-m-d H:i:s', strtotime($row->
|
45 |
|
46 |
return $time;
|
47 |
}
|
41 |
*/
|
42 |
public function render(Varien_Object $row)
|
43 |
{
|
44 |
+
$time = date('Y-m-d H:i:s', strtotime($row->getFromTime()) + Mage::getSingleton('core/date')->getGmtOffset());
|
45 |
|
46 |
return $time;
|
47 |
}
|
app/code/community/Magazento/Megabile/Block/Info.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Created on Mar 16, 2011
|
4 |
+
* Author Ivan Proskuryakov - volgodark@gmail.com - Magazento.com
|
5 |
+
* Copyright Proskuryakov Ivan. Magazento.com © 2011. All Rights Reserved.
|
6 |
+
* Single Use, Limited Licence and Single Use No Resale Licence ["Single Use"]
|
7 |
+
*/
|
8 |
+
?>
|
9 |
+
|
10 |
+
<?php
|
11 |
+
|
12 |
+
class Magazento_Megabile_Block_Info extends Mage_Adminhtml_Block_System_Config_Form_Fieldset {
|
13 |
+
|
14 |
+
public function __construct() {
|
15 |
+
parent::__construct();
|
16 |
+
}
|
17 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
18 |
+
$html = $this->_getHeaderHtml($element);
|
19 |
+
$html.= $this->_getFieldHtml($element);
|
20 |
+
$html .= $this->_getFooterHtml($element);
|
21 |
+
return $html;
|
22 |
+
}
|
23 |
+
protected function _getFieldHtml($fieldset) {
|
24 |
+
$content = 'This extension is developed by <a href="http://Magazento.com/" target="_blank">Magazento.com</a><br/>';
|
25 |
+
$content.= 'Magento Store Setup, modules, data migration, templates, upgrades and much more!';
|
26 |
+
return $content;
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
app/code/community/Magazento/Megabile/Model/Item.php
CHANGED
@@ -29,9 +29,10 @@ class Magazento_Megabile_Model_Item extends Mage_Core_Model_Abstract
|
|
29 |
|
30 |
public function buildXML($profile) {
|
31 |
|
32 |
-
$products
|
33 |
-
|
34 |
-
|
|
|
35 |
$root_category = $profile->getRootCategory();
|
36 |
$file = $profile->getFilename();
|
37 |
$store_id = $profile->getStoreId();
|
@@ -98,7 +99,7 @@ class Magazento_Megabile_Model_Item extends Mage_Core_Model_Abstract
|
|
98 |
// }
|
99 |
|
100 |
$url = $Product_parent->getProductUrl();
|
101 |
-
$description = $Product_parent->
|
102 |
$cat_ids = Mage::getResourceSingleton('catalog/product')->getCategoryIds($Product_parent);
|
103 |
} else {
|
104 |
// if($Product->getImage() != 'no_selection') {
|
@@ -106,9 +107,21 @@ class Magazento_Megabile_Model_Item extends Mage_Core_Model_Abstract
|
|
106 |
// }
|
107 |
|
108 |
$url = $Product->getProductUrl();
|
109 |
-
$description = $Product->
|
110 |
$cat_ids = Mage::getResourceSingleton('catalog/product')->getCategoryIds($Product);
|
111 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
if (($cat_ids) && ($price > 0)) {
|
114 |
$i++;
|
29 |
|
30 |
public function buildXML($profile) {
|
31 |
|
32 |
+
$products = explode(",",$profile->getProducts());
|
33 |
+
$use_attributes = $profile->getUseAttributes();
|
34 |
+
$attributes = explode(",",$profile->getAttributes());
|
35 |
+
$description_field = $profile->getDescriptionField();
|
36 |
$root_category = $profile->getRootCategory();
|
37 |
$file = $profile->getFilename();
|
38 |
$store_id = $profile->getStoreId();
|
99 |
// }
|
100 |
|
101 |
$url = $Product_parent->getProductUrl();
|
102 |
+
$description = $Product_parent->getData($description_field);
|
103 |
$cat_ids = Mage::getResourceSingleton('catalog/product')->getCategoryIds($Product_parent);
|
104 |
} else {
|
105 |
// if($Product->getImage() != 'no_selection') {
|
107 |
// }
|
108 |
|
109 |
$url = $Product->getProductUrl();
|
110 |
+
$description = $Product->getData($description_field);
|
111 |
$cat_ids = Mage::getResourceSingleton('catalog/product')->getCategoryIds($Product);
|
112 |
}
|
113 |
+
|
114 |
+
if ($use_attributes) {
|
115 |
+
$extra_description='\n\n';
|
116 |
+
foreach ($attributes as $attributeItem) {
|
117 |
+
$value_label = $Product->getResource()->getAttribute($attributeItem)->setStoreId($store_id)->getFrontend()->getValue($Product);
|
118 |
+
$value_name = $Product->getResource()->getAttribute($attributeItem)->setStoreId($store_id)->getData('frontend_label');
|
119 |
+
if ($value_label && $value_name) $extra_description.= $value_name.": ".$value_label."\n";
|
120 |
+
}
|
121 |
+
$description = $description.$extra_description;
|
122 |
+
}
|
123 |
+
|
124 |
+
|
125 |
|
126 |
if (($cat_ids) && ($price > 0)) {
|
127 |
$i++;
|
app/code/community/Magazento/Megabile/etc/system.xml
CHANGED
@@ -15,31 +15,17 @@
|
|
15 |
<show_in_website>1</show_in_website>
|
16 |
<show_in_store>1</show_in_store>
|
17 |
<groups>
|
18 |
-
<
|
19 |
-
<label>
|
20 |
<frontend_type>text</frontend_type>
|
21 |
-
<
|
|
|
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 |
-
|
26 |
-
<product_robots translate="label">
|
27 |
-
<label>Product Meta Robots Enabled</label>
|
28 |
-
<frontend_type>select</frontend_type>
|
29 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
30 |
-
<comment><![CDATA[ Override default <meta name="robots" content="*" /> with tag from product]]></comment>
|
31 |
-
<sort_order>46</sort_order>
|
32 |
-
<show_in_default>1</show_in_default>
|
33 |
-
<show_in_website>1</show_in_website>
|
34 |
-
<show_in_store>1</show_in_store>
|
35 |
-
</product_robots>
|
36 |
-
</fields>
|
37 |
-
</general>
|
38 |
</groups>
|
39 |
</megabile>
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
</sections>
|
44 |
|
45 |
</config>
|
15 |
<show_in_website>1</show_in_website>
|
16 |
<show_in_store>1</show_in_store>
|
17 |
<groups>
|
18 |
+
<info translate="label">
|
19 |
+
<label>About</label>
|
20 |
<frontend_type>text</frontend_type>
|
21 |
+
<frontend_model>megabile/info</frontend_model>
|
22 |
+
<sort_order>500</sort_order>
|
23 |
<show_in_default>1</show_in_default>
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>1</show_in_store>
|
26 |
+
</info>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
</groups>
|
28 |
</megabile>
|
|
|
|
|
|
|
29 |
</sections>
|
30 |
|
31 |
</config>
|
app/code/community/Magazento/Megabile/sql/megabile_setup/mysql4-install-0.0.1.php
CHANGED
@@ -3,33 +3,23 @@
|
|
3 |
$installer = $this;
|
4 |
|
5 |
$installer->startSetup();
|
6 |
-
$installer->installEntities();
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
$installer->run("
|
11 |
|
12 |
|
13 |
-
|
14 |
CREATE TABLE IF NOT EXISTS `{$this->getTable('magazento_megabile_item')}` (
|
15 |
`item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Id',
|
16 |
`products` text NOT NULL,
|
17 |
-
`
|
18 |
-
`
|
19 |
-
`
|
20 |
-
`
|
21 |
-
`
|
|
|
22 |
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store id',
|
|
|
23 |
PRIMARY KEY (`item_id`),
|
24 |
KEY `IDX_SITEMAP_STORE_ID` (`store_id`)
|
25 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=
|
26 |
-
|
27 |
-
--
|
28 |
-
-- Dumping data for table `{$this->getTable('magazento_megabile_item')}`
|
29 |
-
--
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
|
35 |
");
|
3 |
$installer = $this;
|
4 |
|
5 |
$installer->startSetup();
|
|
|
|
|
|
|
|
|
6 |
$installer->run("
|
7 |
|
8 |
|
|
|
9 |
CREATE TABLE IF NOT EXISTS `{$this->getTable('magazento_megabile_item')}` (
|
10 |
`item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT ' Id',
|
11 |
`products` text NOT NULL,
|
12 |
+
`description_field` varchar(250) NOT NULL,
|
13 |
+
`use_attributes` tinyint(4) NOT NULL,
|
14 |
+
`root_category` int(11) NOT NULL,
|
15 |
+
`products_for_export` smallint(6) NOT NULL,
|
16 |
+
`attributes` text NOT NULL,
|
17 |
+
`filename` varchar(255) DEFAULT NULL,
|
18 |
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store id',
|
19 |
+
`from_time` datetime NOT NULL,
|
20 |
PRIMARY KEY (`item_id`),
|
21 |
KEY `IDX_SITEMAP_STORE_ID` (`store_id`)
|
22 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
");
|
app/design/adminhtml/default/default/layout/magazento_megabile.xml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<!-- <default>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss"><name>magazento_megabile/style.css</name></action>
|
6 |
+
</reference>
|
7 |
+
</default>-->
|
8 |
+
|
9 |
+
<megabile_admin_item_related>
|
10 |
+
<block type="core/text_list" name="root" output="toHtml">
|
11 |
+
<block type="megabile/admin_item_edit_tab_related" name="megabile.related.grid"/>
|
12 |
+
<block type="admin/widget_grid_serializer" name="related_grid_serializer">
|
13 |
+
<reference name="related_grid_serializer">
|
14 |
+
<action method="initSerializerBlock">
|
15 |
+
<grid_block_name>related.grid</grid_block_name>
|
16 |
+
<data_callback>getSelectedrelatedProducts</data_callback>
|
17 |
+
<hidden_input_name>links[related]</hidden_input_name>
|
18 |
+
<reload_param_name>products_related</reload_param_name>
|
19 |
+
</action>
|
20 |
+
</reference>
|
21 |
+
</block>
|
22 |
+
</block>
|
23 |
+
</megabile_admin_item_related>
|
24 |
+
|
25 |
+
</layout>
|
app/design/adminhtml/default/default/template/magazento_megabile/cattree.phtml
DELETED
@@ -1,128 +0,0 @@
|
|
1 |
-
<div class="entry-edit">
|
2 |
-
<div class="entry-edit-head">
|
3 |
-
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('catalog')->__('Categories') ?></h4>
|
4 |
-
</div>
|
5 |
-
<fieldset id="grop_fields">
|
6 |
-
<input type="hidden" name="category_ids" id="item_categories" value="<?php echo $this->getIdsString() ?>">
|
7 |
-
<div id="item-categories" class="tree"></div>
|
8 |
-
</fieldset>
|
9 |
-
</div>
|
10 |
-
|
11 |
-
<?php if($this->getRootNode() && $this->getRootNode()->hasChildren()): ?>
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
<?php //var_dump($this->getCategoryIds()); ?>
|
17 |
-
|
18 |
-
<script type="text/javascript">
|
19 |
-
Ext.EventManager.onDocumentReady(function() {
|
20 |
-
var categoryLoader = new Ext.tree.TreeLoader({
|
21 |
-
dataUrl: '<?php echo $this->getLoadTreeUrl()?>'
|
22 |
-
});
|
23 |
-
|
24 |
-
categoryLoader.createNode = function(config) {
|
25 |
-
config.uiProvider = Ext.tree.CheckboxNodeUI;
|
26 |
-
var node;
|
27 |
-
if (config.children && !config.children.length) {
|
28 |
-
delete(config.children);
|
29 |
-
node = new Ext.tree.AsyncTreeNode(config);
|
30 |
-
|
31 |
-
} else {
|
32 |
-
node = new Ext.tree.TreeNode(config);
|
33 |
-
}
|
34 |
-
return node;
|
35 |
-
};
|
36 |
-
|
37 |
-
categoryLoader.on("beforeload", function(treeLoader, node) {
|
38 |
-
treeLoader.baseParams.category = node.attributes.id;
|
39 |
-
});
|
40 |
-
|
41 |
-
categoryLoader.on("load", function(treeLoader, node, config) {
|
42 |
-
varienWindowOnload();
|
43 |
-
});
|
44 |
-
|
45 |
-
var tree = new Ext.tree.TreePanel('item-categories', {
|
46 |
-
animate:true,
|
47 |
-
loader: categoryLoader,
|
48 |
-
enableDD:false,
|
49 |
-
containerScroll: true,
|
50 |
-
rootUIProvider: Ext.tree.CheckboxNodeUI,
|
51 |
-
selModel: new Ext.tree.CheckNodeMultiSelectionModel(),
|
52 |
-
rootVisible: '<?php echo $this->getRootNode()->getIsVisible() ?>'
|
53 |
-
});
|
54 |
-
|
55 |
-
tree.on('check', function(node) {
|
56 |
-
if(node.attributes.checked) {
|
57 |
-
categoryAdd(node.id);
|
58 |
-
} else {
|
59 |
-
categoryRemove(node.id);
|
60 |
-
}
|
61 |
-
varienElementMethods.setHasChanges(node.getUI().checkbox);
|
62 |
-
}, tree);
|
63 |
-
|
64 |
-
// set the root node
|
65 |
-
var root = new Ext.tree.TreeNode({
|
66 |
-
text: '<?php echo $this->jsQuoteEscape($this->getRootNode()->getName()) ?>',
|
67 |
-
draggable:false,
|
68 |
-
checked:'<?php echo $this->getRootNode()->getChecked() ?>',
|
69 |
-
id:'<?php echo $this->getRootNode()->getId() ?>',
|
70 |
-
disabled: <?php echo ($this->getRootNode()->getDisabled() ? 'true' : 'false') ?>,
|
71 |
-
uiProvider: Ext.tree.CheckboxNodeUI
|
72 |
-
});
|
73 |
-
|
74 |
-
tree.setRootNode(root);
|
75 |
-
bildCategoryTree(root, <?php echo $this->getTreeJson() ?>);
|
76 |
-
tree.addListener('click', categoryClick.createDelegate(this));
|
77 |
-
|
78 |
-
// render the tree
|
79 |
-
tree.render();
|
80 |
-
root.expand();
|
81 |
-
//tree.expandAll();
|
82 |
-
});
|
83 |
-
|
84 |
-
function bildCategoryTree(parent, config){
|
85 |
-
if (!config) return null;
|
86 |
-
|
87 |
-
if (parent && config && config.length){
|
88 |
-
for (var i = 0; i < config.length; i++){
|
89 |
-
config[i].uiProvider = Ext.tree.CheckboxNodeUI;
|
90 |
-
var node;
|
91 |
-
var _node = Object.clone(config[i]);
|
92 |
-
if (_node.children && !_node.children.length) {
|
93 |
-
delete(_node.children);
|
94 |
-
node = new Ext.tree.AsyncTreeNode(_node);
|
95 |
-
|
96 |
-
} else {
|
97 |
-
node = new Ext.tree.TreeNode(config[i]);
|
98 |
-
}
|
99 |
-
parent.appendChild(node);
|
100 |
-
node.loader = node.getOwnerTree().loader;
|
101 |
-
if(config[i].children){
|
102 |
-
bildCategoryTree(node, config[i].children);
|
103 |
-
}
|
104 |
-
}
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
function categoryClick(node, e){
|
109 |
-
if (node.disabled) {
|
110 |
-
return;
|
111 |
-
}
|
112 |
-
node.getUI().check(!node.getUI().checked());
|
113 |
-
varienElementMethods.setHasChanges(Event.element(e), e);
|
114 |
-
};
|
115 |
-
function categoryAdd(id) {
|
116 |
-
var ids = $('item_categories').value.split(',');
|
117 |
-
ids.push(id);
|
118 |
-
$('item_categories').value = ids.join(',');
|
119 |
-
}
|
120 |
-
function categoryRemove(id) {
|
121 |
-
var ids = $('item_categories').value.split(',');
|
122 |
-
while (-1 != ids.indexOf(id)) {
|
123 |
-
ids.splice(ids.indexOf(id), 1);
|
124 |
-
}
|
125 |
-
$('item_categories').value = ids.join(',');
|
126 |
-
}
|
127 |
-
</script>
|
128 |
-
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>megabile</name>
|
4 |
-
<version>0.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL</license>
|
7 |
<channel>community</channel>
|
@@ -12,8 +12,8 @@ In Megabile we glad to provide you the simpliest way for pulishing your store on
|
|
12 |
<notes>initial release. Post all issues or bugs at magazento.com/ticket</notes>
|
13 |
<authors><author><name>volgodark</name><user>volgodark</user><email>volgodark@gmail.com</email></author></authors>
|
14 |
<date>2013-03-27</date>
|
15 |
-
<time>
|
16 |
-
<contents><target name="magecommunity"><dir name="Magazento"><dir name="Megabile"><dir name="Block"><dir name="Admin"><dir name="Item"><dir name="Edit"><file name="Form.php" hash="42185aaf964eb7548d63adcb78aee8cf"/><dir name="Tab"><file name="Form.php" hash="
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.1.1</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>megabile</name>
|
4 |
+
<version>0.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL</license>
|
7 |
<channel>community</channel>
|
12 |
<notes>initial release. Post all issues or bugs at magazento.com/ticket</notes>
|
13 |
<authors><author><name>volgodark</name><user>volgodark</user><email>volgodark@gmail.com</email></author></authors>
|
14 |
<date>2013-03-27</date>
|
15 |
+
<time>22:25:04</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Magazento"><dir name="Megabile"><dir name="Block"><dir name="Admin"><dir name="Item"><dir name="Edit"><file name="Form.php" hash="42185aaf964eb7548d63adcb78aee8cf"/><dir name="Tab"><file name="Form.php" hash="f3c671d8f59d7d30301b48d77b484a2e"/><file name="Related.php" hash="cd5c4e18c011616c60e2585e28136da0"/></dir><file name="Tabs.php" hash="0bc2280975101e493d3d4f3fdcad4d1e"/></dir><file name="Edit.php" hash="7a379e684384dca6803d1f3cc9dcce0b"/><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="cd843831c9e76dba9f23e68f2f843bb7"/><file name="Category.php" hash="dbe682c16e63428a5e9f3311b1eed207"/><file name="Link.php" hash="aa44b8da85cdb8de90e63d5281cacdee"/><file name="Products.php" hash="973c9ec718838f76478aee086bf32e36"/><file name="Time.php" hash="0efbd6897f38287728a2c6d9f8a00605"/></dir></dir><file name="Grid.php" hash="1b4e73be8c5450d3e24a0165c8b9ae6d"/></dir><file name="Item.php" hash="05fa7f0a72a5fe2ba082ce65ca6e5430"/></dir><file name="Info.php" hash="eac61be58c6ba3126bc18b0213195908"/></dir><dir name="Helper"><file name="Data.php" hash="ecfa3ef0ca79a598483ee8da44a35a27"/><file name="Product.php" hash="04296e9936820fd93615cfcd2e61be31"/></dir><dir name="Model"><file name="Data.php" hash="7367397972efbf028d0f22eb9614fc55"/><file name="Item.php" hash="63e3e410f4437cbad16c6a227bdd5e73"/><dir name="Mysql4"><dir name="Item"><file name="Collection.php" hash="703fbd93edd66314356dd2ce4403b940"/></dir><file name="Item.php" hash="be3c74e0805a95224a21ecfceff8f7c6"/></dir></dir><dir name="controllers"><dir name="Admin"><file name="CatalogController.php" hash="8fe30b7db6e97dbc75cca66c66493c62"/><file name="ItemController.php" hash="0152694a48dd86a931d9c64a7c7ece4f"/></dir></dir><dir name="etc"><file name="config.xml" hash="f1e3c6926572db52bb0642e94e459917"/><file name="system.xml" hash="02e8758b0b1763436854de87bc15af26"/></dir><dir name="sql"><dir name="megabile_setup"><file name="mysql4-install-0.0.1.php" hash="9ae9132366291d841e9f9f73160be59c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="magazento_megabile.xml" hash="604070b0422d05c63b201c2167c46f3c"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magazento_Megabile.xml" hash="822e0f1c604b5d762f33ee47b30cbff8"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="magazento_megabile"><file name="style.css" hash="f25650dc11cd81736bb880de1fa80e94"/></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.1.1</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|