Magmodules_Kiyohsnippets - Version 1.1.3

Version Notes

Kiyoh Snippets

Download this release

Release Info

Developer Magmodules
Extension Magmodules_Kiyohsnippets
Version 1.1.3
Comparing to
See all releases


Code changes from version 1.1.2 to 1.1.3

Files changed (30) hide show
  1. app/code/local/Magmodules/Core/Block/Adminhtml/System/Config/Form/Field/Heading.php +0 -28
  2. app/code/local/Magmodules/Core/Block/Adminhtml/Versions.php +0 -72
  3. app/code/local/Magmodules/Core/Block/Adminhtml/Widget/Info/Info.php +0 -56
  4. app/code/local/Magmodules/Core/Helper/Data.php +0 -20
  5. app/code/local/Magmodules/Core/etc/adminhtml.xml +0 -42
  6. app/code/local/Magmodules/Core/etc/config.xml +0 -77
  7. app/code/local/Magmodules/Core/etc/system.xml +0 -56
  8. app/code/local/Magmodules/Kiyohsnippets/Block/Adminhtml/System/Config/Form/Field/Heading.php +32 -0
  9. app/code/local/Magmodules/Kiyohsnippets/Block/Adminhtml/System/Config/Form/Field/Version.php +29 -0
  10. app/code/local/Magmodules/Kiyohsnippets/Block/Adminhtml/Widget/Info/Info.php +9 -3
  11. app/code/local/Magmodules/Kiyohsnippets/Block/Snippets.php +18 -14
  12. app/code/local/Magmodules/Kiyohsnippets/Helper/Data.php +72 -35
  13. app/code/local/Magmodules/Kiyohsnippets/Model/System/Config/Flushcache.php +3 -2
  14. app/{design/adminhtml/default/default/layout/magmodules_core.xml → code/local/Magmodules/Kiyohsnippets/Model/System/Config/Source/Datatype.php} +16 -14
  15. app/code/local/Magmodules/Kiyohsnippets/Model/System/Config/Source/Kiyoh.php +3 -2
  16. app/code/local/Magmodules/Kiyohsnippets/data/kiyohsnippets_setup/data-upgrade-1.1.2-1.1.3.php +35 -0
  17. app/code/local/Magmodules/Kiyohsnippets/etc/adminhtml.xml +2 -2
  18. app/code/local/Magmodules/Kiyohsnippets/etc/config.xml +18 -7
  19. app/code/local/Magmodules/Kiyohsnippets/etc/system.xml +41 -15
  20. app/design/frontend/base/default/layout/magmodules_kiyohsnippets.xml +1 -1
  21. app/design/frontend/base/default/template/magmodules/kiyohsnippets/block.phtml +29 -10
  22. app/etc/modules/Magmodules_Core.xml +0 -9
  23. app/locale/nl_NL/Magmodules_Kiyohsnippets.csv +9 -4
  24. package.xml +4 -4
  25. skin/adminhtml/default/default/images/magmodules/comments.png +0 -0
  26. skin/adminhtml/default/default/images/magmodules/logo-small.png +0 -0
  27. skin/adminhtml/default/default/magmodules.css +0 -53
  28. skin/frontend/base/default/magmodules/kiyohsnippets/images/5-stars-empty.png +0 -0
  29. skin/frontend/base/default/magmodules/kiyohsnippets/images/5-stars-full.png +0 -0
  30. skin/frontend/base/default/magmodules/kiyohsnippets/style.css +17 -4
app/code/local/Magmodules/Core/Block/Adminhtml/System/Config/Form/Field/Heading.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /**
3
- * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
- * =============================================================
5
- * NOTICE OF LICENSE [Single domain license]
6
- * This source file is subject to the EULA that is
7
- * available through the world-wide-web at:
8
- * http://www.magmodules.eu/license-agreement/
9
- * =============================================================
10
- * @category Magmodules
11
- * @package Magmodules_Core
12
- * @author Magmodules <info@magmodules.eu>
13
- * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
14
- * @license http://www.magmodules.eu/license-agreement/
15
- * =============================================================
16
- */
17
-
18
- class Magmodules_Core_Block_Adminhtml_System_Config_Form_Field_Heading extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
19
- {
20
-
21
- public function render(Varien_Data_Form_Element_Abstract $element)
22
- {
23
- $useContainerId = $element->getData('use_container_id');
24
- return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4>%s</h4></td></tr>',
25
- $element->getHtmlId(), $element->getLabel()
26
- );
27
- }
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Magmodules/Core/Block/Adminhtml/Versions.php DELETED
@@ -1,72 +0,0 @@
1
- <?php
2
- /**
3
- * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
- * =============================================================
5
- * NOTICE OF LICENSE [Single domain license]
6
- * This source file is subject to the EULA that is
7
- * available through the world-wide-web at:
8
- * http://www.magmodules.eu/license-agreement/
9
- * =============================================================
10
- * @category Magmodules
11
- * @package Magmodules_Core
12
- * @author Magmodules <info@magmodules.eu>
13
- * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
14
- * @license http://www.magmodules.eu/license-agreement/
15
- * =============================================================
16
- */
17
-
18
- class Magmodules_Core_Block_Adminhtml_Versions extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
19
- {
20
-
21
- public function render(Varien_Data_Form_Element_Abstract $element)
22
- {
23
- $html = $this->_getHeaderHtml($element);
24
- $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
25
- sort($modules);
26
-
27
- foreach($modules as $moduleName) {
28
-
29
- if(strstr($moduleName, 'Magmodules_') === false) {
30
- continue;
31
- }
32
-
33
- if($moduleName == 'Magmodules_Core'){
34
- continue;
35
- }
36
-
37
- $html.= $this->_getFieldHtml($element, $moduleName);
38
- }
39
- $html .= $this->_getFooterHtml($element);
40
-
41
- return $html;
42
- }
43
-
44
- protected function _getFieldRenderer()
45
- {
46
- if(empty($this->_fieldRenderer)) {
47
- $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
48
- }
49
-
50
- return $this->_fieldRenderer;
51
- }
52
-
53
- protected function _getFieldHtml($fieldset, $moduleCode)
54
- {
55
- $currentVer = Mage::getConfig()->getModuleConfig($moduleCode)->version;
56
-
57
- if(!$currentVer) {
58
- return '';
59
- }
60
-
61
- $moduleName = substr($moduleCode, strpos($moduleCode, '_') + 1);
62
-
63
- $field = $fieldset->addField($moduleCode, 'label', array(
64
- 'name' => 'dummy',
65
- 'label' => $moduleName,
66
- 'value' => $currentVer,
67
- ))->setRenderer($this->_getFieldRenderer());
68
-
69
- return $field->toHtml();
70
- }
71
-
72
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Magmodules/Core/Block/Adminhtml/Widget/Info/Info.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- * Magmodules.eu
4
- * http://www.magmodules.eu
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Open Software License (OSL 3.0)
9
- * that is bundled with this package in the file LICENSE.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/osl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to info@magmodules.eu so we can send you a copy immediately.
15
- *
16
- * @category Magmodules
17
- * @package Magmodules_Webwinkelkeur
18
- * @author Magmodules <info@magmodules.eu)
19
- * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
20
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
- */
22
-
23
- class Magmodules_Core_Block_Adminhtml_Widget_Info_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
24
-
25
- public function render(Varien_Data_Form_Element_Abstract $element)
26
- {
27
- $html = '<div style="background:url(\'http://www.magmodules.eu/_logo.png\') no-repeat scroll 15px center #EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 200px;">
28
- <h4>About Magmodules.eu</h4>
29
- <p>We are a Magento only E-commerce Agency located in the Netherlands.<br>
30
- <br />
31
- <table width="500px" border="0">
32
- <tr>
33
- <td width="58%">View more extensions from us:</td>
34
- <td width="42%"><a href="http://www.magentocommerce.com/magento-connect/developer/Magmodules" target="_blank">Magento Connect</a></td>
35
- </tr>
36
- <tr>
37
- <td>Question about this extension?</td>
38
- <td><a href="http://www.magmodules.eu/contactus">Contact us</a></td>
39
- </tr>
40
- <tr>
41
- <td>&nbsp;</td>
42
- <td>&nbsp;</td>
43
- </tr>
44
- <td>Send us an E-mail:
45
- <td><a href="mailto:info@magmodules.eu">info@magmodules.eu</a></td>
46
- </tr>
47
- <tr>
48
- <td height="30">Visit our website:</td>
49
- <td><a href="http://www.magmodules.eu" target="_blank">www.magmodules.eu</a></td>
50
- </tr>
51
- </table>
52
- </div>';
53
-
54
- return $html;
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Magmodules/Core/Helper/Data.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- /**
3
- * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
- * =============================================================
5
- * NOTICE OF LICENSE [Single domain license]
6
- * This source file is subject to the EULA that is
7
- * available through the world-wide-web at:
8
- * http://www.magmodules.eu/license-agreement/
9
- * =============================================================
10
- * @category Magmodules
11
- * @package Magmodules_Core
12
- * @author Magmodules <info@magmodules.eu>
13
- * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
14
- * @license http://www.magmodules.eu/license-agreement/
15
- * =============================================================
16
- */
17
-
18
- class Magmodules_Core_Helper_Data extends Mage_Core_Helper_Abstract {
19
-
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Magmodules/Core/etc/adminhtml.xml DELETED
@@ -1,42 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
5
- * =============================================================
6
- * NOTICE OF LICENSE [Single domain license]
7
- * This source file is subject to the EULA that is
8
- * available through the world-wide-web at:
9
- * http://www.magmodules.eu/license-agreement/
10
- * =============================================================
11
- * @category Magmodules
12
- * @package Magmodules_Core
13
- * @author Magmodules <info@magmodules.eu>
14
- * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
15
- * @license http://www.magmodules.eu/license-agreement/
16
- * =============================================================
17
- */
18
- -->
19
- <config>
20
- <acl>
21
- <resources>
22
- <all>
23
- <title>Allow Everything</title>
24
- </all>
25
- <admin>
26
- <children>
27
- <system>
28
- <children>
29
- <config>
30
- <children>
31
- <magmodules_core>
32
- <title>Magmodules - Extensions Information</title>
33
- </magmodules_core>
34
- </children>
35
- </config>
36
- </children>
37
- </system>
38
- </children>
39
- </admin>
40
- </resources>
41
- </acl>
42
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Magmodules/Core/etc/config.xml DELETED
@@ -1,77 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
5
- * =============================================================
6
- * NOTICE OF LICENSE [Single domain license]
7
- * This source file is subject to the EULA that is
8
- * available through the world-wide-web at:
9
- * http://www.magmodules.eu/license-agreement/
10
- * =============================================================
11
- * @category Magmodules
12
- * @package Magmodules_Core
13
- * @author Magmodules <info@magmodules.eu>
14
- * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
15
- * @license http://www.magmodules.eu/license-agreement/
16
- * =============================================================
17
- */
18
- -->
19
- <config>
20
- <modules>
21
- <Magmodules_Core>
22
- <version>1.0.1</version>
23
- </Magmodules_Core>
24
- </modules>
25
- <global>
26
- <blocks>
27
- <magmodules_core>
28
- <class>Magmodules_Core_Block_Adminhtml</class>
29
- </magmodules_core>
30
- </blocks>
31
- <helpers>
32
- <magmodules_core>
33
- <class>Magmodules_Core_Helper</class>
34
- </magmodules_core>
35
- </helpers>
36
- </global>
37
- <adminhtml>
38
- <acl>
39
- <resources>
40
- <all>
41
- <title>Allow Everything</title>
42
- </all>
43
- <admin>
44
- <children>
45
- <system>
46
- <children>
47
- <config>
48
- <children>
49
- <magmodules_core>
50
- <title>Magmodules - Extensions Information</title>
51
- </magmodules_core>
52
- </children>
53
- </config>
54
- </children>
55
- </system>
56
- </children>
57
- </admin>
58
- </resources>
59
- </acl>
60
- <layout>
61
- <updates>
62
- <magmodulescore>
63
- <file>magmodules_core.xml</file>
64
- </magmodulescore>
65
- </updates>
66
- </layout>
67
- <translate>
68
- <modules>
69
- <Magmodules_Core>
70
- <files>
71
- <default>Magmodules_Core.csv</default>
72
- </files>
73
- </Magmodules_Core>
74
- </modules>
75
- </translate>
76
- </adminhtml>
77
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Magmodules/Core/etc/system.xml DELETED
@@ -1,56 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
5
- * =============================================================
6
- * NOTICE OF LICENSE [Single domain license]
7
- * This source file is subject to the EULA that is
8
- * available through the world-wide-web at:
9
- * http://www.magmodules.eu/license-agreement/
10
- * =============================================================
11
- * @category Magmodules
12
- * @package Magmodules_Core
13
- * @author Magmodules <info@magmodules.eu>
14
- * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
15
- * @license http://www.magmodules.eu/license-agreement/
16
- * =============================================================
17
- */
18
- -->
19
- <config>
20
- <tabs>
21
- <magmodules>
22
- <label>Magmodules</label>
23
- <sort_order>200</sort_order>
24
- </magmodules>
25
- </tabs>
26
- <sections>
27
- <magmodules_core translate="label">
28
- <label>General</label>
29
- <tab>magmodules</tab>
30
- <frontend_type>text</frontend_type>
31
- <sort_order>10</sort_order>
32
- <show_in_default>1</show_in_default>
33
- <show_in_website>1</show_in_website>
34
- <show_in_store>1</show_in_store>
35
- <expanded>1</expanded>
36
- <groups>
37
- <info>
38
- <frontend_model>magmodules_core/widget_info_info</frontend_model>
39
- <sort_order>1</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
- </info>
44
- <versions translate="label">
45
- <label>Installed Extensions</label>
46
- <frontend_type>text</frontend_type>
47
- <frontend_model>magmodules_core/versions</frontend_model>
48
- <sort_order>2</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
- </versions>
53
- </groups>
54
- </magmodules_core>
55
- </sections>
56
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Magmodules/Kiyohsnippets/Block/Adminhtml/System/Config/Form/Field/Heading.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyohsnippets
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyohsnippets_Block_Adminhtml_System_Config_Form_Field_Heading extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
23
+
24
+ public function render(Varien_Data_Form_Element_Abstract $element)
25
+ {
26
+ $useContainerId = $element->getData('use_container_id');
27
+ return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4>%s</h4></td></tr>',
28
+ $element->getHtmlId(), $element->getLabel()
29
+ );
30
+ }
31
+
32
+ }
app/code/local/Magmodules/Kiyohsnippets/Block/Adminhtml/System/Config/Form/Field/Version.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyohsnippets
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyohsnippets_Block_Adminhtml_System_Config_Form_Field_Version extends Mage_Adminhtml_Block_System_Config_Form_Field {
23
+
24
+ public function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
25
+ {
26
+ return Mage::getConfig()->getNode()->modules->Magmodules_Kiyohsnippets->version;
27
+ }
28
+
29
+ }
app/code/local/Magmodules/Kiyohsnippets/Block/Adminhtml/Widget/Info/Info.php CHANGED
@@ -15,14 +15,20 @@
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
- * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Block_Adminhtml_Widget_Info_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
23
 
24
- public function render(Varien_Data_Form_Element_Abstract $element) {
25
- $html = '<div style="background:url(\'http://www.magmodules.eu/_logo.png\') no-repeat scroll 15px center #EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 200px;">
 
 
 
 
 
 
26
  <h4>About Magmodules.eu</h4>
27
  <p>We are a Magento only E-commerce Agency located in the Netherlands.<br>
28
  <br />
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Block_Adminhtml_Widget_Info_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
23
 
24
+ public function render(Varien_Data_Form_Element_Abstract $element)
25
+ {
26
+
27
+ $magento_version = Mage::getVersion();
28
+ $module_version = Mage::getConfig()->getNode()->modules->Magmodules_Kiyohsnippets->version;
29
+ $logo_link = '//www.magmodules.eu/logo/kiyohsnippets/' . $module_version . '/' . $magento_version . '/logo.png';
30
+
31
+ $html = '<div style="background:url(\'' . $logo_link . '\') no-repeat scroll 15px center #EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 200px;">
32
  <h4>About Magmodules.eu</h4>
33
  <p>We are a Magento only E-commerce Agency located in the Netherlands.<br>
34
  <br />
app/code/local/Magmodules/Kiyohsnippets/Block/Snippets.php CHANGED
@@ -15,37 +15,41 @@
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
- * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Block_Snippets extends Mage_Core_Block_Template {
23
 
24
- protected function _construct() {
25
-
26
  parent::_construct();
27
-
28
  $this->addData(array(
29
- 'cache_lifetime' => 7200,
30
- 'cache_tags' => array(Mage_Cms_Model_Block::CACHE_TAG, 'kiyohsnippets_block'),
31
- 'cache_key' => 'kiyohsnippets-snippets-block',
32
- ));
33
-
34
  if(Mage::getStoreConfig('kiyohsnippets/api/enabled')) {
35
- $this->setTemplate('magmodules/kiyohsnippets/block.phtml');
 
 
 
 
36
  }
37
-
38
  }
39
 
40
- public function getSnapshopRequest() {
 
41
  return $this->helper('kiyohsnippets')->getSnapshopRequest();
42
  }
43
 
44
- public function getKiyohLink() {
 
45
  return $this->helper('kiyohsnippets')->getKiyohLink();
46
  }
47
 
48
- public function getKiyohStars($rating) {
 
49
  return $this->helper('kiyohsnippets')->getKiyohStars($rating);
50
  }
51
 
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Block_Snippets extends Mage_Core_Block_Template {
23
 
24
+ protected function _construct()
25
+ {
26
  parent::_construct();
 
27
  $this->addData(array(
28
+ 'cache_lifetime' => 7200,
29
+ 'cache_tags' => array(Mage_Cms_Model_Block::CACHE_TAG, 'kiyohsnippets_block'),
30
+ 'cache_key' => 'kiyohsnippets-snippets-block',
31
+ ));
 
32
  if(Mage::getStoreConfig('kiyohsnippets/api/enabled')) {
33
+ $snippets = $this->helper('kiyohsnippets')->getSnapshopRequest();
34
+ if($snippets) {
35
+ $this->setSnippets($snippets);
36
+ $this->setTemplate('magmodules/kiyohsnippets/block.phtml');
37
+ }
38
  }
 
39
  }
40
 
41
+ public function getSnapshopRequest()
42
+ {
43
  return $this->helper('kiyohsnippets')->getSnapshopRequest();
44
  }
45
 
46
+ public function getKiyohLink()
47
+ {
48
  return $this->helper('kiyohsnippets')->getKiyohLink();
49
  }
50
 
51
+ public function getKiyohStars($rating)
52
+ {
53
  return $this->helper('kiyohsnippets')->getKiyohStars($rating);
54
  }
55
 
app/code/local/Magmodules/Kiyohsnippets/Helper/Data.php CHANGED
@@ -15,58 +15,95 @@
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
- * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Helper_Data extends Mage_Core_Helper_Abstract {
23
 
24
- function getSnapshopRequest() {
 
25
  $kiyoh_shop_id = Mage::getStoreConfig('kiyohsnippets/api/shop_id');
26
  $api_url = Mage::getStoreConfig('kiyohsnippets/api/api_url');
 
 
 
27
  $filename = 'https://' . $api_url . '/widgetfeed.php?company=';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- if($kiyoh_shop_id) {
30
- $xml = $this->getXml($filename . $kiyoh_shop_id, 1);
31
- if($xml) {
32
- $data = $xml->channel->description;
33
- $snippets = array();
34
-
35
- if(preg_match("/[0-9]+%/", $data, $matches)) {
36
- $snippets['avg'] = substr($matches[0], 0, -1);
37
- }
38
-
39
- $pieces = explode(' ', $data);
40
- $snippets['qty'] = array_pop($pieces);
41
- $snippets['shopname'] = 'shopname';
42
- return $snippets;
43
- }
44
- }
45
- return false;
46
- }
47
 
48
- function getKiyohLink() {
49
- if(Mage::getStoreConfig('kiyohsnippets/api/show_link')) {
50
- $kiyoh_link = Mage::getStoreConfig('kiyohsnippets/api/kiyoh_link');
51
- return Mage::helper('kiyohsnippets')->__('on') . ' <a href="' . $kiyoh_link . '" target="_blank">Kiyoh</a>';
 
 
52
  } else {
53
- return false;
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
 
 
 
 
56
 
57
- function getKiyohStars($rating) {
58
- if(Mage::getStoreConfig('kiyohsnippets/api/show_stars')) {
59
- $perc = $rating;
60
- $html = '<div class="rating-box">';
61
- $html .= ' <div class="rating" style="width:' . $perc . '%"></div>';
62
- $html .= '</div>';
63
- return $html;
64
- } else {
 
 
 
 
65
  return false;
66
  }
 
 
 
 
 
 
67
  }
68
 
69
- public function getXml($url, $timeout = 0) {
 
70
  $ch = curl_init($url);
71
  curl_setopt_array($ch, array(CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => (int) $timeout));
72
  if($xml = curl_exec($ch)){
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Helper_Data extends Mage_Core_Helper_Abstract {
23
 
24
+ function getSnapshopRequest()
25
+ {
26
  $kiyoh_shop_id = Mage::getStoreConfig('kiyohsnippets/api/shop_id');
27
  $api_url = Mage::getStoreConfig('kiyohsnippets/api/api_url');
28
+ $data_type = Mage::getStoreConfig('kiyohsnippets/api/data_type');
29
+ $text_suffix = Mage::getStoreConfig('kiyohsnippets/api/kiyoh_suffix');
30
+
31
  $filename = 'https://' . $api_url . '/widgetfeed.php?company=';
32
+
33
+ if(!$kiyoh_shop_id) {
34
+ return false;
35
+ }
36
+
37
+ $xml = $this->getXml($filename . $kiyoh_shop_id, 1);
38
+
39
+ if(!$xml) {
40
+ return false;
41
+ }
42
+
43
+ $xml_data = $xml->channel->description;
44
+
45
+ $qty = explode(' ', $xml_data);
46
+ $qty = array_pop($qty);
47
 
48
+ if(empty($qty)) {
49
+ return false;
50
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
+ if(empty($data_type)) {
53
+ $max = '10';
54
+ $data = explode(',', $xml_data);
55
+ $data = explode(' ', $data[0]);
56
+ $data = array_pop($data);
57
+ $percentage = ($data * 10);
58
  } else {
59
+ $data = '';
60
+ $max = '100';
61
+ if(preg_match("/[0-9]+%/", $xml_data, $matches)) {
62
+ $data = substr($matches[0], 0, -1);
63
+ }
64
+ $percentage = $data;
65
+ $data = $data . '%';
66
+ }
67
+
68
+ $snippets = array();
69
+ $snippets['qty'] = $qty;
70
+ $snippets['avg'] = $data;
71
+ $snippets['max'] = $max;
72
+ $snippets['percentage'] = $percentage;
73
+ $snippets['data_type'] = $data_type;
74
+ $snippets['text_suffix'] = $text_suffix;
75
+
76
+ return $snippets;
77
  }
78
+
79
+ function getKiyohLink()
80
+ {
81
+ $show_link = Mage::getStoreConfig('kiyohsnippets/api/show_link');
82
 
83
+ if(!$show_link) {
84
+ return false;
85
+ }
86
+
87
+ $kiyoh_link = Mage::getStoreConfig('kiyohsnippets/api/kiyoh_link');
88
+ return $kiyoh_link;
89
+ }
90
+
91
+ function getKiyohStars($rating)
92
+ {
93
+ $show_stars = Mage::getStoreConfig('kiyohsnippets/api/show_stars');
94
+ if(!$show_stars) {
95
  return false;
96
  }
97
+
98
+ $html = '<div class="rating-box">';
99
+ $html .= ' <div class="rating" style="width:' . $rating . '%"></div>';
100
+ $html .= '</div>';
101
+
102
+ return $html;
103
  }
104
 
105
+ public function getXml($url, $timeout = 0)
106
+ {
107
  $ch = curl_init($url);
108
  curl_setopt_array($ch, array(CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => (int) $timeout));
109
  if($xml = curl_exec($ch)){
app/code/local/Magmodules/Kiyohsnippets/Model/System/Config/Flushcache.php CHANGED
@@ -15,13 +15,14 @@
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
- * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Model_System_Config_Flushcache extends Mage_Core_Model_Config_Data {
23
 
24
- protected function _afterSave() {
 
25
  Mage::app()->cleanCache('kiyohsnippets_block');
26
  }
27
 
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Model_System_Config_Flushcache extends Mage_Core_Model_Config_Data {
23
 
24
+ protected function _afterSave()
25
+ {
26
  Mage::app()->cleanCache('kiyohsnippets_block');
27
  }
28
 
app/{design/adminhtml/default/default/layout/magmodules_core.xml → code/local/Magmodules/Kiyohsnippets/Model/System/Config/Source/Datatype.php} RENAMED
@@ -1,8 +1,6 @@
1
- <?xml version="1.0"?>
2
- <!--
3
  /**
4
- * Magmodules.eu
5
- * http://www.magmodules.eu
6
  *
7
  * NOTICE OF LICENSE
8
  *
@@ -15,16 +13,20 @@
15
  * to info@magmodules.eu so we can send you a copy immediately.
16
  *
17
  * @category Magmodules
18
- * @package Magmodules_Core
19
  * @author Magmodules <info@magmodules.eu)
20
- * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
21
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
  */
23
- -->
24
- <layout>
25
- <default>
26
- <reference name="head">
27
- <action method="addCss"><name>magmodules/core/css/style.css</name></action>
28
- </reference>
29
- </default>
30
- </layout>
 
 
 
 
1
+ <?php
 
2
  /**
3
+ * Magmodules.eu - http://www.magmodules.eu
 
4
  *
5
  * NOTICE OF LICENSE
6
  *
13
  * to info@magmodules.eu so we can send you a copy immediately.
14
  *
15
  * @category Magmodules
16
+ * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
+
22
+ class Magmodules_Kiyohsnippets_Model_System_Config_Source_Datatype {
23
+
24
+ public function toOptionArray()
25
+ {
26
+ return array(
27
+ '' => Mage::helper('kiyohsnippets')->__('Score'),
28
+ 'recommended' => Mage::helper('kiyohsnippets')->__('Recommended'),
29
+ );
30
+ }
31
+
32
+ }
app/code/local/Magmodules/Kiyohsnippets/Model/System/Config/Source/Kiyoh.php CHANGED
@@ -15,13 +15,14 @@
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
- * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Model_System_Config_Source_Kiyoh {
23
 
24
- public function toOptionArray() {
 
25
  return array(
26
  'www.kiyoh.nl' => Mage::helper('kiyohsnippets')->__('Kiyoh.nl'),
27
  'www.kiyoh.com' => Mage::helper('kiyohsnippets')->__('Kiyoh.com'),
15
  * @category Magmodules
16
  * @package Magmodules_Kiyohsnippets
17
  * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
22
  class Magmodules_Kiyohsnippets_Model_System_Config_Source_Kiyoh {
23
 
24
+ public function toOptionArray()
25
+ {
26
  return array(
27
  'www.kiyoh.nl' => Mage::helper('kiyohsnippets')->__('Kiyoh.nl'),
28
  'www.kiyoh.com' => Mage::helper('kiyohsnippets')->__('Kiyoh.com'),
app/code/local/Magmodules/Kiyohsnippets/data/kiyohsnippets_setup/data-upgrade-1.1.2-1.1.3.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyohsnippets
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ $installer = $this;
23
+ if(Mage::getModel('admin/block')) {
24
+ $connection = $installer->getConnection();
25
+ $table = $installer->getTable('admin/permission_block');
26
+ $blockNames = array(
27
+ 'kiyohsnippets/snippets',
28
+ );
29
+ foreach ($blockNames as $blockName) {
30
+ $connection->insertOnDuplicate($table, array(
31
+ 'block_name' => $blockName,
32
+ 'is_allowed' => 1,
33
+ ));
34
+ }
35
+ }
app/code/local/Magmodules/Kiyohsnippets/etc/adminhtml.xml CHANGED
@@ -16,7 +16,7 @@
16
  * @category Magmodules
17
  * @package Magmodules_Kiyohsnippets
18
  * @author Magmodules <info@magmodules.eu)
19
- * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
  */
22
  -->
@@ -30,7 +30,7 @@
30
  <config>
31
  <children>
32
  <kiyohsnippets translate="title" module="kiyohsnippets">
33
- <title>Kiyoh Snippets</title>
34
  </kiyohsnippets>
35
  </children>
36
  </config>
16
  * @category Magmodules
17
  * @package Magmodules_Kiyohsnippets
18
  * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
  */
22
  -->
30
  <config>
31
  <children>
32
  <kiyohsnippets translate="title" module="kiyohsnippets">
33
+ <title>KiyOh Snippets</title>
34
  </kiyohsnippets>
35
  </children>
36
  </config>
app/code/local/Magmodules/Kiyohsnippets/etc/config.xml CHANGED
@@ -16,14 +16,14 @@
16
  * @category Magmodules
17
  * @package Magmodules_Kiyohsnippets
18
  * @author Magmodules <info@magmodules.eu)
19
- * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
  */
22
  -->
23
  <config>
24
  <modules>
25
  <Magmodules_Kiyohsnippets>
26
- <version>1.1.2</version>
27
  </Magmodules_Kiyohsnippets>
28
  </modules>
29
  <global>
@@ -41,7 +41,17 @@
41
  <kiyohsnippets>
42
  <class>Magmodules_Kiyohsnippets_Model</class>
43
  </kiyohsnippets>
44
- </models>
 
 
 
 
 
 
 
 
 
 
45
  </global>
46
  <frontend>
47
  <layout>
@@ -73,10 +83,11 @@
73
  </translate>
74
  </adminhtml>
75
  <default>
76
- <kiyoh_snippets>
77
- <general>
78
  <enabled>0</enabled>
79
- </general>
80
- </kiyoh_snippets>
 
81
  </default>
82
  </config>
16
  * @category Magmodules
17
  * @package Magmodules_Kiyohsnippets
18
  * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
  */
22
  -->
23
  <config>
24
  <modules>
25
  <Magmodules_Kiyohsnippets>
26
+ <version>1.1.3</version>
27
  </Magmodules_Kiyohsnippets>
28
  </modules>
29
  <global>
41
  <kiyohsnippets>
42
  <class>Magmodules_Kiyohsnippets_Model</class>
43
  </kiyohsnippets>
44
+ </models>
45
+ <resources>
46
+ <kiyohsnippets_setup>
47
+ <setup>
48
+ <module>Magmodules_Kiyohsnippets</module>
49
+ </setup>
50
+ <connection>
51
+ <use>core_setup</use>
52
+ </connection>
53
+ </kiyohsnippets_setup>
54
+ </resources>
55
  </global>
56
  <frontend>
57
  <layout>
83
  </translate>
84
  </adminhtml>
85
  <default>
86
+ <kiyohsnippets>
87
+ <api>
88
  <enabled>0</enabled>
89
+ <kiyoh_suffix>by KiyOh</kiyoh_suffix>
90
+ </api>
91
+ </kiyohsnippets>
92
  </default>
93
  </config>
app/code/local/Magmodules/Kiyohsnippets/etc/system.xml CHANGED
@@ -16,7 +16,7 @@
16
  * @category Magmodules
17
  * @package Magmodules_Kiyohsnippets
18
  * @author Magmodules <info@magmodules.eu)
19
- * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
  */
22
  -->
@@ -29,10 +29,10 @@
29
  </tabs>
30
  <sections>
31
  <kiyohsnippets translate="label" module="kiyohsnippets">
32
- <label>Kiyoh Rich Snippets</label>
33
  <tab>magmodules</tab>
34
  <frontend_type>text</frontend_type>
35
- <sort_order>21</sort_order>
36
  <show_in_default>1</show_in_default>
37
  <show_in_website>1</show_in_website>
38
  <show_in_store>1</show_in_store>
@@ -63,10 +63,19 @@
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
  </enabled>
 
 
 
 
 
 
 
 
 
66
  <heading_api translate="label">
67
  <label>Shop ID</label>
68
- <frontend_model>magmodules_core/system_config_form_field_heading</frontend_model>
69
- <sort_order>2</sort_order>
70
  <show_in_default>1</show_in_default>
71
  <show_in_website>1</show_in_website>
72
  <show_in_store>1</show_in_store>
@@ -75,7 +84,7 @@
75
  <label>Localisation</label>
76
  <frontend_type>select</frontend_type>
77
  <source_model>kiyohsnippets/system_config_source_kiyoh</source_model>
78
- <sort_order>3</sort_order>
79
  <show_in_default>1</show_in_default>
80
  <show_in_website>1</show_in_website>
81
  <show_in_store>1</show_in_store>
@@ -83,46 +92,63 @@
83
  <shop_id translate="label">
84
  <label>Shop ID</label>
85
  <frontend_type>text</frontend_type>
86
- <sort_order>4</sort_order>
87
  <show_in_default>1</show_in_default>
88
  <show_in_website>1</show_in_website>
89
  <show_in_store>1</show_in_store>
90
  </shop_id>
91
  <heading_design translate="label">
92
  <label>Design</label>
93
- <frontend_model>magmodules_core/system_config_form_field_heading</frontend_model>
94
- <sort_order>5</sort_order>
95
  <show_in_default>1</show_in_default>
96
  <show_in_website>1</show_in_website>
97
  <show_in_store>1</show_in_store>
98
  </heading_design>
 
 
 
 
 
 
 
 
 
99
  <show_stars translate="label">
100
  <label>Show Stars</label>
101
  <frontend_type>select</frontend_type>
102
  <source_model>adminhtml/system_config_source_yesno</source_model>
103
- <sort_order>7</sort_order>
104
  <show_in_default>1</show_in_default>
105
  <show_in_website>1</show_in_website>
106
  <show_in_store>1</show_in_store>
107
  </show_stars>
108
  <show_link translate="label">
109
- <label>Show Link to Kiyoh</label>
110
  <frontend_type>select</frontend_type>
111
  <source_model>adminhtml/system_config_source_yesno</source_model>
112
- <sort_order>8</sort_order>
113
  <show_in_default>1</show_in_default>
114
  <show_in_website>1</show_in_website>
115
  <show_in_store>1</show_in_store>
116
  </show_link>
117
  <kiyoh_link translate="label">
118
- <label>Kiyoh Link</label>
119
  <frontend_type>text</frontend_type>
120
- <sort_order>9</sort_order>
121
  <show_in_default>1</show_in_default>
122
  <show_in_website>1</show_in_website>
123
  <show_in_store>1</show_in_store>
124
  <depends><show_link>1</show_link></depends>
125
- </kiyoh_link>
 
 
 
 
 
 
 
 
126
  </fields>
127
  </api>
128
  <snippets translate="label">
16
  * @category Magmodules
17
  * @package Magmodules_Kiyohsnippets
18
  * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2016 (http://www.magmodules.eu)
20
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
  */
22
  -->
29
  </tabs>
30
  <sections>
31
  <kiyohsnippets translate="label" module="kiyohsnippets">
32
+ <label>KiyOh Rich Snippets</label>
33
  <tab>magmodules</tab>
34
  <frontend_type>text</frontend_type>
35
+ <sort_order>111</sort_order>
36
  <show_in_default>1</show_in_default>
37
  <show_in_website>1</show_in_website>
38
  <show_in_store>1</show_in_store>
63
  <show_in_website>1</show_in_website>
64
  <show_in_store>1</show_in_store>
65
  </enabled>
66
+ <version translate="label">
67
+ <label>Extension Version</label>
68
+ <frontend_type>text</frontend_type>
69
+ <frontend_model>kiyohsnippets/adminhtml_system_config_form_field_version</frontend_model>
70
+ <sort_order>2</sort_order>
71
+ <show_in_default>1</show_in_default>
72
+ <show_in_website>0</show_in_website>
73
+ <show_in_store>0</show_in_store>
74
+ </version>
75
  <heading_api translate="label">
76
  <label>Shop ID</label>
77
+ <frontend_model>kiyohsnippets/adminhtml_system_config_form_field_heading</frontend_model>
78
+ <sort_order>3</sort_order>
79
  <show_in_default>1</show_in_default>
80
  <show_in_website>1</show_in_website>
81
  <show_in_store>1</show_in_store>
84
  <label>Localisation</label>
85
  <frontend_type>select</frontend_type>
86
  <source_model>kiyohsnippets/system_config_source_kiyoh</source_model>
87
+ <sort_order>4</sort_order>
88
  <show_in_default>1</show_in_default>
89
  <show_in_website>1</show_in_website>
90
  <show_in_store>1</show_in_store>
92
  <shop_id translate="label">
93
  <label>Shop ID</label>
94
  <frontend_type>text</frontend_type>
95
+ <sort_order>5</sort_order>
96
  <show_in_default>1</show_in_default>
97
  <show_in_website>1</show_in_website>
98
  <show_in_store>1</show_in_store>
99
  </shop_id>
100
  <heading_design translate="label">
101
  <label>Design</label>
102
+ <frontend_model>kiyohsnippets/adminhtml_system_config_form_field_heading</frontend_model>
103
+ <sort_order>6</sort_order>
104
  <show_in_default>1</show_in_default>
105
  <show_in_website>1</show_in_website>
106
  <show_in_store>1</show_in_store>
107
  </heading_design>
108
+ <data_type translate="label">
109
+ <label>Data Type</label>
110
+ <frontend_type>select</frontend_type>
111
+ <source_model>kiyohsnippets/system_config_source_datatype</source_model>
112
+ <sort_order>7</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>1</show_in_store>
116
+ </data_type>
117
  <show_stars translate="label">
118
  <label>Show Stars</label>
119
  <frontend_type>select</frontend_type>
120
  <source_model>adminhtml/system_config_source_yesno</source_model>
121
+ <sort_order>8</sort_order>
122
  <show_in_default>1</show_in_default>
123
  <show_in_website>1</show_in_website>
124
  <show_in_store>1</show_in_store>
125
  </show_stars>
126
  <show_link translate="label">
127
+ <label>Show Link</label>
128
  <frontend_type>select</frontend_type>
129
  <source_model>adminhtml/system_config_source_yesno</source_model>
130
+ <sort_order>9</sort_order>
131
  <show_in_default>1</show_in_default>
132
  <show_in_website>1</show_in_website>
133
  <show_in_store>1</show_in_store>
134
  </show_link>
135
  <kiyoh_link translate="label">
136
+ <label>Url</label>
137
  <frontend_type>text</frontend_type>
138
+ <sort_order>10</sort_order>
139
  <show_in_default>1</show_in_default>
140
  <show_in_website>1</show_in_website>
141
  <show_in_store>1</show_in_store>
142
  <depends><show_link>1</show_link></depends>
143
+ </kiyoh_link>
144
+ <kiyoh_suffix translate="label">
145
+ <label>Text Suffix</label>
146
+ <frontend_type>text</frontend_type>
147
+ <sort_order>11</sort_order>
148
+ <show_in_default>1</show_in_default>
149
+ <show_in_website>1</show_in_website>
150
+ <show_in_store>1</show_in_store>
151
+ </kiyoh_suffix>
152
  </fields>
153
  </api>
154
  <snippets translate="label">
app/design/frontend/base/default/layout/magmodules_kiyohsnippets.xml CHANGED
@@ -2,7 +2,7 @@
2
  <layout version="0.1.0">
3
  <default>
4
  <reference name="head">
5
- <action method="addCss"><stylesheet>magmodules/kiyohsnippets/style.css</stylesheet></action>
6
  </reference>
7
  </default>
8
  </layout>
2
  <layout version="0.1.0">
3
  <default>
4
  <reference name="head">
5
+ <action method="addCss" ifconfig="kiyohsnippets/api/enabled"><stylesheet>magmodules/kiyohsnippets/style.css</stylesheet></action>
6
  </reference>
7
  </default>
8
  </layout>
app/design/frontend/base/default/template/magmodules/kiyohsnippets/block.phtml CHANGED
@@ -19,14 +19,33 @@
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
  ?>
22
- <?php if($snippets = $this->getSnapshopRequest()) { ?>
23
- <div class="kiyoh-shop-snippets">
24
- <?php echo $this->getKiyohStars($snippets['avg']); ?>
25
- <div class="kiyoh-schema" itemscope="itemscope" itemtype="http://schema.org/WebPage">
26
- <div itemprop="aggregateRating" itemscope="itemscope" itemtype="http://schema.org/AggregateRating">
27
- <meta itemprop="bestRating" content="100">
28
- <p><?php echo Mage::helper('kiyohsnippets')->__('Rating %s based on %s customer reviews', '<span itemprop="ratingValue">' . $snippets['avg'] . '</span>%', '<span itemprop="ratingCount">' . $snippets['qty'] . '</span>') ?> <?php echo $this->getKiyohLink(); ?> </p>
29
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  </div>
31
- </div>
32
- <?php } ?>
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
  ?>
22
+ <?php
23
+ $snippets = $this->getSnippets();
24
+ $url = $this->getKiyohLink();
25
+ ?>
26
+ <div class="kiyoh-shop-snippets">
27
+ <?php echo $this->getKiyohStars($snippets['percentage']); ?>
28
+ <div class="kiyoh-schema" itemscope="itemscope" itemtype="http://schema.org/WebPage">
29
+ <div itemprop="aggregateRating" itemscope="itemscope" itemtype="http://schema.org/AggregateRating">
30
+ <meta itemprop="bestRating" content="<?php echo $snippets['max']; ?>">
31
+ <p>
32
+ <?php
33
+ if(!empty($url)) {
34
+ echo '<a href="' . $url . '" target="_blank" class="kiyoh-link">';
35
+ }
36
+ if(!empty($snippets['type'])) {
37
+ echo Mage::helper('kiyohsnippets')->__('Rating %s out of %s, based on %s customer reviews', '<span itemprop="ratingValue">' . $snippets['avg'] . '</span>', $snippets['max'], '<span itemprop="ratingCount">' . $snippets['qty'] . '</span>');
38
+ } else {
39
+ echo Mage::helper('kiyohsnippets')->__('%s recommandation, based on %s customer reviews', '<span itemprop="ratingValue">' . $snippets['avg'] . '</span>', '<span itemprop="ratingCount">' . $snippets['qty'] . '</span>');
40
+ }
41
+ if(!empty($snippets['text_suffix'])) {
42
+ echo ' ' . $snippets['text_suffix'];
43
+ }
44
+ if(!empty($url)) {
45
+ echo '</a>';
46
+ }
47
+ ?>
48
+ </p>
49
  </div>
50
+ </div>
51
+ </div>
app/etc/modules/Magmodules_Core.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Magmodules_Core>
5
- <active>true</active>
6
- <codePool>local</codePool>
7
- </Magmodules_Core>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/locale/nl_NL/Magmodules_Kiyohsnippets.csv CHANGED
@@ -1,9 +1,14 @@
1
  "Design","Ontwerp"
2
  "Shopname","Winkelnaam"
3
  "Show Stars","Toon Sterren"
4
- "Show Link to Kiyoh","Toon link naar Kiyoh"
5
- "Kiyoh Link","Kiyoh link"
6
  "on","op"
7
  "Shop ID","Winkel ID"
8
- "Rating %s based on %s customer reviews","Beoordeling %s gebaseerd op %s individuele klant beoordelingen"
9
- "Use: {{block type=""kiyohsnippets/snippets" name=""kiyohsnippets""}} to call the block on the homepage","Gebruik: {{block type=""kiyohsnippets/snippets"" name=""kiyohsnippets""}} om het Rich Snippets blok op de homepage te plaatsen"
 
 
 
 
 
1
  "Design","Ontwerp"
2
  "Shopname","Winkelnaam"
3
  "Show Stars","Toon Sterren"
4
+ "Show Link","Link Toevoegen"
5
+ "Url","Url"
6
  "on","op"
7
  "Shop ID","Winkel ID"
8
+ "Rating %s out of %s, based on %s customer reviews","Klanten geven ons %s van %s op basis van %s reviews"
9
+ "%s recommandation, based on %s customer reviews","Aanbevolen door %s, Totaal aantal beoordelingen %s"
10
+ "Use: {{block type=""kiyohsnippets/snippets" name=""kiyohsnippets""}} to call the block on the homepage","Gebruik: {{block type=""kiyohsnippets/snippets"" name=""kiyohsnippets""}} om het Rich Snippets blok op de homepage te plaatsen"
11
+ "Data Type","Beoordeling"
12
+ "Score","Score"
13
+ "Recommended","Aanbevelingen"
14
+ "Text Suffix","Text toevoegen"
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Magmodules_Kiyohsnippets</name>
4
- <version>1.1.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.magmodules.eu/license-agreement/">Single Server License</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Add Kiyoh rich snippets to Magento Homepage</description>
11
  <notes>Kiyoh Snippets</notes>
12
  <authors><author><name>Magmodules</name><user>magmodules</user><email>info@magmodules.nl</email></author></authors>
13
- <date>2015-03-09</date>
14
- <time>17:47:00</time>
15
- <contents><target name="magelocal"><dir name="Magmodules"><dir name="Kiyohsnippets"><dir name="Block"><dir name="Adminhtml"><dir name="Widget"><dir name="Info"><file name="Info.php" hash="1823776726ed5fbb20194273caa9d697"/></dir></dir></dir><file name="Snippets.php" hash="d05d621579caa4740f337ff546ee1d30"/></dir><dir name="Helper"><file name="Data.php" hash="bf62c0595fec602184f7aa09ac569a7a"/></dir><dir name="Model"><dir name="System"><dir name="Config"><file name="Flushcache.php" hash="4bfbb3e62efba51e03f8acd0f9440898"/><dir name="Source"><file name="Kiyoh.php" hash="bd872c8a084eac1d8c19e30374e07094"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="b1e35a5d348c01a00527c7eab95ca281"/><file name="config.xml" hash="6ac6b73a6e7b5ca1e13fc174a0e7a06f"/><file name="system.xml" hash="2968cdf4ca6ded16cfdc43b34545398d"/></dir></dir><dir name="Core"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Heading.php" hash="fee67b788632872f0b2c86309848d3d9"/></dir></dir></dir></dir><file name="Versions.php" hash="06380df9a00d674da609bb277e2c83b3"/><dir name="Widget"><dir name="Info"><file name="Info.php" hash="eafa9312b3e02bb64ffed5d1ded92d6a"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="82b21fbe51152aed9347e66bd7cbac9e"/></dir><dir name="etc"><file name="adminhtml.xml" hash="fd79d4d45a66203f7918387e492f9284"/><file name="config.xml" hash="a8d31b0ac85c237999bf300239cb1b00"/><file name="system.xml" hash="3907152fab9611c25f83a525250c5e0b"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="magmodules_core.xml" hash="118882894a7fef56c24329e044745b51"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="magmodules_kiyohsnippets.xml" hash="9b8e2e7fa569f1a0cc96520eeab1ace6"/></dir><dir name="template"><dir name="magmodules"><dir name="kiyohsnippets"><file name="block.phtml" hash="0a76ffd38901f6f96de70fa436629029"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="magmodules"><file name="comments.png" hash="f187231e161acd185dbb918c8d9b7b6d"/><file name="logo-small.png" hash="b7f5334665d500cd6068a0ce55cd6d74"/></dir></dir><file name="magmodules.css" hash="7cd6b3eca521f94eba537d89e772fc9c"/></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="magmodules"><dir name="kiyohsnippets"><dir><dir name="images"><file name="bkg_rating.gif" hash="0a8777c815350ddf1e316a537ad0c335"/></dir></dir><file name="style.css" hash="845a3fff753b6bcd2e133d6858557080"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Magmodules_Kiyohsnippets.csv" hash="5150919e5bbe895d7f52ea2d8c5c9fbb"/></dir><dir name="nl_NL"><file name="Magmodules_Kiyohsnippets.csv" hash="5f44c5752e32be0cc928da68034d0959"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magmodules_Kiyohsnippets.xml" hash="71256b4e72ddf5170b139515dc80a54b"/><file name="Magmodules_Core.xml" hash="2697672510696f9cc390b995103c89c7"/></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>Magmodules_Kiyohsnippets</name>
4
+ <version>1.1.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.magmodules.eu/license-agreement/">Single Server License</license>
7
  <channel>community</channel>
10
  <description>Add Kiyoh rich snippets to Magento Homepage</description>
11
  <notes>Kiyoh Snippets</notes>
12
  <authors><author><name>Magmodules</name><user>magmodules</user><email>info@magmodules.nl</email></author></authors>
13
+ <date>2016-06-19</date>
14
+ <time>16:47:21</time>
15
+ <contents><target name="magelocal"><dir name="Magmodules"><dir name="Kiyohsnippets"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Heading.php" hash="bec666a09e2ed54beea311dfbee49920"/><file name="Version.php" hash="e35594be5b08f578f83e788e7e36e8cf"/></dir></dir></dir></dir><dir name="Widget"><dir name="Info"><file name="Info.php" hash="aa6c2f43ec61b7bedabbaabb164cca7a"/></dir></dir></dir><file name="Snippets.php" hash="24f389cb2e7a5a9a5d7d41fe50e3b626"/></dir><dir name="Helper"><file name="Data.php" hash="bd0f65a1fcef2955362c9af62a5beff0"/></dir><dir name="Model"><dir name="System"><dir name="Config"><file name="Flushcache.php" hash="748770ceb0a2585a15c91398312e8944"/><dir name="Source"><file name="Datatype.php" hash="b374578180a7f6eba42fd0a5245144f6"/><file name="Kiyoh.php" hash="0f01b0f43dd62511f54629246b7a0e0c"/></dir></dir></dir></dir><dir name="data"><dir name="kiyohsnippets_setup"><file name="data-upgrade-1.1.2-1.1.3.php" hash="00887d970b0a3baecbe08605c8ce3b3b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="6b9a3543614f85f4f8e796233548e159"/><file name="config.xml" hash="2515ffcaa6e259906de3e118eea5a2f7"/><file name="system.xml" hash="8d1402d1ab0f54f20bc72e104630b313"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="magmodules_kiyohsnippets.xml" hash="71f5ea3badfd758e694a1477db88bcd4"/></dir><dir name="template"><dir name="magmodules"><dir name="kiyohsnippets"><file name="block.phtml" hash="7a9b08807678d66f374c8484570a69c0"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Magmodules_Kiyohsnippets.csv" hash="5150919e5bbe895d7f52ea2d8c5c9fbb"/></dir><dir name="nl_NL"><file name="Magmodules_Kiyohsnippets.csv" hash="983507d9558ade4ef78862d0f1f3a8b3"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magmodules_Kiyohsnippets.xml" hash="71256b4e72ddf5170b139515dc80a54b"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="magmodules"><dir name="kiyohsnippets"><dir><dir name="images"><file name="5-stars-empty.png" hash="799c499ca785331e7e69d892df52dd48"/><file name="5-stars-full.png" hash="1d06151a2c4da6bb71381538c8a903a5"/><file name="bkg_rating.gif" hash="0a8777c815350ddf1e316a537ad0c335"/></dir></dir><file name="style.css" hash="27e6f766d0d59dfe2773867b43638b3d"/></dir></dir></dir></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>
skin/adminhtml/default/default/images/magmodules/comments.png DELETED
Binary file
skin/adminhtml/default/default/images/magmodules/logo-small.png DELETED
Binary file
skin/adminhtml/default/default/magmodules.css DELETED
@@ -1,53 +0,0 @@
1
- /**
2
- * Magmodules.eu
3
- * http://www.magmodules.eu
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to info@magmodules.eu so we can send you a copy immediately.
14
- *
15
- * @category Magmodules
16
- * @package Magmodules_Core
17
- * @author Magmodules <info@magmodules.eu>
18
- * @copyright Copyright (c) 2013 (http://www.magmodules.eu)
19
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
- */
21
-
22
- h3.mm-moduleheader {
23
- background: url("images/magmodules/logo-small.png") no-repeat scroll 4px 0 transparent;
24
- padding: 18px 0 2px 160px;
25
- height: 20px;
26
- font-size: 16px;
27
- color: #6C6C6C;
28
- }
29
-
30
- p.mm-info {
31
- border: 1px solid #ccc;
32
- padding: 5px;
33
- }
34
-
35
- a.magtooltip span {
36
- display:none;
37
- padding:2px 3px;
38
- margin-left:8px;
39
- width:550px;
40
- }
41
-
42
- a.magtooltip:hover span {
43
- display:inline;
44
- position:absolute;
45
- background:#ffffff;
46
- border:1px solid #cccccc;
47
- color:#6c6c6c;
48
- }
49
-
50
- .magtooltip hr {
51
- height:1px;
52
- border: 1px dotted #606;
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
skin/frontend/base/default/magmodules/kiyohsnippets/images/5-stars-empty.png ADDED
Binary file
skin/frontend/base/default/magmodules/kiyohsnippets/images/5-stars-full.png ADDED
Binary file
skin/frontend/base/default/magmodules/kiyohsnippets/style.css CHANGED
@@ -18,12 +18,25 @@
18
  * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
-
22
  .kiyoh-shop-snippets {
23
- margin-top: 5px;
24
  }
25
 
26
  .kiyoh-shop-snippets .rating-box {
27
- float: left;
28
- margin: 3px 5px 0px 0px;
29
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
 
21
  .kiyoh-shop-snippets {
22
+ margin-top: 5px;
23
  }
24
 
25
  .kiyoh-shop-snippets .rating-box {
26
+ float: left;
27
+ margin: 0 5px 0 0;
28
  }
29
+
30
+ .rating {
31
+ display: block;
32
+ background: url(./images/5-stars-full.png) no-repeat;
33
+ background-size: 100px;
34
+ height: 50px;
35
+ }
36
+
37
+ .rating-box {
38
+ width: 100px;
39
+ background: url(./images/5-stars-empty.png) no-repeat;
40
+ margin: 5px auto;
41
+ background-size: 100px;
42
+ }