Fishpigs_iBanners - Version 1.0.6

Version Notes

Added dynamic controls that can be activated via the group
Removed group animation settings from config

Download this release

Release Info

Developer fishpig
Extension Fishpigs_iBanners
Version 1.0.6
Comparing to
See all releases


Code changes from version 1.0.4 to 1.0.6

app/code/community/Fishpig/IBanners/Block/Adminhtml/Group/Edit/Tab/Form.php CHANGED
@@ -113,25 +113,30 @@ class Fishpig_iBanners_Block_Adminhtml_Group_Edit_Tab_Form extends Mage_Adminhtm
113
  'label' => $this->__('Transition'),
114
  'values' => Mage::getModel('ibanners/system_config_source_carousel_transition')->toOptionArray(),
115
  ));
116
-
117
- $elementJs = "<script type=\"text/javascript\">
118
- if(\$('" . $form->getHtmlIdPrefix() . "carousel_animate').getValue() == '0') {\$('" . $form->getHtmlIdPrefix() . "%s').up('tr').hide();}\$('" . $form->getHtmlIdPrefix() . "carousel_animate').observe('change', function(event) {var carouselAnimate = Event.element(event);if (carouselAnimate.getValue() == '1') {\$('" . $form->getHtmlIdPrefix() . "%s').up('tr').show();}else {\$('" . $form->getHtmlIdPrefix() . "%s').up('tr').hide();}});
119
- </script>";
120
-
121
-
122
- foreach($fieldset->getElements() as $id => $elem) {
123
- if ($elem->getId() != 'carousel_animate' && $element = $form->getElement($elem->getId())) {
124
- $element->setRenderer(
125
- $this->getLayout()->createBlock('ibanners/adminhtml_form_renderer_useconfig')
126
- );
127
-
128
- $element->getRenderer()->setElementJs(sprintf($elementJs, $element->getId(), $element->getId(), $element->getId()));
129
- }
130
- }
 
 
131
 
132
  if ($group = Mage::registry('ibanners_group')) {
133
  $form->setValues($group->getData());
134
  }
 
 
 
135
 
136
  return parent::_prepareForm();
137
  }
113
  'label' => $this->__('Transition'),
114
  'values' => Mage::getModel('ibanners/system_config_source_carousel_transition')->toOptionArray(),
115
  ));
116
+
117
+ $fieldset = $form->addFieldset('group_controls', array('legend'=> $this->__('Controls')));
118
+
119
+ $fieldset->addField('controls_position', 'select', array(
120
+ 'name' => 'controls_position',
121
+ 'title' => $this->__('Position'),
122
+ 'label' => $this->__('Position'),
123
+ 'values' => Mage::getModel('ibanners/system_config_source_controls_position')->toOptionArray(),
124
+ ));
125
+
126
+ $fieldset->addField('controls_overlap', 'select', array(
127
+ 'name' => 'controls_overlap',
128
+ 'title' => $this->__('Overlap'),
129
+ 'label' => $this->__('Overlap'),
130
+ 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray(),
131
+ 'note' => $this->__('If yes, the controls will be positioned half inside the banner and half outside.'),
132
+ ));
133
 
134
  if ($group = Mage::registry('ibanners_group')) {
135
  $form->setValues($group->getData());
136
  }
137
+ else {
138
+ $form->setValues(Mage::getModel('ibanners/group')->getAnimationData());
139
+ }
140
 
141
  return parent::_prepareForm();
142
  }
app/code/community/Fishpig/IBanners/Block/View.php CHANGED
@@ -15,9 +15,30 @@ class Fishpig_iBanners_Block_View extends Mage_Core_Block_Template
15
  */
16
  public function hasValidGroup()
17
  {
18
- return is_object($this->getGroup());
 
 
 
 
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  /**
22
  * Retrieve the ID used for the wrapper div
23
  *
@@ -45,15 +66,20 @@ class Fishpig_iBanners_Block_View extends Mage_Core_Block_Template
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
  /**
15
  */
16
  public function hasValidGroup()
17
  {
18
+ if ($this->helper('ibanners')->isEnabled()) {
19
+ return is_object($this->getGroup());
20
+ }
21
+
22
+ return false;
23
  }
24
 
25
+ /**
26
+ * Determine whether the group requires animation
27
+ *
28
+ * @return bool
29
+ */
30
+ public function canAnimate()
31
+ {
32
+ if ($this->hasValidGroup()) {
33
+ $group = $this->getGroup();
34
+
35
+ return $group->isAnimationEnabled()
36
+ && $group->getBannerCount() > $group->getCarouselVisibleSlides();
37
+ }
38
+
39
+ return false;
40
+ }
41
+
42
  /**
43
  * Retrieve the ID used for the wrapper div
44
  *
66
 
67
  return $this->_getData('wrapper_class');
68
  }
69
+
70
  /**
71
+ * Retrieve the position of the controls (previous/next buttons)
72
+ * If an empty string is returned, do not show controls
73
  *
74
+ * @return string
75
  */
76
+ public function getControlsPosition()
77
  {
78
+ if (!$this->hasControlsPosition()) {
79
+ $this->setControlsPosition($this->getGroup()->getControlsPosition());
80
+ }
81
+
82
+ return $this->_getData('controls_position');
83
  }
84
 
85
  /**
app/code/community/Fishpig/IBanners/Helper/Data.php CHANGED
@@ -9,5 +9,13 @@
9
 
10
  class Fishpig_iBanners_Helper_Data extends Mage_Core_Helper_Abstract
11
  {
12
-
 
 
 
 
 
 
 
 
13
  }
9
 
10
  class Fishpig_iBanners_Helper_Data extends Mage_Core_Helper_Abstract
11
  {
12
+ /**
13
+ * Determine whether the extension is enabled
14
+ *
15
+ * @return bool
16
+ */
17
+ public function isEnabled()
18
+ {
19
+ return Mage::getStoreConfig('ibanners/settings/enabled');
20
+ }
21
  }
app/code/community/Fishpig/IBanners/Model/Group.php CHANGED
@@ -45,7 +45,7 @@ class Fishpig_iBanners_Model_Group extends Mage_Core_Model_Abstract
45
  $this->setBannerCollection($this->getResource()->getBannerCollection($this));
46
  }
47
 
48
- return $this->getData('banner_collection');
49
  }
50
 
51
  /**
@@ -59,7 +59,7 @@ class Fishpig_iBanners_Model_Group extends Mage_Core_Model_Abstract
59
  $this->setBannerCount($this->getBannerCollection()->count());
60
  }
61
 
62
- return $this->getData('banner_count');
63
  }
64
 
65
  /**
@@ -79,12 +79,11 @@ class Fishpig_iBanners_Model_Group extends Mage_Core_Model_Abstract
79
  */
80
  public function getCarouselDuration()
81
  {
82
- if (!$this->getData('carousel_duration')) {
83
- $duration = (int)Mage::getStoreConfig('ibanners/carousel/duration');
84
- $this->setCarouselDuration($duration > 0 ? $duration : 1);
85
  }
86
 
87
- return (int)$this->getData('carousel_duration');
88
  }
89
 
90
  /**
@@ -94,12 +93,11 @@ class Fishpig_iBanners_Model_Group extends Mage_Core_Model_Abstract
94
  */
95
  public function getCarouselAuto()
96
  {
97
- if ($this->getData('carousel_auto') == '') {
98
- $duration = (int)Mage::getStoreConfig('ibanners/carousel/auto');
99
- $this->setCarouselAuto($duration ? 1 : 0);
100
  }
101
 
102
- return (int)$this->getData('carousel_auto');
103
  }
104
 
105
  /**
@@ -109,12 +107,11 @@ class Fishpig_iBanners_Model_Group extends Mage_Core_Model_Abstract
109
  */
110
  public function getCarouselFrequency()
111
  {
112
- if (!$this->getData('carousel_frequency')) {
113
- $frequency = (int)Mage::getStoreConfig('ibanners/carousel/frequency');
114
- $this->setCarouselFrequency($frequency > 1 ? $frequency : 8);
115
  }
116
 
117
- return (int)$this->getData('carousel_frequency');
118
  }
119
 
120
  /**
@@ -124,12 +121,11 @@ class Fishpig_iBanners_Model_Group extends Mage_Core_Model_Abstract
124
  */
125
  public function getCarouselVisibleSlides()
126
  {
127
- if (!$this->getData('carousel_visible_slides')) {
128
- $visibleSlides = (int)Mage::getStoreConfig('ibanners/carousel/visible_slides');
129
- $this->setCarouselVisibleSlides($visibleSlides > 0 ? $visibleSlides : 1);
130
  }
131
 
132
- return (int)$this->getData('carousel_visible_slides');
133
  }
134
 
135
  /**
@@ -140,11 +136,11 @@ class Fishpig_iBanners_Model_Group extends Mage_Core_Model_Abstract
140
  */
141
  public function getCarouselEffect()
142
  {
143
- if (!$this->getData('carousel_effect')) {
144
- $this->setCarouselEffect(Mage::getStoreConfig('ibanners/carousel/effect'));
145
  }
146
 
147
- return $this->getData('carousel_effect');
148
  }
149
 
150
  /**
@@ -155,10 +151,29 @@ class Fishpig_iBanners_Model_Group extends Mage_Core_Model_Abstract
155
  */
156
  public function getCarouselTransition()
157
  {
158
- if (!$this->getData('carousel_transition')) {
159
- $this->setCarouselTransition(Mage::getStoreConfig('ibanners/carousel/transition'));
160
  }
161
 
162
- return $this->getData('carousel_transition');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  }
164
  }
45
  $this->setBannerCollection($this->getResource()->getBannerCollection($this));
46
  }
47
 
48
+ return $this->_getData('banner_collection');
49
  }
50
 
51
  /**
59
  $this->setBannerCount($this->getBannerCollection()->count());
60
  }
61
 
62
+ return $this->_getData('banner_count');
63
  }
64
 
65
  /**
79
  */
80
  public function getCarouselDuration()
81
  {
82
+ if (!$this->_getData('carousel_duration')) {
83
+ $this->setCarouselDuration(1);
 
84
  }
85
 
86
+ return (int)$this->_getData('carousel_duration');
87
  }
88
 
89
  /**
93
  */
94
  public function getCarouselAuto()
95
  {
96
+ if ($this->_getData('carousel_auto') == '') {
97
+ $this->setCarouselAuto(1);
 
98
  }
99
 
100
+ return (int)$this->_getData('carousel_auto');
101
  }
102
 
103
  /**
107
  */
108
  public function getCarouselFrequency()
109
  {
110
+ if (!$this->_getData('carousel_frequency')) {
111
+ $this->setCarouselFrequency(8);
 
112
  }
113
 
114
+ return (int)$this->_getData('carousel_frequency');
115
  }
116
 
117
  /**
121
  */
122
  public function getCarouselVisibleSlides()
123
  {
124
+ if (!$this->_getData('carousel_visible_slides')) {
125
+ $this->setCarouselVisibleSlides(1);
 
126
  }
127
 
128
+ return (int)$this->_getData('carousel_visible_slides');
129
  }
130
 
131
  /**
136
  */
137
  public function getCarouselEffect()
138
  {
139
+ if (!$this->_getData('carousel_effect')) {
140
+ $this->setCarouselEffect('scroll');
141
  }
142
 
143
+ return $this->_getData('carousel_effect');
144
  }
145
 
146
  /**
151
  */
152
  public function getCarouselTransition()
153
  {
154
+ if (!$this->_getData('carousel_transition')) {
155
+ $this->setCarouselTransition('sinoidal');
156
  }
157
 
158
+ return $this->_getData('carousel_transition');
159
+ }
160
+
161
+ /**
162
+ * Retrieve animation data
163
+ * This is used to popular the Adminhtml form
164
+ *
165
+ * @return array
166
+ */
167
+ public function getAnimationData()
168
+ {
169
+ return array(
170
+ 'carousel_animate' => (int)$this->isAnimationEnabled(),
171
+ 'carousel_duration' => $this->getCarouselDuration(),
172
+ 'carousel_auto' => $this->getCarouselAuto(),
173
+ 'carousel_frequency' => $this->getCarouselFrequency(),
174
+ 'carousel_visible_slides' => $this->getCarouselVisibleSlides(),
175
+ 'carousel_effect' => $this->getCarouselEffect(),
176
+ 'carousel_transition' => $this->getCarouselTransition(),
177
+ );
178
  }
179
  }
app/code/community/Fishpig/IBanners/Model/System/Config/Source/Controls/Position.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_iBanners
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ class Fishpig_iBanners_Model_System_Config_Source_Controls_Position
10
+ {
11
+ /**
12
+ * Retrieve an array of possible options
13
+ *
14
+ * @return array
15
+ */
16
+ public function toOptionArray($includeEmpty = false, $emptyText = '-- Please Select --')
17
+ {
18
+ $options = array();
19
+
20
+ if ($includeEmpty) {
21
+ $options[] = array(
22
+ 'value' => '',
23
+ 'label' => Mage::helper('adminhtml')->__($emptyText),
24
+ );
25
+ }
26
+
27
+ foreach($this->getOptions() as $value => $label) {
28
+ $options[] = array(
29
+ 'value' => $value,
30
+ 'label' => Mage::helper('adminhtml')->__($label),
31
+ );
32
+ }
33
+
34
+ return $options;
35
+ }
36
+
37
+ /**
38
+ * Retrieve an array of possible options
39
+ *
40
+ * @return array
41
+ */
42
+ public function getOptions()
43
+ {
44
+ return array(
45
+ '' => 'None',
46
+ 'top' => 'Top',
47
+ 'middle' => 'Middle',
48
+ 'bottom' => 'Bottom',
49
+ 'below' => 'Below',
50
+ );
51
+ }
52
+ }
app/code/community/Fishpig/IBanners/controllers/Adminhtml/BannerController.php CHANGED
@@ -40,8 +40,22 @@ class Fishpig_iBanners_Adminhtml_BannerController extends Mage_Adminhtml_Control
40
  */
41
  public function editAction()
42
  {
43
- $this->_initBannerModel();
44
  $this->loadLayout();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  $this->renderLayout();
46
  }
47
 
40
  */
41
  public function editAction()
42
  {
43
+ $banner = $this->_initBannerModel();
44
  $this->loadLayout();
45
+
46
+ if ($headBlock = $this->getLayout()->getBlock('head')) {
47
+ $titles = array('iBanners by FishPig');
48
+
49
+ if ($banner) {
50
+ array_unshift($titles, $banner->getTitle());
51
+ }
52
+ else {
53
+ array_unshift($titles, 'Create a Banner');
54
+ }
55
+
56
+ $headBlock->setTitle(implode(' - ', $titles));
57
+ }
58
+
59
  $this->renderLayout();
60
  }
61
 
app/code/community/Fishpig/IBanners/controllers/Adminhtml/GroupController.php CHANGED
@@ -40,8 +40,23 @@ class Fishpig_iBanners_Adminhtml_GroupController extends Mage_Adminhtml_Controll
40
  */
41
  public function editAction()
42
  {
43
- $this->_initGroupModel();
 
44
  $this->loadLayout();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  $this->renderLayout();
46
  }
47
 
40
  */
41
  public function editAction()
42
  {
43
+ $group = $this->_initGroupModel();
44
+
45
  $this->loadLayout();
46
+
47
+ if ($headBlock = $this->getLayout()->getBlock('head')) {
48
+ $titles = array('iBanners by FishPig');
49
+
50
+ if ($group) {
51
+ array_unshift($titles, $group->getTitle());
52
+ }
53
+ else {
54
+ array_unshift($titles, 'Create a Group');
55
+ }
56
+
57
+ $headBlock->setTitle(implode(' - ', $titles));
58
+ }
59
+
60
  $this->renderLayout();
61
  }
62
 
app/code/community/Fishpig/IBanners/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Fishpig_iBanners>
5
- <version>1.0.4</version>
6
  </Fishpig_iBanners>
7
  </modules>
8
  <global>
@@ -85,14 +85,9 @@
85
  </adminhtml>
86
  <default>
87
  <ibanners>
88
- <carousel>
89
- <duration>1</duration>
90
- <auto>1</auto>
91
- <visible_slides>1</visible_slides>
92
- <frequency>8</frequency>
93
- <effect>scroll</effect>
94
- <transition>sinoidal</transition>
95
- </carousel>
96
  </ibanners>
97
  </default>
98
  </config>
2
  <config>
3
  <modules>
4
  <Fishpig_iBanners>
5
+ <version>1.0.6</version>
6
  </Fishpig_iBanners>
7
  </modules>
8
  <global>
85
  </adminhtml>
86
  <default>
87
  <ibanners>
88
+ <settings>
89
+ <enabled>1</enabled>
90
+ </settings>
 
 
 
 
 
91
  </ibanners>
92
  </default>
93
  </config>
app/code/community/Fishpig/IBanners/etc/system.xml CHANGED
@@ -15,72 +15,24 @@
15
  <show_in_website>1</show_in_website>
16
  <show_in_store>1</show_in_store>
17
  <groups>
18
- <carousel>
19
- <label>Group Animation Settings</label>
20
- <sort_order>6</sort_order>
21
  <show_in_default>1</show_in_default>
22
  <show_in_website>1</show_in_website>
23
  <show_in_store>1</show_in_store>
24
  <fields>
25
- <duration>
26
- <label>Animation Duration</label>
27
- <comment>The number of seconds it takes to change slide</comment>
28
- <frontend_type>text</frontend_type>
29
- <sort_order>6</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
- <validate>validate-greater-than-zero required-entry</validate>
34
- </duration>
35
- <auto>
36
- <label>Auto-Start</label>
37
  <frontend_type>select</frontend_type>
38
  <source_model>adminhtml/system_config_source_yesno</source_model>
39
- <sort_order>11</sort_order>
40
- <show_in_default>1</show_in_default>
41
- <show_in_website>1</show_in_website>
42
- <show_in_store>1</show_in_store>
43
- </auto>
44
- <frequency>
45
- <label>Animation Frequency</label>
46
- <comment>The number of seconds before the slide is changed</comment>
47
- <frontend_type>text</frontend_type>
48
- <sort_order>16</sort_order>
49
- <show_in_default>1</show_in_default>
50
- <show_in_website>1</show_in_website>
51
- <show_in_store>1</show_in_store>
52
- <validate>validate-greater-than-zero required-entry</validate>
53
- </frequency>
54
- <visible_slides>
55
- <label>Visible Slides</label>
56
- <comment>The number of slides to be shown at one time</comment>
57
- <frontend_type>text</frontend_type>
58
- <sort_order>21</sort_order>
59
- <show_in_default>1</show_in_default>
60
- <show_in_website>1</show_in_website>
61
- <show_in_store>1</show_in_store>
62
- <validate>validate-greater-than-zero required-entry</validate>
63
- </visible_slides>
64
- <effect>
65
- <label>Carousel Effect</label>
66
- <frontend_type>select</frontend_type>
67
- <source_model>ibanners/system_config_source_carousel_effect</source_model>
68
- <sort_order>26</sort_order>
69
- <show_in_default>1</show_in_default>
70
- <show_in_website>1</show_in_website>
71
- <show_in_store>1</show_in_store>
72
- </effect>
73
- <transition>
74
- <label>Carousel Transition</label>
75
- <frontend_type>select</frontend_type>
76
- <source_model>ibanners/system_config_source_carousel_transition</source_model>
77
- <sort_order>31</sort_order>
78
  <show_in_default>1</show_in_default>
79
  <show_in_website>1</show_in_website>
80
  <show_in_store>1</show_in_store>
81
- </transition>
82
  </fields>
83
- </carousel>
84
  </groups>
85
  </ibanners>
86
  </sections>
15
  <show_in_website>1</show_in_website>
16
  <show_in_store>1</show_in_store>
17
  <groups>
18
+ <settings>
19
+ <label>Settings</label>
20
+ <sort_order>1</sort_order>
21
  <show_in_default>1</show_in_default>
22
  <show_in_website>1</show_in_website>
23
  <show_in_store>1</show_in_store>
24
  <fields>
25
+ <enabled>
26
+ <label>Enabled</label>
 
 
 
 
 
 
 
 
 
 
27
  <frontend_type>select</frontend_type>
28
  <source_model>adminhtml/system_config_source_yesno</source_model>
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
+ </enabled>
34
  </fields>
35
+ </settings>
36
  </groups>
37
  </ibanners>
38
  </sections>
app/code/community/Fishpig/IBanners/notes.txt CHANGED
@@ -8,8 +8,11 @@
8
  ##
9
 
10
  TODO
11
- - Add inner div to template
12
- - Check all options are overridable
 
 
 
13
 
14
  14/08/2012 - 1.0.4
15
  - Added images to controls
8
  ##
9
 
10
  TODO
11
+ - Convert animation and control values to serialized single columns
12
+
13
+ 14/08/2012 - 1.0.6
14
+ - Added dynamic controls that can be activated via the group
15
+ - Removed group animation settings from config
16
 
17
  14/08/2012 - 1.0.4
18
  - Added images to controls
app/code/community/Fishpig/IBanners/sql/ibanners_setup/mysql4-upgrade-1.0.4-1.0.5.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Fishpig
4
+ * @package Fishpig_iBanners
5
+ * @license http://fishpig.co.uk/license.txt
6
+ * @author Ben Tideswell <help@fishpig.co.uk>
7
+ */
8
+
9
+ $this->startSetup();
10
+
11
+ $this->getConnection()->addColumn($this->getTable('ibanners_group'), 'controls_position', " varchar(32) NOT NULL default '' ");
12
+
13
+ $this->endSetup();
app/code/community/Fishpig/IBanners/sql/ibanners_setup/{mysql4-upgrade-0.9.9-0.9.10.php → mysql4-upgrade-1.0.5-1.0.6.php} RENAMED
@@ -8,6 +8,6 @@
8
 
9
  $this->startSetup();
10
 
11
- $this->getConnection()->addColumn($this->getTable('ibanners_banner'), 'url_target', " varchar(12) NOT NULL default '' ");
12
 
13
  $this->endSetup();
8
 
9
  $this->startSetup();
10
 
11
+ $this->getConnection()->addColumn($this->getTable('ibanners_group'), 'controls_overlap', " int(1) unsigned default 0");
12
 
13
  $this->endSetup();
app/design/adminhtml/default/default/layout/ibanners.xml CHANGED
@@ -1,6 +1,15 @@
1
  <?xml version="1.0"?>
2
  <layout>
3
-
 
 
 
 
 
 
 
 
 
4
  <ibanners_admin_adminhtml_group_index>
5
  <reference name="head">
6
  <action method="setTitle" translate="title" module="ibanners"><title>Manage Banner Groups - iBanners by Fishpig</title></action>
@@ -11,6 +20,7 @@
11
  </ibanners_admin_adminhtml_group_index>
12
 
13
  <ibanners_admin_adminhtml_group_edit>
 
14
  <reference name="left">
15
  <block type="ibanners/adminhtml_group_edit_tabs" name="group.tabs" />
16
  </reference>
@@ -29,6 +39,7 @@
29
  </ibanners_admin_adminhtml_banner_index>
30
 
31
  <ibanners_admin_adminhtml_banner_edit>
 
32
  <reference name="left">
33
  <block type="ibanners/adminhtml_banner_edit_tabs" name="banners.tabs" />
34
  </reference>
1
  <?xml version="1.0"?>
2
  <layout>
3
+
4
+ <ibanners_default>
5
+ <reference name="head">
6
+ <action method="addCss"><css>ibanners.css</css></action>
7
+ </reference>
8
+ <reference name="before_body_end">
9
+ <block type="core/template" name="ibanners.getCode" template="ibanners/getcode.phtml" />
10
+ </reference>
11
+ </ibanners_default>
12
+
13
  <ibanners_admin_adminhtml_group_index>
14
  <reference name="head">
15
  <action method="setTitle" translate="title" module="ibanners"><title>Manage Banner Groups - iBanners by Fishpig</title></action>
20
  </ibanners_admin_adminhtml_group_index>
21
 
22
  <ibanners_admin_adminhtml_group_edit>
23
+ <update handle="ibanners_default" />
24
  <reference name="left">
25
  <block type="ibanners/adminhtml_group_edit_tabs" name="group.tabs" />
26
  </reference>
39
  </ibanners_admin_adminhtml_banner_index>
40
 
41
  <ibanners_admin_adminhtml_banner_edit>
42
+ <update handle="ibanners_default" />
43
  <reference name="left">
44
  <block type="ibanners/adminhtml_banner_edit_tabs" name="banners.tabs" />
45
  </reference>
app/design/frontend/base/default/template/ibanners/default.phtml CHANGED
@@ -69,9 +69,9 @@
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"><img src="<?php echo $this->getSkinUrl('images/ibanners/arrow-left.png') ?>" alt="<?php echo $this->__('Previous') ?>" /></a>
77
  </div>
@@ -82,7 +82,7 @@
82
  <?php endif; ?>
83
  <?php endif; ?>
84
  </div>
85
- <?php if ($group->isAnimationEnabled() && $group->getBannerCount() > $group->getCarouselVisibleSlides()): ?>
86
  <script type="text/javascript">
87
  //<![CDATA[
88
  <?php
69
  <?php endif; ?>
70
  </ul>
71
  </div>
72
+ <?php if ($this->canAnimate()): ?>
73
+ <?php if ($this->getControlsPosition() !== ''): ?>
74
+ <div class="controls controls-<?php echo $this->getControlsPosition() ?><?php if ($group->getControlsOverlap()): ?> controls-ol<?php endif; ?>">
75
  <div class="control-prev">
76
  <a href="#" class="carousel-control" rel="prev"><img src="<?php echo $this->getSkinUrl('images/ibanners/arrow-left.png') ?>" alt="<?php echo $this->__('Previous') ?>" /></a>
77
  </div>
82
  <?php endif; ?>
83
  <?php endif; ?>
84
  </div>
85
+ <?php if ($this->canAnimate()): ?>
86
  <script type="text/javascript">
87
  //<![CDATA[
88
  <?php
package.xml CHANGED
@@ -1,18 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Fishpigs_iBanners</name>
4
- <version>1.0.4</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 images to controls</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>14:00:43</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="ca3390077c8f090a0b7ed17ea9ad7c27"/><file name="system.xml" hash="85021826efbb902f94043a1f05197244"/></dir><file name="license.txt" hash="257eae92a36bdaaf9584fbf8ba76d1c6"/><file name="notes.txt" hash="de2700139fbcbed8d18216e20f73ade0"/><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="203b3c01942a8179fd36038bf1830311"/></dir><dir name="template"><dir name="ibanners"><file name="default.phtml" hash="135beea3e34a62db1479b8396243c9b3"/></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="c2d48552c2a3052522de7f1b0b200dc2"/></dir><dir name="images"><dir name="ibanners"><file name="arrow-left.png" hash="a587a6ef8ed482ce83b468b2f8b90008"/><file name="arrow-right.png" hash="001286015205ecf53766877a1d92a784"/></dir></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.6</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 dynamic controls that can be activated via the group&#xD;
12
+ Removed group animation settings from config</notes>
13
  <authors><author><name>fishpig</name><user>fishpig</user><email>ben@fishpig.co.uk</email></author></authors>
14
  <date>2012-08-14</date>
15
+ <time>21:36:33</time>
16
+ <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="67ab47bbe207e41b7542cddc15401590"/></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="1f24d93371ec6e6665b8218c8e4f35b7"/></dir><dir name="Helper"><file name="Data.php" hash="aeaa36a9c56477944b190b63442fc89d"/><file name="Image.php" hash="92a06beda3aefa58577dd91556001115"/></dir><dir name="Model"><file name="Banner.php" hash="e734cbb06eb312cb64022f286c0b1898"/><file name="Group.php" hash="095c22eb1f93aafb57effca8709f5338"/><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 name="Controls"><file name="Position.php" hash="fe9d0c6845fd0fc28603baee7b053c32"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannerController.php" hash="e0dcd98984c1d4d41d755410dfc2fcc0"/><file name="GroupController.php" hash="f388ecef8eef636305fdb1dd3f069815"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="3c83bfafc6ce3e5306ebae43dec8dccf"/><file name="config.xml" hash="8cafc3891755cee41dbfb5dcde00ef98"/><file name="system.xml" hash="bacc23106d758a0c541ee1c1cadfd610"/></dir><file name="license.txt" hash="257eae92a36bdaaf9584fbf8ba76d1c6"/><file name="notes.txt" hash="ec517a23760c57454e223880c7bd3dd0"/><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-1.0.4-1.0.5.php" hash="7f1cb0ec0dca8a5a4cd07ea3e9444cf7"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="2a430094f423b90adead0fcc6defc26e"/></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="a2370cef3c8a48af13801a5844218fb7"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ibanners.xml" hash="203b3c01942a8179fd36038bf1830311"/></dir><dir name="template"><dir name="ibanners"><file name="default.phtml" hash="677f081bb8e40f62771abec88aac857c"/></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="f39554b3dcdaad686da4093e59b4efef"/></dir><dir name="images"><dir name="ibanners"><file name="arrow-left.png" hash="a587a6ef8ed482ce83b468b2f8b90008"/><file name="arrow-right.png" hash="001286015205ecf53766877a1d92a784"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><file name="ibanners.css" hash="328b9e66068670364e620f6e5b194ce5"/></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
skin/adminhtml/default/default/ibanners.css ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+
2
+ #ibgc { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1001; }
3
+ #ibgc-shadow { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 1002; }
4
+ #ibgc-frame { background: #eee; width: 100%; margin: 50px auto 0; position: relative; z-index: 1003; }
5
+ #ibgc .inner { color: #000; padding: 15px 0; margin: 0 auto; width: 500px; }
6
+ #ibgc .inner .content-header { margin-bottom: 10px; }
7
+ #ibgc .inner .content-header h3 { color: #000; font-family: Tahoma, Arial; }
8
+ #ibgc .inner textarea { width: 90%; height: 140px; font-size: 13px; font-family: Tahoma, Arial; padding: 10px; margin: 0 auto; }
9
+ #ibgc .inner p { font-family: Tahoma, Arial; }
10
+ #ibgc .inner .fieldset { margin: 20px 0; }
skin/frontend/base/default/css/ibanners.css CHANGED
@@ -14,6 +14,15 @@
14
  .ibanners.static ul li { float: left; }
15
 
16
  .ibanners-wrapper { position: relative; }
17
- .ibanners-wrapper .controls { position: absolute; top: 46%; width: 100%; }
 
18
  .ibanners-wrapper .controls .control-prev { float: left; }
19
- .ibanners-wrapper .controls .control-next { float: right; }
 
 
 
 
 
 
 
 
14
  .ibanners.static ul li { float: left; }
15
 
16
  .ibanners-wrapper { position: relative; }
17
+
18
+ .ibanners-wrapper .controls { position: absolute; width: 100%; }
19
  .ibanners-wrapper .controls .control-prev { float: left; }
20
+ .ibanners-wrapper .controls .control-next { float: right; }
21
+
22
+ .ibanners-wrapper .controls-top { top: 0; }
23
+ .ibanners-wrapper .controls-middle { top: 45%; }
24
+ .ibanners-wrapper .controls-bottom { bottom: 0; }
25
+ .ibanners-wrapper .controls-below { position: static; height: 1%; overflow: hidden; }
26
+
27
+ .ibanners-wrapper .controls-ol .control-prev { position: relative; left: -10px; }
28
+ .ibanners-wrapper .controls-ol .control-next { position: relative; right: -10px; }