Zanbytes_Cdokus - Version 0.0.0.8

Version Notes

Date: 31-5-2015
Version:v0008
#Fixes psr-2 compliant code

Date:05-12-2013
Version:v0005
#First public free version via MC

Download this release

Release Info

Developer Magento Core Team
Extension Zanbytes_Cdokus
Version 0.0.0.8
Comparing to
See all releases


Code changes from version 0.0.0.7 to 0.0.0.8

Files changed (24) hide show
  1. app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Catalog/Product/Edit/Tab/Cdokus.php +62 -46
  2. app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Catalog/Product/Edit/Tab/Links/Action/Renderer.php +20 -17
  3. app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Catalog/Product/Edit/Tab/Links/Grid.php +24 -15
  4. app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Document.php +8 -6
  5. app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Edit.php +13 -9
  6. app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Edit/Form.php +11 -9
  7. app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Edit/Tab/Form.php +11 -9
  8. app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Edit/Tabs.php +12 -8
  9. app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Grid.php +19 -21
  10. app/code/community/Zanbytes/Cdokus/Block/Download.php +22 -16
  11. app/code/community/Zanbytes/Cdokus/Helper/Data.php +9 -7
  12. app/code/community/Zanbytes/Cdokus/Model/Abstract.php +21 -13
  13. app/code/community/Zanbytes/Cdokus/Model/Link.php +10 -7
  14. app/code/community/Zanbytes/Cdokus/Model/Resource/Link.php +8 -6
  15. app/code/community/Zanbytes/Cdokus/Model/Resource/Link/Collection.php +22 -15
  16. app/code/community/Zanbytes/Cdokus/controllers/Adminhtml/Cdokus/Document/LinkController.php +30 -20
  17. app/code/community/Zanbytes/Cdokus/controllers/Adminhtml/Cdokus/Product/EditController.php +42 -32
  18. app/code/community/Zanbytes/Cdokus/controllers/DownloadController.php +22 -17
  19. app/code/community/Zanbytes/Cdokus/etc/config.xml +32 -32
  20. app/code/community/Zanbytes/Cdokus/etc/system.xml +15 -14
  21. app/code/community/Zanbytes/Cdokus/sql/cdokus_setup/mysql4-install-0.0.0.1.php +45 -45
  22. app/design/frontend/base/default/layout/cdokus.xml +8 -6
  23. app/design/frontend/base/default/template/cdokus/links.phtml +22 -20
  24. package.xml +14 -11
app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Catalog/Product/Edit/Tab/Cdokus.php CHANGED
@@ -26,43 +26,49 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Cdokus.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Cdokus extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface {
 
36
 
37
- public function __construct() {
 
38
  parent::__construct();
39
  $this->setSkipGenerateContent(true);
40
  $this->setTemplate('cdokus/product/edit/cdokus.phtml');
41
  }
42
 
43
- public function getTabUrl() {
 
44
  return $this->getUrl('*/cdokus_product_edit/form', array('_current' => true));
45
  }
46
 
47
- public function getUpdateUrl() {
 
48
  return $this->getUrl('*/cdokus_product_edit/update', array(
49
- 'back' => 'edit',
50
- 'id' => Mage::app()->getRequest()->getParam('id'),
51
- 'tab' => 'product_info_tabs_cdokus',
52
- 'store' => Mage::app()->getRequest()->getParam('store')
53
- ));
54
  }
55
 
56
- public function getaddUrl() {
 
57
  return $this->getUrl('*/cdokus_product_edit/add', array(
58
- 'back' => 'edit',
59
- 'id' => Mage::app()->getRequest()->getParam('id'),
60
- 'tab' => 'product_info_tabs_cdokus',
61
- 'store' => Mage::app()->getRequest()->getParam('store'),
62
- ));
63
  }
64
 
65
- public function getTabClass() {
 
66
  return 'ajax';
67
  }
68
 
@@ -71,24 +77,25 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Cdokus extends Ma
71
  *
72
  * @return Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle
73
  */
74
- protected function _prepareLayout() {
 
75
  $message = Mage::helper('catalog')->__('Are you sure?');
76
  $this->setChild('add_button', $this->getLayout()->createBlock('adminhtml/widget_button')
77
- ->setData(array(
78
- 'label' => Mage::helper('cdokus')->__('Add New Option'),
79
- 'class' => 'add',
80
- 'id' => 'add_new_file',
81
- 'onclick' => 'if( confirm(\'' . $message . '\')) {productForm.submit(\'' . $this->getAddUrl() . '\');}return false;'
82
- ))
83
  );
84
 
85
  $this->setChild('update_button', $this->getLayout()->createBlock('adminhtml/widget_button')
86
- ->setData(array(
87
- 'label' => Mage::helper('cdokus')->__('Update Position'),
88
- 'class' => 'update',
89
- 'id' => 'update_link_position',
90
- 'onclick' => 'if( confirm(\'' . $message . '\')) {productForm.submit(\'' . $this->getUpdateUrl() . '\');}return false;'
91
- ))
92
  );
93
 
94
  $this->setChild('links_grid', $this->getLayout()->createBlock('cdokus/adminhtml_catalog_product_edit_tab_links_grid', 'adminhtml.catalog.product.edit.tab.links.grid')
@@ -97,31 +104,35 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Cdokus extends Ma
97
  return parent::_prepareLayout();
98
  }
99
 
100
- public function getAddButtonHtml() {
 
101
  return $this->getChildHtml('add_button');
102
  }
103
 
104
- public function getUpdateButtonHtml() {
 
105
  return $this->getChildHtml('update_button');
106
  }
107
 
108
- public function getAvailableGridBoxHtml() {
 
109
  return $this->getChildHtml('links_grid');
110
  }
111
 
112
- public function getFormHtml() {
 
113
  $form = new Varien_Data_Form(
114
- array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post')
115
  );
116
 
117
  $form::setElementRenderer(
118
- $this->getLayout()->createBlock('adminhtml/widget_form_renderer_element')
119
  );
120
  $form::setFieldsetRenderer(
121
- $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset')
122
  );
123
  $form::setFieldsetElementRenderer(
124
- $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element')
125
  );
126
 
127
  $fieldset = $form->addFieldset('cdokus_fields', array('legend' => Mage::helper('cdokus')->__('Cdokus uploader'))
@@ -160,23 +171,28 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Cdokus extends Ma
160
  return $form->toHtml();
161
  }
162
 
163
- public function getProduct() {
 
164
  return Mage::registry('product');
165
  }
166
 
167
- public function getTabLabel() {
 
168
  return Mage::helper('cdokus')->__('Documents');
169
  }
170
 
171
- public function getTabTitle() {
 
172
  return Mage::helper('cdokus')->__('Documents');
173
  }
174
 
175
- public function canShowTab() {
 
176
  return true;
177
  }
178
 
179
- public function isHidden() {
 
180
  return false;
181
  }
182
 
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Cdokus.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Cdokus extends Mage_Adminhtml_Block_Widget implements Mage_Adminhtml_Block_Widget_Tab_Interface
36
+ {
37
 
38
+ public function __construct()
39
+ {
40
  parent::__construct();
41
  $this->setSkipGenerateContent(true);
42
  $this->setTemplate('cdokus/product/edit/cdokus.phtml');
43
  }
44
 
45
+ public function getTabUrl()
46
+ {
47
  return $this->getUrl('*/cdokus_product_edit/form', array('_current' => true));
48
  }
49
 
50
+ public function getUpdateUrl()
51
+ {
52
  return $this->getUrl('*/cdokus_product_edit/update', array(
53
+ 'back' => 'edit',
54
+ 'id' => Mage::app()->getRequest()->getParam('id'),
55
+ 'tab' => 'product_info_tabs_cdokus',
56
+ 'store' => Mage::app()->getRequest()->getParam('store')
57
+ ));
58
  }
59
 
60
+ public function getaddUrl()
61
+ {
62
  return $this->getUrl('*/cdokus_product_edit/add', array(
63
+ 'back' => 'edit',
64
+ 'id' => Mage::app()->getRequest()->getParam('id'),
65
+ 'tab' => 'product_info_tabs_cdokus',
66
+ 'store' => Mage::app()->getRequest()->getParam('store'),
67
+ ));
68
  }
69
 
70
+ public function getTabClass()
71
+ {
72
  return 'ajax';
73
  }
74
 
77
  *
78
  * @return Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Bundle
79
  */
80
+ protected function _prepareLayout()
81
+ {
82
  $message = Mage::helper('catalog')->__('Are you sure?');
83
  $this->setChild('add_button', $this->getLayout()->createBlock('adminhtml/widget_button')
84
+ ->setData(array(
85
+ 'label' => Mage::helper('cdokus')->__('Add New Option'),
86
+ 'class' => 'add',
87
+ 'id' => 'add_new_file',
88
+ 'onclick' => 'if( confirm(\'' . $message . '\')) {productForm.submit(\'' . $this->getAddUrl() . '\');}return false;'
89
+ ))
90
  );
91
 
92
  $this->setChild('update_button', $this->getLayout()->createBlock('adminhtml/widget_button')
93
+ ->setData(array(
94
+ 'label' => Mage::helper('cdokus')->__('Update Position'),
95
+ 'class' => 'update',
96
+ 'id' => 'update_link_position',
97
+ 'onclick' => 'if( confirm(\'' . $message . '\')) {productForm.submit(\'' . $this->getUpdateUrl() . '\');}return false;'
98
+ ))
99
  );
100
 
101
  $this->setChild('links_grid', $this->getLayout()->createBlock('cdokus/adminhtml_catalog_product_edit_tab_links_grid', 'adminhtml.catalog.product.edit.tab.links.grid')
104
  return parent::_prepareLayout();
105
  }
106
 
107
+ public function getAddButtonHtml()
108
+ {
109
  return $this->getChildHtml('add_button');
110
  }
111
 
112
+ public function getUpdateButtonHtml()
113
+ {
114
  return $this->getChildHtml('update_button');
115
  }
116
 
117
+ public function getAvailableGridBoxHtml()
118
+ {
119
  return $this->getChildHtml('links_grid');
120
  }
121
 
122
+ public function getFormHtml()
123
+ {
124
  $form = new Varien_Data_Form(
125
+ array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post')
126
  );
127
 
128
  $form::setElementRenderer(
129
+ $this->getLayout()->createBlock('adminhtml/widget_form_renderer_element')
130
  );
131
  $form::setFieldsetRenderer(
132
+ $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset')
133
  );
134
  $form::setFieldsetElementRenderer(
135
+ $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element')
136
  );
137
 
138
  $fieldset = $form->addFieldset('cdokus_fields', array('legend' => Mage::helper('cdokus')->__('Cdokus uploader'))
171
  return $form->toHtml();
172
  }
173
 
174
+ public function getProduct()
175
+ {
176
  return Mage::registry('product');
177
  }
178
 
179
+ public function getTabLabel()
180
+ {
181
  return Mage::helper('cdokus')->__('Documents');
182
  }
183
 
184
+ public function getTabTitle()
185
+ {
186
  return Mage::helper('cdokus')->__('Documents');
187
  }
188
 
189
+ public function canShowTab()
190
+ {
191
  return true;
192
  }
193
 
194
+ public function isHidden()
195
+ {
196
  return false;
197
  }
198
 
app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Catalog/Product/Edit/Tab/Links/Action/Renderer.php CHANGED
@@ -26,27 +26,29 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Renderer.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Action_Renderer extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
 
36
 
37
  /**
38
  * Render delete action link
39
  * @param Varien_Object $row
40
  * @return type
41
  */
42
- public function render(Varien_Object $row) {
 
43
  $label = $this->__('You are attempting link delete, you sure ?');
44
  $out = $this->getLayout()->createBlock('adminhtml/widget_button')
45
- ->setData(array(
46
- 'label' => $this->__('Delete'),
47
- 'class' => 'delete icon-btn',
48
- 'on_click' => "if (confirm('$label')) { setLocation('" . $this->getDeleteUrl($row->getId()) . "');}"
49
- ));
50
  return $out->toHtml();
51
  }
52
 
@@ -55,13 +57,14 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Action_Rend
55
  * @param type $id
56
  * @return type
57
  */
58
- public function getDeleteUrl($id) {
 
59
  return $this->getUrl('*/cdokus_product_edit/deletelink', array(
60
- 'back' => 'edit',
61
- 'id' => Mage::app()->getRequest()->getParam('id'),
62
- 'tab' => 'product_info_tabs_cdokus',
63
- 'link_entity_id' => $id,
64
- ));
65
  }
66
 
67
  }
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Renderer.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Action_Renderer extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
36
+ {
37
 
38
  /**
39
  * Render delete action link
40
  * @param Varien_Object $row
41
  * @return type
42
  */
43
+ public function render(Varien_Object $row)
44
+ {
45
  $label = $this->__('You are attempting link delete, you sure ?');
46
  $out = $this->getLayout()->createBlock('adminhtml/widget_button')
47
+ ->setData(array(
48
+ 'label' => $this->__('Delete'),
49
+ 'class' => 'delete icon-btn',
50
+ 'on_click' => "if (confirm('$label')) { setLocation('" . $this->getDeleteUrl($row->getId()) . "');}"
51
+ ));
52
  return $out->toHtml();
53
  }
54
 
57
  * @param type $id
58
  * @return type
59
  */
60
+ public function getDeleteUrl($id)
61
+ {
62
  return $this->getUrl('*/cdokus_product_edit/deletelink', array(
63
+ 'back' => 'edit',
64
+ 'id' => Mage::app()->getRequest()->getParam('id'),
65
+ 'tab' => 'product_info_tabs_cdokus',
66
+ 'link_entity_id' => $id,
67
+ ));
68
  }
69
 
70
  }
app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Catalog/Product/Edit/Tab/Links/Grid.php CHANGED
@@ -26,13 +26,14 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Grid.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extends Mage_Adminhtml_Block_Widget_Grid {
 
36
 
37
  /**
38
  * Pager visibility
@@ -52,7 +53,8 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extend
52
  * Set grid params
53
  *
54
  */
55
- public function __construct() {
 
56
  parent::__construct();
57
  $this->setId('cdokus_links_product_grid');
58
  $this->setDefaultSort('entity_id');
@@ -64,7 +66,8 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extend
64
  *
65
  * @return Mage_Catalog_Model_Product
66
  */
67
- protected function _getProduct() {
 
68
  return Mage::registry('current_product');
69
  }
70
 
@@ -73,9 +76,10 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extend
73
  *
74
  * @return Mage_Adminhtml_Block_Widget_Grid
75
  */
76
- protected function _prepareCollection() {
 
77
  $collection = Mage::getResourceModel('cdokus/link_collection')
78
- ->addFieldToFilter('sku', $this->_getProduct()->getSku());
79
  if ($storeId = Mage::app()->getRequest()->getParam('store', false)) {
80
  $collection->addFieldToFilter('store_id', $storeId);
81
  } else {
@@ -90,7 +94,8 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extend
90
  *
91
  * @return boolean
92
  */
93
- public function isReadonly() {
 
94
  return $this->_getProduct()->getRelatedReadonly();
95
  }
96
 
@@ -99,7 +104,8 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extend
99
  *
100
  * @return Mage_Adminhtml_Block_Widget_Grid
101
  */
102
- protected function _prepareColumns() {
 
103
 
104
  $this->addColumn('in_products', array(
105
  'header_css_class' => 'a-center',
@@ -227,7 +233,8 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extend
227
  *
228
  * @return string
229
  */
230
- public function getGridUrl() {
 
231
  return $this->getUrl('*/cdokus_product_edit/tabgrid', array('_current' => true));
232
  }
233
 
@@ -237,7 +244,8 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extend
237
  * @param Mage_Catalog_Model_Product|Varien_Object
238
  * @return string
239
  */
240
- public function getRowUrl($link) {
 
241
  return $this->getUrl('*/cdokus_document_link/edit', array('link_id' => $link->getId(), '_current' => true));
242
  }
243
 
@@ -246,9 +254,10 @@ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extend
246
  *
247
  * @return array
248
  */
249
- public function getSelectedProducts() {
 
250
  $collection = Mage::getResourceModel('cdokus/link_collection')
251
- ->addFieldToFilter('sku', $this->_getProduct()->getSku());
252
  $products = array();
253
  foreach ($collection as $link) {
254
  $products[$link->getId()] = array('position' => $link->getPosition());
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Grid.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Adminhtml_Catalog_Product_Edit_Tab_Links_Grid extends Mage_Adminhtml_Block_Widget_Grid
36
+ {
37
 
38
  /**
39
  * Pager visibility
53
  * Set grid params
54
  *
55
  */
56
+ public function __construct()
57
+ {
58
  parent::__construct();
59
  $this->setId('cdokus_links_product_grid');
60
  $this->setDefaultSort('entity_id');
66
  *
67
  * @return Mage_Catalog_Model_Product
68
  */
69
+ protected function _getProduct()
70
+ {
71
  return Mage::registry('current_product');
72
  }
73
 
76
  *
77
  * @return Mage_Adminhtml_Block_Widget_Grid
78
  */
79
+ protected function _prepareCollection()
80
+ {
81
  $collection = Mage::getResourceModel('cdokus/link_collection')
82
+ ->addFieldToFilter('sku', $this->_getProduct()->getSku());
83
  if ($storeId = Mage::app()->getRequest()->getParam('store', false)) {
84
  $collection->addFieldToFilter('store_id', $storeId);
85
  } else {
94
  *
95
  * @return boolean
96
  */
97
+ public function isReadonly()
98
+ {
99
  return $this->_getProduct()->getRelatedReadonly();
100
  }
101
 
104
  *
105
  * @return Mage_Adminhtml_Block_Widget_Grid
106
  */
107
+ protected function _prepareColumns()
108
+ {
109
 
110
  $this->addColumn('in_products', array(
111
  'header_css_class' => 'a-center',
233
  *
234
  * @return string
235
  */
236
+ public function getGridUrl()
237
+ {
238
  return $this->getUrl('*/cdokus_product_edit/tabgrid', array('_current' => true));
239
  }
240
 
244
  * @param Mage_Catalog_Model_Product|Varien_Object
245
  * @return string
246
  */
247
+ public function getRowUrl($link)
248
+ {
249
  return $this->getUrl('*/cdokus_document_link/edit', array('link_id' => $link->getId(), '_current' => true));
250
  }
251
 
254
  *
255
  * @return array
256
  */
257
+ public function getSelectedProducts()
258
+ {
259
  $collection = Mage::getResourceModel('cdokus/link_collection')
260
+ ->addFieldToFilter('sku', $this->_getProduct()->getSku());
261
  $products = array();
262
  foreach ($collection as $link) {
263
  $products[$link->getId()] = array('position' => $link->getPosition());
app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Document.php CHANGED
@@ -26,15 +26,17 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Document.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Document extends Mage_Adminhtml_Block_Widget_Grid_Container {
 
36
 
37
- public function __construct() {
 
38
  parent::__construct();
39
  $this->_controller = 'adminhtml_cdokus';
40
  $this->_blockGroup = 'cdokus';
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Document.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Document extends Mage_Adminhtml_Block_Widget_Grid_Container
36
+ {
37
 
38
+ public function __construct()
39
+ {
40
  parent::__construct();
41
  $this->_controller = 'adminhtml_cdokus';
42
  $this->_blockGroup = 'cdokus';
app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Edit.php CHANGED
@@ -26,15 +26,17 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Edit.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
 
36
 
37
- public function __construct() {
 
38
  parent::__construct();
39
  $this->_objectId = 'id';
40
  $this->_blockGroup = 'cdokus';
@@ -44,18 +46,20 @@ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit extends Mage_Adminhtml_Block_W
44
  'label' => Mage::helper('adminhtml')->__('Delete'),
45
  'class' => 'delete',
46
  'onclick' => 'deleteConfirm(\'' . Mage::helper('adminhtml')->__('Are you sure you want to do this?')
47
- . '\', \'' . $this->getDeleteUrl() . '\')',
48
  ));
49
  }
50
 
51
- public function getHeaderText() {
 
52
  if ($link = Mage::getModel('cdokus/link')->load($this->getRequest()->getParam('link_id', false))) {
53
  Mage::getSingleton('adminhtml/session')->setLinkData($link->getData());
54
  return Mage::helper('cdokus')->__('Link # %s | %s', $link->getEntityId(), $this->formatDate($link->getCreatedAt(), 'medium', true));
55
  }
56
  }
57
 
58
- public function getDeleteUrl() {
 
59
  return $this->getUrl('*/*/delete', array('link_id' => $this->getRequest()->getParam('link_id')));
60
  }
61
 
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Edit.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
36
+ {
37
 
38
+ public function __construct()
39
+ {
40
  parent::__construct();
41
  $this->_objectId = 'id';
42
  $this->_blockGroup = 'cdokus';
46
  'label' => Mage::helper('adminhtml')->__('Delete'),
47
  'class' => 'delete',
48
  'onclick' => 'deleteConfirm(\'' . Mage::helper('adminhtml')->__('Are you sure you want to do this?')
49
+ . '\', \'' . $this->getDeleteUrl() . '\')',
50
  ));
51
  }
52
 
53
+ public function getHeaderText()
54
+ {
55
  if ($link = Mage::getModel('cdokus/link')->load($this->getRequest()->getParam('link_id', false))) {
56
  Mage::getSingleton('adminhtml/session')->setLinkData($link->getData());
57
  return Mage::helper('cdokus')->__('Link # %s | %s', $link->getEntityId(), $this->formatDate($link->getCreatedAt(), 'medium', true));
58
  }
59
  }
60
 
61
+ public function getDeleteUrl()
62
+ {
63
  return $this->getUrl('*/*/delete', array('link_id' => $this->getRequest()->getParam('link_id')));
64
  }
65
 
app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Edit/Form.php CHANGED
@@ -26,19 +26,21 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Form.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
 
36
 
37
- protected function _prepareForm() {
 
38
  $form = new Varien_Data_Form(array(
39
- 'id' => 'edit_form',
40
- 'enctype' => "multipart/form-data",
41
- 'action' => $this->getUrl('*/*/save', array('link_id' => $this->getRequest()->getParam('link_id'))), 'method' => 'post',));
42
  $form->setUseContainer(true);
43
  $this->setForm($form);
44
  return parent::_prepareForm();
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Form.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
36
+ {
37
 
38
+ protected function _prepareForm()
39
+ {
40
  $form = new Varien_Data_Form(array(
41
+ 'id' => 'edit_form',
42
+ 'enctype' => "multipart/form-data",
43
+ 'action' => $this->getUrl('*/*/save', array('link_id' => $this->getRequest()->getParam('link_id'))), 'method' => 'post',));
44
  $form->setUseContainer(true);
45
  $this->setForm($form);
46
  return parent::_prepareForm();
app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Edit/Tab/Form.php CHANGED
@@ -26,26 +26,28 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Form.php 1103 2014-02-18 00:30:55Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
 
36
 
37
- protected function _prepareForm() {
 
38
  $form = new Varien_Data_Form();
39
 
40
  $this->setForm($form);
41
  $form::setElementRenderer(
42
- $this->getLayout()->createBlock('adminhtml/widget_form_renderer_element')
43
  );
44
  $form::setFieldsetRenderer(
45
- $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset')
46
  );
47
  $form::setFieldsetElementRenderer(
48
- $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element')
49
  );
50
 
51
  $fieldset = $form->addFieldset('cdokus_fields', array('legend' => Mage::helper('cdokus')->__('Cdokus uploader'))
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Form.php 1103 2014-02-18 00:30:55Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
36
+ {
37
 
38
+ protected function _prepareForm()
39
+ {
40
  $form = new Varien_Data_Form();
41
 
42
  $this->setForm($form);
43
  $form::setElementRenderer(
44
+ $this->getLayout()->createBlock('adminhtml/widget_form_renderer_element')
45
  );
46
  $form::setFieldsetRenderer(
47
+ $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset')
48
  );
49
  $form::setFieldsetElementRenderer(
50
+ $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element')
51
  );
52
 
53
  $fieldset = $form->addFieldset('cdokus_fields', array('legend' => Mage::helper('cdokus')->__('Cdokus uploader'))
app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Edit/Tabs.php CHANGED
@@ -26,21 +26,24 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Tabs.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
 
36
 
37
- public function __construct() {
 
38
  parent::__construct();
39
  $this->setId('quotation_info_tabs');
40
  $this->setDestElementId('edit_form');
41
  }
42
 
43
- protected function _beforeToHtml() {
 
44
  $this->addTab('general', array(
45
  'label' => Mage::helper('cdokus')->__('General'),
46
  'title' => Mage::helper('cdokus')->__('General'),
@@ -50,7 +53,8 @@ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit_Tabs extends Mage_Adminhtml_Bl
50
  return parent::_beforeToHtml();
51
  }
52
 
53
- protected function _updateActiveTab() {
 
54
  $tabId = $this->getRequest()->getParam('tab');
55
  if ($tabId) {
56
  $tabId = preg_replace("#{$this->getId()}_#", '', $tabId);
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Tabs.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
36
+ {
37
 
38
+ public function __construct()
39
+ {
40
  parent::__construct();
41
  $this->setId('quotation_info_tabs');
42
  $this->setDestElementId('edit_form');
43
  }
44
 
45
+ protected function _beforeToHtml()
46
+ {
47
  $this->addTab('general', array(
48
  'label' => Mage::helper('cdokus')->__('General'),
49
  'title' => Mage::helper('cdokus')->__('General'),
53
  return parent::_beforeToHtml();
54
  }
55
 
56
+ protected function _updateActiveTab()
57
+ {
58
  $tabId = $this->getRequest()->getParam('tab');
59
  if ($tabId) {
60
  $tabId = preg_replace("#{$this->getId()}_#", '', $tabId);
app/code/community/Zanbytes/Cdokus/Block/Adminhtml/Cdokus/Grid.php CHANGED
@@ -26,15 +26,17 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Grid.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Grid extends Mage_Adminhtml_Block_Widget_Grid {
 
36
 
37
- public function __construct() {
 
38
  parent::__construct();
39
  $this->setId('cdokus_links_grid');
40
  $this->setUseAjax(true);
@@ -43,21 +45,14 @@ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Grid extends Mage_Adminhtml_Block_W
43
  $this->setSaveParametersInSession(true);
44
  }
45
 
46
- /**
47
- * Retrieve collection class
48
- *
49
- * @return string
50
- */
51
- protected function _getCollectionClass() {
52
- return 'sales/quote_collection';
53
- }
54
-
55
  /**
56
  * Prepare collection
57
  *
58
  * @return Mage_Adminhtml_Block_Widget_Grid
59
  */
60
- protected function _prepareCollection() {
 
 
61
  $collection = Mage::getResourceModel('cdokus/link_collection');
62
  $this->setCollection($collection);
63
  return parent::_prepareCollection();
@@ -68,7 +63,8 @@ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Grid extends Mage_Adminhtml_Block_W
68
  *
69
  * @return Mage_Adminhtml_Block_Widget_Grid
70
  */
71
- protected function _prepareColumns() {
 
72
  $this->addColumn('entity_id', array(
73
  'header' => Mage::helper('cdokus')->__('ID'),
74
  'sortable' => true,
@@ -127,11 +123,11 @@ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Grid extends Mage_Adminhtml_Block_W
127
  ));
128
 
129
 
130
-
131
  return parent::_prepareColumns();
132
  }
133
 
134
- protected function _prepareMassaction() {
 
135
  $this->setMassactionIdField('entity_id');
136
  $this->getMassactionBlock()->setFormFieldName('cdokus');
137
 
@@ -160,11 +156,13 @@ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Grid extends Mage_Adminhtml_Block_W
160
  return $this;
161
  }
162
 
163
- public function getRowUrl($row) {
 
164
  return $this->getUrl('*/*/edit', array('link_id' => $row->getEntityId()));
165
  }
166
 
167
- public function getGridUrl() {
 
168
  return $this->getUrl('*/*/grid', array('_current' => true));
169
  }
170
 
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Grid.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Adminhtml_Cdokus_Grid extends Mage_Adminhtml_Block_Widget_Grid
36
+ {
37
 
38
+ public function __construct()
39
+ {
40
  parent::__construct();
41
  $this->setId('cdokus_links_grid');
42
  $this->setUseAjax(true);
45
  $this->setSaveParametersInSession(true);
46
  }
47
 
 
 
 
 
 
 
 
 
 
48
  /**
49
  * Prepare collection
50
  *
51
  * @return Mage_Adminhtml_Block_Widget_Grid
52
  */
53
+ protected function _prepareCollection()
54
+ {
55
+ /** @var $collection Zanbytes_Cdokus_Model_Resource_Link_Collection */
56
  $collection = Mage::getResourceModel('cdokus/link_collection');
57
  $this->setCollection($collection);
58
  return parent::_prepareCollection();
63
  *
64
  * @return Mage_Adminhtml_Block_Widget_Grid
65
  */
66
+ protected function _prepareColumns()
67
+ {
68
  $this->addColumn('entity_id', array(
69
  'header' => Mage::helper('cdokus')->__('ID'),
70
  'sortable' => true,
123
  ));
124
 
125
 
 
126
  return parent::_prepareColumns();
127
  }
128
 
129
+ protected function _prepareMassaction()
130
+ {
131
  $this->setMassactionIdField('entity_id');
132
  $this->getMassactionBlock()->setFormFieldName('cdokus');
133
 
156
  return $this;
157
  }
158
 
159
+ public function getRowUrl($row)
160
+ {
161
  return $this->getUrl('*/*/edit', array('link_id' => $row->getEntityId()));
162
  }
163
 
164
+ public function getGridUrl()
165
+ {
166
  return $this->getUrl('*/*/grid', array('_current' => true));
167
  }
168
 
app/code/community/Zanbytes/Cdokus/Block/Download.php CHANGED
@@ -26,17 +26,19 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Download.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Block_Download extends Mage_Core_Block_Template {
 
36
 
37
  protected $_collection;
38
 
39
- protected function _beforeToHtml() {
 
40
  if (!$this->getProductSku()) {
41
  return false;
42
  }
@@ -45,11 +47,12 @@ class Zanbytes_Cdokus_Block_Download extends Mage_Core_Block_Template {
45
 
46
  /**
47
  * The final moment of truth i.e html
48
- * @desc Assumptions the last entry will be set at default store
49
  * @see Mage_Catalog_Model_Resource_Product_Link_Product_Collection::setStoreOrder
50
  * @return string
51
  */
52
- public function getAllLinks() {
 
53
  $links = array();
54
  $collection = $this->_getCollection();
55
  if ($collection->count() <= 0)
@@ -72,24 +75,27 @@ class Zanbytes_Cdokus_Block_Download extends Mage_Core_Block_Template {
72
  * @param Zanbytes_Cdokus_Model_Link $link
73
  * @return type
74
  */
75
- public function getDownloadUrl(Zanbytes_Cdokus_Model_Link $link) {
 
76
  return $this->getUrl('cdokus/download/index', array('link_id' => $link->getId()));
77
  }
78
 
79
- protected function _getCollection() {
 
80
  if (!$this->_collection && $this->getProductSku()) {
81
  $model = Mage::getModel('cdokus/link');
82
  $this->_collection = $model->getResourceCollection()
83
- ->addSkuToSelect($this->getProductSku())
84
- ->addProductFilter()
85
- ->addStoreFilter(Mage::app()->getStore()->getId())
86
- ->addActiveFilter(Zanbytes_Cdokus_Model_Link::STATUS_ENABLED)
87
- ->setPositionOrder();
88
  }
89
  return $this->_collection;
90
  }
91
 
92
- public function getProductSku() {
 
93
  if ($product = Mage::registry('current_product')) {
94
  return $product->getSku();
95
  }
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Download.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Block_Download extends Mage_Core_Block_Template
36
+ {
37
 
38
  protected $_collection;
39
 
40
+ protected function _beforeToHtml()
41
+ {
42
  if (!$this->getProductSku()) {
43
  return false;
44
  }
47
 
48
  /**
49
  * The final moment of truth i.e html
50
+ * @desc Assumptions the last entry will be set at default store
51
  * @see Mage_Catalog_Model_Resource_Product_Link_Product_Collection::setStoreOrder
52
  * @return string
53
  */
54
+ public function getAllLinks()
55
+ {
56
  $links = array();
57
  $collection = $this->_getCollection();
58
  if ($collection->count() <= 0)
75
  * @param Zanbytes_Cdokus_Model_Link $link
76
  * @return type
77
  */
78
+ public function getDownloadUrl(Zanbytes_Cdokus_Model_Link $link)
79
+ {
80
  return $this->getUrl('cdokus/download/index', array('link_id' => $link->getId()));
81
  }
82
 
83
+ protected function _getCollection()
84
+ {
85
  if (!$this->_collection && $this->getProductSku()) {
86
  $model = Mage::getModel('cdokus/link');
87
  $this->_collection = $model->getResourceCollection()
88
+ ->addSkuToSelect($this->getProductSku())
89
+ ->addProductFilter()
90
+ ->addStoreFilter(Mage::app()->getStore()->getId())
91
+ ->addActiveFilter(Zanbytes_Cdokus_Model_Link::STATUS_ENABLED)
92
+ ->setPositionOrder();
93
  }
94
  return $this->_collection;
95
  }
96
 
97
+ public function getProductSku()
98
+ {
99
  if ($product = Mage::registry('current_product')) {
100
  return $product->getSku();
101
  }
app/code/community/Zanbytes/Cdokus/Helper/Data.php CHANGED
@@ -26,20 +26,22 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Data.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Helper_Data extends Mage_Core_Helper_Abstract {
 
36
 
37
  /**
38
  * false if guest not allowed && user not logged in, otherwise true
39
  * @return boolean
40
  */
41
- public function isAllowed() {
42
- $allowed = (bool) Mage::getSingleton('cdokus/link')->getConfigData('allow_guest');
 
43
  $isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
44
  if (false === $allowed && false === $isLoggedIn)
45
  return false;
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Data.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Helper_Data extends Mage_Core_Helper_Abstract
36
+ {
37
 
38
  /**
39
  * false if guest not allowed && user not logged in, otherwise true
40
  * @return boolean
41
  */
42
+ public function isAllowed()
43
+ {
44
+ $allowed = (bool)Mage::getSingleton('cdokus/link')->getConfigData('allow_guest');
45
  $isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
46
  if (false === $allowed && false === $isLoggedIn)
47
  return false;
app/code/community/Zanbytes/Cdokus/Model/Abstract.php CHANGED
@@ -26,13 +26,14 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Abstract.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- abstract class Zanbytes_Cdokus_Model_Abstract extends Mage_Core_Model_Abstract {
 
36
 
37
  protected $_dirPath = null;
38
 
@@ -43,7 +44,8 @@ abstract class Zanbytes_Cdokus_Model_Abstract extends Mage_Core_Model_Abstract {
43
  * @param string $idFieldName
44
  * @return Mage_Core_Model_Abstract
45
  */
46
- protected function _construct() {
 
47
  $this->_init('cdokus/link');
48
  $this->setDirpath();
49
  }
@@ -52,11 +54,13 @@ abstract class Zanbytes_Cdokus_Model_Abstract extends Mage_Core_Model_Abstract {
52
  * @desc Get Directory Path
53
  * @return type string path used to store docs
54
  */
55
- public function getDirpath() {
 
56
  return $this->setDirpath();
57
  }
58
 
59
- public function setDirpath($dir = null) {
 
60
  if (null === $dir)
61
  $this->_dirPath = Mage::getBaseDir() . DS . 'media' . DS . 'catalog' . DS . 'docs' . DS;
62
  $this->setData('dir_path', $dir);
@@ -71,7 +75,8 @@ abstract class Zanbytes_Cdokus_Model_Abstract extends Mage_Core_Model_Abstract {
71
  *
72
  * @return mixed
73
  */
74
- public function getConfigData($field, $storeId = null, $code = 'general') {
 
75
  if (null === $storeId) {
76
  $storeId = $this->getStore();
77
  }
@@ -79,14 +84,16 @@ abstract class Zanbytes_Cdokus_Model_Abstract extends Mage_Core_Model_Abstract {
79
  return Mage::getStoreConfig($path, $storeId);
80
  }
81
 
82
- public function getStore() {
 
83
  if ($storeId = $this->getData('store_id')) {
84
  return $storeId;
85
  }
86
  return Mage::app()->getStore()->getId();
87
  }
88
 
89
- public function verifyLicence($host = null) {
 
90
  if (null === $host) {
91
  $url = new Varien_Object(parse_url(Mage::app()->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)));
92
  $host = $url->getHost();
@@ -100,10 +107,11 @@ abstract class Zanbytes_Cdokus_Model_Abstract extends Mage_Core_Model_Abstract {
100
  return false;
101
  }
102
 
103
- public function execute($observer) {
 
104
  if (!Mage::getModel('cdokus/link')->verifyLicence())
105
  Mage::getSingleton('adminhtml/session')
106
- ->addError('Your license is invalid, please consult me via <a href="mailto:info@zanbytes.com">info@zanbytes.com</a>');
107
  return $this;
108
  }
109
 
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Abstract.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ abstract class Zanbytes_Cdokus_Model_Abstract extends Mage_Core_Model_Abstract
36
+ {
37
 
38
  protected $_dirPath = null;
39
 
44
  * @param string $idFieldName
45
  * @return Mage_Core_Model_Abstract
46
  */
47
+ protected function _construct()
48
+ {
49
  $this->_init('cdokus/link');
50
  $this->setDirpath();
51
  }
54
  * @desc Get Directory Path
55
  * @return type string path used to store docs
56
  */
57
+ public function getDirpath()
58
+ {
59
  return $this->setDirpath();
60
  }
61
 
62
+ public function setDirpath($dir = null)
63
+ {
64
  if (null === $dir)
65
  $this->_dirPath = Mage::getBaseDir() . DS . 'media' . DS . 'catalog' . DS . 'docs' . DS;
66
  $this->setData('dir_path', $dir);
75
  *
76
  * @return mixed
77
  */
78
+ public function getConfigData($field, $storeId = null, $code = 'general')
79
+ {
80
  if (null === $storeId) {
81
  $storeId = $this->getStore();
82
  }
84
  return Mage::getStoreConfig($path, $storeId);
85
  }
86
 
87
+ public function getStore()
88
+ {
89
  if ($storeId = $this->getData('store_id')) {
90
  return $storeId;
91
  }
92
  return Mage::app()->getStore()->getId();
93
  }
94
 
95
+ public function verifyLicence($host = null)
96
+ {
97
  if (null === $host) {
98
  $url = new Varien_Object(parse_url(Mage::app()->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK)));
99
  $host = $url->getHost();
107
  return false;
108
  }
109
 
110
+ public function execute($observer)
111
+ {
112
  if (!Mage::getModel('cdokus/link')->verifyLicence())
113
  Mage::getSingleton('adminhtml/session')
114
+ ->addError('Your license is invalid, please consult me via <a href="mailto:info@zanbytes.com">info@zanbytes.com</a>');
115
  return $this;
116
  }
117
 
app/code/community/Zanbytes/Cdokus/Model/Link.php CHANGED
@@ -26,13 +26,14 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Link.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Model_Link extends Zanbytes_Cdokus_Model_Abstract {
 
36
 
37
  const STATUS_ENABLED = 1;
38
  const STATUS_DISABLED = 2;
@@ -41,11 +42,13 @@ class Zanbytes_Cdokus_Model_Link extends Zanbytes_Cdokus_Model_Abstract {
41
  * Re-attach the directory path to the basename
42
  * @return type
43
  */
44
- public function getFilename() {
 
45
  return $this->getDirpath() . $this->getData('filename');
46
  }
47
 
48
- public function getLabel() {
 
49
  $label = $this->getData('label');
50
  if (!empty($label))
51
  return $label;
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Link.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Model_Link extends Zanbytes_Cdokus_Model_Abstract
36
+ {
37
 
38
  const STATUS_ENABLED = 1;
39
  const STATUS_DISABLED = 2;
42
  * Re-attach the directory path to the basename
43
  * @return type
44
  */
45
+ public function getFilename()
46
+ {
47
  return $this->getDirpath() . $this->getData('filename');
48
  }
49
 
50
+ public function getLabel()
51
+ {
52
  $label = $this->getData('label');
53
  if (!empty($label))
54
  return $label;
app/code/community/Zanbytes/Cdokus/Model/Resource/Link.php CHANGED
@@ -26,19 +26,21 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Link.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Model_Resource_Link extends Mage_Core_Model_Mysql4_Abstract {
 
36
 
37
  /**
38
  * Resource initialization
39
  *
40
  */
41
- protected function _construct() {
 
42
  $this->_init('cdokus/links', 'entity_id');
43
  }
44
 
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Link.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Model_Resource_Link extends Mage_Core_Model_Mysql4_Abstract
36
+ {
37
 
38
  /**
39
  * Resource initialization
40
  *
41
  */
42
+ protected function _construct()
43
+ {
44
  $this->_init('cdokus/links', 'entity_id');
45
  }
46
 
app/code/community/Zanbytes/Cdokus/Model/Resource/Link/Collection.php CHANGED
@@ -26,24 +26,27 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: Collection.php 1105 2014-03-17 22:41:47Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Model_Resource_Link_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
 
36
 
37
  protected $_sku = null;
38
 
39
  /**
40
  * Resource initialization
41
  */
42
- protected function _construct() {
 
43
  $this->_init('cdokus/link');
44
  }
45
 
46
- public function addSkuToSelect($sku) {
 
47
  $this->_sku = $sku;
48
  return $this;
49
  }
@@ -54,7 +57,8 @@ class Zanbytes_Cdokus_Model_Resource_Link_Collection extends Mage_Core_Model_Mys
54
  * @param array | int $storeId
55
  * @return Mage_Tag_Model_Resource_Tag_Collection
56
  */
57
- public function addStoreFilter($storeId) {
 
58
  /**
59
  * All links on the store view level
60
  */
@@ -69,10 +73,10 @@ class Zanbytes_Cdokus_Model_Resource_Link_Collection extends Mage_Core_Model_Mys
69
  * All links on default level, duplicate handled here
70
  */
71
  $sql = $this->getConnection()
72
- ->select()
73
- ->from(array('s' => $this->getMainTable()), array('entity_id'))
74
- ->where('s.store_id IN(?)', array($storeId, Mage_Core_Model_App::ADMIN_STORE_ID))
75
- ->where('s.sku = ?', $this->_sku);
76
  if (!empty($files))
77
  $sql->where('s.filename NOT IN(?)', $files);
78
  /**
@@ -88,7 +92,8 @@ class Zanbytes_Cdokus_Model_Resource_Link_Collection extends Mage_Core_Model_Mys
88
  * @param int $status
89
  * @return Mage_Tag_Model_Resource_Tag_Collection
90
  */
91
- public function addActiveFilter($status) {
 
92
  $this->getSelect()->where('main_table.is_active = ?', $status);
93
  return $this;
94
  }
@@ -99,7 +104,8 @@ class Zanbytes_Cdokus_Model_Resource_Link_Collection extends Mage_Core_Model_Mys
99
  * @param array | int $sku
100
  * @return Mage_Tag_Model_Resource_Tag_Collection
101
  */
102
- public function addProductFilter() {
 
103
  $this->getSelect()->where('main_table.sku = ?', $this->_sku);
104
  return $this;
105
  }
@@ -110,7 +116,8 @@ class Zanbytes_Cdokus_Model_Resource_Link_Collection extends Mage_Core_Model_Mys
110
  * @param string $dir sort type asc|desc
111
  * @return Mage_Catalog_Model_Resource_Product_Link_Product_Collection
112
  */
113
- public function setPositionOrder($dir = self::SORT_ORDER_DESC) {
 
114
  $this->getSelect()->order('main_table.position ' . $dir);
115
  return $this;
116
  }
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: Collection.php 1105 2014-03-17 22:41:47Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Model_Resource_Link_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
36
+ {
37
 
38
  protected $_sku = null;
39
 
40
  /**
41
  * Resource initialization
42
  */
43
+ protected function _construct()
44
+ {
45
  $this->_init('cdokus/link');
46
  }
47
 
48
+ public function addSkuToSelect($sku)
49
+ {
50
  $this->_sku = $sku;
51
  return $this;
52
  }
57
  * @param array | int $storeId
58
  * @return Mage_Tag_Model_Resource_Tag_Collection
59
  */
60
+ public function addStoreFilter($storeId)
61
+ {
62
  /**
63
  * All links on the store view level
64
  */
73
  * All links on default level, duplicate handled here
74
  */
75
  $sql = $this->getConnection()
76
+ ->select()
77
+ ->from(array('s' => $this->getMainTable()), array('entity_id'))
78
+ ->where('s.store_id IN(?)', array($storeId, Mage_Core_Model_App::ADMIN_STORE_ID))
79
+ ->where('s.sku = ?', $this->_sku);
80
  if (!empty($files))
81
  $sql->where('s.filename NOT IN(?)', $files);
82
  /**
92
  * @param int $status
93
  * @return Mage_Tag_Model_Resource_Tag_Collection
94
  */
95
+ public function addActiveFilter($status)
96
+ {
97
  $this->getSelect()->where('main_table.is_active = ?', $status);
98
  return $this;
99
  }
104
  * @param array | int $sku
105
  * @return Mage_Tag_Model_Resource_Tag_Collection
106
  */
107
+ public function addProductFilter()
108
+ {
109
  $this->getSelect()->where('main_table.sku = ?', $this->_sku);
110
  return $this;
111
  }
116
  * @param string $dir sort type asc|desc
117
  * @return Mage_Catalog_Model_Resource_Product_Link_Product_Collection
118
  */
119
+ public function setPositionOrder($dir = self::SORT_ORDER_DESC)
120
+ {
121
  $this->getSelect()->order('main_table.position ' . $dir);
122
  return $this;
123
  }
app/code/community/Zanbytes/Cdokus/controllers/Adminhtml/Cdokus/Document/LinkController.php CHANGED
@@ -26,33 +26,38 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: LinkController.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_Adminhtml_Cdokus_Document_LinkController extends Mage_Adminhtml_Controller_Action {
 
36
 
37
- protected function _construct() {
 
38
  $this->setUsedModuleName('Zanbytes_Cdokus');
39
  }
40
 
41
- public function indexAction() {
 
42
  $this->loadLayout();
43
  $this->_title($this->__('Catalog Links Overview'));
44
  $this->_setActiveMenu('catalog/cdokus');
45
  $this->renderLayout();
46
  }
47
 
48
- public function editAction() {
 
49
  $this->loadLayout();
50
  $this->_title($this->__('Catalog Links Overview'));
51
  $this->_setActiveMenu('catalog/cdokus');
52
  $this->renderLayout();
53
  }
54
 
55
- public function massStatusAction() {
 
56
  $collection = $this->_getCollection();
57
  if ($collection->count() <= 0) {
58
  $this->_getSession()->addError($this->__('Please select link(s).'));
@@ -61,7 +66,7 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Document_LinkController extends Mage_Admi
61
  try {
62
  foreach ($collection as $link) {
63
  $link->setIsActive($this->getRequest()->getPost('status'))
64
- ->save();
65
  }
66
  $this->_getSession()->addSuccess($this->__('%s link(s) status updated.', $collection->count()));
67
  } catch (Mage_Core_Exception $e) {
@@ -73,7 +78,8 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Document_LinkController extends Mage_Admi
73
  $this->_redirect('*/*/');
74
  }
75
 
76
- public function massDeleteAction() {
 
77
  $collection = $this->_getCollection();
78
  if ($collection->count() <= 0) {
79
  $this->_getSession()->addError($this->__('Please select link(s).'));
@@ -93,27 +99,30 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Document_LinkController extends Mage_Admi
93
  $this->_redirect('*/*/');
94
  }
95
 
96
- protected function _getCollection() {
 
97
  return Mage::getResourceModel('cdokus/link_collection')
98
- ->addFieldToFilter('entity_id', array('in' => $this->getRequest()->getPost('cdokus', array())));
99
  }
100
 
101
- public function gridAction() {
 
102
  $this->loadLayout();
103
  $this->renderLayout();
104
  }
105
 
106
- public function saveAction() {
 
107
  $data = $this->getRequest()->getPost();
108
  if ($data) {
109
  try {
110
  if ($linkId = $this->getRequest()->getParam('link_id', false)) {
111
  if ($link = Mage::getModel('cdokus/link')->load($linkId)) {
112
  $link->setStoreId($this->getRequest()->getPost('store_id'))
113
- ->setLabel($this->getRequest()->getPost('label'))
114
- ->setPosition($this->getRequest()->getPost('position'))
115
- ->setIsActive($this->getRequest()->getPost('is_active'))
116
- ->save();
117
  $this->_getSession()->addSuccess($this->__('The link # %s updated.', $link->getId()));
118
  }
119
  }
@@ -127,7 +136,8 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Document_LinkController extends Mage_Admi
127
  }
128
  }
129
 
130
- public function deleteAction() {
 
131
  try {
132
  if ($linkId = $this->getRequest()->getParam('link_id', false)) {
133
  if ($link = Mage::getModel('cdokus/link')->load($linkId)) {
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: LinkController.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_Adminhtml_Cdokus_Document_LinkController extends Mage_Adminhtml_Controller_Action
36
+ {
37
 
38
+ protected function _construct()
39
+ {
40
  $this->setUsedModuleName('Zanbytes_Cdokus');
41
  }
42
 
43
+ public function indexAction()
44
+ {
45
  $this->loadLayout();
46
  $this->_title($this->__('Catalog Links Overview'));
47
  $this->_setActiveMenu('catalog/cdokus');
48
  $this->renderLayout();
49
  }
50
 
51
+ public function editAction()
52
+ {
53
  $this->loadLayout();
54
  $this->_title($this->__('Catalog Links Overview'));
55
  $this->_setActiveMenu('catalog/cdokus');
56
  $this->renderLayout();
57
  }
58
 
59
+ public function massStatusAction()
60
+ {
61
  $collection = $this->_getCollection();
62
  if ($collection->count() <= 0) {
63
  $this->_getSession()->addError($this->__('Please select link(s).'));
66
  try {
67
  foreach ($collection as $link) {
68
  $link->setIsActive($this->getRequest()->getPost('status'))
69
+ ->save();
70
  }
71
  $this->_getSession()->addSuccess($this->__('%s link(s) status updated.', $collection->count()));
72
  } catch (Mage_Core_Exception $e) {
78
  $this->_redirect('*/*/');
79
  }
80
 
81
+ public function massDeleteAction()
82
+ {
83
  $collection = $this->_getCollection();
84
  if ($collection->count() <= 0) {
85
  $this->_getSession()->addError($this->__('Please select link(s).'));
99
  $this->_redirect('*/*/');
100
  }
101
 
102
+ protected function _getCollection()
103
+ {
104
  return Mage::getResourceModel('cdokus/link_collection')
105
+ ->addFieldToFilter('entity_id', array('in' => $this->getRequest()->getPost('cdokus', array())));
106
  }
107
 
108
+ public function gridAction()
109
+ {
110
  $this->loadLayout();
111
  $this->renderLayout();
112
  }
113
 
114
+ public function saveAction()
115
+ {
116
  $data = $this->getRequest()->getPost();
117
  if ($data) {
118
  try {
119
  if ($linkId = $this->getRequest()->getParam('link_id', false)) {
120
  if ($link = Mage::getModel('cdokus/link')->load($linkId)) {
121
  $link->setStoreId($this->getRequest()->getPost('store_id'))
122
+ ->setLabel($this->getRequest()->getPost('label'))
123
+ ->setPosition($this->getRequest()->getPost('position'))
124
+ ->setIsActive($this->getRequest()->getPost('is_active'))
125
+ ->save();
126
  $this->_getSession()->addSuccess($this->__('The link # %s updated.', $link->getId()));
127
  }
128
  }
136
  }
137
  }
138
 
139
+ public function deleteAction()
140
+ {
141
  try {
142
  if ($linkId = $this->getRequest()->getParam('link_id', false)) {
143
  if ($link = Mage::getModel('cdokus/link')->load($linkId)) {
app/code/community/Zanbytes/Cdokus/controllers/Adminhtml/Cdokus/Product/EditController.php CHANGED
@@ -25,11 +25,11 @@
25
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
  */
27
  /**
28
- * @desc Catalog Product Documents
29
  * @author Omar,Muhsin <info@zanbytes.com>
30
- * @version $Id: EditController.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
31
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
32
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
33
  */
34
  require_once 'Mage/Adminhtml/controllers/Catalog/ProductController.php';
35
 
@@ -40,26 +40,30 @@ require_once 'Mage/Adminhtml/controllers/Catalog/ProductController.php';
40
  * @package Mage_Bundle
41
  * @author Magento Core Team <core@magentocommerce.com>
42
  */
43
- class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Adminhtml_Catalog_ProductController {
 
44
 
45
- protected function _construct() {
 
46
  $this->setUsedModuleName('Zanbytes_Cdokus');
47
  }
48
 
49
- public function formAction() {
 
50
  $product = $this->_initProduct();
51
  $this->loadLayout();
52
  $this->getLayout()->getBlock('admin.product.cdokus.items')
53
- ->setProductId($product->getId());
54
  $this->renderLayout();
55
  }
56
 
57
- public function addAction() {
 
58
  $product = $this->_initProduct();
59
  $storeId = $this->getRequest()->getParam('store', Mage_Core_Model_App::ADMIN_STORE_ID);
60
  $redirectBack = $this->getRequest()->getParam('back', false);
61
  $productId = $this->getRequest()->getParam('id');
62
- $isEdit = (int) ($this->getRequest()->getParam('id') != null);
63
 
64
  $data = $this->getRequest()->getPost();
65
  if ($data) {
@@ -73,20 +77,20 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Admin
73
  * Upload handler
74
  */
75
  $uploader = new Varien_File_Uploader('cdokus_filename');
76
- $uploader->setFilesDispersion((bool) $link->getConfigData('allow_file_dispersion'));
77
- $uploader->setAllowRenameFiles((bool) $link->getConfigData('allow_file_rename'));
78
  $uploader->setAllowedExtensions(explode(',', $link->getConfigData('allowed_file_extension')));
79
  $result = $uploader->save($link->getDirpath());
80
  $label = $this->getRequest()->getParam('cdokus_label', null);
81
  $isActive = $this->getRequest()->getParam('cdokus_is_active', true);
82
  $link->setSku($sku)
83
- ->setFilename($result['file'])
84
- ->setLabel($label)
85
- ->setStoreId($storeId)
86
- ->setIsActive($isActive)
87
- ->setCreatedAt(now())
88
- ->setUpdatedAt(now())
89
- ->save();
90
  /**
91
  * Generate event , just incase someone want to dive in here
92
  */
@@ -97,7 +101,7 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Admin
97
  $this->_getSession()->addSuccess($this->__('The link has been saved.'));
98
  } catch (Mage_Core_Exception $e) {
99
  $this->_getSession()->addError($e->getMessage())
100
- ->setProductData($data);
101
  $redirectBack = true;
102
  } catch (Exception $e) {
103
  Mage::logException($e);
@@ -121,11 +125,12 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Admin
121
  }
122
  }
123
 
124
- public function updateAction() {
 
125
  $storeId = $this->getRequest()->getParam('store');
126
  $redirectBack = $this->getRequest()->getParam('back', false);
127
  $productId = $this->getRequest()->getParam('id');
128
- $isEdit = (int) ($this->getRequest()->getParam('id') != null);
129
 
130
  $data = $this->getRequest()->getPost();
131
  if ($data) {
@@ -141,7 +146,7 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Admin
141
  $this->_getSession()->addSuccess($this->__('The link position updated.'));
142
  } catch (Mage_Core_Exception $e) {
143
  $this->_getSession()->addError($e->getMessage())
144
- ->setProductData($data);
145
  $redirectBack = true;
146
  } catch (Exception $e) {
147
  Mage::logException($e);
@@ -166,7 +171,8 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Admin
166
  }
167
  }
168
 
169
- public function deletelinkAction() {
 
170
  $productId = $this->getRequest()->getParam('id');
171
  try {
172
  if ($linkId = $this->getRequest()->getParam('link_entity_id', false)) {
@@ -174,7 +180,8 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Admin
174
  $link->delete();
175
  $storeId = $link->getStoreId();
176
  $this->_getSession()->addSuccess($this->__("The link is now removed."));
177
- $this->_getSession()->addNotice($this->__("File %s is left for you to manually delete it.", $link->getData('filename')));
 
178
  }
179
  }
180
  } catch (Mage_Core_Exception $e) {
@@ -191,18 +198,20 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Admin
191
  ));
192
  }
193
 
194
- public function statusAction() {
 
195
  try {
196
  if ($linkId = $this->getRequest()->getParam('link_id', false)) {
197
  if ($link = Mage::getModel('cdokus/link')->load($linkId)) {
198
  $link->setIsActive($this->getRequest()->getParam('is_active'))
199
- ->setUpdatedAt(now())
200
- ->save();
201
  $storeId = $link->getStoreId();
202
  $productId = Mage::getResourceModel('catalog/product')->getIdBySku($link->getSku());
203
  $status = $link->getIsActive() == Zanbytes_Cdokus_Model_Link::STATUS_ENABLED ?
204
- $this->__('enabled') : $this->__('disabled');
205
- $this->_getSession()->addSuccess($this->__("The link %s status is to %s.", $link->getId(), $status));
 
206
  }
207
  }
208
  } catch (Mage_Core_Exception $e) {
@@ -219,11 +228,12 @@ class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Admin
219
  ));
220
  }
221
 
222
- public function tabgridAction() {
 
223
  $product = $this->_initProduct();
224
  $this->loadLayout();
225
  $this->getLayout()->getBlock('adminhtml.catalog.product.edit.tab.links.grid')
226
- ->setProductId($product->getId());
227
  $this->renderLayout();
228
  }
229
 
25
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
  */
27
  /**
28
+ * @desc Catalog Product Documents
29
  * @author Omar,Muhsin <info@zanbytes.com>
30
+ * @version $Id: EditController.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
31
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
32
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
33
  */
34
  require_once 'Mage/Adminhtml/controllers/Catalog/ProductController.php';
35
 
40
  * @package Mage_Bundle
41
  * @author Magento Core Team <core@magentocommerce.com>
42
  */
43
+ class Zanbytes_Cdokus_Adminhtml_Cdokus_Product_EditController extends Mage_Adminhtml_Catalog_ProductController
44
+ {
45
 
46
+ protected function _construct()
47
+ {
48
  $this->setUsedModuleName('Zanbytes_Cdokus');
49
  }
50
 
51
+ public function formAction()
52
+ {
53
  $product = $this->_initProduct();
54
  $this->loadLayout();
55
  $this->getLayout()->getBlock('admin.product.cdokus.items')
56
+ ->setProductId($product->getId());
57
  $this->renderLayout();
58
  }
59
 
60
+ public function addAction()
61
+ {
62
  $product = $this->_initProduct();
63
  $storeId = $this->getRequest()->getParam('store', Mage_Core_Model_App::ADMIN_STORE_ID);
64
  $redirectBack = $this->getRequest()->getParam('back', false);
65
  $productId = $this->getRequest()->getParam('id');
66
+ $isEdit = (int)($this->getRequest()->getParam('id') != null);
67
 
68
  $data = $this->getRequest()->getPost();
69
  if ($data) {
77
  * Upload handler
78
  */
79
  $uploader = new Varien_File_Uploader('cdokus_filename');
80
+ $uploader->setFilesDispersion((bool)$link->getConfigData('allow_file_dispersion'));
81
+ $uploader->setAllowRenameFiles((bool)$link->getConfigData('allow_file_rename'));
82
  $uploader->setAllowedExtensions(explode(',', $link->getConfigData('allowed_file_extension')));
83
  $result = $uploader->save($link->getDirpath());
84
  $label = $this->getRequest()->getParam('cdokus_label', null);
85
  $isActive = $this->getRequest()->getParam('cdokus_is_active', true);
86
  $link->setSku($sku)
87
+ ->setFilename($result['file'])
88
+ ->setLabel($label)
89
+ ->setStoreId($storeId)
90
+ ->setIsActive($isActive)
91
+ ->setCreatedAt(now())
92
+ ->setUpdatedAt(now())
93
+ ->save();
94
  /**
95
  * Generate event , just incase someone want to dive in here
96
  */
101
  $this->_getSession()->addSuccess($this->__('The link has been saved.'));
102
  } catch (Mage_Core_Exception $e) {
103
  $this->_getSession()->addError($e->getMessage())
104
+ ->setProductData($data);
105
  $redirectBack = true;
106
  } catch (Exception $e) {
107
  Mage::logException($e);
125
  }
126
  }
127
 
128
+ public function updateAction()
129
+ {
130
  $storeId = $this->getRequest()->getParam('store');
131
  $redirectBack = $this->getRequest()->getParam('back', false);
132
  $productId = $this->getRequest()->getParam('id');
133
+ $isEdit = (int)($this->getRequest()->getParam('id') != null);
134
 
135
  $data = $this->getRequest()->getPost();
136
  if ($data) {
146
  $this->_getSession()->addSuccess($this->__('The link position updated.'));
147
  } catch (Mage_Core_Exception $e) {
148
  $this->_getSession()->addError($e->getMessage())
149
+ ->setProductData($data);
150
  $redirectBack = true;
151
  } catch (Exception $e) {
152
  Mage::logException($e);
171
  }
172
  }
173
 
174
+ public function deletelinkAction()
175
+ {
176
  $productId = $this->getRequest()->getParam('id');
177
  try {
178
  if ($linkId = $this->getRequest()->getParam('link_entity_id', false)) {
180
  $link->delete();
181
  $storeId = $link->getStoreId();
182
  $this->_getSession()->addSuccess($this->__("The link is now removed."));
183
+ $notice = $this->__("File %s is left for you to manually delete it.", $link->getData('filename'));
184
+ $this->_getSession()->addNotice($notice);
185
  }
186
  }
187
  } catch (Mage_Core_Exception $e) {
198
  ));
199
  }
200
 
201
+ public function statusAction()
202
+ {
203
  try {
204
  if ($linkId = $this->getRequest()->getParam('link_id', false)) {
205
  if ($link = Mage::getModel('cdokus/link')->load($linkId)) {
206
  $link->setIsActive($this->getRequest()->getParam('is_active'))
207
+ ->setUpdatedAt(now())
208
+ ->save();
209
  $storeId = $link->getStoreId();
210
  $productId = Mage::getResourceModel('catalog/product')->getIdBySku($link->getSku());
211
  $status = $link->getIsActive() == Zanbytes_Cdokus_Model_Link::STATUS_ENABLED ?
212
+ $this->__('enabled') : $this->__('disabled');
213
+ $successMessage = $this->__("The link %s status is to %s.", $link->getId(), $status);
214
+ $this->_getSession()->addSuccess($successMessage);
215
  }
216
  }
217
  } catch (Mage_Core_Exception $e) {
228
  ));
229
  }
230
 
231
+ public function tabgridAction()
232
+ {
233
  $product = $this->_initProduct();
234
  $this->loadLayout();
235
  $this->getLayout()->getBlock('adminhtml.catalog.product.edit.tab.links.grid')
236
+ ->setProductId($product->getId());
237
  $this->renderLayout();
238
  }
239
 
app/code/community/Zanbytes/Cdokus/controllers/DownloadController.php CHANGED
@@ -26,24 +26,27 @@
26
  */
27
 
28
  /**
29
- * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
- * @version $Id: DownloadController.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
- class Zanbytes_Cdokus_DownloadController extends Mage_Core_Controller_Front_Action {
 
36
 
37
  /**
38
  * Retrieve customer session object
39
  *
40
  * @return Mage_Customer_Model_Session
41
  */
42
- protected function _getSession() {
 
43
  return Mage::getSingleton('customer/session');
44
  }
45
 
46
- public function preDispatch() {
 
47
  if (Mage::helper('cdokus')->isAllowed())
48
  return $this;
49
  parent::preDispatch();
@@ -52,7 +55,8 @@ class Zanbytes_Cdokus_DownloadController extends Mage_Core_Controller_Front_Acti
52
  }
53
  }
54
 
55
- public function indexAction() {
 
56
  if ($linkId = $this->getRequest()->getParam('link_id', false)) {
57
  if ($link = Mage::getSingleton('cdokus/link')->load($linkId)) {
58
  $this->_prepareDownloadResponse(basename($link->getFilename()), array('type' => 'filename', 'value' => $link->getFilename(), 'rm' => false));
@@ -69,11 +73,12 @@ class Zanbytes_Cdokus_DownloadController extends Mage_Core_Controller_Front_Acti
69
  * @param string|array $content set to null to avoid starting output, $contentLength should be set explicitly in
70
  * that case
71
  * @param string $contentType
72
- * @param int $contentLength explicit content length, if strlen($content) isn't applicable
73
  * @return Mage_Adminhtml_Controller_Action
74
  */
75
  protected function _prepareDownloadResponse($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null
76
- ) {
 
77
  $session = Mage::getSingleton('admin/session');
78
  if ($session->isFirstPageAfterLogin()) {
79
  $this->_redirect($session->getUser()->getStartupPageUrl());
@@ -94,13 +99,13 @@ class Zanbytes_Cdokus_DownloadController extends Mage_Core_Controller_Front_Acti
94
  }
95
 
96
  $this->getResponse()
97
- ->setHttpResponseCode(200)
98
- ->setHeader('Pragma', 'public', true)
99
- ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
100
- ->setHeader('Content-type', $contentType, true)
101
- ->setHeader('Content-Length', is_null($contentLength) ? strlen($content) : $contentLength)
102
- ->setHeader('Content-Disposition', 'attachment; filename="' . $fileName . '"')
103
- ->setHeader('Last-Modified', date('r'));
104
 
105
  if (!is_null($content)) {
106
  if ($isFile) {
26
  */
27
 
28
  /**
29
+ * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
+ * @version $Id: DownloadController.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
+ class Zanbytes_Cdokus_DownloadController extends Mage_Core_Controller_Front_Action
36
+ {
37
 
38
  /**
39
  * Retrieve customer session object
40
  *
41
  * @return Mage_Customer_Model_Session
42
  */
43
+ protected function _getSession()
44
+ {
45
  return Mage::getSingleton('customer/session');
46
  }
47
 
48
+ public function preDispatch()
49
+ {
50
  if (Mage::helper('cdokus')->isAllowed())
51
  return $this;
52
  parent::preDispatch();
55
  }
56
  }
57
 
58
+ public function indexAction()
59
+ {
60
  if ($linkId = $this->getRequest()->getParam('link_id', false)) {
61
  if ($link = Mage::getSingleton('cdokus/link')->load($linkId)) {
62
  $this->_prepareDownloadResponse(basename($link->getFilename()), array('type' => 'filename', 'value' => $link->getFilename(), 'rm' => false));
73
  * @param string|array $content set to null to avoid starting output, $contentLength should be set explicitly in
74
  * that case
75
  * @param string $contentType
76
+ * @param int $contentLength explicit content length, if strlen($content) isn't applicable
77
  * @return Mage_Adminhtml_Controller_Action
78
  */
79
  protected function _prepareDownloadResponse($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null
80
+ )
81
+ {
82
  $session = Mage::getSingleton('admin/session');
83
  if ($session->isFirstPageAfterLogin()) {
84
  $this->_redirect($session->getUser()->getStartupPageUrl());
99
  }
100
 
101
  $this->getResponse()
102
+ ->setHttpResponseCode(200)
103
+ ->setHeader('Pragma', 'public', true)
104
+ ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
105
+ ->setHeader('Content-type', $contentType, true)
106
+ ->setHeader('Content-Length', is_null($contentLength) ? strlen($content) : $contentLength)
107
+ ->setHeader('Content-Disposition', 'attachment; filename="' . $fileName . '"')
108
+ ->setHeader('Last-Modified', date('r'));
109
 
110
  if (!is_null($content)) {
111
  if ($isFile) {
app/code/community/Zanbytes/Cdokus/etc/config.xml CHANGED
@@ -36,7 +36,7 @@
36
  <config>
37
  <modules>
38
  <Zanbytes_Cdokus>
39
- <version>0.0.0.7</version>
40
  </Zanbytes_Cdokus>
41
  </modules>
42
  <frontend>
@@ -55,7 +55,7 @@
55
  <file>cdokus.xml</file>
56
  </cdokus>
57
  </updates>
58
- </layout>
59
  <translate>
60
  <modules>
61
  <Zanbytes_Cdokus>
@@ -64,9 +64,9 @@
64
  </files>
65
  </Zanbytes_Cdokus>
66
  </modules>
67
- </translate>
68
- </frontend>
69
- <global>
70
  <models>
71
  <cdokus>
72
  <class>Zanbytes_Cdokus_Model</class>
@@ -80,7 +80,7 @@
80
  </links>
81
  </entities>
82
  </cdokus_resource>
83
- </models>
84
  <resources>
85
  <cdokus_setup>
86
  <setup>
@@ -101,7 +101,7 @@
101
  <use>core_read</use>
102
  </connection>
103
  </cdokus_read>
104
- </resources>
105
  <helpers>
106
  <cdokus>
107
  <class>Zanbytes_Cdokus_Helper</class>
@@ -123,38 +123,38 @@
123
  </modules>
124
  </args>
125
  </adminhtml>
126
- </routers>
127
  </admin>
128
  <adminhtml>
129
- <!--
130
- <events>
131
- <admin_system_config_changed_section_cdokus>
132
- <observers>
133
  <admin_system_config_changed_section_cdokus>
134
- <type>model</type>
135
- <class>cdokus/link</class>
136
- <method>execute</method>
 
 
 
 
137
  </admin_system_config_changed_section_cdokus>
138
- </observers>
139
- </admin_system_config_changed_section_cdokus>
140
- <catalog_product_cdokus_upload_document_after>
141
- <observers>
142
- <catalog_product_cdokus_upload_document_after_cdokus>
143
- <type>model</type>
144
- <class>cdokus/link</class>
145
- <method>execute</method>
146
- </catalog_product_cdokus_upload_document_after_cdokus>
147
- </observers>
148
- </catalog_product_cdokus_upload_document_after>
149
- </events>
150
- -->
151
  <layout>
152
  <updates>
153
  <cdokus>
154
  <file>cdokus.xml</file>
155
  </cdokus>
156
  </updates>
157
- </layout>
158
  <translate>
159
  <modules>
160
  <Zanbytes_Cdokus>
@@ -163,7 +163,7 @@
163
  </files>
164
  </Zanbytes_Cdokus>
165
  </modules>
166
- </translate>
167
  <acl>
168
  <resources>
169
  <admin>
@@ -182,7 +182,7 @@
182
  </children>
183
  </admin>
184
  </resources>
185
- </acl>
186
  </adminhtml>
187
  <default>
188
  <cdokus>
@@ -193,5 +193,5 @@
193
  <allow_file_rename>1</allow_file_rename>
194
  </general>
195
  </cdokus>
196
- </default>
197
  </config>
36
  <config>
37
  <modules>
38
  <Zanbytes_Cdokus>
39
+ <version>0.0.0.8</version>
40
  </Zanbytes_Cdokus>
41
  </modules>
42
  <frontend>
55
  <file>cdokus.xml</file>
56
  </cdokus>
57
  </updates>
58
+ </layout>
59
  <translate>
60
  <modules>
61
  <Zanbytes_Cdokus>
64
  </files>
65
  </Zanbytes_Cdokus>
66
  </modules>
67
+ </translate>
68
+ </frontend>
69
+ <global>
70
  <models>
71
  <cdokus>
72
  <class>Zanbytes_Cdokus_Model</class>
80
  </links>
81
  </entities>
82
  </cdokus_resource>
83
+ </models>
84
  <resources>
85
  <cdokus_setup>
86
  <setup>
101
  <use>core_read</use>
102
  </connection>
103
  </cdokus_read>
104
+ </resources>
105
  <helpers>
106
  <cdokus>
107
  <class>Zanbytes_Cdokus_Helper</class>
123
  </modules>
124
  </args>
125
  </adminhtml>
126
+ </routers>
127
  </admin>
128
  <adminhtml>
129
+ <!--
130
+ <events>
 
 
131
  <admin_system_config_changed_section_cdokus>
132
+ <observers>
133
+ <admin_system_config_changed_section_cdokus>
134
+ <type>model</type>
135
+ <class>cdokus/link</class>
136
+ <method>execute</method>
137
+ </admin_system_config_changed_section_cdokus>
138
+ </observers>
139
  </admin_system_config_changed_section_cdokus>
140
+ <catalog_product_cdokus_upload_document_after>
141
+ <observers>
142
+ <catalog_product_cdokus_upload_document_after_cdokus>
143
+ <type>model</type>
144
+ <class>cdokus/link</class>
145
+ <method>execute</method>
146
+ </catalog_product_cdokus_upload_document_after_cdokus>
147
+ </observers>
148
+ </catalog_product_cdokus_upload_document_after>
149
+ </events>
150
+ -->
 
 
151
  <layout>
152
  <updates>
153
  <cdokus>
154
  <file>cdokus.xml</file>
155
  </cdokus>
156
  </updates>
157
+ </layout>
158
  <translate>
159
  <modules>
160
  <Zanbytes_Cdokus>
163
  </files>
164
  </Zanbytes_Cdokus>
165
  </modules>
166
+ </translate>
167
  <acl>
168
  <resources>
169
  <admin>
182
  </children>
183
  </admin>
184
  </resources>
185
+ </acl>
186
  </adminhtml>
187
  <default>
188
  <cdokus>
193
  <allow_file_rename>1</allow_file_rename>
194
  </general>
195
  </cdokus>
196
+ </default>
197
  </config>
app/code/community/Zanbytes/Cdokus/etc/system.xml CHANGED
@@ -39,7 +39,7 @@
39
  <label>ZANBYTES</label>
40
  <sort_order>500</sort_order>
41
  </zanbytes>
42
- </tabs>
43
  <sections>
44
  <cdokus>
45
  <label>Cdokus</label>
@@ -67,7 +67,7 @@
67
  <show_in_store>1</show_in_store>
68
  <comment><![CDATA[Comma seperated e.g pdf,txt,doc]]>
69
  </comment>
70
- </allowed_file_extension>
71
  <allow_guest>
72
  <label>Allow guest</label>
73
  <frontend_type>select</frontend_type>
@@ -77,7 +77,8 @@
77
  <show_in_default>1</show_in_default>
78
  <show_in_website>1</show_in_website>
79
  <show_in_store>1</show_in_store>
80
- <comment><![CDATA[Set this to no, if you intend to let only logged in customers to download.Default Yes]]>
 
81
  </comment>
82
  </allow_guest>
83
  <allow_file_dispersion>
@@ -91,7 +92,7 @@
91
  <show_in_store>1</show_in_store>
92
  <comment><![CDATA[All uploaded files will be dispersed e.g foo.pdf to /f/o/foo.pdf]]>
93
  </comment>
94
- </allow_file_dispersion>
95
  <allow_file_rename>
96
  <label>Allow file rename</label>
97
  <frontend_type>select</frontend_type>
@@ -104,16 +105,16 @@
104
  <comment><![CDATA[If file exist it will be renamed to foo_1.pdf]]>
105
  </comment>
106
  </allow_file_rename>
107
- <!-- <license>
108
- <label>License key</label>
109
- <frontend_type>text</frontend_type>
110
- <sort_order>20</sort_order>
111
- <show_in_default>1</show_in_default>
112
- <show_in_website>1</show_in_website>
113
- <show_in_store>1</show_in_store>
114
- <comment><![CDATA[If you dont have one, please consult me info@zanbytes.com]]>
115
- </comment>
116
- </license> -->
117
  </fields>
118
  </general>
119
  </groups>
39
  <label>ZANBYTES</label>
40
  <sort_order>500</sort_order>
41
  </zanbytes>
42
+ </tabs>
43
  <sections>
44
  <cdokus>
45
  <label>Cdokus</label>
67
  <show_in_store>1</show_in_store>
68
  <comment><![CDATA[Comma seperated e.g pdf,txt,doc]]>
69
  </comment>
70
+ </allowed_file_extension>
71
  <allow_guest>
72
  <label>Allow guest</label>
73
  <frontend_type>select</frontend_type>
77
  <show_in_default>1</show_in_default>
78
  <show_in_website>1</show_in_website>
79
  <show_in_store>1</show_in_store>
80
+ <comment>
81
+ <![CDATA[Set this to no, if you intend to let only logged in customers to download.Default Yes]]>
82
  </comment>
83
  </allow_guest>
84
  <allow_file_dispersion>
92
  <show_in_store>1</show_in_store>
93
  <comment><![CDATA[All uploaded files will be dispersed e.g foo.pdf to /f/o/foo.pdf]]>
94
  </comment>
95
+ </allow_file_dispersion>
96
  <allow_file_rename>
97
  <label>Allow file rename</label>
98
  <frontend_type>select</frontend_type>
105
  <comment><![CDATA[If file exist it will be renamed to foo_1.pdf]]>
106
  </comment>
107
  </allow_file_rename>
108
+ <!-- <license>
109
+ <label>License key</label>
110
+ <frontend_type>text</frontend_type>
111
+ <sort_order>20</sort_order>
112
+ <show_in_default>1</show_in_default>
113
+ <show_in_website>1</show_in_website>
114
+ <show_in_store>1</show_in_store>
115
+ <comment><![CDATA[If you dont have one, please consult me info@zanbytes.com]]>
116
+ </comment>
117
+ </license> -->
118
  </fields>
119
  </general>
120
  </groups>
app/code/community/Zanbytes/Cdokus/sql/cdokus_setup/mysql4-install-0.0.0.1.php CHANGED
@@ -25,11 +25,11 @@
25
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
  */
27
  /**
28
- * @desc Catalog Product Documents
29
  * @author Omar,Muhsin <info@zanbytes.com>
30
- * @version $Id: mysql4-install-0.0.0.1.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
31
- * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
32
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
33
  */
34
  $installer = $this;
35
 
@@ -41,47 +41,47 @@ $installer->startSetup();
41
  */
42
  if (version_compare(Mage::getVersion(), '1.5.1.0', '>') === true) {
43
  $table = $installer->getConnection()
44
- ->newTable($installer->getTable('cdokus/links'))
45
- ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
46
- 'identity' => true,
47
- 'nullable' => false,
48
- 'primary' => true,
49
- ), 'Entity ID')
50
- ->addColumn('sku', Varien_Db_Ddl_Table::TYPE_CHAR, 55, array(
51
- 'nullable' => false,
52
- ), 'Sku')
53
- ->addColumn('filename', Varien_Db_Ddl_Table::TYPE_VARCHAR, 155, array(
54
- 'nullable' => false,
55
- ), 'File Name')
56
- ->addColumn('label', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
57
- 'nullable' => false,
58
- ), 'Label')
59
- ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
60
- 'nullable' => false,
61
- 'default' => 0,
62
- ), 'Store Id')
63
- ->addColumn('position', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
64
- 'nullable' => false,
65
- 'default' => 0,
66
- ), 'Position')
67
- ->addColumn('is_active', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
68
- 'nullable' => false,
69
- 'default' => 1,
70
- ), 'Is Active')
71
- ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array(
72
- 'nullable' => false,
73
- ), 'Created At')
74
- ->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array(
75
- 'nullable' => false,
76
- ), 'Updated At')
77
- ->addIndex($installer->getIdxName('cdokus/links', array('filename')), array('filename'))
78
- ->addIndex(
79
- $installer->getIdxName(
80
- array('cdokus/links', 'decimal'), array('filename', 'store_id'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
81
- ), array('filename', 'store_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE))
82
- ->addForeignKey($installer->getFkName('cdokus/links', 'sku', 'catalog/product', 'sku'), 'sku', $installer->getTable('catalog/product'), 'sku', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
83
- ->addForeignKey($installer->getFkName('cdokus/links', 'store_id', 'core/store', 'store_id'), 'store_id', $installer->getTable('core/store'), 'store_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
84
- ->setComment('Cdokus Links');
85
  $installer->getConnection()->dropTable($installer->getTable('cdokus/links'));
86
  $installer->getConnection()->createTable($table);
87
  } else {
25
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
  */
27
  /**
28
+ * @desc Catalog Product Documents
29
  * @author Omar,Muhsin <info@zanbytes.com>
30
+ * @version $Id: mysql4-install-0.0.0.1.php 1104 2014-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
31
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
32
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
33
  */
34
  $installer = $this;
35
 
41
  */
42
  if (version_compare(Mage::getVersion(), '1.5.1.0', '>') === true) {
43
  $table = $installer->getConnection()
44
+ ->newTable($installer->getTable('cdokus/links'))
45
+ ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
46
+ 'identity' => true,
47
+ 'nullable' => false,
48
+ 'primary' => true,
49
+ ), 'Entity ID')
50
+ ->addColumn('sku', Varien_Db_Ddl_Table::TYPE_CHAR, 55, array(
51
+ 'nullable' => false,
52
+ ), 'Sku')
53
+ ->addColumn('filename', Varien_Db_Ddl_Table::TYPE_VARCHAR, 155, array(
54
+ 'nullable' => false,
55
+ ), 'File Name')
56
+ ->addColumn('label', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
57
+ 'nullable' => false,
58
+ ), 'Label')
59
+ ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
60
+ 'nullable' => false,
61
+ 'default' => 0,
62
+ ), 'Store Id')
63
+ ->addColumn('position', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
64
+ 'nullable' => false,
65
+ 'default' => 0,
66
+ ), 'Position')
67
+ ->addColumn('is_active', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
68
+ 'nullable' => false,
69
+ 'default' => 1,
70
+ ), 'Is Active')
71
+ ->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array(
72
+ 'nullable' => false,
73
+ ), 'Created At')
74
+ ->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array(
75
+ 'nullable' => false,
76
+ ), 'Updated At')
77
+ ->addIndex($installer->getIdxName('cdokus/links', array('filename')), array('filename'))
78
+ ->addIndex(
79
+ $installer->getIdxName(
80
+ array('cdokus/links', 'decimal'), array('filename', 'store_id'), Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
81
+ ), array('filename', 'store_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE))
82
+ ->addForeignKey($installer->getFkName('cdokus/links', 'sku', 'catalog/product', 'sku'), 'sku', $installer->getTable('catalog/product'), 'sku', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
83
+ ->addForeignKey($installer->getFkName('cdokus/links', 'store_id', 'core/store', 'store_id'), 'store_id', $installer->getTable('core/store'), 'store_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
84
+ ->setComment('Cdokus Links');
85
  $installer->getConnection()->dropTable($installer->getTable('cdokus/links'));
86
  $installer->getConnection()->createTable($table);
87
  } else {
app/design/frontend/base/default/layout/cdokus.xml CHANGED
@@ -29,26 +29,28 @@
29
  * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
  * @version $Id: cdokus.xml 1104 2013-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
- * @copyright Copyright (c) 2013 Zanbytes Inc. (http://www.zanbytes.com)
33
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
  -->
36
- <layout version="0.1.0">
37
  <catalog_product_view>
38
  <reference name="head">
39
  <action method="addCss">
40
  <stylesheet>cdokus/style.css</stylesheet>
41
  </action>
42
- </reference>
43
  <label>Catalog Product View</label>
44
- <!-- Zanbytes_Cdokus -->
45
  <reference name="product.info.additional">
46
  <block type="cdokus/download" name="cdokus_download" before="-" template="cdokus/links.phtml">
47
  <block type="page/html_wrapper" name="cdokus.download" as="list_before" translate="label">
48
  <label>Links</label>
49
- <action method="setMayBeInvisible"><value>1</value></action>
 
 
50
  </block>
51
  </block>
52
  </reference>
53
- </catalog_product_view>
54
  </layout>
29
  * @desc Catalog Product Documents
30
  * @author Omar,Muhsin <info@zanbytes.com>
31
  * @version $Id: cdokus.xml 1104 2013-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
32
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
33
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
  */
35
  -->
36
+ <layout version="0.1.0">
37
  <catalog_product_view>
38
  <reference name="head">
39
  <action method="addCss">
40
  <stylesheet>cdokus/style.css</stylesheet>
41
  </action>
42
+ </reference>
43
  <label>Catalog Product View</label>
44
+ <!-- Zanbytes_Cdokus -->
45
  <reference name="product.info.additional">
46
  <block type="cdokus/download" name="cdokus_download" before="-" template="cdokus/links.phtml">
47
  <block type="page/html_wrapper" name="cdokus.download" as="list_before" translate="label">
48
  <label>Links</label>
49
+ <action method="setMayBeInvisible">
50
+ <value>1</value>
51
+ </action>
52
  </block>
53
  </block>
54
  </reference>
55
+ </catalog_product_view>
56
  </layout>
app/design/frontend/base/default/template/cdokus/links.phtml CHANGED
@@ -24,36 +24,38 @@
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  /**
27
- * @desc Catalog Product Documents
28
  * @author Omar,Muhsin <info@zanbytes.com>
29
- * @version $Id: links.phtml 1104 2013-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
30
- * @copyright Copyright (c) 2013 Zanbytes Inc. (http://www.zanbytes.com)
31
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
32
  */
33
  ?>
34
- <?php if(Mage::helper('cdokus')->isAllowed()): ?>
35
- <div class="box-collateral box-additional cdokus-download">
36
- <?php if ($_links = $this->getAllLinks()): ?>
37
- <h2><?php echo $this->__('Available Download Links') ?></h2>
38
- <table class="data-table" id="cdoku-available-links">
39
- <col />
40
- <col width="25%" />
41
- <tbody>
42
  <?php foreach ($_links as $_link): ?>
43
  <tr>
44
  <th class="label"><?php echo $this->htmlEscape($this->__($_link->getLabel())) ?></th>
45
  <td class="data">
46
- <button onclick="setLocation('<?php echo $this->getDownloadUrl($_link) ?>')" class="button action-link" title="<?php echo $this->__('Download') ?>" type="button">
 
 
47
  <span>
48
  <span><?php echo $this->__('Download') ?></span>
49
  </span>
50
- </button>
51
  </td>
52
  </tr>
53
  <?php endforeach; ?>
54
- </tbody>
55
- </table>
56
- <script type="text/javascript">decorateTable('cdoku-available-links')</script>
57
- <?php endif; ?>
58
- </div>
59
- <?php endif;?>
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
  /**
27
+ * @desc Catalog Product Documents
28
  * @author Omar,Muhsin <info@zanbytes.com>
29
+ * @version $Id: links.phtml 1104 2013-02-18 00:33:21Z muhsin $ $LastChangedBy: muhsin $
30
+ * @copyright Copyright (c) 2014 Zanbytes Inc. (http://www.zanbytes.com)
31
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
32
  */
33
  ?>
34
+ <?php if (Mage::helper('cdokus')->isAllowed()): ?>
35
+ <div class="box-collateral box-additional cdokus-download">
36
+ <?php if ($_links = $this->getAllLinks()): ?>
37
+ <h2><?php echo $this->__('Available Download Links') ?></h2>
38
+ <table class="data-table" id="cdoku-available-links">
39
+ <col/>
40
+ <col width="25%"/>
41
+ <tbody>
42
  <?php foreach ($_links as $_link): ?>
43
  <tr>
44
  <th class="label"><?php echo $this->htmlEscape($this->__($_link->getLabel())) ?></th>
45
  <td class="data">
46
+ <button onclick="setLocation('<?php echo $this->getDownloadUrl($_link) ?>')"
47
+ class="button action-link" title="<?php echo $this->__('Download') ?>"
48
+ type="button">
49
  <span>
50
  <span><?php echo $this->__('Download') ?></span>
51
  </span>
52
+ </button>
53
  </td>
54
  </tr>
55
  <?php endforeach; ?>
56
+ </tbody>
57
+ </table>
58
+ <script type="text/javascript">decorateTable('cdoku-available-links')</script>
59
+ <?php endif; ?>
60
+ </div>
61
+ <?php endif; ?>
package.xml CHANGED
@@ -1,23 +1,26 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Zanbytes_Cdokus</name>
4
- <version>0.0.0.7</version>
5
  <stability>stable</stability>
6
- <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Product Document, the extension includes admin tab on the Admin Product Interface.And it also provides a way to show the download link per store.</summary>
10
  <description>Plugin that gives a nice user interface for administrator to upload product documents like manuals via a nice product tab in the Magento Backoffice.&#xD;
11
  &#xD;
12
  As a bonus the plugin, allow administrators to control the visibility of the links per store and by using the translation file the label can be translated into multiple languages.</description>
13
- <notes>Date:11-01-2014&#xD;
14
- Version:v0007&#xD;
15
- #Compatibility testing with c1810&#xD;
16
- #Removes licence messages and its key from the cdokus.</notes>
17
- <authors><author><name>Omar,Muhsin</name><user>omarmadian</user><email>o.z.muhsin@gmail.com</email></author></authors>
18
- <date>2014-01-11</date>
19
- <time>14:39:59</time>
20
- <contents><target name="mage"><dir name="app"><dir name="locale"><dir name="en_US"><file name="Zanbytes_Cdokus.txt" hash="118e7eb832b943a17b8aff74c4489f23"/></dir></dir><dir name="etc"><dir name="modules"><file name="Zanbytes_Cdokus.xml" hash="f35529ad415197c9c47994fdf5d39760"/></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="cdokus"><file name="links.phtml" hash="fbdad7a3c6ab227e8af07a9dc716ffd0"/></dir></dir><dir name="layout"><file name="cdokus.xml" hash="fa642f1af0c9e8c5ae4367a14e591c07"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="cdokus.xml" hash="67360c986435c888f76f1b812dc13235"/></dir><dir name="template"><dir name="cdokus"><dir name="product"><dir name="edit"><file name="cdokus.phtml" hash="cb5f49fef2a3c6245534433f4231bc44"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="code"><dir name="community"><dir name="Zanbytes"><dir name="Cdokus"><dir><dir><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Cdokus.php" hash="942c14ae95907c3ed351a1c4ba429584"/><dir name="Links"><dir name="Action"><file name="Renderer.php" hash="d602eb275b4580c866c879be0b6fb931"/></dir><file name="Grid.php" hash="c3ffd16e724cd87a62932e1eac98fc6b"/></dir></dir></dir></dir></dir><dir name="Cdokus"><file name="Document.php" hash="d230294a2503e20260408a4b998cc023"/><dir name="Edit"><file name="Form.php" hash="985d7a778827b763ac753db4dd646b48"/><dir name="Tab"><file name="Form.php" hash="c8ce8bfc813b1dbe9c367d6086084381"/></dir><file name="Tabs.php" hash="872ffd3320f2b00b78e984f8ab83eb6c"/></dir><file name="Edit.php" hash="b8302c9107305caefd788b7f2f7602a9"/><file name="Grid.php" hash="5c85c38aa9508ca09c2c111e0656ad2f"/></dir></dir><file name="Download.php" hash="645b59225ef50bc6b11ee5a5fcf62632"/></dir><dir name="Helper"><file name="Data.php" hash="80142c6d1478c23865ae5bcbebec491b"/></dir><dir name="Model"><file name="Abstract.php" hash="1a616835c51b6ebeba809f2b3312b953"/><file name="Link.php" hash="5f641f42d0677afc050d3ed05e8526fe"/><dir name="Resource"><dir name="Link"><file name="Collection.php" hash="2e289cbb4ede1a5d35fefbf000a540cb"/></dir><file name="Link.php" hash="4b3128a30911869b834312b3df7c8492"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Cdokus"><dir name="Document"><file name="LinkController.php" hash="be56d3428a6acd0ecbef653c18870d44"/></dir><dir name="Product"><file name="EditController.php" hash="b6f6d5966f4d151d8eaa6184f31fa959"/></dir></dir></dir><file name="DownloadController.php" hash="0a68417cd68a768f1fc5b8529a782f58"/></dir><dir name="docs"><file name="TODO" hash="508dd0c06bfdfbb5feb20de141428de1"/><file name="readme" hash="05f427f032dddaeebaf9db2da06be119"/><file name="reset-cdoku-db-entries.sql" hash="e2272e9d913d45415d40dcaebdc06e21"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ebe01080c4ab035ca783f6cda2380325"/><file name="config.xml" hash="00e6b16c5a37ccc85d1e86e4889b186b"/><file name="system.xml" hash="ce142db0887e92b0730d37b75fed6080"/></dir><dir name="sql"><dir name="cdokus_setup"><file name="mysql4-install-0.0.0.1.php" hash="5de08052a13213d7efea54c223653c20"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="skin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="cdokus"><file name="style.css" hash="289cd7956266a91ef9d6c36d12a071e5"/></dir></dir></dir></dir></dir></target></contents>
 
 
 
21
  <compatible/>
22
- <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Zanbytes_Cdokus</name>
4
+ <version>0.0.0.8</version>
5
  <stability>stable</stability>
6
+ <license/>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Product Document, the extension includes admin tab on the Admin Product Interface.And it also provides a way to show the download link per store.</summary>
10
  <description>Plugin that gives a nice user interface for administrator to upload product documents like manuals via a nice product tab in the Magento Backoffice.&#xD;
11
  &#xD;
12
  As a bonus the plugin, allow administrators to control the visibility of the links per store and by using the translation file the label can be translated into multiple languages.</description>
13
+ <notes>Date: 31-5-2015&#xD;
14
+ Version:v0008&#xD;
15
+ #Fixes psr-2 compliant code&#xD;
16
+ &#xD;
17
+ Date:05-12-2013&#xD;
18
+ Version:v0005&#xD;
19
+ #First public free version via MC</notes>
20
+ <authors><author><name>Omar,Muhsin</name><user>auto-converted</user><email>info@zanbytes.com</email></author></authors>
21
+ <date>2015-05-31</date>
22
+ <time>08:37:53</time>
23
+ <contents><target name="mage"><dir name="app"><dir name="locale"><dir name="en_US"><file name="Zanbytes_Cdokus.txt" hash="118e7eb832b943a17b8aff74c4489f23"/></dir></dir><dir name="etc"><dir name="modules"><file name="Zanbytes_Cdokus.xml" hash="f35529ad415197c9c47994fdf5d39760"/></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="cdokus"><file name="links.phtml" hash="cb905edbf68d0a868314b8e18f10f83d"/></dir></dir><dir name="layout"><file name="cdokus.xml" hash="dbf1fd1ba0ea7ad6be20e8770b97b961"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="cdokus.xml" hash="67360c986435c888f76f1b812dc13235"/></dir><dir name="template"><dir name="cdokus"><dir name="product"><dir name="edit"><file name="cdokus.phtml" hash="cb5f49fef2a3c6245534433f4231bc44"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="code"><dir name="community"><dir name="Zanbytes"><dir name="Cdokus"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><dir name="Links"><dir name="Action"><file name="Renderer.php" hash="2b34491c3e2c219b9d51dc695bdd5bc7"/></dir><file name="Grid.php" hash="5f48c5c9425bacebf7c92f7ff1b51c36"/></dir><file name="Cdokus.php" hash="070e1fe2b2d0dada28bb2eaa405bc48f"/></dir></dir></dir></dir><dir name="Cdokus"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="31070941afd6ff3ccbe1e4df946293a7"/></dir><file name="Form.php" hash="4a4554706cc1a009efbb834c55819d82"/><file name="Tabs.php" hash="7c321b07a12c42fc0248d59c5295025f"/></dir><file name="Document.php" hash="f0d8963b607ece9690f5acea7a23602e"/><file name="Edit.php" hash="114e7de8444fc4bfcc468bd69fe79d14"/><file name="Grid.php" hash="250c700fb8d7562282cbe431c5f4c3d5"/></dir></dir><file name="Download.php" hash="64c49df19de9b462f72b9d82d84c19b4"/></dir><dir name="Helper"><file name="Data.php" hash="d87bc48a0336d0bca090002e86c35322"/></dir><dir name="Model"><dir name="Resource"><dir name="Link"><file name="Collection.php" hash="3fb2c2a98564963d70af86cfc2e113d9"/></dir><file name="Link.php" hash="368897c216ada5d3f7cdf4899f03e227"/></dir><file name="Abstract.php" hash="ad1163eae36b6074fffe2d718e77dc8a"/><file name="Link.php" hash="0c62343a0ae9625bbfbeef536fafdc92"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Cdokus"><dir name="Document"><file name="LinkController.php" hash="dabf52792c3fd66241d67bff3dc38abb"/></dir><dir name="Product"><file name="EditController.php" hash="f145722ee27a99982118ee6a88556c9c"/></dir></dir></dir><file name="DownloadController.php" hash="0bd87881d5a523f0d38012ad4f631514"/></dir><dir name="docs"><file name="TODO" hash="508dd0c06bfdfbb5feb20de141428de1"/><file name="readme" hash="05f427f032dddaeebaf9db2da06be119"/><file name="reset-cdoku-db-entries.sql" hash="e2272e9d913d45415d40dcaebdc06e21"/></dir><dir name="etc"><file name="adminhtml.xml" hash="ebe01080c4ab035ca783f6cda2380325"/><file name="config.xml" hash="9b32d0fca74a263c5c671a393a135919"/><file name="system.xml" hash="96f043d90bb779e43f80112808a73adb"/></dir><dir name="sql"><dir name="cdokus_setup"><file name="mysql4-install-0.0.0.1.php" hash="b8701d5fb11b9be376ae9c4efd76062a"/></dir></dir></dir></dir></dir></dir></dir><dir name="skin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="cdokus"><file name="style.css" hash="289cd7956266a91ef9d6c36d12a071e5"/></dir></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
+ <dependencies/>
26
  </package>