Version Notes
With categories and images paging and system configuration setting.
Download this release
Release Info
Developer | Navneet |
Extension | SAG_Gallery |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- app/code/community/Sag/Gallery/Block/Adminhtml/Category.php +24 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit.php +23 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Form.php +23 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tab/Form.php +23 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tabs.php +23 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Category/Grid.php +23 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Gallery.php +24 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit.php +23 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Form.php +23 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Tab/Form.php +23 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Tabs.php +23 -0
- app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Grid.php +23 -0
- app/code/community/Sag/Gallery/Block/Category.php +25 -9
- app/code/community/Sag/Gallery/Block/Gallery.php +24 -12
- app/code/community/Sag/Gallery/Helper/Data.php +23 -0
- app/code/community/Sag/Gallery/Model/Category.php +23 -0
- app/code/community/Sag/Gallery/Model/Gallery.php +23 -0
- app/code/community/Sag/Gallery/Model/Mysql4/Category.php +24 -1
- app/code/community/Sag/Gallery/Model/Mysql4/Category/Collection.php +23 -0
- app/code/community/Sag/Gallery/Model/Mysql4/Gallery.php +23 -0
- app/code/community/Sag/Gallery/Model/Mysql4/Gallery/Collection.php +23 -0
- app/code/community/Sag/Gallery/Model/Status.php +23 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Category.php +14 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Category/Edit.php +45 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Category/Edit/Form.php +19 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Category/Edit/Tab/Form.php +59 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Category/Edit/Tabs.php +24 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Category/Grid.php +116 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Gallery.php +12 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Gallery/Edit.php +45 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Gallery/Edit/Form.php +19 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Gallery/Edit/Tab/Form.php +88 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Gallery/Edit/Tabs.php +24 -0
- app/code/community/Sag/Gallery/New folder/Block/Adminhtml/Gallery/Grid.php +141 -0
- app/code/community/Sag/Gallery/New folder/Block/Category.php +85 -0
- app/code/community/Sag/Gallery/New folder/Block/Gallery.php +114 -0
- app/code/community/Sag/Gallery/New folder/Helper/Data.php +7 -0
- app/code/community/Sag/Gallery/New folder/Model/Category.php +14 -0
- app/code/community/Sag/Gallery/New folder/Model/Gallery.php +14 -0
- app/code/community/Sag/Gallery/New folder/Model/Mysql4/Category.php +10 -0
- app/code/community/Sag/Gallery/New folder/Model/Mysql4/Category/Collection.php +10 -0
- app/code/community/Sag/Gallery/New folder/Model/Mysql4/Gallery.php +10 -0
- app/code/community/Sag/Gallery/New folder/Model/Mysql4/Gallery/Collection.php +10 -0
- app/code/community/Sag/Gallery/New folder/Model/Status.php +17 -0
- app/code/community/Sag/Gallery/New folder/controllers/Adminhtml/CategoryController.php +185 -0
- app/code/community/Sag/Gallery/New folder/controllers/Adminhtml/GalleryController.php +182 -0
- app/code/community/Sag/Gallery/New folder/controllers/CategoryController.php +17 -0
- app/code/community/Sag/Gallery/New folder/controllers/ImageController.php +18 -0
- app/code/community/Sag/Gallery/New folder/controllers/IndexController.php +19 -0
- app/code/community/Sag/Gallery/New folder/etc/config.xml +136 -0
- app/code/community/Sag/Gallery/New folder/etc/system.xml +84 -0
- app/code/community/Sag/Gallery/New folder/sql/category_setup/mysql4-install-0.1.0.php +23 -0
- app/code/community/Sag/Gallery/New folder/sql/gallery_setup/mysql4-install-0.1.0.php +40 -0
- app/code/community/Sag/Gallery/controllers/Adminhtml/CategoryController.php +23 -0
- app/code/community/Sag/Gallery/controllers/Adminhtml/GalleryController.php +23 -0
- app/code/community/Sag/Gallery/controllers/CategoryController.php +24 -0
- app/code/community/Sag/Gallery/controllers/ImageController.php +24 -0
- app/code/community/Sag/Gallery/controllers/IndexController.php +24 -2
- app/code/community/Sag/Gallery/etc/config.xml +25 -0
- app/code/community/Sag/Gallery/etc/system.xml +25 -0
- app/code/community/Sag/Gallery/sql/category_setup/mysql4-install-0.1.0.php +23 -0
- app/code/community/Sag/Gallery/sql/gallery_setup/mysql4-install-0.1.0.php +24 -1
- app/design/adminhtml/default/default/layout/gallery.xml +25 -0
- app/design/frontend/base/default/layout/gallery.xml +25 -0
- app/design/frontend/base/default/template/gallery/category.phtml +26 -0
- app/design/frontend/base/default/template/gallery/gallery.phtml +25 -0
- app/design/frontend/base/default/template/gallery/image.phtml +26 -0
- app/etc/modules/Sag_Gallery.xml +25 -0
- package.xml +6 -6
app/code/community/Sag/Gallery/Block/Adminhtml/Category.php
CHANGED
@@ -1,4 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sag_Gallery_Block_Adminhtml_Category extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
{
|
4 |
public function __construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Category extends Mage_Adminhtml_Block_Widget_Grid_Container
|
27 |
{
|
28 |
public function __construct()
|
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Block_Adminhtml_Category_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
{
|
5 |
public function __construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Category_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
27 |
{
|
28 |
public function __construct()
|
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Form.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Block_Adminhtml_Category_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
{
|
5 |
protected function _prepareForm()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Category_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
27 |
{
|
28 |
protected function _prepareForm()
|
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tab/Form.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Block_Adminhtml_Category_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
{
|
5 |
protected function _prepareForm()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Category_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
27 |
{
|
28 |
protected function _prepareForm()
|
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Edit/Tabs.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Block_Adminhtml_Category_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
{
|
5 |
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Category_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
27 |
{
|
28 |
|
app/code/community/Sag/Gallery/Block/Adminhtml/Category/Grid.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
{
|
5 |
public function __construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Category_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
27 |
{
|
28 |
public function __construct()
|
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery.php
CHANGED
@@ -1,4 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sag_Gallery_Block_Adminhtml_Gallery extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
{
|
4 |
public function __construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Gallery extends Mage_Adminhtml_Block_Widget_Grid_Container
|
27 |
{
|
28 |
public function __construct()
|
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Block_Adminhtml_Gallery_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
{
|
5 |
public function __construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Gallery_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
27 |
{
|
28 |
public function __construct()
|
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Form.php
CHANGED
@@ -1,4 +1,27 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
class Sag_Gallery_Block_Adminhtml_Gallery_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
{
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
|
26 |
class Sag_Gallery_Block_Adminhtml_Gallery_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
27 |
{
|
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Tab/Form.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Block_Adminhtml_Gallery_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
{
|
5 |
protected function _prepareForm()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Gallery_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
27 |
{
|
28 |
protected function _prepareForm()
|
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Edit/Tabs.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Block_Adminhtml_Gallery_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
{
|
5 |
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Gallery_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
27 |
{
|
28 |
|
app/code/community/Sag/Gallery/Block/Adminhtml/Gallery/Grid.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Block_Adminhtml_Gallery_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
{
|
5 |
public function __construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Adminhtml_Gallery_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
27 |
{
|
28 |
public function __construct()
|
app/code/community/Sag/Gallery/Block/Category.php
CHANGED
@@ -1,4 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sag_Gallery_Block_Category extends Mage_Core_Block_Template
|
3 |
{
|
4 |
public function _prepareLayout()
|
@@ -32,15 +56,7 @@ class Sag_Gallery_Block_Category extends Mage_Core_Block_Template
|
|
32 |
}
|
33 |
}
|
34 |
|
35 |
-
|
36 |
-
//{
|
37 |
-
// if (!$this->hasData('category')) {
|
38 |
-
// $this->setData('category', Mage::getModel('gallery/category')->getCollection());
|
39 |
-
// }
|
40 |
-
// return $this->getData('category');
|
41 |
-
//}
|
42 |
-
|
43 |
-
|
44 |
public function getPagerHtml()
|
45 |
{
|
46 |
return $this->getChildHtml('pager');
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Category extends Mage_Core_Block_Template
|
27 |
{
|
28 |
public function _prepareLayout()
|
56 |
}
|
57 |
}
|
58 |
|
59 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
public function getPagerHtml()
|
61 |
{
|
62 |
return $this->getChildHtml('pager');
|
app/code/community/Sag/Gallery/Block/Gallery.php
CHANGED
@@ -1,4 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sag_Gallery_Block_Gallery extends Mage_Core_Block_Template
|
3 |
{
|
4 |
public function _prepareLayout()
|
@@ -34,15 +58,6 @@ class Sag_Gallery_Block_Gallery extends Mage_Core_Block_Template
|
|
34 |
}
|
35 |
}
|
36 |
|
37 |
-
/*public function getGallery()
|
38 |
-
{
|
39 |
-
if (!$this->hasData('gallery')) {
|
40 |
-
$current_cat =$this->getRequest()->getParam('cat');
|
41 |
-
|
42 |
-
$this->setData('gallery', Mage::getModel('gallery/gallery')->getCollection()->addFieldToFilter("category", $current_cat));
|
43 |
-
}
|
44 |
-
return $this->getData('gallery');
|
45 |
-
}*/
|
46 |
|
47 |
public function getPagerHtml()
|
48 |
{
|
@@ -50,8 +65,6 @@ class Sag_Gallery_Block_Gallery extends Mage_Core_Block_Template
|
|
50 |
}
|
51 |
|
52 |
|
53 |
-
|
54 |
-
|
55 |
public function getImage()
|
56 |
{
|
57 |
if (!$this->hasData('gallery')) {
|
@@ -73,7 +86,6 @@ class Sag_Gallery_Block_Gallery extends Mage_Core_Block_Template
|
|
73 |
endforeach;
|
74 |
endif;
|
75 |
|
76 |
-
//return $this->getData('cat');
|
77 |
}
|
78 |
|
79 |
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Block_Gallery extends Mage_Core_Block_Template
|
27 |
{
|
28 |
public function _prepareLayout()
|
58 |
}
|
59 |
}
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
public function getPagerHtml()
|
63 |
{
|
65 |
}
|
66 |
|
67 |
|
|
|
|
|
68 |
public function getImage()
|
69 |
{
|
70 |
if (!$this->hasData('gallery')) {
|
86 |
endforeach;
|
87 |
endif;
|
88 |
|
|
|
89 |
}
|
90 |
|
91 |
|
app/code/community/Sag/Gallery/Helper/Data.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
{
|
5 |
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Helper_Data extends Mage_Core_Helper_Abstract
|
27 |
{
|
28 |
|
app/code/community/Sag/Gallery/Model/Category.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Model_Category extends Mage_Core_Model_Abstract
|
4 |
{
|
5 |
public function _construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Model_Category extends Mage_Core_Model_Abstract
|
27 |
{
|
28 |
public function _construct()
|
app/code/community/Sag/Gallery/Model/Gallery.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Model_Gallery extends Mage_Core_Model_Abstract
|
4 |
{
|
5 |
public function _construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Model_Gallery extends Mage_Core_Model_Abstract
|
27 |
{
|
28 |
public function _construct()
|
app/code/community/Sag/Gallery/Model/Mysql4/Category.php
CHANGED
@@ -1,10 +1,33 @@
|
|
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
|
8 |
$this->_init('gallery/category', 'category_id');
|
9 |
}
|
10 |
}
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Model_Mysql4_Category extends Mage_Core_Model_Mysql4_Abstract
|
27 |
{
|
28 |
public function _construct()
|
29 |
{
|
30 |
+
// Note that the category_id refers to the key field in your database table.
|
31 |
$this->_init('gallery/category', 'category_id');
|
32 |
}
|
33 |
}
|
app/code/community/Sag/Gallery/Model/Mysql4/Category/Collection.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
{
|
5 |
public function _construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Model_Mysql4_Category_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
27 |
{
|
28 |
public function _construct()
|
app/code/community/Sag/Gallery/Model/Mysql4/Gallery.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Model_Mysql4_Gallery extends Mage_Core_Model_Mysql4_Abstract
|
4 |
{
|
5 |
public function _construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Model_Mysql4_Gallery extends Mage_Core_Model_Mysql4_Abstract
|
27 |
{
|
28 |
public function _construct()
|
app/code/community/Sag/Gallery/Model/Mysql4/Gallery/Collection.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Model_Mysql4_Gallery_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
{
|
5 |
public function _construct()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Model_Mysql4_Gallery_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
27 |
{
|
28 |
public function _construct()
|
app/code/community/Sag/Gallery/Model/Status.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Model_Status extends Varien_Object
|
4 |
{
|
5 |
const STATUS_ENABLED = 1;
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Model_Status extends Varien_Object
|
27 |
{
|
28 |
const STATUS_ENABLED = 1;
|
app/code/community/Sag/Gallery/New folder/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/New folder/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/New folder/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/New folder/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' => true,
|
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/New folder/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/New folder/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/New folder/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/New folder/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/New folder/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/New folder/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' => true,
|
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/New folder/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/New folder/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/New folder/Block/Category.php
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sag_Gallery_Block_Category extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
parent::_prepareLayout();
|
7 |
+
|
8 |
+
if (!$this->hasData('category')) {
|
9 |
+
$collection = Mage::getModel('gallery/category')->getCollection();
|
10 |
+
$this->setCollection($collection);
|
11 |
+
|
12 |
+
//////////////////////// per page setting get value from configuration setting //////////////////////////////
|
13 |
+
$_module_cat_per_page = Mage::getStoreConfig('saggallery/general/gallery_cat_per_page',Mage::app()->getStore());
|
14 |
+
if($_module_cat_per_page==''){
|
15 |
+
$per_page = array(10=>10,20=>20,30=>30,'all'=>'all');
|
16 |
+
}else{
|
17 |
+
$ar = explode(',',$_module_cat_per_page);
|
18 |
+
for($i=0; $i<count($ar); $i++){
|
19 |
+
$val = $ar[$i];
|
20 |
+
$per_page[$val] = $val;
|
21 |
+
}
|
22 |
+
$per_page['all'] = 'all';
|
23 |
+
}
|
24 |
+
//////////////////////// per page setting get value from configuration setting //////////////////////////////
|
25 |
+
|
26 |
+
$pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
|
27 |
+
$pager->setAvailableLimit($per_page);
|
28 |
+
$pager->setCollection($this->getCollection());
|
29 |
+
$this->setChild('pager', $pager);
|
30 |
+
$this->getCollection()->load();
|
31 |
+
return $this;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
//public function getCategory()
|
36 |
+
//{
|
37 |
+
// if (!$this->hasData('category')) {
|
38 |
+
// $this->setData('category', Mage::getModel('gallery/category')->getCollection());
|
39 |
+
// }
|
40 |
+
// return $this->getData('category');
|
41 |
+
//}
|
42 |
+
|
43 |
+
|
44 |
+
public function getPagerHtml()
|
45 |
+
{
|
46 |
+
return $this->getChildHtml('pager');
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Resize Image proportionally and return the resized image url
|
53 |
+
*
|
54 |
+
* @param string $imageName name of the image file
|
55 |
+
* @param integer|null $width resize width
|
56 |
+
* @param integer|null $height resize height
|
57 |
+
* @param string|null $imagePath directory path of the image present inside media directory
|
58 |
+
* @return string full url path of the image
|
59 |
+
*/
|
60 |
+
public function resizeImage($imageName, $width=NULL, $height=NULL, $imagePath=NULL)
|
61 |
+
{
|
62 |
+
$imagePath = str_replace("/", DS, $imagePath);
|
63 |
+
$imagePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $imageName;
|
64 |
+
|
65 |
+
if($width == NULL && $height == NULL) {
|
66 |
+
$width = 100;
|
67 |
+
$height = 100;
|
68 |
+
}
|
69 |
+
$resizePath = $width . 'x' . $height;
|
70 |
+
$resizePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $resizePath . DS . $imageName;
|
71 |
+
|
72 |
+
if (file_exists($imagePathFull) && !file_exists($resizePathFull)) {
|
73 |
+
$imageObj = new Varien_Image($imagePathFull);
|
74 |
+
$imageObj->constrainOnly(TRUE);
|
75 |
+
$imageObj->keepAspectRatio(TRUE);
|
76 |
+
$imageObj->resize($width,$height);
|
77 |
+
$imageObj->save($resizePathFull);
|
78 |
+
}
|
79 |
+
|
80 |
+
$imagePath=str_replace(DS, "/", $imagePath);
|
81 |
+
$img = Mage::getBaseUrl("media") . $imagePath . "/" . $resizePath . "/" . $imageName;
|
82 |
+
return str_replace(DS, "/", $img);
|
83 |
+
}
|
84 |
+
|
85 |
+
}
|
app/code/community/Sag/Gallery/New folder/Block/Gallery.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sag_Gallery_Block_Gallery extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
parent::_prepareLayout();
|
7 |
+
|
8 |
+
if (!$this->hasData('gallery')) {
|
9 |
+
$current_cat =$this->getRequest()->getParam('cat');
|
10 |
+
|
11 |
+
$collection = Mage::getModel('gallery/gallery')->getCollection()->addFieldToFilter("category", $current_cat);
|
12 |
+
$this->setCollection($collection);
|
13 |
+
|
14 |
+
//////////////////////// per page setting get value from configuration setting //////////////////////////////
|
15 |
+
$_module_img_item_per_page = Mage::getStoreConfig('saggallery/general/gallery_img_item_per_page',Mage::app()->getStore());
|
16 |
+
if($_module_img_item_per_page==''){
|
17 |
+
$per_page = array(10=>10,20=>20,30=>30,'all'=>'all');
|
18 |
+
}else{
|
19 |
+
$ar = explode(',',$_module_img_item_per_page);
|
20 |
+
for($i=0; $i<count($ar); $i++){
|
21 |
+
$val = $ar[$i];
|
22 |
+
$per_page[$val] = $val;
|
23 |
+
}
|
24 |
+
$per_page['all'] = 'all';
|
25 |
+
}
|
26 |
+
//////////////////////// per page setting get value from configuration setting //////////////////////////////
|
27 |
+
|
28 |
+
$pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
|
29 |
+
$pager->setAvailableLimit($per_page);
|
30 |
+
$pager->setCollection($this->getCollection());
|
31 |
+
$this->setChild('pager', $pager);
|
32 |
+
$this->getCollection()->load();
|
33 |
+
return $this;
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/*public function getGallery()
|
38 |
+
{
|
39 |
+
if (!$this->hasData('gallery')) {
|
40 |
+
$current_cat =$this->getRequest()->getParam('cat');
|
41 |
+
|
42 |
+
$this->setData('gallery', Mage::getModel('gallery/gallery')->getCollection()->addFieldToFilter("category", $current_cat));
|
43 |
+
}
|
44 |
+
return $this->getData('gallery');
|
45 |
+
}*/
|
46 |
+
|
47 |
+
public function getPagerHtml()
|
48 |
+
{
|
49 |
+
return $this->getChildHtml('pager');
|
50 |
+
}
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
public function getImage()
|
56 |
+
{
|
57 |
+
if (!$this->hasData('gallery')) {
|
58 |
+
$current_img =$this->getRequest()->getParam('img');
|
59 |
+
$this->setData('gallery', Mage::getModel('gallery/gallery')->getCollection()->addFieldToFilter("gallery_id", $current_img));
|
60 |
+
}
|
61 |
+
return $this->getData('gallery');
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getCategoryById()
|
66 |
+
{ $current_cat =$this->getRequest()->getParam('cat');
|
67 |
+
$this->setData('cat',Mage::getModel('gallery/category')->getCollection()->addFieldToFilter("category_id", $current_cat));
|
68 |
+
|
69 |
+
$catcount = count($this->getData('cat'));
|
70 |
+
if($catcount > 0 ):
|
71 |
+
foreach ($this->getData('cat') as $catTitle):
|
72 |
+
echo $catTitle->getTitle();
|
73 |
+
endforeach;
|
74 |
+
endif;
|
75 |
+
|
76 |
+
//return $this->getData('cat');
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Resize Image proportionally and return the resized image url
|
82 |
+
*
|
83 |
+
* @param string $imageName name of the image file
|
84 |
+
* @param integer|null $width resize width
|
85 |
+
* @param integer|null $height resize height
|
86 |
+
* @param string|null $imagePath directory path of the image present inside media directory
|
87 |
+
* @return string full url path of the image
|
88 |
+
*/
|
89 |
+
public function resizeImage($imageName, $width=NULL, $height=NULL, $imagePath=NULL)
|
90 |
+
{
|
91 |
+
$imagePath = str_replace("/", DS, $imagePath);
|
92 |
+
$imagePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $imageName;
|
93 |
+
|
94 |
+
if($width == NULL && $height == NULL) {
|
95 |
+
$width = 100;
|
96 |
+
$height = 100;
|
97 |
+
}
|
98 |
+
$resizePath = $width . 'x' . $height;
|
99 |
+
$resizePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $resizePath . DS . $imageName;
|
100 |
+
|
101 |
+
if (file_exists($imagePathFull) && !file_exists($resizePathFull)) {
|
102 |
+
$imageObj = new Varien_Image($imagePathFull);
|
103 |
+
$imageObj->constrainOnly(TRUE);
|
104 |
+
$imageObj->keepAspectRatio(TRUE);
|
105 |
+
$imageObj->resize($width,$height);
|
106 |
+
$imageObj->save($resizePathFull);
|
107 |
+
}
|
108 |
+
|
109 |
+
$imagePath=str_replace(DS, "/", $imagePath);
|
110 |
+
$img = Mage::getBaseUrl("media") . $imagePath . "/" . $resizePath . "/" . $imageName;
|
111 |
+
return str_replace(DS, "/", $img);
|
112 |
+
}
|
113 |
+
|
114 |
+
}
|
app/code/community/Sag/Gallery/New folder/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/New folder/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/New folder/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/New folder/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/New folder/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/New folder/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/New folder/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/New folder/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/New folder/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/New folder/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/New folder/controllers/CategoryController.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sag_Gallery_CategoryController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$_module_enabaled = Mage::getStoreConfig('saggallery/general/gallery_enabled_select_box',Mage::app()->getStore());
|
7 |
+
|
8 |
+
if($_module_enabaled==1){
|
9 |
+
$this->loadLayout();
|
10 |
+
$this->renderLayout();
|
11 |
+
}else{
|
12 |
+
$this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
|
13 |
+
$this->getResponse()->setHeader('Status','404 File not found');
|
14 |
+
$this->_forward('defaultNoRoute');
|
15 |
+
}
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Sag/Gallery/New folder/controllers/ImageController.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sag_Gallery_ImageController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
|
7 |
+
$_module_enabaled = Mage::getStoreConfig('saggallery/general/gallery_enabled_select_box',Mage::app()->getStore());
|
8 |
+
|
9 |
+
if($_module_enabaled==1){
|
10 |
+
$this->loadLayout();
|
11 |
+
$this->renderLayout();
|
12 |
+
}else{
|
13 |
+
$this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
|
14 |
+
$this->getResponse()->setHeader('Status','404 File not found');
|
15 |
+
$this->_forward('defaultNoRoute');
|
16 |
+
}
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Sag/Gallery/New folder/controllers/IndexController.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sag_Gallery_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
//$_module_enabaled = Mage::getStoreConfig('saggallery/general/gallery_enabled_select_box');
|
7 |
+
// we can use above comment line to get store config value
|
8 |
+
$_module_enabaled = Mage::getStoreConfig('saggallery/general/gallery_enabled_select_box',Mage::app()->getStore());
|
9 |
+
|
10 |
+
if($_module_enabaled==1){
|
11 |
+
$this->loadLayout();
|
12 |
+
$this->renderLayout();
|
13 |
+
}else{
|
14 |
+
$this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
|
15 |
+
$this->getResponse()->setHeader('Status','404 File not found');
|
16 |
+
$this->_forward('defaultNoRoute');
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Sag/Gallery/New folder/etc/config.xml
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
<system>
|
64 |
+
<children>
|
65 |
+
<config>
|
66 |
+
<children>
|
67 |
+
<saggallery translate="title">
|
68 |
+
<title>Sag Gallery</title>
|
69 |
+
<sort_order>1</sort_order>
|
70 |
+
</saggallery>
|
71 |
+
</children>
|
72 |
+
</config>
|
73 |
+
</children>
|
74 |
+
</system>
|
75 |
+
</children>
|
76 |
+
</admin>
|
77 |
+
</resources>
|
78 |
+
</acl>
|
79 |
+
<layout>
|
80 |
+
<updates>
|
81 |
+
<gallery>
|
82 |
+
<file>gallery.xml</file>
|
83 |
+
</gallery>
|
84 |
+
</updates>
|
85 |
+
</layout>
|
86 |
+
</adminhtml>
|
87 |
+
<global>
|
88 |
+
<models>
|
89 |
+
<gallery>
|
90 |
+
<class>Sag_Gallery_Model</class>
|
91 |
+
<resourceModel>gallery_mysql4</resourceModel>
|
92 |
+
</gallery>
|
93 |
+
<gallery_mysql4>
|
94 |
+
<class>Sag_Gallery_Model_Mysql4</class>
|
95 |
+
<entities>
|
96 |
+
<gallery>
|
97 |
+
<table>gallery</table>
|
98 |
+
</gallery>
|
99 |
+
<category>
|
100 |
+
<table>category</table>
|
101 |
+
</category>
|
102 |
+
</entities>
|
103 |
+
</gallery_mysql4>
|
104 |
+
</models>
|
105 |
+
<resources>
|
106 |
+
<gallery_setup>
|
107 |
+
<setup>
|
108 |
+
<module>Sag_Gallery</module>
|
109 |
+
</setup>
|
110 |
+
<connection>
|
111 |
+
<use>core_setup</use>
|
112 |
+
</connection>
|
113 |
+
</gallery_setup>
|
114 |
+
<gallery_write>
|
115 |
+
<connection>
|
116 |
+
<use>core_write</use>
|
117 |
+
</connection>
|
118 |
+
</gallery_write>
|
119 |
+
<gallery_read>
|
120 |
+
<connection>
|
121 |
+
<use>core_read</use>
|
122 |
+
</connection>
|
123 |
+
</gallery_read>
|
124 |
+
</resources>
|
125 |
+
<blocks>
|
126 |
+
<gallery>
|
127 |
+
<class>Sag_Gallery_Block</class>
|
128 |
+
</gallery>
|
129 |
+
</blocks>
|
130 |
+
<helpers>
|
131 |
+
<gallery>
|
132 |
+
<class>Sag_Gallery_Helper</class>
|
133 |
+
</gallery>
|
134 |
+
</helpers>
|
135 |
+
</global>
|
136 |
+
</config>
|
app/code/community/Sag/Gallery/New folder/etc/system.xml
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<gallery translate="label" module="gallery">
|
5 |
+
<label>SAG Gallery</label>
|
6 |
+
<sort_order>100</sort_order>
|
7 |
+
</gallery>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<saggallery translate="label" module="gallery">
|
11 |
+
<label>Extension Options</label>
|
12 |
+
<tab>gallery</tab>
|
13 |
+
<sort_order>1000</sort_order>
|
14 |
+
<show_in_default>1</show_in_default>
|
15 |
+
<show_in_website>1</show_in_website>
|
16 |
+
<show_in_store>1</show_in_store>
|
17 |
+
<groups>
|
18 |
+
<readme translate="label">
|
19 |
+
<label>Information about SAG infotech</label>
|
20 |
+
<frontend_type>text</frontend_type>
|
21 |
+
<sort_order>-1</sort_order>
|
22 |
+
<show_in_default>1</show_in_default>
|
23 |
+
<show_in_website>1</show_in_website>
|
24 |
+
<show_in_store>1</show_in_store>
|
25 |
+
<fields>
|
26 |
+
<information>
|
27 |
+
<label>About Company</label>
|
28 |
+
<comment>
|
29 |
+
<![CDATA[The Best Website Design, Web Application Development , web solutions Company backed by a team of creative and experienced web designers, web developers. Website: <a href="http://www.sagipl.com" target="_blank">sagipl.com</a> ]]>
|
30 |
+
</comment>
|
31 |
+
<frontend_type>label</frontend_type>
|
32 |
+
<sort_order>1</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
</information>
|
37 |
+
</fields>
|
38 |
+
</readme>
|
39 |
+
<general translate="label" module="gallery">
|
40 |
+
<label>General Extension Options</label>
|
41 |
+
<frontend_type>text</frontend_type>
|
42 |
+
<sort_order>1000</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
<fields>
|
47 |
+
<gallery_enabled_select_box translate="label">
|
48 |
+
<label>Enabled: </label>
|
49 |
+
<comment>Make extension enabled Yes/No</comment>
|
50 |
+
<frontend_type>select</frontend_type>
|
51 |
+
<sort_order>1</sort_order>
|
52 |
+
<show_in_default>1</show_in_default>
|
53 |
+
<show_in_website>1</show_in_website>
|
54 |
+
<show_in_store>1</show_in_store>
|
55 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
56 |
+
</gallery_enabled_select_box>
|
57 |
+
<gallery_cat_per_page translate="label">
|
58 |
+
<label>Categories per Page Allowed Values: </label>
|
59 |
+
<comment>Comma-separated. And default value is 10,20,30</comment>
|
60 |
+
<frontend_type>text</frontend_type>
|
61 |
+
<validate>validate-per-page-value-list</validate>
|
62 |
+
<sort_order>2</sort_order>
|
63 |
+
<show_in_default>1</show_in_default>
|
64 |
+
<show_in_website>1</show_in_website>
|
65 |
+
<show_in_store>1</show_in_store>
|
66 |
+
</gallery_cat_per_page>
|
67 |
+
<gallery_img_item_per_page translate="label">
|
68 |
+
<label>Image Items per Page Allowed Values: </label>
|
69 |
+
<comment>Comma-separated. And default value is 10,20,30</comment>
|
70 |
+
<frontend_type>text</frontend_type>
|
71 |
+
<validate>validate-per-page-value-list</validate>
|
72 |
+
<sort_order>3</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>1</show_in_website>
|
75 |
+
<show_in_store>1</show_in_store>
|
76 |
+
</gallery_img_item_per_page>
|
77 |
+
|
78 |
+
|
79 |
+
</fields>
|
80 |
+
</general>
|
81 |
+
</groups>
|
82 |
+
</saggallery>
|
83 |
+
</sections>
|
84 |
+
</config>
|
app/code/community/Sag/Gallery/New folder/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/New folder/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/code/community/Sag/Gallery/controllers/Adminhtml/CategoryController.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Adminhtml_CategoryController extends Mage_Adminhtml_Controller_action
|
4 |
{
|
5 |
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Adminhtml_CategoryController extends Mage_Adminhtml_Controller_action
|
27 |
{
|
28 |
|
app/code/community/Sag/Gallery/controllers/Adminhtml/GalleryController.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sag_Gallery_Adminhtml_GalleryController extends Mage_Adminhtml_Controller_action
|
4 |
{
|
5 |
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_Adminhtml_GalleryController extends Mage_Adminhtml_Controller_action
|
27 |
{
|
28 |
|
app/code/community/Sag/Gallery/controllers/CategoryController.php
CHANGED
@@ -1,4 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sag_Gallery_CategoryController extends Mage_Core_Controller_Front_Action
|
3 |
{
|
4 |
public function indexAction()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_CategoryController extends Mage_Core_Controller_Front_Action
|
27 |
{
|
28 |
public function indexAction()
|
app/code/community/Sag/Gallery/controllers/ImageController.php
CHANGED
@@ -1,4 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sag_Gallery_ImageController extends Mage_Core_Controller_Front_Action
|
3 |
{
|
4 |
public function indexAction()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_ImageController extends Mage_Core_Controller_Front_Action
|
27 |
{
|
28 |
public function indexAction()
|
app/code/community/Sag/Gallery/controllers/IndexController.php
CHANGED
@@ -1,10 +1,32 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
class Sag_Gallery_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
{
|
4 |
public function indexAction()
|
5 |
{
|
6 |
-
//$_module_enabaled = Mage::getStoreConfig('saggallery/general/gallery_enabled_select_box');
|
7 |
-
// we can use above comment line to get store config value
|
8 |
$_module_enabaled = Mage::getStoreConfig('saggallery/general/gallery_enabled_select_box',Mage::app()->getStore());
|
9 |
|
10 |
if($_module_enabaled==1){
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
class Sag_Gallery_IndexController extends Mage_Core_Controller_Front_Action
|
27 |
{
|
28 |
public function indexAction()
|
29 |
{
|
|
|
|
|
30 |
$_module_enabaled = Mage::getStoreConfig('saggallery/general/gallery_enabled_select_box',Mage::app()->getStore());
|
31 |
|
32 |
if($_module_enabaled==1){
|
app/code/community/Sag/Gallery/etc/config.xml
CHANGED
@@ -1,4 +1,29 @@
|
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Sag_Gallery>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* SAGIPL
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category SAGIPL
|
14 |
+
* @package Sag_Gallery
|
15 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Simple Images Gallery with Categories
|
21 |
+
*
|
22 |
+
* @category SAGIPL
|
23 |
+
* @package Sag_Gallery
|
24 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
25 |
+
*/
|
26 |
+
-->
|
27 |
<config>
|
28 |
<modules>
|
29 |
<Sag_Gallery>
|
app/code/community/Sag/Gallery/etc/system.xml
CHANGED
@@ -1,4 +1,29 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
<tabs>
|
4 |
<gallery translate="label" module="gallery">
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* SAGIPL
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category SAGIPL
|
14 |
+
* @package Sag_Gallery
|
15 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Simple Images Gallery with Categories
|
21 |
+
*
|
22 |
+
* @category SAGIPL
|
23 |
+
* @package Sag_Gallery
|
24 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
25 |
+
*/
|
26 |
+
-->
|
27 |
<config>
|
28 |
<tabs>
|
29 |
<gallery translate="label" module="gallery">
|
app/code/community/Sag/Gallery/sql/category_setup/mysql4-install-0.1.0.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
$installer = $this;
|
4 |
|
5 |
$installer->startSetup();
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
$installer = $this;
|
27 |
|
28 |
$installer->startSetup();
|
app/code/community/Sag/Gallery/sql/gallery_setup/mysql4-install-0.1.0.php
CHANGED
@@ -1,5 +1,28 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
$installer = $this;
|
4 |
|
5 |
$installer->startSetup();
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
|
26 |
$installer = $this;
|
27 |
|
28 |
$installer->startSetup();
|
app/design/adminhtml/default/default/layout/gallery.xml
CHANGED
@@ -1,4 +1,29 @@
|
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<layout version="0.1.0">
|
3 |
<gallery_adminhtml_gallery_index>
|
4 |
<reference name="content">
|
1 |
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* SAGIPL
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category SAGIPL
|
14 |
+
* @package Sag_Gallery
|
15 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Simple Images Gallery with Categories
|
21 |
+
*
|
22 |
+
* @category SAGIPL
|
23 |
+
* @package Sag_Gallery
|
24 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
25 |
+
*/
|
26 |
+
-->
|
27 |
<layout version="0.1.0">
|
28 |
<gallery_adminhtml_gallery_index>
|
29 |
<reference name="content">
|
app/design/frontend/base/default/layout/gallery.xml
CHANGED
@@ -1,4 +1,29 @@
|
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<layout version="0.1.0">
|
3 |
<default>
|
4 |
<reference name="top.links">
|
1 |
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* SAGIPL
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category SAGIPL
|
14 |
+
* @package Sag_Gallery
|
15 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Simple Images Gallery with Categories
|
21 |
+
*
|
22 |
+
* @category SAGIPL
|
23 |
+
* @package Sag_Gallery
|
24 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
25 |
+
*/
|
26 |
+
-->
|
27 |
<layout version="0.1.0">
|
28 |
<default>
|
29 |
<reference name="top.links">
|
app/design/frontend/base/default/template/gallery/category.phtml
CHANGED
@@ -1,3 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div class="page-title">
|
2 |
<h1><?php echo $this->__('Gallery') ?></h1>
|
3 |
</div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
?>
|
26 |
+
|
27 |
<div class="page-title">
|
28 |
<h1><?php echo $this->__('Gallery') ?></h1>
|
29 |
</div>
|
app/design/frontend/base/default/template/gallery/gallery.phtml
CHANGED
@@ -1,3 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<div class="page-title">
|
2 |
<h1><?php $this->getCategoryById(); ?></h1>
|
3 |
</div>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
?>
|
26 |
<div class="page-title">
|
27 |
<h1><?php $this->getCategoryById(); ?></h1>
|
28 |
</div>
|
app/design/frontend/base/default/template/gallery/image.phtml
CHANGED
@@ -1,3 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php $cnt = count($this->getImage()); ?>
|
2 |
<?php if($cnt > 0 ): ?>
|
3 |
<?php foreach ($this->getImage() as $item): ?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* SAGIPL
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
*
|
12 |
+
* @category SAGIPL
|
13 |
+
* @package Sag_Gallery
|
14 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
16 |
+
*/
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Simple Images Gallery with Categories
|
20 |
+
*
|
21 |
+
* @category SAGIPL
|
22 |
+
* @package Sag_Gallery
|
23 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
24 |
+
*/
|
25 |
+
?>
|
26 |
+
|
27 |
<?php $cnt = count($this->getImage()); ?>
|
28 |
<?php if($cnt > 0 ): ?>
|
29 |
<?php foreach ($this->getImage() as $item): ?>
|
app/etc/modules/Sag_Gallery.xml
CHANGED
@@ -1,4 +1,29 @@
|
|
1 |
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Sag_Gallery>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* SAGIPL
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
*
|
13 |
+
* @category SAGIPL
|
14 |
+
* @package Sag_Gallery
|
15 |
+
* @copyright Copyright (c) 2014 SAGIPL. (http://www.sagipl.com/)
|
16 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
17 |
+
*/
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Simple Images Gallery with Categories
|
21 |
+
*
|
22 |
+
* @category SAGIPL
|
23 |
+
* @package Sag_Gallery
|
24 |
+
* @author Navneet <navneet.kshk@gmail.com>
|
25 |
+
*/
|
26 |
+
-->
|
27 |
<config>
|
28 |
<modules>
|
29 |
<Sag_Gallery>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>SAG_Gallery</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -17,13 +17,13 @@
|
|
17 |
<h3>Steps:</h3>
|
18 |
<ul>
|
19 |
<li>Install module , Clear cache and logout, login again. Check admin menu bar , in menu bar Go to “<b>Gallery</b>“,here manage category and add images with desciription to these categories.</li>
|
20 |
-
<li>Front end: View Gallery by add ”<b>/gallery</b>” in url example: www.test.com/gallery</li>
|
21 |
</ul></description>
|
22 |
-
<notes>
|
23 |
<authors><author><name>Navneet</name><user>navneetkoshik</user><email>navneet.kshk@gmail.com</email></author></authors>
|
24 |
-
<date>
|
25 |
-
<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="ae6d8213d6de8a5a3e89a952184e43d8"/></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="7a8ce812fd677bf75ec426d61f186f9a"/></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="0b6316a92e38dd60b18dc7e2ebfdbbbb"/><file name="Gallery.php" hash="0b75b1350a0aad239bf47264643600cf"/></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="588ab20ccad75c1f0279dc7cf8727b7c"/><file name="ImageController.php" hash="5ed2cb31648e4cf1838672df791b09c9"/><file name="IndexController.php" hash="3ae61c21308469939937ae4cc4ac5872"/></dir><dir name="etc"><file name="config.xml" hash="10478951de5b7605fd93b37533526411"/><file name="system.xml" hash="c6ccabb70fce8ffa7741984ef292f1f9"/></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
|
27 |
<compatible/>
|
28 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
29 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>SAG_Gallery</name>
|
4 |
+
<version>1.0.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
17 |
<h3>Steps:</h3>
|
18 |
<ul>
|
19 |
<li>Install module , Clear cache and logout, login again. Check admin menu bar , in menu bar Go to “<b>Gallery</b>“,here manage category and add images with desciription to these categories.</li>
|
20 |
+
<li>Front end: View Gallery by add ”<b>/gallery</b>” in url example: www.test.com/gallery or www.test.com/index.php/gallery. and &quot;gallery&quot; link also come in top link.</li>
|
21 |
</ul></description>
|
22 |
+
<notes>With categories and images paging and system configuration setting.</notes>
|
23 |
<authors><author><name>Navneet</name><user>navneetkoshik</user><email>navneet.kshk@gmail.com</email></author></authors>
|
24 |
+
<date>2015-01-05</date>
|
25 |
+
<time>12:32:28</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="94c18269206d8d02e46162c5651dead4"/><dir name="Tab"><file name="Form.php" hash="f0f35b9f8d3a429c583149fa796e19be"/></dir><file name="Tabs.php" hash="2abe6c56070c58e84d5a627c3256c5f5"/></dir><file name="Edit.php" hash="55a6bd02328cbce4b85481d35aebd49c"/><file name="Grid.php" hash="d456e0e103946060555c5811909b3a34"/></dir><file name="Category.php" hash="336e4ddc542b4da629211e6ea9dd9d40"/><dir name="Gallery"><dir name="Edit"><file name="Form.php" hash="7685f2b131270776817d01bb49740d4e"/><dir name="Tab"><file name="Form.php" hash="5fb09de7a25fe40b29b622167fecd8ad"/></dir><file name="Tabs.php" hash="f5a64ee723fe85cfe4e7c2bad4ae9bad"/></dir><file name="Edit.php" hash="5520399a08af1975d1867535fde1ed63"/><file name="Grid.php" hash="16964a45eb96652509f45c44abfff075"/></dir><file name="Gallery.php" hash="3b32b13d5f7ab2d908fa98b4f425c257"/></dir><file name="Category.php" hash="6c336b66ee0b1cb7461127b050fc97cc"/><file name="Gallery.php" hash="db375b3b6d3ec4eaab3ab19db81f7047"/></dir><dir name="Helper"><file name="Data.php" hash="7079586f07e455179893edaaf5c085ae"/></dir><dir name="Model"><file name="Category.php" hash="2254304f1df7a6747ff6f9b03b91b492"/><file name="Gallery.php" hash="fa39aa102f9b06cac578570c9ff79d17"/><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="5128ee619c6a824cc699096f7978fc17"/></dir><file name="Category.php" hash="d1631b858e5299cb82e72a6f4885a7d4"/><dir name="Gallery"><file name="Collection.php" hash="4fd8b7143c0e65d3093d842813e6b58b"/></dir><file name="Gallery.php" hash="ff492bfc7ef47ef5c4721e7343a52ea0"/></dir><file name="Status.php" hash="36c60d15bca60fca363a33a8f040267f"/></dir><dir name="New folder"><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="ae6d8213d6de8a5a3e89a952184e43d8"/></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="7a8ce812fd677bf75ec426d61f186f9a"/></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="0b6316a92e38dd60b18dc7e2ebfdbbbb"/><file name="Gallery.php" hash="0b75b1350a0aad239bf47264643600cf"/></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="588ab20ccad75c1f0279dc7cf8727b7c"/><file name="ImageController.php" hash="5ed2cb31648e4cf1838672df791b09c9"/><file name="IndexController.php" hash="3ae61c21308469939937ae4cc4ac5872"/></dir><dir name="etc"><file name="config.xml" hash="10478951de5b7605fd93b37533526411"/><file name="system.xml" hash="c6ccabb70fce8ffa7741984ef292f1f9"/></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 name="controllers"><dir name="Adminhtml"><file name="CategoryController.php" hash="bab1069f479f8ff934ec35e7a07692b9"/><file name="GalleryController.php" hash="45c8b64a797f2e680134271419e79a25"/></dir><file name="CategoryController.php" hash="beb217c44f456618fdfdc204036a86e1"/><file name="ImageController.php" hash="0e5280caf060a87c3cfd15e71a3431c0"/><file name="IndexController.php" hash="0f97ac79d40847aa315eb92d0b8b5831"/></dir><dir name="etc"><file name="config.xml" hash="d8a92e2de43113245d3516c9728f1234"/><file name="system.xml" hash="11a7f0e8532b956b335f696dee7d5132"/></dir><dir name="sql"><dir name="category_setup"><file name="mysql4-install-0.1.0.php" hash="f606341c000e1b88a755c3a056b0a9d4"/></dir><dir name="gallery_setup"><file name="mysql4-install-0.1.0.php" hash="a56f29aaff9453ee9d4ff73e7187f66a"/></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="88f8c11e3605d085a9169a3fe69a658b"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="gallery.xml" hash="14f2c96b07a99ca4ed0f42ad2ddae987"/></dir><dir name="template"><dir name="gallery"><file name="category.phtml" hash="e26b658af4791aabb47c6eaa66376634"/><file name="gallery.phtml" hash="0f940759276ceb2c6d7c78885e6f179d"/><file name="image.phtml" hash="5ae79767bdcf29447c6a23156bcc74c5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sag_Gallery.xml" hash="236e5243a6d6f51d8887b593907f4b5a"/></dir></target></contents>
|
27 |
<compatible/>
|
28 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
29 |
</package>
|