Maurisource_ByTheme - Version 1.0.0

Version Notes

Initial Release

Download this release

Release Info

Developer Manesh Sonah
Extension Maurisource_ByTheme
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Maurisource/Bytheme/Block/Theme/List.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Maurisource_Bytheme extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
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/mit-license.php
11
+ *
12
+ * @category Maurisource
13
+ * @package Maurisource_Bytheme
14
+ * @copyright Copyright (c) 2014
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Theme list block
19
+ *
20
+ * @category Maurisource
21
+ * @package Maurisource_Bytheme
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Maurisource_Bytheme_Block_Theme_List
25
+ extends Mage_Core_Block_Template {
26
+ /**
27
+ * prepare the layout
28
+ * @access protected
29
+ * @return Maurisource_Bytheme_Block_Theme_List
30
+ * @author Ultimate Module Creator
31
+ */
32
+ protected function _prepareLayout(){
33
+ parent::_prepareLayout();
34
+ return $this;
35
+ }
36
+
37
+ public function getCategories(){
38
+ $arrCats = array();
39
+
40
+
41
+ $categories = Mage::getModel('catalog/category')->getCategories(Mage::getStoreConfig('categorybrowser_options/messages/starting_directory',Mage::app()->getStore()));
42
+
43
+ foreach ($categories as $cat){
44
+ $arrCats[] = array(
45
+ 'cat' => $cat,
46
+ 'children' => Mage::getModel('catalog/category')->getCategories($cat->getId())
47
+ );
48
+ }
49
+
50
+ return $arrCats;
51
+ }
52
+ }
app/code/local/Maurisource/Bytheme/Block/Theme/Sidebar.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Maurisource_Bytheme extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
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/mit-license.php
11
+ *
12
+ * @category Maurisource
13
+ * @package Maurisource_Bytheme
14
+ * @copyright Copyright (c) 2014
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Theme view block
19
+ *
20
+ * @category Maurisource
21
+ * @package Maurisource_Bytheme
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Maurisource_Bytheme_Block_Theme_Sidebar
25
+ extends Mage_Core_Block_Template {
26
+ /**
27
+ * get the current theme
28
+ * @access public
29
+ * @return mixed (Maurisource_Bytheme_Model_Theme|null)
30
+ * @author Ultimate Module Creator
31
+ */
32
+
33
+ public function getTree(){
34
+ $arrCats = array();
35
+ $categories = Mage::getModel('catalog/category')->getCategories(Mage::getStoreConfig('categorybrowser_options/messages/starting_directory',Mage::app()->getStore()));
36
+
37
+ foreach ($categories as $cat){
38
+ $arrCats[] = array(
39
+ 'cat' => $cat,
40
+ 'children' => Mage::getModel('catalog/category')->getCategories($cat->getId())
41
+ );
42
+ }
43
+
44
+ return $arrCats;
45
+ }
46
+
47
+
48
+ }
app/code/local/Maurisource/Bytheme/Block/Theme/View.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Maurisource_Bytheme extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
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/mit-license.php
11
+ *
12
+ * @category Maurisource
13
+ * @package Maurisource_Bytheme
14
+ * @copyright Copyright (c) 2014
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Theme view block
19
+ *
20
+ * @category Maurisource
21
+ * @package Maurisource_Bytheme
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Maurisource_Bytheme_Block_Theme_View
25
+ extends Mage_Core_Block_Template {
26
+ /**
27
+ * get the current theme
28
+ * @access public
29
+ * @return mixed (Maurisource_Bytheme_Model_Theme|null)
30
+ * @author Ultimate Module Creator
31
+ */
32
+
33
+ protected function _prepareLayout(){
34
+ parent::_prepareLayout();
35
+ return $this;
36
+ }
37
+
38
+ public function getCategory($categoryId){
39
+ return Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*')
40
+ ->addAttributeToFilter('url_key',$categoryId)->getFirstItem();
41
+ }
42
+
43
+ public function getSubCategories($categoryId){
44
+ $arrSub = array();
45
+ $cats = explode(",",$this->getCategory($categoryId)->getChildren());
46
+ foreach ($cats as $cat){
47
+ $arrSub[] = Mage::getModel('catalog/category')->load($cat);
48
+ }
49
+
50
+ return $arrSub;
51
+
52
+ }
53
+ }
app/code/local/Maurisource/Bytheme/Controller/Router.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Maurisource_Bytheme extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
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/mit-license.php
11
+ *
12
+ * @category Maurisource
13
+ * @package Maurisource_Bytheme
14
+ * @copyright Copyright (c) 2014
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Router
19
+ *
20
+ * @category Maurisource
21
+ * @package Maurisource_Bytheme
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Maurisource_Bytheme_Controller_Router
25
+ extends Mage_Core_Controller_Varien_Router_Abstract {
26
+ /**
27
+ * init routes
28
+ * @access public
29
+ * @param Varien_Event_Observer $observer
30
+ * @return Maurisource_Bytheme_Controller_Router
31
+ * @author Ultimate Module Creator
32
+ */
33
+ public function initControllerRouters($observer){
34
+ $front = $observer->getEvent()->getFront();
35
+ $front->addRouter('maurisource_bytheme', $this);
36
+ return $this;
37
+ }
38
+ /**
39
+ * Validate and match entities and modify request
40
+ * @access public
41
+ * @param Zend_Controller_Request_Http $request
42
+ * @return bool
43
+ * @author Ultimate Module Creator
44
+ */
45
+ public function match(Zend_Controller_Request_Http $request){
46
+ if (!Mage::isInstalled()) {
47
+ Mage::app()->getFrontController()->getResponse()
48
+ ->setRedirect(Mage::getUrl('install'))
49
+ ->sendResponse();
50
+ exit;
51
+ }
52
+
53
+
54
+
55
+
56
+ $urlKey = trim($request->getPathInfo(), '/');
57
+
58
+ if ($urlKey == Mage::getStoreConfig('categorybrowser_options/messages/url_slug',Mage::app()->getStore())){
59
+ $request->setModuleName('by-category')
60
+ ->setControllerName('theme')
61
+ ->setActionName('index');
62
+ return true;
63
+ }elseif (substr($urlKey,0,8) == Mage::getStoreConfig('categorybrowser_options/messages/url_slug',Mage::app()->getStore())){
64
+ $var = str_replace(Mage::getStoreConfig('categorybrowser_options/messages/url_slug',Mage::app()->getStore()) . '/','',$urlKey);
65
+ $request->setModuleName('by-theme')
66
+ ->setControllerName('theme')
67
+ ->setActionName('view')
68
+ ->setParam('themeId',$var);
69
+ return true;
70
+
71
+ }
72
+
73
+
74
+ return false;
75
+ }
76
+ }
app/code/local/Maurisource/Bytheme/Helper/Data.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Maurisource_Bytheme extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
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/mit-license.php
11
+ *
12
+ * @category Maurisource
13
+ * @package Maurisource_Bytheme
14
+ * @copyright Copyright (c) 2014
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Bytheme default helper
19
+ *
20
+ * @category Maurisource
21
+ * @package Maurisource_Bytheme
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Maurisource_Bytheme_Helper_Data
25
+ extends Mage_Core_Helper_Abstract {
26
+ /**
27
+ * convert array to options
28
+ * @access public
29
+ * @param $options
30
+ * @return array
31
+ * @author Ultimate Module Creator
32
+ */
33
+ public function convertOptions($options){
34
+ $converted = array();
35
+ foreach ($options as $option){
36
+ if (isset($option['value']) && !is_array($option['value']) && isset($option['label']) && !is_array($option['label'])){
37
+ $converted[$option['value']] = $option['label'];
38
+ }
39
+ }
40
+ return $converted;
41
+ }
42
+ }
app/code/local/Maurisource/Bytheme/Helper/Theme.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Maurisource_Bytheme extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
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/mit-license.php
11
+ *
12
+ * @category Maurisource
13
+ * @package Maurisource_Bytheme
14
+ * @copyright Copyright (c) 2014
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Theme helper
19
+ *
20
+ * @category Maurisource
21
+ * @package Maurisource_Bytheme
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Maurisource_Bytheme_Helper_Theme
25
+ extends Mage_Core_Helper_Abstract {
26
+ /**
27
+ * get the url to the themes list page
28
+ * @access public
29
+ * @return string
30
+ * @author Ultimate Module Creator
31
+ */
32
+ public function getThemesUrl(){
33
+ if ($listKey = Mage::getStoreConfig('maurisource_bytheme/theme/url_rewrite_list')) {
34
+ return Mage::getUrl('', array('_direct'=>$listKey));
35
+ }
36
+ return Mage::getUrl('maurisource_bytheme/theme/index');
37
+ }
38
+ /**
39
+ * check if breadcrumbs can be used
40
+ * @access public
41
+ * @return bool
42
+ * @author Ultimate Module Creator
43
+ */
44
+ public function getUseBreadcrumbs(){
45
+ return Mage::getStoreConfigFlag('maurisource_bytheme/theme/breadcrumbs');
46
+ }
47
+ /**
48
+ * check if the rss for theme is enabled
49
+ * @access public
50
+ * @return bool
51
+ * @author Ultimate Module Creator
52
+ */
53
+ public function isRssEnabled(){
54
+ return Mage::getStoreConfigFlag('rss/config/active') && Mage::getStoreConfigFlag('maurisource_bytheme/theme/rss');
55
+ }
56
+ /**
57
+ * get the link to the theme rss list
58
+ * @access public
59
+ * @return string
60
+ * @author Ultimate Module Creator
61
+ */
62
+ public function getRssUrl(){
63
+ return Mage::getUrl('maurisource_bytheme/theme/rss');
64
+ }
65
+ }
app/code/local/Maurisource/Bytheme/controllers/ThemeController.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Maurisource_Bytheme extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
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/mit-license.php
11
+ *
12
+ * @category Maurisource
13
+ * @package Maurisource_Bytheme
14
+ * @copyright Copyright (c) 2014
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Theme front contrller
19
+ *
20
+ * @category Maurisource
21
+ * @package Maurisource_Bytheme
22
+ * @author Ultimate Module Creator
23
+ */
24
+ class Maurisource_Bytheme_ThemeController
25
+ extends Mage_Core_Controller_Front_Action {
26
+ /**
27
+ * default action
28
+ * @access public
29
+ * @return void
30
+ * @author Ultimate Module Creator
31
+ */
32
+ public function indexAction(){
33
+ $this->loadLayout();
34
+ $this->_initLayoutMessages('catalog/session');
35
+ $this->_initLayoutMessages('customer/session');
36
+ $this->_initLayoutMessages('checkout/session');
37
+ if (Mage::helper('maurisource_bytheme/theme')->getUseBreadcrumbs()){
38
+ if ($breadcrumbBlock = $this->getLayout()->getBlock('breadcrumbs')){
39
+ $breadcrumbBlock->addCrumb('home', array(
40
+ 'label' => Mage::helper('maurisource_bytheme')->__('Home'),
41
+ 'link' => Mage::getUrl(),
42
+ )
43
+ );
44
+ $breadcrumbBlock->addCrumb('themes', array(
45
+ 'label' => Mage::helper('maurisource_bytheme')->__('Themes'),
46
+ 'link' => '',
47
+ )
48
+ );
49
+ }
50
+ }
51
+ $this->renderLayout();
52
+ }
53
+
54
+ }
app/code/local/Maurisource/Bytheme/etc/config.xml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ *Maurisource_Bytheme extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
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/mit-license.php
12
+ *
13
+ * @category Maurisource
14
+ * @package Maurisource_Bytheme
15
+ * @copyright Copyright (c) 2014
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <Maurisource_Bytheme>
22
+ <version>1.0.0</version>
23
+ </Maurisource_Bytheme>
24
+ </modules>
25
+ <global>
26
+ <blocks>
27
+ <maurisource_bytheme>
28
+ <class>Maurisource_Bytheme_Block</class>
29
+ </maurisource_bytheme>
30
+ </blocks>
31
+ <helpers>
32
+ <maurisource_bytheme>
33
+ <class>Maurisource_Bytheme_Helper</class>
34
+ </maurisource_bytheme>
35
+ </helpers>
36
+ <models>
37
+ <maurisource_bytheme>
38
+ <class>Maurisource_Bytheme_Model</class>
39
+ <resourceModel>maurisource_bytheme_resource</resourceModel>
40
+ </maurisource_bytheme>
41
+ <maurisource_bytheme_resource>
42
+ <class>Maurisource_Bytheme_Model_Resource</class>
43
+ <entities>
44
+ <theme>
45
+ <table>maurisource_bytheme_theme</table>
46
+ </theme>
47
+ </entities>
48
+ </maurisource_bytheme_resource>
49
+ </models>
50
+ <events>
51
+ <controller_front_init_routers>
52
+ <observers>
53
+ <maurisource_bytheme>
54
+ <class>Maurisource_Bytheme_Controller_Router</class>
55
+ <method>initControllerRouters</method>
56
+ </maurisource_bytheme>
57
+ </observers>
58
+ </controller_front_init_routers>
59
+ </events>
60
+ </global>
61
+ <frontend>
62
+ <routers>
63
+ <maurisource_bytheme>
64
+ <use>standard</use>
65
+ <args>
66
+ <module>Maurisource_Bytheme</module>
67
+ <frontName>by-category</frontName>
68
+ </args>
69
+ </maurisource_bytheme>
70
+ </routers>
71
+ <layout>
72
+ <updates>
73
+ <maurisource_bytheme>
74
+ <file>maurisource_bytheme.xml</file>
75
+ </maurisource_bytheme>
76
+ </updates>
77
+ </layout>
78
+ <translate>
79
+ <modules>
80
+ <Maurisource_Bytheme>
81
+ <files>
82
+ <default>Maurisource_Bytheme.csv</default>
83
+ </files>
84
+ </Maurisource_Bytheme>
85
+ </modules>
86
+ </translate>
87
+ </frontend>
88
+ <default>
89
+ <categorybrowser_options>
90
+ <messages>
91
+ <starting_directory>2</starting_directory>
92
+ <url_slug>category-browser</url_slug>
93
+ <sidebar_title>Categories</sidebar_title>
94
+ <main_title>Categories</main_title>
95
+ <main_content>With dozens of different products to choose from, you are sure to find what you are looking for here.</main_content>
96
+ </messages>
97
+ </categorybrowser_options>
98
+ </default>
99
+ <adminhtml>
100
+ <acl>
101
+ <resources>
102
+ <admin>
103
+ <children>
104
+ <system>
105
+ <children>
106
+ <config>
107
+ <children>
108
+ <categorybrowser_options>
109
+ <title>Category Browser Admin Section</title>
110
+ </categorybrowser_options>
111
+ </children>
112
+ </config>
113
+ </children>
114
+ </system>
115
+ </children>
116
+ </admin>
117
+ </resources>
118
+ </acl>
119
+ </adminhtml>
120
+ </config>
app/code/local/Maurisource/Bytheme/etc/system.xml ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <tabs>
3
+ <categorybrowser translate="label" module="maurisource_bytheme">
4
+ <label>Category Browser</label>
5
+ <sort_order>10000</sort_order>
6
+ </categorybrowser>
7
+ </tabs>
8
+ <sections>
9
+ <categorybrowser_options translate="label" module="maurisource_bytheme">
10
+ <label>Category Browser Config</label>
11
+ <tab>categorybrowser</tab>
12
+ <frontend_type>text</frontend_type>
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
+ <messages translate="label">
19
+ <label>Category Browser Config</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
+ <starting_directory>
27
+ <label>Starting Category ID</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>1</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ </starting_directory>
34
+ <url_slug>
35
+ <label>URL Slug</label>
36
+ <frontend_type>text</frontend_type>
37
+ <sort_order>1</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>1</show_in_store>
41
+ </url_slug>
42
+ <sidebar_title>
43
+ <label>Sidebar Title</label>
44
+ <frontend_type>text</frontend_type>
45
+ <sort_order>1</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>1</show_in_store>
49
+ </sidebar_title>
50
+ <main_title>
51
+ <label>Main Title</label>
52
+ <frontend_type>text</frontend_type>
53
+ <sort_order>1</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>1</show_in_store>
57
+ </main_title>
58
+ <main_content>
59
+ <label>Main Content</label>
60
+ <frontend_type>textarea</frontend_type>
61
+ <sort_order>1</sort_order>
62
+ <show_in_default>1</show_in_default>
63
+ <show_in_website>1</show_in_website>
64
+ <show_in_store>1</show_in_store>
65
+ </main_content>
66
+ </fields>
67
+ </messages>
68
+ </groups>
69
+ </categorybrowser_options>
70
+ </sections>
71
+ </config>
app/design/adminhtml/default/default/layout/maurisource_bytheme.xml ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Maurisource_Bytheme extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
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/mit-license.php
12
+ *
13
+ * @category Maurisource
14
+ * @package Maurisource_Bytheme
15
+ * @copyright Copyright (c) 2014
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <layout>
20
+ <adminhtml_bytheme_theme_index>
21
+ <reference name="menu">
22
+ <action method="setActive">
23
+ <menupath>catalog/maurisource_bytheme/theme</menupath>
24
+ </action>
25
+ </reference>
26
+ <reference name="content">
27
+ <block type="maurisource_bytheme/adminhtml_theme" name="theme" />
28
+
29
+ </reference>
30
+ </adminhtml_bytheme_theme_index>
31
+ <adminhtml_bytheme_theme_grid>
32
+ <block type="core/text_list" name="root" output="toHtml">
33
+ <block type="maurisource_bytheme/adminhtml_theme_grid" name="theme_grid"/>
34
+ </block>
35
+ </adminhtml_bytheme_theme_grid>
36
+ <!-- Theme add/edit action -->
37
+ <adminhtml_bytheme_theme_edit>
38
+ <update handle="editor"/>
39
+ <reference name="menu">
40
+ <action method="setActive">
41
+ <menupath>catalog/maurisource_bytheme/theme</menupath>
42
+ </action>
43
+ </reference>
44
+ <reference name="content">
45
+ <block type="maurisource_bytheme/adminhtml_theme_edit" name="theme_edit"></block>
46
+ </reference>
47
+ <reference name="left">
48
+ <block type="maurisource_bytheme/adminhtml_theme_edit_tabs" name="theme_tabs"></block>
49
+ </reference>
50
+ </adminhtml_bytheme_theme_edit>
51
+
52
+ <adminhtml_bytheme_theme_comment_index>
53
+ <reference name="menu">
54
+ <action method="setActive">
55
+ <menupath>catalog/maurisource_bytheme/theme_comment</menupath>
56
+ </action>
57
+ </reference>
58
+ <reference name="content">
59
+ <block type="maurisource_bytheme/adminhtml_theme_comment" name="theme_comment_grid"/>
60
+ </reference>
61
+ </adminhtml_bytheme_theme_comment_index>
62
+ <adminhtml_bytheme_theme_comment_grid>
63
+ <block type="core/text_list" name="root" output="toHtml">
64
+ <block type="maurisource_bytheme/adminhtml_theme_comment_grid" name="theme_comment_grid"/>
65
+ </block>
66
+ </adminhtml_bytheme_theme_comment_grid>
67
+ <adminhtml_bytheme_theme_comment_edit>
68
+ <update handle="editor"/>
69
+ <reference name="menu">
70
+ <action method="setActive">
71
+ <menupath>catalog/maurisource_bytheme/theme_comment</menupath>
72
+ </action>
73
+ </reference>
74
+ <reference name="content">
75
+ <block type="maurisource_bytheme/adminhtml_theme_comment_edit" name="theme_comment_edit"></block>
76
+ </reference>
77
+ <reference name="left">
78
+ <block type="maurisource_bytheme/adminhtml_theme_comment_edit_tabs" name="theme_comment_tabs"></block>
79
+ </reference>
80
+ </adminhtml_bytheme_theme_comment_edit>
81
+ </layout>
app/design/frontend/base/default/layout/maurisource_bytheme.xml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Buyjigsaw_Bytheme extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
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/mit-license.php
12
+ *
13
+ * @category Buyjigsaw
14
+ * @package Buyjigsaw_Bytheme
15
+ * @copyright Copyright (c) 2014
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <layout>
20
+
21
+ <maurisource_bytheme_theme_index translate="label" module="maurisource_bytheme">
22
+ <label>Themes list</label>
23
+ <update handle="page_two_columns_left" />
24
+ <reference name="content">
25
+ <block type="maurisource_bytheme/theme_list" name="theme_list" template="maurisource_bytheme/theme/list.phtml" />
26
+ </reference>
27
+ <reference name="left">
28
+ <block type="maurisource_bytheme/theme_sidebar" name="theme_sidebar" template="maurisource_bytheme/theme/sidebar.phtml" />
29
+ </reference>
30
+ </maurisource_bytheme_theme_index>
31
+ <maurisource_bytheme_theme_view translate="label" module="maurisource_bytheme">
32
+ <label>Theme view page</label>
33
+ <update handle="page_two_columns_left" />
34
+ <reference name="content">
35
+ <block type="maurisource_bytheme/theme_view" name="theme_view" template="maurisource_bytheme/theme/view.phtml" />
36
+ </reference>
37
+ <reference name="left">
38
+ <block type="maurisource_bytheme/theme_sidebar" name="theme_sidebar" template="maurisource_bytheme/theme/sidebar.phtml" />
39
+ </reference>
40
+ </maurisource_bytheme_theme_view>
41
+ </layout>
app/design/frontend/base/default/template/maurisource_bytheme/theme/list.phtml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Maurisource_Bytheme extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the MIT License
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/mit-license.php
11
+ *
12
+ * @category Maurisource
13
+ * @package Maurisource_Bytheme
14
+ * @copyright Copyright (c) 2014
15
+ * @license http://opensource.org/licenses/mit-license.php MIT License
16
+ */
17
+ /**
18
+ * Theme list template
19
+ *
20
+ * @category Maurisource
21
+ * @package Maurisource_Bytheme
22
+ * @author Ultimate Module Creator
23
+ */
24
+ ?>
25
+ <style>
26
+ .mainCat {
27
+ width:25%;
28
+ margin-right:5%;
29
+ float:left;
30
+ height:170px;
31
+ overflow:hidden;
32
+ margin-bottom:10px;
33
+ text-align:center;
34
+ }
35
+ .subCats {
36
+ width:70%;
37
+ float:left;
38
+ }
39
+
40
+
41
+ .mainCat img {
42
+ height:140px;
43
+
44
+ }
45
+
46
+ .subCats li {
47
+ display:block;
48
+ width:50%;
49
+ line-height:30px;
50
+ float:left;
51
+ }
52
+
53
+
54
+ hr.clear {
55
+ width:100%;
56
+ display:block;
57
+ clear:both;
58
+ margin:10px 0px;
59
+ border: 1px solid #AAAAAA;
60
+ }
61
+
62
+ </style>
63
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
64
+ <?php $_cats = $this->getCategories(); ?>
65
+ <div class="page-title theme-title">
66
+ <h1><?php echo Mage::getStoreConfig('categorybrowser_options/messages/main_title',Mage::app()->getStore()); ?></h1>
67
+ </div>
68
+ <p><?php echo Mage::getStoreConfig('categorybrowser_options/messages/main_content',Mage::app()->getStore()); ?></p>
69
+ <div class="theme-list-container">
70
+ <?php foreach ($_cats as $_cat) : ?>
71
+ <?php $cat = Mage::getModel('catalog/category')->load($_cat['cat']->getId()); ?>
72
+ <div class='mainCat'>
73
+ <a href='<?php echo Mage::getBaseUrl(); ?>/<?php echo Mage::getStoreConfig('categorybrowser_options/messages/url_slug',Mage::app()->getStore()); ?>/<?php echo $cat->getUrlKey(); ?>/'><img src='<?php echo Mage::getBaseUrl('media').'catalog/category/'.$cat->getThumbnail() ?>' /></a>
74
+ <h3><a href='<?php echo Mage::getBaseUrl(); ?>/<?php echo Mage::getStoreConfig('categorybrowser_options/messages/url_slug',Mage::app()->getStore()); ?>/<?php echo $cat->getUrlKey(); ?>/'><?php echo $cat->getName(); ?></a></h3>
75
+ </div>
76
+ <div class='subCats'>
77
+ <?php foreach ($_cat['children'] as $child): ?>
78
+ <?php $child = Mage::getModel('catalog/category')->load($child->getId()); ?>
79
+ <li><a href='<?php echo $child->getUrl(); ?>'><?php echo $child->getName(); ?></a></li>
80
+ <?php endforeach; ?>
81
+ </div>
82
+ <hr class='clear' />
83
+ <?php endforeach;?>
84
+ </div>
app/design/frontend/base/default/template/maurisource_bytheme/theme/sidebar.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class='quick_short'>
2
+ <div class='title row'><h3><?php echo Mage::getStoreConfig('categorybrowser_options/messages/sidebar_title',Mage::app()->getStore()); ?></h3></div>
3
+ </div>
4
+ <?php
5
+ $themeId = Mage::app()->getRequest()->getParam('themeId');
6
+ $tree = $this->getTree();
7
+
8
+ foreach ($tree as $cat):
9
+ ?>
10
+ <?php if ($themeId AND $cat['cat']->getUrlKey() != $themeId) continue; ?>
11
+ <div class='title_1'><?php echo $cat['cat']->getName(); ?></div>
12
+ <div class='box'>
13
+ <ul>
14
+ <?php foreach ($cat['children'] as $child): ?>
15
+ <?php $child = Mage::getModel('catalog/category')->load($child->getId()); ?>
16
+ <li><a href='<?php echo $child->getUrl(); ?>'><?php echo $child->getName(); ?></a></li>
17
+ <?php endforeach; ?>
18
+ </ul>
19
+ </div>
20
+ <?php endforeach; ?>
app/etc/modules/Maurisource_Bytheme.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Maurisource_Bytheme extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the MIT License
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/mit-license.php
12
+ *
13
+ * @category Maurisource
14
+ * @package Maurisource_Bytheme
15
+ * @copyright Copyright (c) 2014
16
+ * @license http://opensource.org/licenses/mit-license.php MIT License
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <Maurisource_Bytheme>
22
+ <active>true</active>
23
+ <codePool>local</codePool>
24
+ <depends>
25
+ <Mage_Core />
26
+ </depends>
27
+ </Maurisource_Bytheme>
28
+ </modules>
29
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Maurisource_ByTheme</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>ASL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Allow users to easily browse through your product categories.</summary>
10
+ <description>Quick installation to allow for your users to browse through your product categories. This could either be from your core category, or just using a subset of categories. Ideal for browsing by theme or by genre.</description>
11
+ <notes>Initial Release</notes>
12
+ <authors><author><name>Manesh Sonah</name><user>maneso</user><email>maurisource.seo@gmail.com</email></author></authors>
13
+ <date>2014-11-18</date>
14
+ <time>09:55:00</time>
15
+ <contents><target name="magelocal"><dir name="Maurisource"><dir name="Bytheme"><dir name="Block"><dir name="Theme"><file name="List.php" hash="caf57eed5d37d3f6a1e4cb0620214ebd"/><file name="Sidebar.php" hash="4a6d7e78df25896c884ba971579f2330"/><file name="View.php" hash="0bd24109194caada8e3c1753f91fc430"/></dir></dir><dir name="Controller"><file name="Router.php" hash="9f131bdd6288388bcbf24afafa4dd3a1"/></dir><dir name="Helper"><file name="Data.php" hash="d29afdfb1cdd8495341f1085722df927"/><file name="Theme.php" hash="b38cb369af68b8604197364c3a4dd1eb"/></dir><dir name="controllers"><file name="ThemeController.php" hash="1b4a479ff1df72f479f160c12ac82f18"/></dir><dir name="etc"><file name="config.xml" hash="5d7df73ee7a462c162db3f74e03c63a3"/><file name="system.xml" hash="c5cda61a2b230e534a5f54659e9db2e9"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="maurisource_bytheme"><dir name="theme"><file name="list.phtml" hash="8a9681dcf1a623537244e6fa46824d25"/><file name="sidebar.phtml" hash="8750b3518d3641247aeea7f9f78984df"/></dir></dir></dir><dir name="layout"><file name="maurisource_bytheme.xml" hash="89929d9aa4cd5b382a7dcda2a4cad964"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="maurisource_bytheme.xml" hash="703f8102d43fa98ef9ea56b5abcf7b16"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Maurisource_Bytheme.xml" hash="367e0712e8e733536c2aaf6556b78873"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.0.0</min><max>5.6.0</max></php></required></dependencies>
18
+ </package>