Cybernetikz_Background - Version 0.5.1

Version Notes

- Small bugs are fixed

Download this release

Release Info

Developer CyberNetikz
Extension Cybernetikz_Background
Version 0.5.1
Comparing to
See all releases


Code changes from version 0.5.0 to 0.5.1

app/code/local/Cybernetikz/Background/Block/Background.php CHANGED
@@ -1,17 +1,20 @@
1
  <?php
2
  class Cybernetikz_Background_Block_Background extends Mage_Core_Block_Template{
3
 
4
- protected $_backgroundCollection = null;
5
-
 
 
6
  protected function _getCollection()
7
  {
8
  $ccontrollername = Mage::app()->getFrontController()->getRequest()->getControllerName();
9
- $cmodulename = Mage::app()->getFrontController()->getRequest()->getModuleName();
10
- $rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
11
 
12
- $collection = Mage::getResourceModel('background/background_collection');
13
  // Check Category / Product Page
14
  if($ccontrollername=='category' || $ccontrollername=="product"){
 
 
 
15
  // Product Page
16
  if($ccontrollername=="product"){
17
  $catId = Mage::getModel('catalog/layer')->getCurrentCategory()->getId();
@@ -49,26 +52,34 @@ class Cybernetikz_Background_Block_Background extends Mage_Core_Block_Template{
49
  $collection->addFieldToFilter('bg_type',"category");
50
 
51
  }
 
 
 
 
 
 
52
  }
53
 
54
  // Check CMS Page
55
  if($cmodulename=="cms"){
56
  $pageId = Mage::getSingleton('cms/page')->getId();
 
57
  $collection->addFieldToFilter('page_id',"{$pageId}");
58
  $collection->addFieldToFilter('bg_type',"{$cmodulename}");
 
 
 
 
59
  }
60
 
61
- $collection->getSelect()->order('id','ASC');
62
-
63
-
64
  // If background not found, check default background
65
- if(!$collection->count() || $collection->count()==0){
66
  $collection = Mage::getResourceModel('background/background_collection');
67
  $collection->addFieldToFilter('page_id',"0");
68
  $collection->addFieldToFilter('bg_type',"default");
69
  $collection->getSelect()->order('id','ASC');
70
  }
71
-
72
  return $collection;
73
 
74
  }
1
  <?php
2
  class Cybernetikz_Background_Block_Background extends Mage_Core_Block_Template{
3
 
4
+ protected $_backgroundCollection = NULL;
5
+
6
+ protected $_backgroundColCount = NULL;
7
+
8
  protected function _getCollection()
9
  {
10
  $ccontrollername = Mage::app()->getFrontController()->getRequest()->getControllerName();
11
+ $cmodulename = Mage::app()->getFrontController()->getRequest()->getModuleName();
 
12
 
 
13
  // Check Category / Product Page
14
  if($ccontrollername=='category' || $ccontrollername=="product"){
15
+ $rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
16
+ $collection = Mage::getResourceModel('background/background_collection');
17
+
18
  // Product Page
19
  if($ccontrollername=="product"){
20
  $catId = Mage::getModel('catalog/layer')->getCurrentCategory()->getId();
52
  $collection->addFieldToFilter('bg_type',"category");
53
 
54
  }
55
+
56
+ $collection->getSelect()->order('id','ASC');
57
+
58
+ // Count Select Bangrounds
59
+ $this->_backgroundColCount = $collection->count();
60
+
61
  }
62
 
63
  // Check CMS Page
64
  if($cmodulename=="cms"){
65
  $pageId = Mage::getSingleton('cms/page')->getId();
66
+ $collection = Mage::getResourceModel('background/background_collection');
67
  $collection->addFieldToFilter('page_id',"{$pageId}");
68
  $collection->addFieldToFilter('bg_type',"{$cmodulename}");
69
+ $collection->getSelect()->order('id','ASC');
70
+
71
+ // Count Select Bangrounds
72
+ $this->_backgroundColCount = $collection->count();
73
  }
74
 
 
 
 
75
  // If background not found, check default background
76
+ if(empty($this->_backgroundColCount) || $this->_backgroundColCount==0){
77
  $collection = Mage::getResourceModel('background/background_collection');
78
  $collection->addFieldToFilter('page_id',"0");
79
  $collection->addFieldToFilter('bg_type',"default");
80
  $collection->getSelect()->order('id','ASC');
81
  }
82
+
83
  return $collection;
84
 
85
  }
app/code/local/Cybernetikz/Background/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Cybernetikz_Background>
5
- <version>0.5.0</version>
6
  </Cybernetikz_Background>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Cybernetikz_Background>
5
+ <version>0.5.1</version>
6
  </Cybernetikz_Background>
7
  </modules>
8
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cybernetikz_Background</name>
4
- <version>0.5.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>
@@ -10,9 +10,9 @@
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>- Small bugs are fixed</notes>
12
  <authors><author><name>CyberNetikz</name><user>CyberNetikz</user><email>admin@cybernetikz.com</email></author></authors>
13
- <date>2015-07-23</date>
14
- <time>13:44:27</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="743483090182143360ea13b8b8ff9717"/></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="BackgroundController.php" hash="91bfd3d9c7e5a43653f4abbe64e2c303"/></dir></dir><dir name="etc"><file name="config.xml" hash="0ac55d5838a4ead309cafdf33d5c8266"/></dir><dir name="sql"><dir name="background_setup"><file name="mysql4-install-0.1.0.php" hash="b887593bb3c2befd1505e424814259b8"/><file name="mysql4-upgrade-0.3.0-0.4.0.php" hash="e79a91e21d6502e1d765b2fe67741d92"/></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="edit.phtml" hash="4926d2872518562a6e047f13c9d2013f"/><file name="grid.phtml" hash="a68fc9fbaab31c0e4c8ec2f5d37ad2dd"/><file name="new.phtml" hash="cfcfc27bad59b7d41f0a001e89efb3f2"/></dir></dir><dir name="layout"><file name="background.xml" hash="69d302cfd97e38315b76c058db238eeb"/></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="ddac4e7f0fe4ef28720d83e4d544c1b9"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="backgroundjs"><file name="jquery-1.10.1.min.js" hash="94ee4d9e6232eda246263c50b469ab4a"/></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.5.1</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>
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>- Small bugs are fixed</notes>
12
  <authors><author><name>CyberNetikz</name><user>CyberNetikz</user><email>admin@cybernetikz.com</email></author></authors>
13
+ <date>2015-07-24</date>
14
+ <time>10:26:18</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="fea7e641f99097a82175d06c1dd45a09"/></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="BackgroundController.php" hash="91bfd3d9c7e5a43653f4abbe64e2c303"/></dir></dir><dir name="etc"><file name="config.xml" hash="0c0483a70f561eaa1301e22cd234aaef"/></dir><dir name="sql"><dir name="background_setup"><file name="mysql4-install-0.1.0.php" hash="b887593bb3c2befd1505e424814259b8"/><file name="mysql4-upgrade-0.3.0-0.4.0.php" hash="e79a91e21d6502e1d765b2fe67741d92"/></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="edit.phtml" hash="4926d2872518562a6e047f13c9d2013f"/><file name="grid.phtml" hash="a68fc9fbaab31c0e4c8ec2f5d37ad2dd"/><file name="new.phtml" hash="cfcfc27bad59b7d41f0a001e89efb3f2"/></dir></dir><dir name="layout"><file name="background.xml" hash="69d302cfd97e38315b76c058db238eeb"/></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="ddac4e7f0fe4ef28720d83e4d544c1b9"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="backgroundjs"><file name="jquery-1.10.1.min.js" hash="94ee4d9e6232eda246263c50b469ab4a"/></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>