Cybernetikz_Background - Version 0.2.0

Version Notes

Category pages issue fix. Multiple store category support.

Download this release

Release Info

Developer CyberNetikz
Extension Cybernetikz_Background
Version 0.2.0
Comparing to
See all releases


Code changes from version 0.1.0 to 0.2.0

app/code/local/Cybernetikz/Background/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Cybernetikz_Background>
5
- <version>0.1.0</version>
6
  </Cybernetikz_Background>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Cybernetikz_Background>
5
+ <version>0.2.0</version>
6
  </Cybernetikz_Background>
7
  </modules>
8
 
app/design/adminhtml/default/default/template/background/editpage.phtml CHANGED
@@ -12,7 +12,7 @@
12
  <tr>
13
  <td><h3><?php echo $this->__('Edit Background')?></h3></td>
14
  <td class="a-right">
15
- <button onclick="editForm.submit()" class="scalable save" type="button"><span>Submit</span></button>
16
  </td>
17
  </tr>
18
  </table>
@@ -35,20 +35,15 @@
35
  <tr id="cms_page_list" style="<?php echo ($signgleinfo['bg_type']!="cms")?'display:none':''?>;">
36
  <td class="label"><?php echo $this->__('Page')?> <span class="required">*</span></td>
37
  <td class="input-ele">
38
- <?php $store = Mage::app()->getStore('default')->getCode();
39
- $cms_pages = Mage::getModel('cms/page')->getCollection();
40
- //$cms_pages->addStoreFilter($store);
41
  $cms_pages->load();
42
  ?>
43
 
44
  <select name="page_id" id="page_id" style="width:200px;" disabled="disabled">
45
  <option value="">Select Page</option>
46
  <?php foreach($cms_pages as $_page): ?>
47
- <?php $data = $_page->getData();
48
- //if($data['identifier'] !='no-route' && $data['identifier'] !='enable-cookies'/* && $data['identifier'] !='customer-service'*/):
49
- ?>
50
  <option value="<?php echo $data['page_id'] ?>" <?php if(($signgleinfo['bg_type']=="cms") && ($signgleinfo['page_id']==$data['page_id'])){?> selected="selected" <?php } ?>><?php echo $data['title']; ?></option>
51
- <?php //endif; ?>
52
  <?php endforeach; ?>
53
  </select>
54
  </td>
@@ -57,15 +52,51 @@
57
  <tr id="category_list" style="<?php echo ($signgleinfo['bg_type']!="category")?'display:none':'';?>;">
58
  <td class="label"><?php echo $this->__('Category')?> <span class="required">*</span></td>
59
  <td class="input-ele">
60
- <?php $_category = Mage::getModel('catalog/category')->load(2) ?>
61
- <?php $_subcategories = $_category->getChildrenCategories(); ?>
62
  <select name="category_id" id="category_id" style="width:200px;" <?php echo ($signgleinfo['bg_type']=="category")?'disabled="disabled"':''?>>
63
  <option value="">Select Category</option>
64
- <?php foreach($_subcategories as $_subcategory): ?>
65
- <?php if($_subcategory->getIsActive()): ?>
66
- <option value="<?php echo $_subcategory->getId() ?>" <?php if(($signgleinfo['bg_type']=="category") && ($signgleinfo['page_id']==$_subcategory->getId())){?> selected="selected" <?php } ?>><?php echo $_subcategory->getName() ?></option>
67
- <?php endif; ?>
68
- <?php endforeach; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  </select>
70
  </td>
71
  </tr>
12
  <tr>
13
  <td><h3><?php echo $this->__('Edit Background')?></h3></td>
14
  <td class="a-right">
15
+ <button onclick="location.href='<?php echo Mage::helper("adminhtml")->getUrl("background/adminhtml_myform/pagemanage");?>'" class="scalable back" type="button"><span>Back</span></button> <button onclick="editForm.submit()" class="scalable save" type="button"><span>Submit</span></button>
16
  </td>
17
  </tr>
18
  </table>
35
  <tr id="cms_page_list" style="<?php echo ($signgleinfo['bg_type']!="cms")?'display:none':''?>;">
36
  <td class="label"><?php echo $this->__('Page')?> <span class="required">*</span></td>
37
  <td class="input-ele">
38
+ <?php $cms_pages = Mage::getModel('cms/page')->getCollection();
 
 
39
  $cms_pages->load();
40
  ?>
41
 
42
  <select name="page_id" id="page_id" style="width:200px;" disabled="disabled">
43
  <option value="">Select Page</option>
44
  <?php foreach($cms_pages as $_page): ?>
45
+ <?php $data = $_page->getData(); ?>
 
 
46
  <option value="<?php echo $data['page_id'] ?>" <?php if(($signgleinfo['bg_type']=="cms") && ($signgleinfo['page_id']==$data['page_id'])){?> selected="selected" <?php } ?>><?php echo $data['title']; ?></option>
 
47
  <?php endforeach; ?>
48
  </select>
49
  </td>
52
  <tr id="category_list" style="<?php echo ($signgleinfo['bg_type']!="category")?'display:none':'';?>;">
53
  <td class="label"><?php echo $this->__('Category')?> <span class="required">*</span></td>
54
  <td class="input-ele">
 
 
55
  <select name="category_id" id="category_id" style="width:200px;" <?php echo ($signgleinfo['bg_type']=="category")?'disabled="disabled"':''?>>
56
  <option value="">Select Category</option>
57
+ <?php foreach (Mage::app()->getWebsites() as $website):?>
58
+ <optgroup label="<?php echo $website->getName(); ?>">
59
+ <?php foreach ($website->getGroups() as $group):?>
60
+ <?php $stores = $group->getStores(); ?>
61
+ <optgroup label="<?php echo "&nbsp;&nbsp;".$group->getName(); ?>">
62
+ <?php foreach ($stores as $store): ?>
63
+ <optgroup label="<?php echo "&nbsp;&nbsp;&nbsp;&nbsp;".$store->getName(); ?>"></optgroup>
64
+ <?php endforeach;?>
65
+ <?php
66
+ $root_categoryid=Mage::app()->getStore($store->getStoreId())->getRootCategoryId();
67
+ $_categories = Mage::getModel('catalog/category')->load($root_categoryid);
68
+ $_categories = $_categories->getChildrenCategories();
69
+ if (count($_categories) > 0):
70
+ ?>
71
+ <?php foreach($_categories as $_category):?>
72
+ <?php $_category = Mage::getModel('catalog/category')->load($_category->getId());?>
73
+ <?php //print_r($_category->getData());exit; ?>
74
+ <?php if($_category->getIsActive() && $_category->getName()!=""): ?>
75
+ <option style="margin-left:25px;" value="<?php echo $_category->getId() ?>" <?php if(($signgleinfo['bg_type']=="category") && ($signgleinfo['page_id']==$_category->getId())){?> selected="selected" <?php } ?>><?php echo $_category->getName() ?></option>
76
+ <?php $_subcategories = $_category->getChildrenCategories() ?>
77
+ <?php if (count($_subcategories) > 0): ?>
78
+ <?php foreach($_subcategories as $_subcategory): ?>
79
+ <?php if($_subcategory->getIsActive() && $_subcategory->getName()!=""): ?>
80
+ <option style="margin-left:35px;" value="<?php echo $_subcategory->getId() ?>" <?php if(($signgleinfo['bg_type']=="category") && ($signgleinfo['page_id']==$_subcategory->getId())){?> selected="selected" <?php } ?>><?php echo $_subcategory->getName() ?></option>
81
+ <?php $_subcategorylevel4 = Mage::getModel('catalog/category')->load($_subcategory->getId());?>
82
+ <?php $_level4subcategories = $_subcategorylevel4->getChildrenCategories() ?>
83
+ <?php if (count($_level4subcategories) > 0): ?>
84
+ <?php foreach($_level4subcategories as $_level4subcategory): ?>
85
+ <?php if($_level4subcategory->getIsActive() && $_level4subcategory->getName()!=""): ?>
86
+ <option style="margin-left:45px;" value="<?php echo $_level4subcategory->getId() ?>" <?php if(($signgleinfo['bg_type']=="category") && ($signgleinfo['page_id']==$_level4subcategory->getId())){?> selected="selected" <?php } ?>><?php echo $_level4subcategory->getName() ?></option>
87
+ <?php endif; ?>
88
+ <?php endforeach; ?>
89
+ <?php endif; ?>
90
+ <?php endif; ?>
91
+ <?php endforeach; ?>
92
+ <?php endif; ?>
93
+ <?php endif; ?>
94
+ <?php endforeach; ?>
95
+ <?php endif; ?>
96
+ </optgroup>
97
+ <?php endforeach;?>
98
+ </optgroup>
99
+ <?php endforeach;?>
100
  </select>
101
  </td>
102
  </tr>
app/design/adminhtml/default/default/template/background/myform.phtml CHANGED
@@ -7,7 +7,7 @@
7
  <tr>
8
  <td><h3><?php echo $this->__('New Background')?></h3></td>
9
  <td class="a-right">
10
- <button onclick="editForm.submit()" class="scalable save" type="button"><span>Submit</span></button>
11
  </td>
12
  </tr>
13
  </table>
@@ -31,20 +31,15 @@
31
  <tr id="cms_page_list" style="display:none;">
32
  <td class="label"><?php echo $this->__('Page')?> <span class="required">*</span></td>
33
  <td class="input-ele">
34
- <?php $store = Mage::app()->getStore('default')->getCode();
35
- $cms_pages = Mage::getModel('cms/page')->getCollection();
36
- //$cms_pages->addStoreFilter($store);
37
  $cms_pages->load();
38
  ?>
39
 
40
  <select name="page_id" id="page_id" style="width:200px;">
41
  <option value="">Select Page</option>
42
  <?php foreach($cms_pages as $_page): ?>
43
- <?php $data = $_page->getData();
44
- //if(/*$data['identifier'] !='no-route' &&*/ $data['identifier'] !='enable-cookies' /*&& $data['identifier'] !='customer-service'*/):
45
- ?>
46
- <option value="<?php echo $data['page_id'] ?>"><?php echo $data['title']; ?></option>
47
- <?php //endif; ?>
48
  <?php endforeach; ?>
49
  </select>
50
  </td>
@@ -52,16 +47,52 @@
52
 
53
  <tr id="category_list" style="display:none;">
54
  <td class="label"><?php echo $this->__('Category')?> <span class="required">*</span></td>
55
- <td class="input-ele">
56
- <?php $_category = Mage::getModel('catalog/category')->load(2) ?>
57
- <?php $_subcategories = $_category->getChildrenCategories(); ?>
58
  <select name="category_id" id="category_id" style="width:200px;">
59
  <option value="">Select Category</option>
60
- <?php foreach($_subcategories as $_subcategory): ?>
61
- <?php if($_subcategory->getIsActive()): ?>
62
- <option value="<?php echo $_subcategory->getId() ?>"><?php echo $_subcategory->getName() ?></option>
63
- <?php endif; ?>
64
- <?php endforeach; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  </select>
66
  </td>
67
  </tr>
7
  <tr>
8
  <td><h3><?php echo $this->__('New Background')?></h3></td>
9
  <td class="a-right">
10
+ <button onclick="location.href='<?php echo Mage::helper("adminhtml")->getUrl("background/adminhtml_myform/pagemanage");?>'" class="scalable back" type="button"><span>Back</span></button> <button onclick="editForm.submit()" class="scalable save" type="button"><span>Submit</span></button>
11
  </td>
12
  </tr>
13
  </table>
31
  <tr id="cms_page_list" style="display:none;">
32
  <td class="label"><?php echo $this->__('Page')?> <span class="required">*</span></td>
33
  <td class="input-ele">
34
+ <?php $cms_pages = Mage::getModel('cms/page')->getCollection();
 
 
35
  $cms_pages->load();
36
  ?>
37
 
38
  <select name="page_id" id="page_id" style="width:200px;">
39
  <option value="">Select Page</option>
40
  <?php foreach($cms_pages as $_page): ?>
41
+ <?php $data = $_page->getData();?>
42
+ <option value="<?php echo $data['page_id'] ?>"><?php echo $data['title']; ?></option>
 
 
 
43
  <?php endforeach; ?>
44
  </select>
45
  </td>
47
 
48
  <tr id="category_list" style="display:none;">
49
  <td class="label"><?php echo $this->__('Category')?> <span class="required">*</span></td>
50
+ <td class="input-ele">
 
 
51
  <select name="category_id" id="category_id" style="width:200px;">
52
  <option value="">Select Category</option>
53
+ <?php foreach (Mage::app()->getWebsites() as $website):?>
54
+ <optgroup label="<?php echo $website->getName(); ?>">
55
+ <?php foreach ($website->getGroups() as $group):?>
56
+ <?php $stores = $group->getStores(); ?>
57
+ <optgroup label="<?php echo "&nbsp;&nbsp;".$group->getName(); ?>">
58
+ <?php foreach ($stores as $store): ?>
59
+ <optgroup label="<?php echo "&nbsp;&nbsp;&nbsp;&nbsp;".$store->getName(); ?>"></optgroup>
60
+ <?php endforeach;?>
61
+ <?php
62
+ $root_categoryid=Mage::app()->getStore($store->getStoreId())->getRootCategoryId();
63
+ $_categories = Mage::getModel('catalog/category')->load($root_categoryid);
64
+ $_categories = $_categories->getChildrenCategories();
65
+ if (count($_categories) > 0):
66
+ ?>
67
+ <?php foreach($_categories as $_category):?>
68
+ <?php $_category = Mage::getModel('catalog/category')->load($_category->getId());?>
69
+ <?php //print_r($_category->getData());exit; ?>
70
+ <?php if($_category->getIsActive() && $_category->getName()!=""): ?>
71
+ <option style="margin-left:25px;" value="<?php echo $_category->getId() ?>"><?php echo $_category->getName() ?></option>
72
+ <?php $_subcategories = $_category->getChildrenCategories() ?>
73
+ <?php if (count($_subcategories) > 0): ?>
74
+ <?php foreach($_subcategories as $_subcategory): ?>
75
+ <?php if($_subcategory->getIsActive() && $_subcategory->getName()!=""): ?>
76
+ <option style="margin-left:35px;" value="<?php echo $_subcategory->getId() ?>"><?php echo $_subcategory->getName() ?></option>
77
+ <?php $_subcategorylevel4 = Mage::getModel('catalog/category')->load($_subcategory->getId());?>
78
+ <?php $_level4subcategories = $_subcategorylevel4->getChildrenCategories() ?>
79
+ <?php if (count($_level4subcategories) > 0): ?>
80
+ <?php foreach($_level4subcategories as $_level4subcategory): ?>
81
+ <?php if($_level4subcategory->getIsActive() && $_level4subcategory->getName()!=""): ?>
82
+ <option style="margin-left:45px;" value="<?php echo $_level4subcategory->getId() ?>"><?php echo $_level4subcategory->getName() ?></option>
83
+ <?php endif; ?>
84
+ <?php endforeach; ?>
85
+ <?php endif; ?>
86
+ <?php endif; ?>
87
+ <?php endforeach; ?>
88
+ <?php endif; ?>
89
+ <?php endif; ?>
90
+ <?php endforeach; ?>
91
+ <?php endif; ?>
92
+ </optgroup>
93
+ <?php endforeach;?>
94
+ </optgroup>
95
+ <?php endforeach;?>
96
  </select>
97
  </td>
98
  </tr>
app/design/frontend/{default → base}/default/layout/background.xml RENAMED
File without changes
app/design/frontend/{default → base}/default/template/background/background.phtml RENAMED
File without changes
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cybernetikz_Background</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Upload Unique Background Image for Each CMS &amp; Category Page. Product page will use Category Background Image.</summary>
10
  <description>Background Uploader Magento Extension is made for Store CMS and Category Page Background Image Change. Admin will able to easily change background image for CMS page and Category Page. Admin can upload unique background image. Product page will use there category Background Image.</description>
11
- <notes>Upload Unique Background Image for Each CMS &amp; Category Page. Product page will use Category Background Image.</notes>
12
  <authors><author><name>CyberNetikz</name><user>CyberNetikz</user><email>admin@cybernetikz.com</email></author></authors>
13
- <date>2013-07-19</date>
14
- <time>11:27:44</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Cybernetikz_Background.xml" hash="62fbb8010ada4e672b36101145c5dc5a"/></dir></target><target name="magelocal"><dir name="Cybernetikz"><dir name="Background"><dir name="Block"><file name="Background.php" hash="88a1bc1b72ecc0202444d8d59a162ea4"/></dir><dir name="Helper"><file name="Data.php" hash="ed004387bb74393082e11af95378ab0f"/></dir><dir name="Model"><file name="Background.php" hash="f6fa810151c1d5eccbfaec96f25930d1"/><dir name="Mysql4"><dir name="Background"><file name="Collection.php" hash="2cc15973dcc9aae2339fcd0f3fe5740d"/></dir><file name="Background.php" hash="2659a9da799392f8b96fa8d90440837c"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="MyformController.php" hash="3f899c2edab3ef733a171c2766c1ba33"/></dir></dir><dir name="etc"><file name="config.xml" hash="272c88a1e7002c454ec8cab5f2806516"/></dir><dir name="sql"><dir name="background_setup"><file name="mysql4-install-0.1.0.php" hash="f1342309acacfa446aa81994a2da937e"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="background"><file name="editpage.phtml" hash="8a37ba0e3a6370eb230fb425f33c9a45"/><file name="myform.phtml" hash="0b4623e4a84b7db0cc52ebacd03f4fb5"/><file name="pagemanage.phtml" hash="f79624239b04492ba8c920e9e42ca831"/></dir></dir><dir name="layout"><file name="background.xml" hash="a551cd8c7497c934f18419a9d9df9b7c"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="background.xml" hash="c2df88e1cab087ed24f380be120592a2"/></dir><dir name="template"><dir name="background"><file name="background.phtml" hash="9a3d1b2746d8a0f47f17d4605face331"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cybernetikz_Background</name>
4
+ <version>0.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Upload Unique Background Image for Each CMS &amp; Category Page. Product page will use Category Background Image.</summary>
10
  <description>Background Uploader Magento Extension is made for Store CMS and Category Page Background Image Change. Admin will able to easily change background image for CMS page and Category Page. Admin can upload unique background image. Product page will use there category Background Image.</description>
11
+ <notes>Category pages issue fix. Multiple store category support.</notes>
12
  <authors><author><name>CyberNetikz</name><user>CyberNetikz</user><email>admin@cybernetikz.com</email></author></authors>
13
+ <date>2014-01-08</date>
14
+ <time>09:32:05</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Cybernetikz_Background.xml" hash="62fbb8010ada4e672b36101145c5dc5a"/></dir></target><target name="magelocal"><dir name="Cybernetikz"><dir name="Background"><dir name="Block"><file name="Background.php" hash="88a1bc1b72ecc0202444d8d59a162ea4"/></dir><dir name="Helper"><file name="Data.php" hash="ed004387bb74393082e11af95378ab0f"/></dir><dir name="Model"><file name="Background.php" hash="f6fa810151c1d5eccbfaec96f25930d1"/><dir name="Mysql4"><dir name="Background"><file name="Collection.php" hash="2cc15973dcc9aae2339fcd0f3fe5740d"/></dir><file name="Background.php" hash="2659a9da799392f8b96fa8d90440837c"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="MyformController.php" hash="3f899c2edab3ef733a171c2766c1ba33"/></dir></dir><dir name="etc"><file name="config.xml" hash="6a26d1e3f284be399f80c836a3fea498"/></dir><dir name="sql"><dir name="background_setup"><file name="mysql4-install-0.1.0.php" hash="f1342309acacfa446aa81994a2da937e"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="background"><file name="editpage.phtml" hash="070fa46872e5c9b124b9805c1f1fd8b7"/><file name="myform.phtml" hash="add7de9aaa3400decef3bdbe1d4a1650"/><file name="pagemanage.phtml" hash="f79624239b04492ba8c920e9e42ca831"/></dir></dir><dir name="layout"><file name="background.xml" hash="a551cd8c7497c934f18419a9d9df9b7c"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="background.xml" hash="c2df88e1cab087ed24f380be120592a2"/></dir><dir name="template"><dir name="background"><file name="background.phtml" hash="9a3d1b2746d8a0f47f17d4605face331"/></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>