SAG_Gallery - Version 1.0.0

Version Notes

This module is use for image gallery with category.

Download this release

Release Info

Developer Navneet
Extension SAG_Gallery
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (37) hide show
  1. app/code/community/Sag/Gallery/Block/Adminhtml/Category.php +14 -0
  2. app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit.php +45 -0
  3. app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Form.php +19 -0
  4. app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tab/Form.php +59 -0
  5. app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tabs.php +24 -0
  6. app/code/community/Sag/Gallery/Block/Adminhtml/Category/Grid.php +116 -0
  7. app/code/community/Sag/Gallery/Block/Adminhtml/Gallery.php +12 -0
  8. app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit.php +45 -0
  9. app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Form.php +19 -0
  10. app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Tab/Form.php +88 -0
  11. app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Tabs.php +24 -0
  12. app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Grid.php +141 -0
  13. app/code/community/Sag/Gallery/Block/Category.php +52 -0
  14. app/code/community/Sag/Gallery/Block/Gallery.php +79 -0
  15. app/code/community/Sag/Gallery/Helper/Data.php +7 -0
  16. app/code/community/Sag/Gallery/Model/Category.php +14 -0
  17. app/code/community/Sag/Gallery/Model/Gallery.php +14 -0
  18. app/code/community/Sag/Gallery/Model/Mysql4/Category.php +10 -0
  19. app/code/community/Sag/Gallery/Model/Mysql4/Category/Collection.php +10 -0
  20. app/code/community/Sag/Gallery/Model/Mysql4/Gallery.php +10 -0
  21. app/code/community/Sag/Gallery/Model/Mysql4/Gallery/Collection.php +10 -0
  22. app/code/community/Sag/Gallery/Model/Status.php +17 -0
  23. app/code/community/Sag/Gallery/controllers/Adminhtml/CategoryController.php +185 -0
  24. app/code/community/Sag/Gallery/controllers/Adminhtml/GalleryController.php +182 -0
  25. app/code/community/Sag/Gallery/controllers/CategoryController.php +9 -0
  26. app/code/community/Sag/Gallery/controllers/ImageController.php +9 -0
  27. app/code/community/Sag/Gallery/controllers/IndexController.php +9 -0
  28. app/code/community/Sag/Gallery/etc/config.xml +128 -0
  29. app/code/community/Sag/Gallery/sql/category_setup/mysql4-install-0.1.0.php +23 -0
  30. app/code/community/Sag/Gallery/sql/gallery_setup/mysql4-install-0.1.0.php +40 -0
  31. app/design/adminhtml/default/default/layout/gallery.xml +14 -0
  32. app/design/frontend/base/default/layout/gallery.xml +20 -0
  33. app/design/frontend/base/default/template/gallery/category.phtml +20 -0
  34. app/design/frontend/base/default/template/gallery/gallery.phtml +19 -0
  35. app/design/frontend/base/default/template/gallery/image.phtml +14 -0
  36. app/etc/modules/Sag_Gallery.xml +9 -0
  37. package.xml +29 -0
app/code/community/Sag/Gallery/Block/Adminhtml/Category.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Sag_Gallery_Block_Adminhtml_Category extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_category';
7
+ $this->_blockGroup = 'gallery';
8
+ $this->_headerText = Mage::helper('gallery')->__('Category Manager');
9
+ $this->_addButtonLabel = Mage::helper('gallery')->__('Add Category');
10
+ parent::__construct();
11
+ }
12
+
13
+
14
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Category_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'gallery';
11
+ $this->_controller = 'adminhtml_category';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('gallery')->__('Save Category'));
14
+ $this->_updateButton('delete', 'label', Mage::helper('gallery')->__('Delete Category'));
15
+
16
+ $this->_addButton('saveandcontinue', array(
17
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
+ 'onclick' => 'saveAndContinueEdit()',
19
+ 'class' => 'save',
20
+ ), -100);
21
+
22
+ $this->_formScripts[] = "
23
+ function toggleEditor() {
24
+ if (tinyMCE.getInstanceById('category_content') == null) {
25
+ tinyMCE.execCommand('mceAddControl', false, 'category_content');
26
+ } else {
27
+ tinyMCE.execCommand('mceRemoveControl', false, 'category_content');
28
+ }
29
+ }
30
+
31
+ function saveAndContinueEdit(){
32
+ editForm.submit($('edit_form').action+'back/edit/');
33
+ }
34
+ ";
35
+ }
36
+
37
+ public function getHeaderText()
38
+ {
39
+ if( Mage::registry('category_data') && Mage::registry('category_data')->getId() ) {
40
+ return Mage::helper('gallery')->__("Edit Category '%s'", $this->htmlEscape(Mage::registry('category_data')->getTitle()));
41
+ } else {
42
+ return Mage::helper('gallery')->__('Add Category');
43
+ }
44
+ }
45
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Category_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tab/Form.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Category_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset('category_form', array('legend'=>Mage::helper('gallery')->__('Category information')));
10
+
11
+ $fieldset->addField('title', 'text', array(
12
+ 'label' => Mage::helper('gallery')->__('Title'),
13
+ 'class' => 'required-entry',
14
+ 'required' => true,
15
+ 'name' => 'title',
16
+ ));
17
+
18
+
19
+ $fieldset->addField('filename', 'image', array(
20
+ 'label' => Mage::helper('gallery')->__('Image'),
21
+ 'required' => false,
22
+ 'name' => 'filename',
23
+ ));
24
+
25
+ $fieldset->addField('status', 'select', array(
26
+ 'label' => Mage::helper('gallery')->__('Status'),
27
+ 'name' => 'status',
28
+ 'values' => array(
29
+ array(
30
+ 'value' => 1,
31
+ 'label' => Mage::helper('gallery')->__('Enabled'),
32
+ ),
33
+
34
+ array(
35
+ 'value' => 2,
36
+ 'label' => Mage::helper('gallery')->__('Disabled'),
37
+ ),
38
+ ),
39
+ ));
40
+
41
+ $fieldset->addField('content', 'editor', array(
42
+ 'name' => 'content',
43
+ 'label' => Mage::helper('gallery')->__('Content'),
44
+ 'title' => Mage::helper('gallery')->__('Content'),
45
+ 'style' => 'width:700px; height:200px;',
46
+ 'wysiwyg' => false,
47
+ 'required' => true,
48
+ ));
49
+
50
+ if ( Mage::getSingleton('adminhtml/session')->getCategoryData() )
51
+ {
52
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getCategoryData());
53
+ Mage::getSingleton('adminhtml/session')->setCategoryData(null);
54
+ } elseif ( Mage::registry('category_data') ) {
55
+ $form->setValues(Mage::registry('category_data')->getData());
56
+ }
57
+ return parent::_prepareForm();
58
+ }
59
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tabs.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Category_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('category_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('gallery')->__('Category Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('gallery')->__('Category Information'),
18
+ 'title' => Mage::helper('gallery')->__('Category Information'),
19
+ 'content' => $this->getLayout()->createBlock('gallery/adminhtml_category_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Grid.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('categoryGrid');
9
+ $this->setDefaultSort('category_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('gallery/category')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('category_id', array(
24
+ 'header' => Mage::helper('gallery')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '50px',
27
+ 'index' => 'category_id',
28
+ ));
29
+
30
+ $this->addColumn('title', array(
31
+ 'header' => Mage::helper('gallery')->__('Title'),
32
+ 'align' =>'left',
33
+ 'index' => 'title',
34
+ ));
35
+
36
+ /*
37
+ $this->addColumn('content', array(
38
+ 'header' => Mage::helper('gallery')->__('Item Content'),
39
+ 'width' => '150px',
40
+ 'index' => 'content',
41
+ ));
42
+ */
43
+
44
+ $this->addColumn('status', array(
45
+ 'header' => Mage::helper('gallery')->__('Status'),
46
+ 'align' => 'left',
47
+ 'width' => '80px',
48
+ 'index' => 'status',
49
+ 'type' => 'options',
50
+ 'options' => array(
51
+ 1 => 'Enabled',
52
+ 2 => 'Disabled',
53
+ ),
54
+ ));
55
+
56
+ $this->addColumn('action',
57
+ array(
58
+ 'header' => Mage::helper('gallery')->__('Action'),
59
+ 'width' => '100',
60
+ 'type' => 'action',
61
+ 'getter' => 'getId',
62
+ 'actions' => array(
63
+ array(
64
+ 'caption' => Mage::helper('gallery')->__('Edit'),
65
+ 'url' => array('base'=> '*/*/edit'),
66
+ 'field' => 'id'
67
+ )
68
+ ),
69
+ 'filter' => false,
70
+ 'sortable' => false,
71
+ 'index' => 'stores',
72
+ 'is_system' => true,
73
+ ));
74
+
75
+ $this->addExportType('*/*/exportCsv', Mage::helper('gallery')->__('CSV'));
76
+ $this->addExportType('*/*/exportXml', Mage::helper('gallery')->__('XML'));
77
+
78
+ return parent::_prepareColumns();
79
+ }
80
+
81
+ protected function _prepareMassaction()
82
+ {
83
+ $this->setMassactionIdField('category_id');
84
+ $this->getMassactionBlock()->setFormFieldName('category');
85
+
86
+ $this->getMassactionBlock()->addItem('delete', array(
87
+ 'label' => Mage::helper('gallery')->__('Delete'),
88
+ 'url' => $this->getUrl('*/*/massDelete'),
89
+ 'confirm' => Mage::helper('gallery')->__('Are you sure?')
90
+ ));
91
+
92
+ $statuses = Mage::getSingleton('gallery/status')->getOptionArray();
93
+
94
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
95
+ $this->getMassactionBlock()->addItem('status', array(
96
+ 'label'=> Mage::helper('gallery')->__('Change status'),
97
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
+ 'additional' => array(
99
+ 'visibility' => array(
100
+ 'name' => 'status',
101
+ 'type' => 'select',
102
+ 'class' => 'required-entry',
103
+ 'label' => Mage::helper('gallery')->__('Status'),
104
+ 'values' => $statuses
105
+ )
106
+ )
107
+ ));
108
+ return $this;
109
+ }
110
+
111
+ public function getRowUrl($row)
112
+ {
113
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
+ }
115
+
116
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Sag_Gallery_Block_Adminhtml_Gallery extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_gallery';
7
+ $this->_blockGroup = 'gallery';
8
+ $this->_headerText = Mage::helper('gallery')->__('Item Manager');
9
+ $this->_addButtonLabel = Mage::helper('gallery')->__('Add Item');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Gallery_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'gallery';
11
+ $this->_controller = 'adminhtml_gallery';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('gallery')->__('Save Item'));
14
+ $this->_updateButton('delete', 'label', Mage::helper('gallery')->__('Delete Item'));
15
+
16
+ $this->_addButton('saveandcontinue', array(
17
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
+ 'onclick' => 'saveAndContinueEdit()',
19
+ 'class' => 'save',
20
+ ), -100);
21
+
22
+ $this->_formScripts[] = "
23
+ function toggleEditor() {
24
+ if (tinyMCE.getInstanceById('gallery_content') == null) {
25
+ tinyMCE.execCommand('mceAddControl', false, 'gallery_content');
26
+ } else {
27
+ tinyMCE.execCommand('mceRemoveControl', false, 'gallery_content');
28
+ }
29
+ }
30
+
31
+ function saveAndContinueEdit(){
32
+ editForm.submit($('edit_form').action+'back/edit/');
33
+ }
34
+ ";
35
+ }
36
+
37
+ public function getHeaderText()
38
+ {
39
+ if( Mage::registry('gallery_data') && Mage::registry('gallery_data')->getId() ) {
40
+ return Mage::helper('gallery')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('gallery_data')->getTitle()));
41
+ } else {
42
+ return Mage::helper('gallery')->__('Add Item');
43
+ }
44
+ }
45
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Gallery_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Tab/Form.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Gallery_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form();
8
+ $this->setForm($form);
9
+ $fieldset = $form->addFieldset('gallery_form', array('legend'=>Mage::helper('gallery')->__('Item information')));
10
+
11
+
12
+
13
+
14
+
15
+
16
+ $_cats = Mage::getModel('gallery/category')->getCollection();
17
+ foreach($_cats as $item)
18
+ {
19
+ if($item->getParent == NULL){
20
+ $_categories[] = array(
21
+ 'value' => $item->getCategoryId(),
22
+ 'label' => $item->getTitle(),
23
+ );
24
+ }
25
+ }
26
+
27
+ $fieldset->addField('category', 'select', array(
28
+ 'label' => Mage::helper('gallery')->__('Category'),
29
+ 'class' => 'required-entry',
30
+ 'required' => true,
31
+ 'name' => 'category',
32
+ 'values' => $_categories,
33
+ ));
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+ $fieldset->addField('title', 'text', array(
42
+ 'label' => Mage::helper('gallery')->__('Title'),
43
+ 'class' => 'required-entry',
44
+ 'required' => true,
45
+ 'name' => 'title',
46
+ ));
47
+
48
+ $fieldset->addField('filename', 'image', array(
49
+ 'label' => Mage::helper('gallery')->__('Image'),
50
+ 'required' => false,
51
+ 'name' => 'filename',
52
+ ));
53
+
54
+ $fieldset->addField('status', 'select', array(
55
+ 'label' => Mage::helper('gallery')->__('Status'),
56
+ 'name' => 'status',
57
+ 'values' => array(
58
+ array(
59
+ 'value' => 1,
60
+ 'label' => Mage::helper('gallery')->__('Enabled'),
61
+ ),
62
+
63
+ array(
64
+ 'value' => 2,
65
+ 'label' => Mage::helper('gallery')->__('Disabled'),
66
+ ),
67
+ ),
68
+ ));
69
+
70
+ $fieldset->addField('content', 'editor', array(
71
+ 'name' => 'content',
72
+ 'label' => Mage::helper('gallery')->__('Content'),
73
+ 'title' => Mage::helper('gallery')->__('Content'),
74
+ 'style' => 'width:700px; height:200px;',
75
+ 'wysiwyg' => false,
76
+ 'required' => true,
77
+ ));
78
+
79
+ if ( Mage::getSingleton('adminhtml/session')->getGalleryData() )
80
+ {
81
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getGalleryData());
82
+ Mage::getSingleton('adminhtml/session')->setGalleryData(null);
83
+ } elseif ( Mage::registry('gallery_data') ) {
84
+ $form->setValues(Mage::registry('gallery_data')->getData());
85
+ }
86
+ return parent::_prepareForm();
87
+ }
88
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Tabs.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Gallery_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('gallery_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('gallery')->__('Item Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('gallery')->__('Item Information'),
18
+ 'title' => Mage::helper('gallery')->__('Item Information'),
19
+ 'content' => $this->getLayout()->createBlock('gallery/adminhtml_gallery_edit_tab_form')->toHtml(),
20
+ ));
21
+
22
+ return parent::_beforeToHtml();
23
+ }
24
+ }
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Grid.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Block_Adminhtml_Gallery_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('galleryGrid');
9
+ $this->setDefaultSort('gallery_id');
10
+ $this->setDefaultDir('ASC');
11
+ $this->setSaveParametersInSession(true);
12
+ }
13
+
14
+ protected function _prepareCollection()
15
+ {
16
+ $collection = Mage::getModel('gallery/gallery')->getCollection();
17
+ $this->setCollection($collection);
18
+ return parent::_prepareCollection();
19
+ }
20
+
21
+ protected function _prepareColumns()
22
+ {
23
+ $this->addColumn('gallery_id', array(
24
+ 'header' => Mage::helper('gallery')->__('ID'),
25
+ 'align' =>'right',
26
+ 'width' => '50px',
27
+ 'index' => 'gallery_id',
28
+ ));
29
+
30
+ $this->addColumn('title', array(
31
+ 'header' => Mage::helper('gallery')->__('Title'),
32
+ 'align' =>'left',
33
+ 'index' => 'title',
34
+ ));
35
+
36
+
37
+
38
+ ///////////////////////////////////Category////////////////////////////////////
39
+ $_cats = Mage::getModel('gallery/category')->getCollection();
40
+ foreach($_cats as $item)
41
+ {
42
+ if($item->getParent == NULL){
43
+ $_categories[$item->getCategoryId()] = $item->getTitle();
44
+ }
45
+ }
46
+ $this->addColumn('category', array(
47
+ 'header' => Mage::helper('gallery')->__('Category'),
48
+ 'align' => 'left',
49
+ 'width' => '80px',
50
+ 'index' => 'category',
51
+ 'type' => 'options',
52
+ 'options' => $_categories,
53
+ ));
54
+ ///////////////////////////////////Category////////////////////////////////////
55
+
56
+
57
+
58
+
59
+
60
+
61
+ /*
62
+ $this->addColumn('content', array(
63
+ 'header' => Mage::helper('gallery')->__('Item Content'),
64
+ 'width' => '150px',
65
+ 'index' => 'content',
66
+ ));
67
+ */
68
+
69
+ $this->addColumn('status', array(
70
+ 'header' => Mage::helper('gallery')->__('Status'),
71
+ 'align' => 'left',
72
+ 'width' => '80px',
73
+ 'index' => 'status',
74
+ 'type' => 'options',
75
+ 'options' => array(
76
+ 1 => 'Enabled',
77
+ 2 => 'Disabled',
78
+ ),
79
+ ));
80
+
81
+ $this->addColumn('action',
82
+ array(
83
+ 'header' => Mage::helper('gallery')->__('Action'),
84
+ 'width' => '100',
85
+ 'type' => 'action',
86
+ 'getter' => 'getId',
87
+ 'actions' => array(
88
+ array(
89
+ 'caption' => Mage::helper('gallery')->__('Edit'),
90
+ 'url' => array('base'=> '*/*/edit'),
91
+ 'field' => 'id'
92
+ )
93
+ ),
94
+ 'filter' => false,
95
+ 'sortable' => false,
96
+ 'index' => 'stores',
97
+ 'is_system' => true,
98
+ ));
99
+
100
+ $this->addExportType('*/*/exportCsv', Mage::helper('gallery')->__('CSV'));
101
+ $this->addExportType('*/*/exportXml', Mage::helper('gallery')->__('XML'));
102
+
103
+ return parent::_prepareColumns();
104
+ }
105
+
106
+ protected function _prepareMassaction()
107
+ {
108
+ $this->setMassactionIdField('gallery_id');
109
+ $this->getMassactionBlock()->setFormFieldName('gallery');
110
+
111
+ $this->getMassactionBlock()->addItem('delete', array(
112
+ 'label' => Mage::helper('gallery')->__('Delete'),
113
+ 'url' => $this->getUrl('*/*/massDelete'),
114
+ 'confirm' => Mage::helper('gallery')->__('Are you sure?')
115
+ ));
116
+
117
+ $statuses = Mage::getSingleton('gallery/status')->getOptionArray();
118
+
119
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
120
+ $this->getMassactionBlock()->addItem('status', array(
121
+ 'label'=> Mage::helper('gallery')->__('Change status'),
122
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
123
+ 'additional' => array(
124
+ 'visibility' => array(
125
+ 'name' => 'status',
126
+ 'type' => 'select',
127
+ 'class' => 'required-entry',
128
+ 'label' => Mage::helper('gallery')->__('Status'),
129
+ 'values' => $statuses
130
+ )
131
+ )
132
+ ));
133
+ return $this;
134
+ }
135
+
136
+ public function getRowUrl($row)
137
+ {
138
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
139
+ }
140
+
141
+ }
app/code/community/Sag/Gallery/Block/Category.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Sag_Gallery_Block_Category extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getCategory()
10
+ {
11
+ if (!$this->hasData('category')) {
12
+ $this->setData('category', Mage::getModel('gallery/category')->getCollection());
13
+ }
14
+ return $this->getData('category');
15
+ }
16
+
17
+
18
+ /**
19
+ * Resize Image proportionally and return the resized image url
20
+ *
21
+ * @param string $imageName name of the image file
22
+ * @param integer|null $width resize width
23
+ * @param integer|null $height resize height
24
+ * @param string|null $imagePath directory path of the image present inside media directory
25
+ * @return string full url path of the image
26
+ */
27
+ public function resizeImage($imageName, $width=NULL, $height=NULL, $imagePath=NULL)
28
+ {
29
+ $imagePath = str_replace("/", DS, $imagePath);
30
+ $imagePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $imageName;
31
+
32
+ if($width == NULL && $height == NULL) {
33
+ $width = 100;
34
+ $height = 100;
35
+ }
36
+ $resizePath = $width . 'x' . $height;
37
+ $resizePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $resizePath . DS . $imageName;
38
+
39
+ if (file_exists($imagePathFull) && !file_exists($resizePathFull)) {
40
+ $imageObj = new Varien_Image($imagePathFull);
41
+ $imageObj->constrainOnly(TRUE);
42
+ $imageObj->keepAspectRatio(TRUE);
43
+ $imageObj->resize($width,$height);
44
+ $imageObj->save($resizePathFull);
45
+ }
46
+
47
+ $imagePath=str_replace(DS, "/", $imagePath);
48
+ $img = Mage::getBaseUrl("media") . $imagePath . "/" . $resizePath . "/" . $imageName;
49
+ return str_replace(DS, "/", $img);
50
+ }
51
+
52
+ }
app/code/community/Sag/Gallery/Block/Gallery.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Sag_Gallery_Block_Gallery extends Mage_Core_Block_Template
3
+ {
4
+ public function _prepareLayout()
5
+ {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function getGallery()
10
+ {
11
+ if (!$this->hasData('gallery')) {
12
+ $current_cat =$this->getRequest()->getParam('cat');
13
+ $this->setData('gallery', Mage::getModel('gallery/gallery')->getCollection()->addFieldToFilter("category", $current_cat));
14
+ }
15
+ return $this->getData('gallery');
16
+
17
+ }
18
+
19
+
20
+ public function getImage()
21
+ {
22
+ if (!$this->hasData('gallery')) {
23
+ $current_img =$this->getRequest()->getParam('img');
24
+ $this->setData('gallery', Mage::getModel('gallery/gallery')->getCollection()->addFieldToFilter("gallery_id", $current_img));
25
+ }
26
+ return $this->getData('gallery');
27
+
28
+ }
29
+
30
+ public function getCategoryById()
31
+ { $current_cat =$this->getRequest()->getParam('cat');
32
+ $this->setData('cat',Mage::getModel('gallery/category')->getCollection()->addFieldToFilter("category_id", $current_cat));
33
+
34
+ $catcount = count($this->getData('cat'));
35
+ if($catcount > 0 ):
36
+ foreach ($this->getData('cat') as $catTitle):
37
+ echo $catTitle->getTitle();
38
+ endforeach;
39
+ endif;
40
+
41
+ //return $this->getData('cat');
42
+ }
43
+
44
+
45
+ /**
46
+ * Resize Image proportionally and return the resized image url
47
+ *
48
+ * @param string $imageName name of the image file
49
+ * @param integer|null $width resize width
50
+ * @param integer|null $height resize height
51
+ * @param string|null $imagePath directory path of the image present inside media directory
52
+ * @return string full url path of the image
53
+ */
54
+ public function resizeImage($imageName, $width=NULL, $height=NULL, $imagePath=NULL)
55
+ {
56
+ $imagePath = str_replace("/", DS, $imagePath);
57
+ $imagePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $imageName;
58
+
59
+ if($width == NULL && $height == NULL) {
60
+ $width = 100;
61
+ $height = 100;
62
+ }
63
+ $resizePath = $width . 'x' . $height;
64
+ $resizePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $resizePath . DS . $imageName;
65
+
66
+ if (file_exists($imagePathFull) && !file_exists($resizePathFull)) {
67
+ $imageObj = new Varien_Image($imagePathFull);
68
+ $imageObj->constrainOnly(TRUE);
69
+ $imageObj->keepAspectRatio(TRUE);
70
+ $imageObj->resize($width,$height);
71
+ $imageObj->save($resizePathFull);
72
+ }
73
+
74
+ $imagePath=str_replace(DS, "/", $imagePath);
75
+ $img = Mage::getBaseUrl("media") . $imagePath . "/" . $resizePath . "/" . $imageName;
76
+ return str_replace(DS, "/", $img);
77
+ }
78
+
79
+ }
app/code/community/Sag/Gallery/Helper/Data.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
7
+ ?>
app/code/community/Sag/Gallery/Model/Category.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Model_Category extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('gallery/category');
9
+ }
10
+
11
+ public function getCollection() {
12
+ return Mage::getResourceModel('gallery/category_collection');
13
+ }
14
+ }
app/code/community/Sag/Gallery/Model/Gallery.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Model_Gallery extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('gallery/gallery');
9
+ }
10
+
11
+ public function getCollection() {
12
+ return Mage::getResourceModel('gallery/gallery_collection');
13
+ }
14
+ }
app/code/community/Sag/Gallery/Model/Mysql4/Category.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Model_Mysql4_Category extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the gallery_id refers to the key field in your database table.
8
+ $this->_init('gallery/category', 'category_id');
9
+ }
10
+ }
app/code/community/Sag/Gallery/Model/Mysql4/Category/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('gallery/category');
9
+ }
10
+ }
app/code/community/Sag/Gallery/Model/Mysql4/Gallery.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Model_Mysql4_Gallery extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the gallery_id refers to the key field in your database table.
8
+ $this->_init('gallery/gallery', 'gallery_id');
9
+ }
10
+ }
app/code/community/Sag/Gallery/Model/Mysql4/Gallery/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Model_Mysql4_Gallery_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('gallery/gallery');
9
+ }
10
+ }
app/code/community/Sag/Gallery/Model/Status.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('gallery')->__('Enabled'),
12
+ self::STATUS_DISABLED => Mage::helper('gallery')->__('Disabled')
13
+ );
14
+ }
15
+ }
16
+
17
+ ?>
app/code/community/Sag/Gallery/controllers/Adminhtml/CategoryController.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Adminhtml_CategoryController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('gallery/categories')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Category Manager'), Mage::helper('adminhtml')->__('Category Manager'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+ $this->_initAction()
16
+ ->renderLayout();
17
+ }
18
+
19
+ public function editAction() {
20
+ $id = $this->getRequest()->getParam('id');
21
+ $model = Mage::getModel('gallery/category')->load($id);
22
+
23
+ if ($model->getId() || $id == 0) {
24
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
25
+ if (!empty($data)) {
26
+ $model->setData($data);
27
+ }
28
+
29
+ Mage::register('category_data', $model);
30
+
31
+ $this->loadLayout();
32
+ $this->_setActiveMenu('gallery/categories');
33
+
34
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Category Manager'), Mage::helper('adminhtml')->__('Category Manager'));
35
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Category News'), Mage::helper('adminhtml')->__('Category News'));
36
+
37
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
38
+
39
+ $this->_addContent($this->getLayout()->createBlock('gallery/adminhtml_category_edit'))
40
+ ->_addLeft($this->getLayout()->createBlock('gallery/adminhtml_category_edit_tabs'));
41
+
42
+ $this->renderLayout();
43
+ } else {
44
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('gallery')->__('Category does not exist'));
45
+ $this->_redirect('*/*/');
46
+ }
47
+ }
48
+
49
+ public function newAction() {
50
+ $this->_forward('edit');
51
+ }
52
+
53
+ public function saveAction() {
54
+ if ($data = $this->getRequest()->getPost()) {
55
+
56
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
57
+ try {
58
+ /* Starting upload */
59
+ $uploader = new Varien_File_Uploader('filename');
60
+
61
+ // Any extention would work
62
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
63
+ $uploader->setAllowRenameFiles(false);
64
+
65
+ // Set the file upload mode
66
+ // false -> get the file directly in the specified folder
67
+ // true -> get the file in the product like folders
68
+ // (file.jpg will go in something like /media/f/i/file.jpg)
69
+ $uploader->setFilesDispersion(false);
70
+
71
+ // We set media as the upload dir
72
+ $path = Mage::getBaseDir('media') . DS . 'gallery' . DS. 'category' . DS;
73
+ $uploader->save($path, str_replace(' ', '_',$_FILES['filename']['name']) );
74
+
75
+ } catch (Exception $e) {
76
+
77
+ }
78
+
79
+ //this way the name is saved in DB
80
+ $data['filename'] = 'gallery' . DS. 'category' . DS. str_replace(' ', '_',$_FILES['filename']['name']);
81
+ }else {
82
+ unset($data['filename']); // Unset filename part when image upload field is empty
83
+ }
84
+
85
+
86
+
87
+ $model = Mage::getModel('gallery/category');
88
+ $model->setData($data)
89
+ ->setId($this->getRequest()->getParam('id'));
90
+
91
+ try {
92
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
93
+ $model->setCreatedTime(now())
94
+ ->setUpdateTime(now());
95
+ } else {
96
+ $model->setUpdateTime(now());
97
+ }
98
+
99
+ $model->save();
100
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('gallery')->__('Category was successfully saved'));
101
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
102
+
103
+ if ($this->getRequest()->getParam('back')) {
104
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
105
+ return;
106
+ }
107
+ $this->_redirect('*/*/');
108
+ return;
109
+ } catch (Exception $e) {
110
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
111
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
112
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
113
+ return;
114
+ }
115
+ }
116
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('gallery')->__('Unable to find Category to save'));
117
+ $this->_redirect('*/*/');
118
+ }
119
+
120
+ public function deleteAction() {
121
+ if( $this->getRequest()->getParam('id') > 0 ) {
122
+ try {
123
+ $model = Mage::getModel('gallery/category');
124
+
125
+ $model->setId($this->getRequest()->getParam('id'))
126
+ ->delete();
127
+
128
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Category was successfully deleted'));
129
+ $this->_redirect('*/*/');
130
+ } catch (Exception $e) {
131
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
132
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
133
+ }
134
+ }
135
+ $this->_redirect('*/*/');
136
+ }
137
+
138
+ public function massDeleteAction() {
139
+ $galleryIds = $this->getRequest()->getParam('category');
140
+ if(!is_array($galleryIds)) {
141
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select Category(s)'));
142
+ } else {
143
+ try {
144
+ foreach ($galleryIds as $galleryId) {
145
+ $gallery = Mage::getModel('gallery/category')->load($galleryId);
146
+ $gallery->delete();
147
+ }
148
+ Mage::getSingleton('adminhtml/session')->addSuccess(
149
+ Mage::helper('adminhtml')->__(
150
+ 'Total of %d record(s) were successfully deleted', count($galleryIds)
151
+ )
152
+ );
153
+ } catch (Exception $e) {
154
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
155
+ }
156
+ }
157
+ $this->_redirect('*/*/index');
158
+ }
159
+
160
+ public function massStatusAction()
161
+ {
162
+ $galleryIds = $this->getRequest()->getParam('category');
163
+ if(!is_array($galleryIds)) {
164
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select Category(s)'));
165
+ } else {
166
+ try {
167
+ foreach ($galleryIds as $galleryId) {
168
+ $gallery = Mage::getSingleton('gallery/category')
169
+ ->load($galleryId)
170
+ ->setStatus($this->getRequest()->getParam('status'))
171
+ ->setIsMassupdate(true)
172
+ ->save();
173
+ }
174
+ $this->_getSession()->addSuccess(
175
+ $this->__('Total of %d record(s) were successfully updated', count($galleryIds))
176
+ );
177
+ } catch (Exception $e) {
178
+ $this->_getSession()->addError($e->getMessage());
179
+ }
180
+ }
181
+ $this->_redirect('*/*/index');
182
+ }
183
+
184
+
185
+ }
app/code/community/Sag/Gallery/controllers/Adminhtml/GalleryController.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sag_Gallery_Adminhtml_GalleryController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('gallery/items')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+ $this->_initAction()
16
+ ->renderLayout();
17
+ }
18
+
19
+ public function editAction() {
20
+ $id = $this->getRequest()->getParam('id');
21
+ $model = Mage::getModel('gallery/gallery')->load($id);
22
+
23
+ if ($model->getId() || $id == 0) {
24
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
25
+ if (!empty($data)) {
26
+ $model->setData($data);
27
+ }
28
+
29
+ Mage::register('gallery_data', $model);
30
+
31
+ $this->loadLayout();
32
+ $this->_setActiveMenu('gallery/items');
33
+
34
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
35
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
36
+
37
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
38
+
39
+ $this->_addContent($this->getLayout()->createBlock('gallery/adminhtml_gallery_edit'))
40
+ ->_addLeft($this->getLayout()->createBlock('gallery/adminhtml_gallery_edit_tabs'));
41
+
42
+ $this->renderLayout();
43
+ } else {
44
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('gallery')->__('Item does not exist'));
45
+ $this->_redirect('*/*/');
46
+ }
47
+ }
48
+
49
+ public function newAction() {
50
+ $this->_forward('edit');
51
+ }
52
+
53
+ public function saveAction() {
54
+ if ($data = $this->getRequest()->getPost()) {
55
+
56
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
57
+ try {
58
+ /* Starting upload */
59
+ $uploader = new Varien_File_Uploader('filename');
60
+
61
+ // Any extention would work
62
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
63
+ $uploader->setAllowRenameFiles(false);
64
+
65
+ // Set the file upload mode
66
+ // false -> get the file directly in the specified folder
67
+ // true -> get the file in the product like folders
68
+ // (file.jpg will go in something like /media/f/i/file.jpg)
69
+ $uploader->setFilesDispersion(false);
70
+
71
+ // We set media as the upload dir
72
+ $path = Mage::getBaseDir('media') . DS . 'gallery' . DS. 'images' . DS;
73
+ $uploader->save($path, str_replace(' ', '_',$_FILES['filename']['name']) );
74
+
75
+ } catch (Exception $e) {
76
+
77
+ }
78
+
79
+ //this way the name is saved in DB
80
+ $data['filename'] = 'gallery' . DS. 'images' . DS.str_replace(' ', '_',$_FILES['filename']['name']);
81
+ }else {
82
+ unset($data['filename']); // Unset filename part when image upload field is empty
83
+ }
84
+
85
+
86
+ $model = Mage::getModel('gallery/gallery');
87
+ $model->setData($data)
88
+ ->setId($this->getRequest()->getParam('id'));
89
+
90
+ try {
91
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
92
+ $model->setCreatedTime(now())
93
+ ->setUpdateTime(now());
94
+ } else {
95
+ $model->setUpdateTime(now());
96
+ }
97
+
98
+ $model->save();
99
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('gallery')->__('Item was successfully saved'));
100
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
101
+
102
+ if ($this->getRequest()->getParam('back')) {
103
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
104
+ return;
105
+ }
106
+ $this->_redirect('*/*/');
107
+ return;
108
+ } catch (Exception $e) {
109
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
110
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
111
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
112
+ return;
113
+ }
114
+ }
115
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('gallery')->__('Unable to find item to save'));
116
+ $this->_redirect('*/*/');
117
+ }
118
+
119
+ public function deleteAction() {
120
+ if( $this->getRequest()->getParam('id') > 0 ) {
121
+ try {
122
+ $model = Mage::getModel('gallery/gallery');
123
+
124
+ $model->setId($this->getRequest()->getParam('id'))
125
+ ->delete();
126
+
127
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
128
+ $this->_redirect('*/*/');
129
+ } catch (Exception $e) {
130
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
131
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
132
+ }
133
+ }
134
+ $this->_redirect('*/*/');
135
+ }
136
+
137
+ public function massDeleteAction() {
138
+ $galleryIds = $this->getRequest()->getParam('gallery');
139
+ if(!is_array($galleryIds)) {
140
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
141
+ } else {
142
+ try {
143
+ foreach ($galleryIds as $galleryId) {
144
+ $gallery = Mage::getModel('gallery/gallery')->load($galleryId);
145
+ $gallery->delete();
146
+ }
147
+ Mage::getSingleton('adminhtml/session')->addSuccess(
148
+ Mage::helper('adminhtml')->__(
149
+ 'Total of %d record(s) were successfully deleted', count($galleryIds)
150
+ )
151
+ );
152
+ } catch (Exception $e) {
153
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
154
+ }
155
+ }
156
+ $this->_redirect('*/*/index');
157
+ }
158
+
159
+ public function massStatusAction()
160
+ {
161
+ $galleryIds = $this->getRequest()->getParam('gallery');
162
+ if(!is_array($galleryIds)) {
163
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
164
+ } else {
165
+ try {
166
+ foreach ($galleryIds as $galleryId) {
167
+ $gallery = Mage::getSingleton('gallery/gallery')
168
+ ->load($galleryId)
169
+ ->setStatus($this->getRequest()->getParam('status'))
170
+ ->setIsMassupdate(true)
171
+ ->save();
172
+ }
173
+ $this->_getSession()->addSuccess(
174
+ $this->__('Total of %d record(s) were successfully updated', count($galleryIds))
175
+ );
176
+ } catch (Exception $e) {
177
+ $this->_getSession()->addError($e->getMessage());
178
+ }
179
+ }
180
+ $this->_redirect('*/*/index');
181
+ }
182
+ }
app/code/community/Sag/Gallery/controllers/CategoryController.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Sag_Gallery_CategoryController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+ }
app/code/community/Sag/Gallery/controllers/ImageController.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Sag_Gallery_ImageController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+ }
app/code/community/Sag/Gallery/controllers/IndexController.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Sag_Gallery_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+ }
app/code/community/Sag/Gallery/etc/config.xml ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Sag_Gallery>
5
+ <version>1.0.0</version>
6
+ </Sag_Gallery>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <gallery>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Sag_Gallery</module>
14
+ <frontName>gallery</frontName>
15
+ </args>
16
+ </gallery>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <gallery>
21
+ <file>gallery.xml</file>
22
+ </gallery>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <admin>
27
+ <routers>
28
+ <gallery>
29
+ <use>admin</use>
30
+ <args>
31
+ <module>Sag_Gallery</module>
32
+ <frontName>gallery</frontName>
33
+ </args>
34
+ </gallery>
35
+ </routers>
36
+ </admin>
37
+ <adminhtml>
38
+ <menu>
39
+ <gallery module="gallery">
40
+ <title>Gallery</title>
41
+ <sort_order>71</sort_order>
42
+ <children>
43
+ <categories module="gallery">
44
+ <title>Manage Category</title>
45
+ <sort_order>0</sort_order>
46
+ <action>gallery/adminhtml_category</action>
47
+ </categories>
48
+ <items module="gallery">
49
+ <title>Manage Items</title>
50
+ <sort_order>1</sort_order>
51
+ <action>gallery/adminhtml_gallery</action>
52
+ </items>
53
+ </children>
54
+ </gallery>
55
+ </menu>
56
+ <acl>
57
+ <resources>
58
+ <all>
59
+ <title>Allow Everything</title>
60
+ </all>
61
+ <admin>
62
+ <children>
63
+ <Sag_Gallery>
64
+ <title>Gallery Module</title>
65
+ <sort_order>10</sort_order>
66
+ </Sag_Gallery>
67
+ </children>
68
+ </admin>
69
+ </resources>
70
+ </acl>
71
+ <layout>
72
+ <updates>
73
+ <gallery>
74
+ <file>gallery.xml</file>
75
+ </gallery>
76
+ </updates>
77
+ </layout>
78
+ </adminhtml>
79
+ <global>
80
+ <models>
81
+ <gallery>
82
+ <class>Sag_Gallery_Model</class>
83
+ <resourceModel>gallery_mysql4</resourceModel>
84
+ </gallery>
85
+ <gallery_mysql4>
86
+ <class>Sag_Gallery_Model_Mysql4</class>
87
+ <entities>
88
+ <gallery>
89
+ <table>gallery</table>
90
+ </gallery>
91
+ <category>
92
+ <table>category</table>
93
+ </category>
94
+ </entities>
95
+ </gallery_mysql4>
96
+ </models>
97
+ <resources>
98
+ <gallery_setup>
99
+ <setup>
100
+ <module>Sag_Gallery</module>
101
+ </setup>
102
+ <connection>
103
+ <use>core_setup</use>
104
+ </connection>
105
+ </gallery_setup>
106
+ <gallery_write>
107
+ <connection>
108
+ <use>core_write</use>
109
+ </connection>
110
+ </gallery_write>
111
+ <gallery_read>
112
+ <connection>
113
+ <use>core_read</use>
114
+ </connection>
115
+ </gallery_read>
116
+ </resources>
117
+ <blocks>
118
+ <gallery>
119
+ <class>Sag_Gallery_Block</class>
120
+ </gallery>
121
+ </blocks>
122
+ <helpers>
123
+ <gallery>
124
+ <class>Sag_Gallery_Helper</class>
125
+ </gallery>
126
+ </helpers>
127
+ </global>
128
+ </config>
app/code/community/Sag/Gallery/sql/category_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('category')};
10
+ CREATE TABLE {$this->getTable('category')} (
11
+ `category_id` int(11) unsigned NOT NULL auto_increment,
12
+ `title` varchar(255) NOT NULL default '',
13
+ `filename` varchar(255) NOT NULL default '',
14
+ `content` text NOT NULL default '',
15
+ `status` smallint(6) NOT NULL default '0',
16
+ `created_time` datetime NULL,
17
+ `update_time` datetime NULL,
18
+ PRIMARY KEY (`category_id`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
+
21
+ ");
22
+
23
+ $installer->endSetup();
app/code/community/Sag/Gallery/sql/gallery_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('gallery')};
10
+ CREATE TABLE {$this->getTable('gallery')} (
11
+ `gallery_id` int(11) unsigned NOT NULL auto_increment,
12
+ `category` int(11) NOT NULL,
13
+ `title` varchar(255) NOT NULL default '',
14
+ `filename` varchar(255) NOT NULL default '',
15
+ `content` text NOT NULL default '',
16
+ `status` smallint(6) NOT NULL default '0',
17
+ `created_time` datetime NULL,
18
+ `update_time` datetime NULL,
19
+ PRIMARY KEY (`gallery_id`)
20
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
21
+
22
+ ");
23
+
24
+ $installer->run("
25
+
26
+ -- DROP TABLE IF EXISTS {$this->getTable('category')};
27
+ CREATE TABLE {$this->getTable('category')} (
28
+ `category_id` int(11) unsigned NOT NULL auto_increment,
29
+ `title` varchar(255) NOT NULL default '',
30
+ `filename` varchar(255) NOT NULL default '',
31
+ `content` text NOT NULL default '',
32
+ `status` smallint(6) NOT NULL default '0',
33
+ `created_time` datetime NULL,
34
+ `update_time` datetime NULL,
35
+ PRIMARY KEY (`category_id`)
36
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
37
+
38
+ ");
39
+
40
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/gallery.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <gallery_adminhtml_gallery_index>
4
+ <reference name="content">
5
+ <block type="gallery/adminhtml_gallery" name="gallery" />
6
+ </reference>
7
+ </gallery_adminhtml_gallery_index>
8
+
9
+ <gallery_adminhtml_category_index>
10
+ <reference name="content">
11
+ <block type="gallery/adminhtml_category" name="category" />
12
+ </reference>
13
+ </gallery_adminhtml_category_index>
14
+ </layout>
app/design/frontend/base/default/layout/gallery.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ </default>
5
+ <gallery_index_index>
6
+ <reference name="content">
7
+ <block type="gallery/category" name="category" template="gallery/category.phtml" />
8
+ </reference>
9
+ </gallery_index_index>
10
+ <gallery_category_index>
11
+ <reference name="content">
12
+ <block type="gallery/gallery" name="gallery" template="gallery/gallery.phtml" />
13
+ </reference>
14
+ </gallery_category_index>
15
+ <gallery_image_index>
16
+ <reference name="content">
17
+ <block type="gallery/gallery" name="gallery" template="gallery/image.phtml" />
18
+ </reference>
19
+ </gallery_image_index>
20
+ </layout>
app/design/frontend/base/default/template/gallery/category.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="page-title">
2
+ <h1><?php echo $this->__('Gallery') ?></h1>
3
+ </div>
4
+
5
+ <?php $cnt = count($this->getCategory()); ?>
6
+ <?php if($cnt > 0 ): ?>
7
+ <ul id="gallery_con">
8
+ <?php foreach ($this->getCategory() as $item): ?>
9
+ <li>
10
+ <a class="image_gal" href="gallery/category/?cat=<?php echo $item->getCategoryId(); ?>">
11
+ <img src="<?php echo $this->resizeImage($item->getFilename(), 208, 230, ''); ?>" alt="<?php echo $item->getTitle(); ?>" />
12
+ </a>
13
+ <a class="link_gal" href="gallery/category/?cat=<?php echo $item->getCategoryId(); ?>"><?php echo $item->getTitle(); ?></a>
14
+ <!--<p><?php echo $item->getContent(); ?></p>-->
15
+ </li>
16
+ <?php endforeach; ?>
17
+ </ul>
18
+ <?php else: ?>
19
+ <div>There is no Category here</div>
20
+ <?php endif; ?>
app/design/frontend/base/default/template/gallery/gallery.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="page-title">
2
+ <h1><?php $this->getCategoryById(); ?></h1>
3
+ </div>
4
+
5
+ <?php $cnt = count($this->getGallery()); ?>
6
+ <?php if($cnt > 0 ): ?>
7
+ <ul id="gallery_con">
8
+ <?php foreach ($this->getGallery() as $item): ?>
9
+ <li>
10
+ <a class="image_gal" href="../image/?img=<?php echo $item->getGalleryId(); ?>">
11
+ <img src="<?php echo $this->resizeImage($item->getFilename(), 208, 230, ''); ?>" alt="<?php echo $item->getTitle(); ?>" />
12
+ </a>
13
+ <a class="link_gal" href="../image/?img=<?php echo $item->getGalleryId(); ?>"><?php echo $item->getTitle(); ?></a>
14
+ </li>
15
+ <?php endforeach; ?>
16
+ </ul>
17
+ <?php else: ?>
18
+ <div>There is no Images here</div>
19
+ <?php endif; ?>
app/design/frontend/base/default/template/gallery/image.phtml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $cnt = count($this->getImage()); ?>
2
+ <?php if($cnt > 0 ): ?>
3
+ <?php foreach ($this->getImage() as $item): ?>
4
+ <div class="page-title">
5
+ <h1><?php echo $item->getTitle(); ?></h1>
6
+ </div>
7
+ <div class="imageDetail" >
8
+ <img style="float:left; margin:0 10px 10px 0; border-radius: 5px; border:5px solid #a89ca1;" src="<?php echo $this->resizeImage($item->getFilename(), 267, 400, ''); ?>" alt="<?php echo $item->getTitle(); ?>" />
9
+ <?php echo $item->getContent(); ?>
10
+ </div>
11
+ <?php endforeach; ?>
12
+ <?php else: ?>
13
+ <div>There is no Images here</div>
14
+ <?php endif; ?>
app/etc/modules/Sag_Gallery.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Sag_Gallery>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Sag_Gallery>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>SAG_Gallery</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This module is use for image gallery with category.</summary>
10
+ <description>&lt;h3&gt;Features:&lt;/h3&gt;&#xD;
11
+ &lt;ul&gt;&#xD;
12
+ &lt;li&gt;Upload images with category, add title and their description. &lt;/li&gt;&#xD;
13
+ &lt;li&gt;gallery itself is very flexible and easily customizable&lt;/li&gt;&#xD;
14
+ &lt;li&gt; Easy to install&lt;/li&gt;&#xD;
15
+ &lt;/ul&gt;&#xD;
16
+ &#xD;
17
+ &lt;h3&gt;Steps:&lt;/h3&gt;&#xD;
18
+ &lt;ul&gt;&#xD;
19
+ &lt;li&gt; Install module , Clear cache, check admin menu bar , Go to &#x201C;&lt;b&gt;Gallery&lt;/b&gt; &#x201C; ,here manage category and add images with desciription .&lt;/li&gt;&#xD;
20
+ &lt;li&gt;Front end: View Gallery by add &#x201D;&lt;b&gt;/gallery&lt;/b&gt;&#x201D; in url example: www.test.com/gallery&lt;/li&gt;&#xD;
21
+ &lt;/ul&gt;</description>
22
+ <notes>This module is use for image gallery with category.</notes>
23
+ <authors><author><name>Navneet</name><user>navneetkoshik</user><email>navneet.kshk@gmail.com</email></author></authors>
24
+ <date>2013-10-07</date>
25
+ <time>05:47:22</time>
26
+ <contents><target name="magecommunity"><dir name="Sag"><dir name="Gallery"><dir name="Block"><dir name="Adminhtml"><dir name="Category"><dir name="Edit"><file name="Form.php" hash="ae4e1e865699507d59185198fa5373e2"/><dir name="Tab"><file name="Form.php" hash="786daed4f46c2479742806b2e6a3e70a"/></dir><file name="Tabs.php" hash="b466df74e5dbefe29b8e5054181adbe1"/></dir><file name="Edit.php" hash="38b819172609e8b8fa6944f6a5f31685"/><file name="Grid.php" hash="0454abf5427de1653c8ad402758f2e73"/></dir><file name="Category.php" hash="56f5839405fd45d80e32641ed44eb907"/><dir name="Gallery"><dir name="Edit"><file name="Form.php" hash="8f5337803feefaa888fb18f8aed78347"/><dir name="Tab"><file name="Form.php" hash="aefc9d5107485a44de42538a3b9bf49d"/></dir><file name="Tabs.php" hash="b1939f938e840f2cd94164b25f3a0a77"/></dir><file name="Edit.php" hash="6131ec293f6e993c55d76f8a8c3fbcff"/><file name="Grid.php" hash="ee5f87edb9e31b4037f5b17005d9c655"/></dir><file name="Gallery.php" hash="b6c543541caceefb78eeb992f4eedbc0"/></dir><file name="Category.php" hash="d1964d45c6a45bf8a61ba7548a420b92"/><file name="Gallery.php" hash="4de81a538775a60701999573c5b0e394"/></dir><dir name="Helper"><file name="Data.php" hash="68299461670829942df1fbfed2996ebb"/></dir><dir name="Model"><file name="Category.php" hash="ad94aa40e2853e5d69417a8b53893077"/><file name="Gallery.php" hash="f52818d2009ca792b6ff27fc3905d45f"/><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="a3ced1fcab208e1d0f066967a6a79c9e"/></dir><file name="Category.php" hash="8f00a7d50e13a297c8ab4c324130126d"/><dir name="Gallery"><file name="Collection.php" hash="6a8f5d7b709bcc764d3ccdba3e366898"/></dir><file name="Gallery.php" hash="9bcec1d41f31b0bd138fb9b1154670c7"/></dir><file name="Status.php" hash="43d29bc98b39eb41fd8a03c7dcc33a5a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CategoryController.php" hash="6b61402a8d50013b8254e37af6f54908"/><file name="GalleryController.php" hash="b129e34f62b6f5ee31afe639222d7101"/></dir><file name="CategoryController.php" hash="c5ede1a96f75cee4eaf5d6e9453f01e6"/><file name="ImageController.php" hash="a040af8bd1fc3acc63ed260ed82a3485"/><file name="IndexController.php" hash="fb869990aab09f9035b4ba282e88e627"/></dir><dir name="etc"><file name="config.xml" hash="bfe12b0887b89068bf020c19fbf6cfc5"/></dir><dir name="sql"><dir name="category_setup"><file name="mysql4-install-0.1.0.php" hash="da8f1299b688a7565059e82c576287ab"/></dir><dir name="gallery_setup"><file name="mysql4-install-0.1.0.php" hash="6ab5c2a698a2031534e60ea880352ed2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="gallery.xml" hash="3e5a43a322b36052bccea22a5607fb89"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="gallery.xml" hash="4d285f1a33d366c87a0e03a49a8359ab"/></dir><dir name="template"><dir name="gallery"><file name="category.phtml" hash="d3b5f35f68f939aa856110130aeaed92"/><file name="gallery.phtml" hash="f78f8497b968deef00dbcee4404980e2"/><file name="image.phtml" hash="0667cc4e29442da3fe6b9ea497164022"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sag_Gallery.xml" hash="2dab763598742d9237fafbe568dfcc38"/></dir></target></contents>
27
+ <compatible/>
28
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
29
+ </package>