Fishpigs_iBanners - Version 1.0.2

Version Notes

Added option to add controls to slideshow

Download this release

Release Info

Developer fishpig
Extension Fishpigs_iBanners
Version 1.0.2
Comparing to
See all releases


Code changes from version 1.0.1 to 1.0.2

app/code/community/Fishpig/IBanners/Block/View.php CHANGED
@@ -31,7 +31,31 @@ class Fishpig_iBanners_Block_View extends Mage_Core_Block_Template
31
 
32
  return $this->_getData('wrapper_id');
33
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
 
 
 
 
 
 
 
 
 
 
35
  /**
36
  * Set the group code
37
  * The group code is validated before being set
31
 
32
  return $this->_getData('wrapper_id');
33
  }
34
+
35
+ /**
36
+ * Retrieve the ID used for the wrapper div
37
+ *
38
+ * @return string
39
+ */
40
+ public function getWrapperClass()
41
+ {
42
+ if (!$this->hasWrapperClass()) {
43
+ $this->setWrapperClass('ibanners-wrapper');
44
+ }
45
+
46
+ return $this->_getData('wrapper_class');
47
+ }
48
 
49
+ /**
50
+ * Determine whether to display the controls
51
+ *
52
+ * @return bool
53
+ */
54
+ public function canDisplayControls()
55
+ {
56
+ return $this->getDisplayControls() == '1';
57
+ }
58
+
59
  /**
60
  * Set the group code
61
  * The group code is validated before being set
app/code/community/Fishpig/IBanners/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Fishpig_iBanners>
5
- <version>1.0.1</version>
6
  </Fishpig_iBanners>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Fishpig_iBanners>
5
+ <version>1.0.2</version>
6
  </Fishpig_iBanners>
7
  </modules>
8
  <global>
app/code/community/Fishpig/IBanners/notes.txt CHANGED
@@ -11,6 +11,9 @@ TODO
11
  - Add inner div to template
12
  - Check all options are overridable
13
 
 
 
 
14
  14/08/2012 - 1.0.1
15
  - Added ability to add custom wrapper ID and class
16
 
11
  - Add inner div to template
12
  - Check all options are overridable
13
 
14
+ 14/08/2012 - 1.0.2
15
+ - Added option to add controls to slideshow
16
+
17
  14/08/2012 - 1.0.1
18
  - Added ability to add custom wrapper ID and class
19
 
app/design/frontend/base/default/template/ibanners/default.phtml CHANGED
@@ -25,48 +25,62 @@
25
  <?php endforeach; ?>
26
  </div>
27
  <?php elseif ($this->getGroup()->getBannerCount() > 1): ?>
28
- <div id="<?php echo $this->getWrapperId() ?>" class="ibanners <?php if ($group->isAnimationEnabled()): ?>animated<?php else: ?>static<?php endif; ?> <?php echo $this->getWrapperClass() ?>">
29
- <ul>
30
- <?php foreach($banners as $banner): ?>
31
- <li id="ibanner-<?php echo $banner->getId() ?>" class="banner">
32
- <?php if ($banner->getImageUrl()): ?>
33
- <?php if ($banner->hasUrl()): ?>
34
- <a href="<?php echo $banner->getUrl() ?>" title="<?php echo $this->escapeHtml($banner->getTitle()) ?>"<?php if ($banner->getUrlTarget()): ?> target="<?php echo $banner->getUrlTarget() ?>"<?php endif; ?>>
 
 
 
 
 
 
35
  <?php endif; ?>
36
- <img src="<?php echo $banner->getImageUrl() ?>" alt="<?php echo $this->escapeHtml($banner->getAltText()) ?>" />
37
- <?php if ($banner->hasUrl()): ?>
38
- </a>
39
  <?php endif; ?>
40
- <?php endif; ?>
41
- <?php if ($banner->getHtml()): ?>
42
- <div class="html"><?php echo $banner->getHtml() ?></div>
43
- <?php endif; ?>
44
- </li>
45
- <?php endforeach; ?>
46
- <?php if ($group->isAnimationEnabled() && $this->getGroup()->getCarouselEffect() != 'fade'): ?>
47
- <?php
48
- /**
49
- * When using the scroll effect, the first slide must be duplicated at the end of the slide list
50
- * This ensures a smooth scrolling action when moving between the last and first slide
51
- */
52
- ?>
53
- <?php $banner = $banners->getFirstItem() ?>
54
- <li id="ibanner-<?php echo $banner->getId() ?>-2" class="banner">
55
- <?php if ($banner->getImageUrl()): ?>
56
- <?php if ($banner->hasUrl()): ?>
57
- <a href="<?php echo $banner->getUrl() ?>" title="<?php echo $this->escapeHtml($banner->getTitle()) ?>"<?php if ($banner->getUrlTarget()): ?> target="<?php echo $banner->getUrlTarget() ?>"<?php endif; ?>>
 
58
  <?php endif; ?>
59
- <img src="<?php echo $banner->getImageUrl() ?>" alt="<?php echo $this->escapeHtml($banner->getAltText()) ?>" />
60
- <?php if ($banner->hasUrl()): ?>
61
- </a>
62
  <?php endif; ?>
63
- <?php endif; ?>
64
- <?php if ($banner->getHtml()): ?>
65
- <div class="html"><?php echo $banner->getHtml() ?></div>
66
- <?php endif; ?>
67
- </li>
 
 
 
 
 
 
 
 
 
68
  <?php endif; ?>
69
- </ul>
70
  </div>
71
  <?php if ($group->isAnimationEnabled() && $group->getBannerCount() > $group->getCarouselVisibleSlides()): ?>
72
  <script type="text/javascript">
@@ -81,7 +95,7 @@
81
  $('<?php echo $this->getWrapperId() ?>').scrollLeft = 0;
82
  $('<?php echo $this->getWrapperId() ?>').scrollTop = 0;
83
 
84
- new Carousel('<?php echo $this->getWrapperId() ?>', $('<?php echo $this->getWrapperId() ?>').select('li.banner'), $('<?php echo $this->getWrapperId() ?>').select('.ibanner-control'), {
85
  duration: <?php echo $group->getCarouselDuration() ?>,
86
  auto: <?php if ($group->getCarouselAuto()): ?>true<?php else: ?>false<?php endif; ?>,
87
  frequency: <?php echo $group->getCarouselFrequency() ?>,
25
  <?php endforeach; ?>
26
  </div>
27
  <?php elseif ($this->getGroup()->getBannerCount() > 1): ?>
28
+ <div id="<?php echo $this->getWrapperId() ?>-wrapper" class="<?php echo $this->getWrapperClass() ?>">
29
+ <div id="<?php echo $this->getWrapperId() ?>" class="ibanners <?php if ($group->isAnimationEnabled()): ?>animated<?php else: ?>static<?php endif; ?>">
30
+ <ul>
31
+ <?php foreach($banners as $banner): ?>
32
+ <li id="ibanner-<?php echo $banner->getId() ?>" class="banner">
33
+ <?php if ($banner->getImageUrl()): ?>
34
+ <?php if ($banner->hasUrl()): ?>
35
+ <a href="<?php echo $banner->getUrl() ?>" title="<?php echo $this->escapeHtml($banner->getTitle()) ?>"<?php if ($banner->getUrlTarget()): ?> target="<?php echo $banner->getUrlTarget() ?>"<?php endif; ?>>
36
+ <?php endif; ?>
37
+ <img src="<?php echo $banner->getImageUrl() ?>" alt="<?php echo $this->escapeHtml($banner->getAltText()) ?>" />
38
+ <?php if ($banner->hasUrl()): ?>
39
+ </a>
40
+ <?php endif; ?>
41
  <?php endif; ?>
42
+ <?php if ($banner->getHtml()): ?>
43
+ <div class="html"><?php echo $banner->getHtml() ?></div>
 
44
  <?php endif; ?>
45
+ </li>
46
+ <?php endforeach; ?>
47
+ <?php if ($group->isAnimationEnabled() && $this->getGroup()->getCarouselEffect() != 'fade'): ?>
48
+ <?php
49
+ /**
50
+ * When using the scroll effect, the first slide must be duplicated at the end of the slide list
51
+ * This ensures a smooth scrolling action when moving between the last and first slide
52
+ */
53
+ ?>
54
+ <?php $banner = $banners->getFirstItem() ?>
55
+ <li id="ibanner-<?php echo $banner->getId() ?>-2" class="banner">
56
+ <?php if ($banner->getImageUrl()): ?>
57
+ <?php if ($banner->hasUrl()): ?>
58
+ <a href="<?php echo $banner->getUrl() ?>" title="<?php echo $this->escapeHtml($banner->getTitle()) ?>"<?php if ($banner->getUrlTarget()): ?> target="<?php echo $banner->getUrlTarget() ?>"<?php endif; ?>>
59
+ <?php endif; ?>
60
+ <img src="<?php echo $banner->getImageUrl() ?>" alt="<?php echo $this->escapeHtml($banner->getAltText()) ?>" />
61
+ <?php if ($banner->hasUrl()): ?>
62
+ </a>
63
+ <?php endif; ?>
64
  <?php endif; ?>
65
+ <?php if ($banner->getHtml()): ?>
66
+ <div class="html"><?php echo $banner->getHtml() ?></div>
 
67
  <?php endif; ?>
68
+ </li>
69
+ <?php endif; ?>
70
+ </ul>
71
+ </div>
72
+ <?php if ($group->isAnimationEnabled() && $group->getBannerCount() > $group->getCarouselVisibleSlides()): ?>
73
+ <?php if ($this->canDisplayControls()): ?>
74
+ <div class="controls">
75
+ <div class="control-prev">
76
+ <a href="#" class="carousel-control" rel="prev"><?php echo $this->__('Previous') ?></a>
77
+ </div>
78
+ <div class="control-next">
79
+ <a href="#" class="carousel-control" rel="next"><?php echo $this->__('Next') ?></a>
80
+ </div>
81
+ </div>
82
  <?php endif; ?>
83
+ <?php endif; ?>
84
  </div>
85
  <?php if ($group->isAnimationEnabled() && $group->getBannerCount() > $group->getCarouselVisibleSlides()): ?>
86
  <script type="text/javascript">
95
  $('<?php echo $this->getWrapperId() ?>').scrollLeft = 0;
96
  $('<?php echo $this->getWrapperId() ?>').scrollTop = 0;
97
 
98
+ new Carousel('<?php echo $this->getWrapperId() ?>', $('<?php echo $this->getWrapperId() ?>').select('li.banner'), $('<?php echo $this->getWrapperId() ?>-wrapper').select('.carousel-control'), {
99
  duration: <?php echo $group->getCarouselDuration() ?>,
100
  auto: <?php if ($group->getCarouselAuto()): ?>true<?php else: ?>false<?php endif; ?>,
101
  frequency: <?php echo $group->getCarouselFrequency() ?>,
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Fishpigs_iBanners</name>
4
- <version>1.0.1</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 ability to add custom wrapper ID and class</notes>
12
  <authors><author><name>fishpig</name><user>fishpig</user><email>ben@fishpig.co.uk</email></author></authors>
13
  <date>2012-08-14</date>
14
- <time>10:50:21</time>
15
- <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="73172d40331c5663258eb5754566beff"/></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="658847d327becc80bf8b271c173f1cad"/><file name="system.xml" hash="85021826efbb902f94043a1f05197244"/></dir><file name="license.txt" hash="257eae92a36bdaaf9584fbf8ba76d1c6"/><file name="notes.txt" hash="4ff0dba710d72fef5b8b5e4c85da4680"/><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="6628e8d150a86239987c431c0d8612de"/></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>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Fishpigs_iBanners</name>
4
+ <version>1.0.2</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 option to add controls to slideshow</notes>
12
  <authors><author><name>fishpig</name><user>fishpig</user><email>ben@fishpig.co.uk</email></author></authors>
13
  <date>2012-08-14</date>
14
+ <time>13:43:55</time>
15
+ <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="72c9e06a196daca2daadf5831a2d018e"/></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="4af326144cad7cf3426ea171da135121"/><file name="system.xml" hash="85021826efbb902f94043a1f05197244"/></dir><file name="license.txt" hash="257eae92a36bdaaf9584fbf8ba76d1c6"/><file name="notes.txt" hash="9493a7e0e3f577121e9196fa8e122e7d"/><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="5f39c18ee0c889baf08e092e3eeb55e2"/></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>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>