Magdev_Tinycon - Version 1.0.3

Version Notes

added force-fallback option

Download this release

Release Info

Developer Marco Graetsch
Extension Magdev_Tinycon
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/community/Magdev/Tinycon/Block/Script.php CHANGED
@@ -104,7 +104,7 @@ class Magdev_Tinycon_Block_Script extends Mage_Core_Block_Template
104
  public function getFallback()
105
  {
106
  if (!$this->getData('fallback')) {
107
- $this->setData('fallback', Mage::getStoreConfigFlag('design/tinycon/fallback'));
108
  }
109
  return $this->getData('fallback');
110
  }
104
  public function getFallback()
105
  {
106
  if (!$this->getData('fallback')) {
107
+ $this->setData('fallback', Mage::getStoreConfig('design/tinycon/fallback'));
108
  }
109
  return $this->getData('fallback');
110
  }
app/code/community/Magdev/Tinycon/Model/System/Config/Source/Fallback.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ ##LICENSE_HEADER##
4
+ *
5
+ * @author magdev
6
+ * @copyright 2013 magdev
7
+ */
8
+
9
+
10
+ class Magdev_Tinycon_Model_System_Config_Source_Fallback
11
+ {
12
+ public function toOptionArray()
13
+ {
14
+ return array(
15
+ array('label' => Mage::helper('tinycon')->__('Yes'), 'value' => 1),
16
+ array('label' => Mage::helper('tinycon')->__('No'), 'value' => 0),
17
+ array('label' => Mage::helper('tinycon')->__('Force'), 'value' => 'force'),
18
+ );
19
+ }
20
+ }
app/code/community/Magdev/Tinycon/Model/System/Config/Source/Fontsize.php CHANGED
@@ -38,9 +38,11 @@ class Magdev_Tinycon_Model_System_Config_Source_Fontsize
38
  public function toOptionArray()
39
  {
40
  return array(
 
41
  array('label' => Mage::helper('tinycon')->__('9px'), 'value' => 9),
42
  array('label' => Mage::helper('tinycon')->__('10px'), 'value' => 10),
43
  array('label' => Mage::helper('tinycon')->__('11px'), 'value' => 11),
 
44
  );
45
  }
46
  }
38
  public function toOptionArray()
39
  {
40
  return array(
41
+ array('label' => Mage::helper('tinycon')->__('8px'), 'value' => 8),
42
  array('label' => Mage::helper('tinycon')->__('9px'), 'value' => 9),
43
  array('label' => Mage::helper('tinycon')->__('10px'), 'value' => 10),
44
  array('label' => Mage::helper('tinycon')->__('11px'), 'value' => 11),
45
+ array('label' => Mage::helper('tinycon')->__('12px'), 'value' => 12),
46
  );
47
  }
48
  }
app/code/community/Magdev/Tinycon/etc/config.xml CHANGED
@@ -31,7 +31,7 @@
31
  <config>
32
  <modules>
33
  <Magdev_Tinycon>
34
- <version>1.0.2</version>
35
  </Magdev_Tinycon>
36
  </modules>
37
  <global>
31
  <config>
32
  <modules>
33
  <Magdev_Tinycon>
34
+ <version>1.0.3</version>
35
  </Magdev_Tinycon>
36
  </modules>
37
  <global>
app/code/community/Magdev/Tinycon/etc/system.xml CHANGED
@@ -106,7 +106,7 @@
106
  <fallback translate="label comment" module="tinycon">
107
  <label>Use Fallback</label>
108
  <frontend_type>select</frontend_type>
109
- <source_model>adminhtml/system_config_source_yesno</source_model>
110
  <sort_order>100</sort_order>
111
  <show_in_default>1</show_in_default>
112
  <show_in_website>1</show_in_website>
106
  <fallback translate="label comment" module="tinycon">
107
  <label>Use Fallback</label>
108
  <frontend_type>select</frontend_type>
109
+ <source_model>tinycon/system_config_source_fallback</source_model>
110
  <sort_order>100</sort_order>
111
  <show_in_default>1</show_in_default>
112
  <show_in_website>1</show_in_website>
app/design/frontend/base/default/template/tinycon/js.phtml CHANGED
@@ -26,20 +26,29 @@
26
  * @author Marco Graetsch <info@magdev.de>
27
  * @copyright 2012 Marco Graetsch
28
  */
 
 
 
 
 
 
 
 
 
29
  ?>
30
  <?php if ($this->isEnabled()) { ?>
31
- <script type="text/javascript">
32
- $(document).observe('dom:loaded', function() {
33
- Tinycon.setOptions({
34
- width: <?php echo $this->getWidth() ?>,
35
- height: <?php echo $this->getHeight() ?>,
36
- font: '<?php echo $this->getFont() ?>',
37
- colour: '<?php echo $this->getColor() ?>',
38
- background: '<?php echo $this->getBackground() ?>',
39
- fallback: <?php echo $this->getFallback() ? 'true' : 'false' ?>,
40
- abbreviate: <?php echo $this->getAbbreviate() ? 'true' : 'false' ?>
 
 
41
  });
42
- Tinycon.setBubble(<?php echo $this->getCount() ?>);
43
- });
44
- </script>
45
  <?php } ?>
26
  * @author Marco Graetsch <info@magdev.de>
27
  * @copyright 2012 Marco Graetsch
28
  */
29
+
30
+ $_fallback = $this->getFallback();
31
+ if ($_fallback) {
32
+ if ($_fallback != '"force"') {
33
+ $_fallback = 'true';
34
+ }
35
+ } else {
36
+ $_fallback = 'false';
37
+ }
38
  ?>
39
  <?php if ($this->isEnabled()) { ?>
40
+ <script type="text/javascript">
41
+ $(document).observe('dom:loaded', function() {
42
+ Tinycon.setOptions({
43
+ width: <?php echo $this->getWidth() ?>,
44
+ height: <?php echo $this->getHeight() ?>,
45
+ font: '<?php echo $this->getFont() ?>',
46
+ colour: '<?php echo $this->getColor() ?>',
47
+ background: '<?php echo $this->getBackground() ?>',
48
+ fallback: <?php echo $_fallback ?>,
49
+ abbreviate: <?php echo $this->getAbbreviate() ? 'true' : 'false' ?>
50
+ });
51
+ Tinycon.setBubble(<?php echo $this->getCount() ?>);
52
  });
53
+ </script>
 
 
54
  <?php } ?>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Magdev_Tinycon</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/mit-license.php">MIT License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Display the number of items in cart as favicon bubble</summary>
10
  <description>Display the number of items in cart as favicon bubble using the Tinycon javascript library</description>
11
- <notes>js-fix</notes>
12
  <authors><author><name>Marco Graetsch</name><user>magdev</user><email>info@magdev.de</email></author></authors>
13
  <date>2013-04-01</date>
14
- <time>19:20:23</time>
15
- <contents><target name="magecommunity"><dir name="Magdev"><dir name="Tinycon"><dir name="Block"><file name="Script.php" hash="bbade88907060cf03d5d15e2abc5772a"/></dir><dir name="Helper"><file name="Data.php" hash="759c93792721a1562813bf6286ae37c7"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Fontface.php" hash="e592653dfafd3ea63c7b8fa6ae211fb8"/><file name="Fontsize.php" hash="093fb8cb0d3c53aa31ab16547f981888"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="d2a463dcf40271877a8254b45afaa819"/><file name="config.xml" hash="9edc732112b04bf6c44db0a017b1d0c1"/><file name="system.xml" hash="111e90e3d68b55584668d71dbbbc8d5b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magdev_Tinycon.xml" hash="fb42db35e3e733c26b10a91e217deebe"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="tinycon.xml" hash="b56e38afc714b192f8ec0c246fe11711"/></dir><dir name="template"><dir name="tinycon"><file name="js.phtml" hash="abb33e1363b6ecb85f4e5d22c3e9ba6f"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="tinycon"><file name="tinycon.js" hash="f61e4e95050172b30344b5f2fd51ce2a"/><file name="tinycon.min.js" hash="f9e48e5d4590630acf74b4f0b63e502f"/></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Magdev_Tinycon.csv" hash="428a9c0480ba1ff9b9a00f4d530150d8"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.6</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Magdev_Tinycon</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/mit-license.php">MIT License</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Display the number of items in cart as favicon bubble</summary>
10
  <description>Display the number of items in cart as favicon bubble using the Tinycon javascript library</description>
11
+ <notes>added force-fallback option</notes>
12
  <authors><author><name>Marco Graetsch</name><user>magdev</user><email>info@magdev.de</email></author></authors>
13
  <date>2013-04-01</date>
14
+ <time>19:37:16</time>
15
+ <contents><target name="magecommunity"><dir name="Magdev"><dir name="Tinycon"><dir name="Block"><file name="Script.php" hash="055a71c4788752f5e5adbf66338e3712"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d2a463dcf40271877a8254b45afaa819"/><file name="config.xml" hash="6481167acb0896b80300ae244c80d0a8"/><file name="system.xml" hash="7dc4624e10de86f9babc2a01c8cb8fb6"/></dir><dir name="Helper"><file name="Data.php" hash="759c93792721a1562813bf6286ae37c7"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Fallback.php" hash="d8788b451ffd3f5d1c461116c141e8cd"/><file name="Fontface.php" hash="e592653dfafd3ea63c7b8fa6ae211fb8"/><file name="Fontsize.php" hash="dff5ddd5fc82f9e8e19f7d44f3bd996b"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magdev_Tinycon.xml" hash="fb42db35e3e733c26b10a91e217deebe"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="tinycon.xml" hash="b56e38afc714b192f8ec0c246fe11711"/></dir><dir name="template"><dir name="tinycon"><file name="js.phtml" hash="06b9be966e38f93d1ca9076d60931071"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="tinycon"><file name="tinycon.js" hash="f61e4e95050172b30344b5f2fd51ce2a"/><file name="tinycon.min.js" hash="f9e48e5d4590630acf74b4f0b63e502f"/></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Magdev_Tinycon.csv" hash="428a9c0480ba1ff9b9a00f4d530150d8"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.6</min><max>6.0.0</max></php></required></dependencies>
18
  </package>