Version Notes
Added fix that caused disabled groups to display
Added fix that didn't load an Admin group in a multistore
Auto-set the default template when not set in XML
Download this release
Release Info
Developer | fishpig |
Extension | Fishpigs_iBanners |
Version | 1.0.0 |
Comparing to | |
See all releases |
Code changes from version 0.9.10 to 1.0.0
- app/code/community/Fishpig/IBanners/Block/View.php +17 -1
- app/code/community/Fishpig/IBanners/Model/Group.php +10 -0
- app/code/community/Fishpig/IBanners/Model/Mysql4/Group.php +3 -1
- app/code/community/Fishpig/IBanners/etc/config.xml +1 -1
- app/code/community/Fishpig/IBanners/notes.txt +5 -0
- app/design/frontend/base/default/layout/ibanners.xml +9 -1
- package.xml +9 -7
app/code/community/Fishpig/IBanners/Block/View.php
CHANGED
@@ -44,7 +44,7 @@ class Fishpig_iBanners_Block_View extends Mage_Core_Block_Template
|
|
44 |
|
45 |
$group = Mage::getModel('ibanners/group')->loadByCode($code);
|
46 |
|
47 |
-
if ($group->getId()) {
|
48 |
if (in_array($group->getStoreId(), array(0, Mage::app()->getStore()->getId()))) {
|
49 |
$this->setGroup($group);
|
50 |
$this->setData('group_code', $code);
|
@@ -64,4 +64,20 @@ class Fishpig_iBanners_Block_View extends Mage_Core_Block_Template
|
|
64 |
{
|
65 |
return $this->getGroup()->getBannerCollection();
|
66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
44 |
|
45 |
$group = Mage::getModel('ibanners/group')->loadByCode($code);
|
46 |
|
47 |
+
if ($group->getId() && $group->getIsEnabled()) {
|
48 |
if (in_array($group->getStoreId(), array(0, Mage::app()->getStore()->getId()))) {
|
49 |
$this->setGroup($group);
|
50 |
$this->setData('group_code', $code);
|
64 |
{
|
65 |
return $this->getGroup()->getBannerCollection();
|
66 |
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* If a template isn't passed in the XML, set the default template
|
70 |
+
*
|
71 |
+
* @return Fishpig_iBanners_Block_View
|
72 |
+
*/
|
73 |
+
protected function _beforeToHtml()
|
74 |
+
{
|
75 |
+
parent::_beforeToHtml();
|
76 |
+
|
77 |
+
if (!$this->getTemplate()) {
|
78 |
+
$this->setTemplate('ibanners/default.phtml');
|
79 |
+
}
|
80 |
+
|
81 |
+
return $this;
|
82 |
+
}
|
83 |
}
|
app/code/community/Fishpig/IBanners/Model/Group.php
CHANGED
@@ -24,6 +24,16 @@ class Fishpig_iBanners_Model_Group extends Mage_Core_Model_Abstract
|
|
24 |
return $this->load($code, 'code');
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
* Retrieve a collection of banners associated with this group
|
29 |
*
|
24 |
return $this->load($code, 'code');
|
25 |
}
|
26 |
|
27 |
+
/**
|
28 |
+
* Determine whether the group is enabled
|
29 |
+
*
|
30 |
+
* @return bool
|
31 |
+
*/
|
32 |
+
public function isEnabled()
|
33 |
+
{
|
34 |
+
return $this->getIsEnabled();
|
35 |
+
}
|
36 |
+
|
37 |
/**
|
38 |
* Retrieve a collection of banners associated with this group
|
39 |
*
|
app/code/community/Fishpig/IBanners/Model/Mysql4/Group.php
CHANGED
@@ -26,7 +26,9 @@ class Fishpig_iBanners_Model_Mysql4_Group extends Mage_Core_Model_Mysql4_Abstrac
|
|
26 |
$select = parent::_getLoadSelect($field, $value, $object);
|
27 |
|
28 |
if (!Mage::app()->isSingleStoreMode() && Mage::app()->getStore()->getId() > 0) {
|
29 |
-
$select->where('store_id
|
|
|
|
|
30 |
}
|
31 |
|
32 |
return $select;
|
26 |
$select = parent::_getLoadSelect($field, $value, $object);
|
27 |
|
28 |
if (!Mage::app()->isSingleStoreMode() && Mage::app()->getStore()->getId() > 0) {
|
29 |
+
$select->where('store_id IN (?)', array(0, Mage::app()->getStore()->getId()))
|
30 |
+
->order('store_id DESC')
|
31 |
+
->limit(1);
|
32 |
}
|
33 |
|
34 |
return $select;
|
app/code/community/Fishpig/IBanners/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fishpig_iBanners>
|
5 |
-
<version>0.
|
6 |
</Fishpig_iBanners>
|
7 |
</modules>
|
8 |
<global>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Fishpig_iBanners>
|
5 |
+
<version>1.0.0</version>
|
6 |
</Fishpig_iBanners>
|
7 |
</modules>
|
8 |
<global>
|
app/code/community/Fishpig/IBanners/notes.txt
CHANGED
@@ -11,6 +11,11 @@ TODO
|
|
11 |
- Add inner div to template
|
12 |
- Check all options are overridable
|
13 |
|
|
|
|
|
|
|
|
|
|
|
14 |
20/02/2012 - v0.9.10
|
15 |
- Added url_target field to specify target for banner links
|
16 |
|
11 |
- Add inner div to template
|
12 |
- Check all options are overridable
|
13 |
|
14 |
+
20/02/2012 - 1.0.0
|
15 |
+
- Added fix that caused disabled groups to display
|
16 |
+
- Added fix that didn't load an Admin group in a multistore
|
17 |
+
- Auto-set the default template when not set in XML
|
18 |
+
|
19 |
20/02/2012 - v0.9.10
|
20 |
- Added url_target field to specify target for banner links
|
21 |
|
app/design/frontend/base/default/layout/ibanners.xml
CHANGED
@@ -4,6 +4,10 @@
|
|
4 |
<!--
|
5 |
/**
|
6 |
* Use this handle to include the CSS and JavaScript files needed to display the banner group
|
|
|
|
|
|
|
|
|
7 |
*/
|
8 |
-->
|
9 |
<ibanners_default>
|
@@ -17,12 +21,16 @@
|
|
17 |
/**
|
18 |
* The cms_index_index block below injects the banner group with the code 'home'
|
19 |
* into the homepage
|
|
|
|
|
|
|
|
|
20 |
*/
|
21 |
-->
|
22 |
<cms_index_index>
|
23 |
<update handle="ibanners_default" />
|
24 |
<reference name="content">
|
25 |
-
<block type="ibanners/view" name="ibanners.homepage" before="-"
|
26 |
<action method="setGroupCode"><group_code>home</group_code></action>
|
27 |
</block>
|
28 |
</reference>
|
4 |
<!--
|
5 |
/**
|
6 |
* Use this handle to include the CSS and JavaScript files needed to display the banner group
|
7 |
+
* To include these on a page, add the following to your XML
|
8 |
+
*
|
9 |
+
* <update handle="ibanners_default" />
|
10 |
+
*
|
11 |
*/
|
12 |
-->
|
13 |
<ibanners_default>
|
21 |
/**
|
22 |
* The cms_index_index block below injects the banner group with the code 'home'
|
23 |
* into the homepage
|
24 |
+
*
|
25 |
+
* To include other banner groups, copy the block code
|
26 |
+
* To include the JS/CSS on a page, ensure you include the <update handle line
|
27 |
+
*
|
28 |
*/
|
29 |
-->
|
30 |
<cms_index_index>
|
31 |
<update handle="ibanners_default" />
|
32 |
<reference name="content">
|
33 |
+
<block type="ibanners/view" name="ibanners.homepage" before="-">
|
34 |
<action method="setGroupCode"><group_code>home</group_code></action>
|
35 |
</block>
|
36 |
</reference>
|
package.xml
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fishpigs_iBanners</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://fishpig.co.uk/license.txt">FishPig EULA</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Create multiple banner slideshows for your site.</summary>
|
10 |
<description>Create multiple banner slideshows for your site.</description>
|
11 |
-
<notes>Added
|
12 |
-
|
13 |
-
|
14 |
-
<
|
15 |
-
<
|
|
|
|
|
16 |
<compatible/>
|
17 |
-
<dependencies
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fishpigs_iBanners</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://fishpig.co.uk/license.txt">FishPig EULA</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Create multiple banner slideshows for your site.</summary>
|
10 |
<description>Create multiple banner slideshows for your site.</description>
|
11 |
+
<notes>Added fix that caused disabled groups to display
|
12 |
+
Added fix that didn't load an Admin group in a multistore
|
13 |
+
Auto-set the default template when not set in XML</notes>
|
14 |
+
<authors><author><name>fishpig</name><user>fishpig</user><email>ben@fishpig.co.uk</email></author></authors>
|
15 |
+
<date>2012-07-20</date>
|
16 |
+
<time>09:57:30</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Fishpig"><dir name="IBanners"><dir name="Block"><dir name="Adminhtml"><dir name="Banner"><dir name="Edit"><file name="Form.php" hash="e9cd0d7436d36048706bc474704d2b82"/><dir name="Tab"><file name="Form.php" hash="a6ab04d3bb183e32935e3e285fbdabd5"/></dir><file name="Tabs.php" hash="60a82a390e8580594885bceb19a13460"/></dir><file name="Edit.php" hash="93807e5b677fd064e49c547551507202"/><file name="Grid.php" hash="59ca8a1c3822e37f1e82f464589f6525"/><dir name="Helper"><file name="Image.php" hash="da1821e82b38af686705efb53f5a1ca9"/></dir></dir><file name="Banner.php" hash="181c9778d624e104ab3f8e729c58b3f7"/><dir name="Form"><dir name="Renderer"><file name="Useconfig.php" hash="df579ff6a4a783ed17d6c5bc6118e171"/></dir></dir><dir name="Group"><dir name="Edit"><file name="Form.php" hash="5b8f4f8649e974f80ea21de7f323788e"/><dir name="Tab"><file name="Banners.php" hash="f13f72d714e73ba5481fe488b369c879"/><file name="Form.php" hash="4f04a01fc20940b8b82674e58d7bc54c"/></dir><file name="Tabs.php" hash="d57a68d75dde73b39127dc8a932b858e"/></dir><file name="Edit.php" hash="1f3ca94777f0eb8a3363d245d9c5bc9d"/><file name="Grid.php" hash="2d86e326cb6825c8e7738e5c73abaf67"/></dir><file name="Group.php" hash="6a6ea8ad3f9e1e25dcf0411fa5347b9c"/></dir><file name="View.php" hash="6c2c4206a64edeca55ff69fcc156a43f"/></dir><dir name="Helper"><file name="Data.php" hash="22b6c9355bb8eeb8bab400a824109e24"/><file name="Image.php" hash="92a06beda3aefa58577dd91556001115"/></dir><dir name="Model"><file name="Banner.php" hash="e734cbb06eb312cb64022f286c0b1898"/><file name="Group.php" hash="59745784f90b527b67563fc72c41970b"/><dir name="Mysql4"><dir name="Banner"><file name="Collection.php" hash="511a3aceff96f430a5fa44a3a7ff2b05"/></dir><file name="Banner.php" hash="81752a0ab34bde996d9472ac67272472"/><dir name="Group"><file name="Collection.php" hash="ab6a49e01708c118052a696a0e09184c"/></dir><file name="Group.php" hash="65169f143695653cafa08a3aeca28904"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Carousel"><file name="Effect.php" hash="b615ef28aa59aed914dd95a0242cfc9e"/><file name="Transition.php" hash="290f6abe41d0d44f72f8188a77f8e475"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannerController.php" hash="ab4015467f0f37f0cedbb344d3021e8f"/><file name="GroupController.php" hash="f58f269a86c211095314b1f41f212ffa"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="3c83bfafc6ce3e5306ebae43dec8dccf"/><file name="config.xml" hash="ef0eac844d82b8de3fbecaee2939f6bf"/><file name="system.xml" hash="85021826efbb902f94043a1f05197244"/></dir><file name="license.txt" hash="257eae92a36bdaaf9584fbf8ba76d1c6"/><file name="notes.txt" hash="7b7332230167354edd32be3366701668"/><dir name="sql"><dir name="ibanners_setup"><file name="mysql4-install-0.1.0.php" hash="62e4961272f2d697595002b006e72731"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="2e85887fb121d988357a45785d9f06df"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="a16fd4c674ed65eed1c7cee851960d28"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="a002305ec4b958c7213309d874b349f8"/><file name="mysql4-upgrade-0.9.0-0.9.1.php" hash="b970018526e15b6fc938b1866c5bfd81"/><file name="mysql4-upgrade-0.9.1-0.9.2.php" hash="07ba18c243e573655e43c64ee1a0d876"/><file name="mysql4-upgrade-0.9.9-0.9.10.php" hash="2b8b4dcc3770402b167a0a2140beeaf7"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ibanners.xml" hash="daa28ce83b6f288108c87bc352475ca8"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ibanners.xml" hash="ce05f77e53a1af3beb9600130360f0ce"/></dir><dir name="template"><dir name="ibanners"><file name="default.phtml" hash="b9e098e514320f8a0d9af03490a47131"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="fishpig"><file name="carousel.min.js" hash="cfd7a8d08a6dca87e4211a400877716e"/></dir></dir><dir name="app"><dir name="etc"><dir name="modules"><file name="Fishpig_iBanners.xml" hash="d3476db8a3f950a7bf249b5382b5c42e"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="ibanners.css" hash="6bdf6ea79a22cb035d41f1f37b7d6a11"/></dir></dir></dir></dir></target></contents>
|
18 |
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|