Version Notes
Kiyoh Snippets
Download this release
Release Info
Developer | Magento Core Team |
Extension | Magmodules_Kiyohsnippets |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.0
- app/code/local/Magmodules/Core/Block/Adminhtml/System/Config/Form/Field/Heading.php +11 -6
- app/code/local/Magmodules/Core/Block/Adminhtml/Versions.php +72 -0
- app/code/local/Magmodules/Core/Block/Adminhtml/Widget/Info/Info.php +56 -0
- app/code/local/Magmodules/Core/Helper/Data.php +20 -0
- app/code/local/Magmodules/Core/etc/adminhtml.xml +42 -0
- app/code/local/Magmodules/Core/etc/config.xml +40 -8
- app/code/local/Magmodules/Core/etc/system.xml +42 -7
- app/code/local/Magmodules/Kiyohsnippets/Block/Adminhtml/Widget/Info/Info.php +54 -0
- app/code/local/Magmodules/Kiyohsnippets/Block/Snippets.php +19 -24
- app/code/local/Magmodules/Kiyohsnippets/Helper/Data.php +25 -25
- app/code/local/Magmodules/Kiyohsnippets/Model/System/Config/Flushcache.php +28 -0
- app/code/local/Magmodules/Kiyohsnippets/Model/System/Config/Source/Kiyoh.php +31 -0
- app/code/local/Magmodules/Kiyohsnippets/etc/adminhtml.xml +2 -3
- app/code/local/Magmodules/Kiyohsnippets/etc/config.xml +9 -5
- app/code/local/Magmodules/Kiyohsnippets/etc/system.xml +34 -20
- app/design/adminhtml/default/default/layout/magmodules_core.xml +30 -0
- app/design/frontend/base/default/layout/magmodules_kiyohsnippets.xml +2 -2
- app/design/frontend/base/default/template/magmodules/kiyohsnippets/block.phtml +6 -14
- package.xml +4 -4
- skin/frontend/base/default/magmodules/kiyohsnippets/style.css +5 -17
app/code/local/Magmodules/Core/Block/Adminhtml/System/Config/Form/Field/Heading.php
CHANGED
@@ -1,13 +1,18 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magmodules.eu
|
4 |
-
*
|
5 |
-
*
|
|
|
|
|
|
|
|
|
6 |
* @category Magmodules
|
7 |
* @package Magmodules_Core
|
8 |
-
* @author Magmodules <info@magmodules.eu
|
9 |
-
* @copyright Copyright (c)
|
10 |
-
* @license http://www.magmodules.eu/license-agreement/
|
|
|
11 |
*/
|
12 |
|
13 |
class Magmodules_Core_Block_Adminhtml_System_Config_Form_Field_Heading extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
|
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
|
app/code/local/Magmodules/Core/Block/Adminhtml/Versions.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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> </td>
|
42 |
+
<td> </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
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
CHANGED
@@ -1,20 +1,25 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* Magmodules.eu
|
5 |
-
*
|
6 |
-
*
|
|
|
|
|
|
|
|
|
7 |
* @category Magmodules
|
8 |
* @package Magmodules_Core
|
9 |
-
* @author Magmodules <info@magmodules.eu
|
10 |
-
* @copyright Copyright (c)
|
11 |
-
* @license http://www.magmodules.eu/license-agreement/
|
|
|
12 |
*/
|
13 |
-->
|
14 |
<config>
|
15 |
<modules>
|
16 |
<Magmodules_Core>
|
17 |
-
<version>1.0.
|
18 |
</Magmodules_Core>
|
19 |
</modules>
|
20 |
<global>
|
@@ -23,12 +28,39 @@
|
|
23 |
<class>Magmodules_Core_Block_Adminhtml</class>
|
24 |
</magmodules_core>
|
25 |
</blocks>
|
|
|
|
|
|
|
|
|
|
|
26 |
</global>
|
27 |
<adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
<layout>
|
29 |
<updates>
|
30 |
<magmodulescore>
|
31 |
-
<file>
|
32 |
</magmodulescore>
|
33 |
</updates>
|
34 |
</layout>
|
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>
|
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>
|
app/code/local/Magmodules/Core/etc/system.xml
CHANGED
@@ -1,14 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* Magmodules.eu
|
5 |
-
*
|
6 |
-
*
|
|
|
|
|
|
|
|
|
7 |
* @category Magmodules
|
8 |
* @package Magmodules_Core
|
9 |
-
* @author Magmodules <info@magmodules.eu
|
10 |
-
* @copyright Copyright (c)
|
11 |
-
* @license http://www.magmodules.eu/license-agreement/
|
|
|
12 |
*/
|
13 |
-->
|
14 |
<config>
|
@@ -18,4 +23,34 @@
|
|
18 |
<sort_order>200</sort_order>
|
19 |
</magmodules>
|
20 |
</tabs>
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>
|
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/Widget/Info/Info.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) 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 />
|
29 |
+
<table width="500px" border="0">
|
30 |
+
<tr>
|
31 |
+
<td width="58%">View more extensions from us:</td>
|
32 |
+
<td width="42%"><a href="http://www.magentocommerce.com/magento-connect/developer/Magmodules" target="_blank">Magento Connect</a></td>
|
33 |
+
</tr>
|
34 |
+
<td>Send us an E-mail:
|
35 |
+
<td><a href="mailto:info@magmodules.eu">info@magmodules.eu</a></td>
|
36 |
+
</tr>
|
37 |
+
<tr>
|
38 |
+
<td height="30">Visit our website:</td>
|
39 |
+
<td><a href="http://www.magmodules.eu" target="_blank">www.magmodules.eu</a></td>
|
40 |
+
</tr>
|
41 |
+
<tr>
|
42 |
+
<td> </td>
|
43 |
+
<td> </td>
|
44 |
+
</tr>
|
45 |
+
<tr>
|
46 |
+
<td height="30"><strong>Need help?</strong></td>
|
47 |
+
<td><strong><a href="http://www.magmodules.eu/help/kiyoh-rich-snippets" target="_blank">Online manual</a></strong></td>
|
48 |
+
</tr>
|
49 |
+
</table>
|
50 |
+
</div>';
|
51 |
+
return $html;
|
52 |
+
}
|
53 |
+
|
54 |
+
}
|
app/code/local/Magmodules/Kiyohsnippets/Block/Snippets.php
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
-
<?php
|
2 |
/**
|
3 |
-
* Magmodules.eu
|
4 |
-
* http://www.magmodules.eu
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
@@ -16,41 +15,37 @@
|
|
16 |
* @category Magmodules
|
17 |
* @package Magmodules_Kiyohsnippets
|
18 |
* @author Magmodules <info@magmodules.eu)
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Magmodules_Kiyohsnippets_Block_Snippets extends Mage_Core_Block_Template {
|
24 |
|
25 |
-
protected function _construct()
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
|
|
|
|
|
35 |
}
|
36 |
|
37 |
-
public function getSnapshopRequest()
|
38 |
-
{
|
39 |
return $this->helper('kiyohsnippets')->getSnapshopRequest();
|
40 |
}
|
41 |
|
42 |
-
public function getKiyohLink()
|
43 |
-
{
|
44 |
return $this->helper('kiyohsnippets')->getKiyohLink();
|
45 |
}
|
46 |
|
47 |
-
public function
|
48 |
-
{
|
49 |
-
return Mage::getStoreConfig('kiyohsnippets/api/shop_name');
|
50 |
-
}
|
51 |
-
|
52 |
-
public function getKiyohStars($rating)
|
53 |
-
{
|
54 |
return $this->helper('kiyohsnippets')->getKiyohStars($rating);
|
55 |
}
|
56 |
|
1 |
+
<?php
|
2 |
/**
|
3 |
+
* Magmodules.eu - http://www.magmodules.eu
|
|
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
|
app/code/local/Magmodules/Kiyohsnippets/Helper/Data.php
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
-
<?php
|
2 |
/**
|
3 |
-
* Magmodules.eu
|
4 |
-
* http://www.magmodules.eu
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
@@ -16,42 +15,34 @@
|
|
16 |
* @category Magmodules
|
17 |
* @package Magmodules_Kiyohsnippets
|
18 |
* @author Magmodules <info@magmodules.eu)
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
|
23 |
class Magmodules_Kiyohsnippets_Helper_Data extends Mage_Core_Helper_Abstract {
|
24 |
|
25 |
-
function getSnapshopRequest()
|
26 |
-
|
27 |
-
$
|
28 |
-
$filename
|
29 |
-
|
30 |
if($kiyoh_shop_id) {
|
31 |
-
$xml =
|
32 |
if($xml) {
|
33 |
$data = $xml->channel->description;
|
34 |
$snippets = array();
|
35 |
|
36 |
-
|
37 |
-
if (preg_match("/[0-9]+%/", $data, $matches)) {
|
38 |
$snippets['avg'] = substr($matches[0], 0, -1);
|
39 |
}
|
40 |
|
41 |
-
// NUMBER OF REVIEWS
|
42 |
$pieces = explode(' ', $data);
|
43 |
$snippets['qty'] = array_pop($pieces);
|
44 |
-
|
45 |
-
// SHOPNAME
|
46 |
-
$snippets['shopname'] = 'shopname';
|
47 |
-
|
48 |
return $snippets;
|
49 |
-
}
|
50 |
-
return false;
|
51 |
-
}
|
52 |
-
} else {
|
53 |
-
return false;
|
54 |
}
|
|
|
55 |
}
|
56 |
|
57 |
function getKiyohLink() {
|
@@ -63,8 +54,7 @@ class Magmodules_Kiyohsnippets_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
63 |
}
|
64 |
}
|
65 |
|
66 |
-
function getKiyohStars($rating)
|
67 |
-
{
|
68 |
if(Mage::getStoreConfig('kiyohsnippets/api/show_stars')) {
|
69 |
$perc = $rating;
|
70 |
$html = '<div class="rating-box">';
|
@@ -76,4 +66,14 @@ class Magmodules_Kiyohsnippets_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
76 |
}
|
77 |
}
|
78 |
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
/**
|
3 |
+
* Magmodules.eu - http://www.magmodules.eu
|
|
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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() {
|
54 |
}
|
55 |
}
|
56 |
|
57 |
+
function getKiyohStars($rating) {
|
|
|
58 |
if(Mage::getStoreConfig('kiyohsnippets/api/show_stars')) {
|
59 |
$perc = $rating;
|
60 |
$html = '<div class="rating-box">';
|
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)){
|
73 |
+
return simplexml_load_string($xml);
|
74 |
+
} else {
|
75 |
+
return false;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
}
|
app/code/local/Magmodules/Kiyohsnippets/Model/System/Config/Flushcache.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) 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 |
+
|
28 |
+
}
|
app/code/local/Magmodules/Kiyohsnippets/Model/System/Config/Source/Kiyoh.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) 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('kiyoh')->__('Kiyoh.nl'),
|
27 |
+
'www.kiyoh.com' => Mage::helper('kiyoh')->__('Kiyoh.com'),
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
}
|
app/code/local/Magmodules/Kiyohsnippets/etc/adminhtml.xml
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* Magmodules.eu
|
5 |
-
* http://www.magmodules.eu
|
6 |
*
|
7 |
* NOTICE OF LICENSE
|
8 |
*
|
@@ -17,7 +16,7 @@
|
|
17 |
* @category Magmodules
|
18 |
* @package Magmodules_Kiyohsnippets
|
19 |
* @author Magmodules <info@magmodules.eu)
|
20 |
-
* @copyright Copyright (c)
|
21 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
*/
|
23 |
-->
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
+
* Magmodules.eu - http://www.magmodules.eu
|
|
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
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 |
-->
|
app/code/local/Magmodules/Kiyohsnippets/etc/config.xml
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* Magmodules.eu
|
5 |
-
* http://www.magmodules.eu
|
6 |
*
|
7 |
* NOTICE OF LICENSE
|
8 |
*
|
@@ -17,14 +16,14 @@
|
|
17 |
* @category Magmodules
|
18 |
* @package Magmodules_Kiyohsnippets
|
19 |
* @author Magmodules <info@magmodules.eu)
|
20 |
-
* @copyright Copyright (c)
|
21 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
*/
|
23 |
-->
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Magmodules_Kiyohsnippets>
|
27 |
-
<version>1.
|
28 |
</Magmodules_Kiyohsnippets>
|
29 |
</modules>
|
30 |
<global>
|
@@ -37,7 +36,12 @@
|
|
37 |
<kiyohsnippets>
|
38 |
<class>Magmodules_Kiyohsnippets_Block</class>
|
39 |
</kiyohsnippets>
|
40 |
-
</blocks>
|
|
|
|
|
|
|
|
|
|
|
41 |
</global>
|
42 |
<frontend>
|
43 |
<layout>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
+
* Magmodules.eu - http://www.magmodules.eu
|
|
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
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 |
-->
|
23 |
<config>
|
24 |
<modules>
|
25 |
<Magmodules_Kiyohsnippets>
|
26 |
+
<version>1.1.0</version>
|
27 |
</Magmodules_Kiyohsnippets>
|
28 |
</modules>
|
29 |
<global>
|
36 |
<kiyohsnippets>
|
37 |
<class>Magmodules_Kiyohsnippets_Block</class>
|
38 |
</kiyohsnippets>
|
39 |
+
</blocks>
|
40 |
+
<models>
|
41 |
+
<kiyohsnippets>
|
42 |
+
<class>Magmodules_Kiyohsnippets_Model</class>
|
43 |
+
</kiyohsnippets>
|
44 |
+
</models>
|
45 |
</global>
|
46 |
<frontend>
|
47 |
<layout>
|
app/code/local/Magmodules/Kiyohsnippets/etc/system.xml
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
* Magmodules.eu
|
5 |
-
* http://www.magmodules.eu
|
6 |
*
|
7 |
* NOTICE OF LICENSE
|
8 |
*
|
@@ -17,7 +16,7 @@
|
|
17 |
* @category Magmodules
|
18 |
* @package Magmodules_Kiyohsnippets
|
19 |
* @author Magmodules <info@magmodules.eu)
|
20 |
-
* @copyright Copyright (c)
|
21 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
*/
|
23 |
-->
|
@@ -30,15 +29,21 @@
|
|
30 |
</tabs>
|
31 |
<sections>
|
32 |
<kiyohsnippets translate="label" module="kiyohsnippets">
|
33 |
-
<label>Kiyoh Snippets</label>
|
34 |
<tab>magmodules</tab>
|
35 |
-
<header_css>mm-moduleheader</header_css>
|
36 |
<frontend_type>text</frontend_type>
|
37 |
-
<sort_order>
|
38 |
<show_in_default>1</show_in_default>
|
39 |
<show_in_website>1</show_in_website>
|
40 |
<show_in_store>1</show_in_store>
|
41 |
<groups>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
<api translate="label" module="kiyohsnippets">
|
43 |
<label>General configuration</label>
|
44 |
<frontend_type>text</frontend_type>
|
@@ -47,14 +52,12 @@
|
|
47 |
<show_in_website>1</show_in_website>
|
48 |
<show_in_store>1</show_in_store>
|
49 |
<expanded>1</expanded>
|
50 |
-
<comment>
|
51 |
-
<![CDATA[<p style="padding: 5px; border: 1px solid #ccc">Use: {{block type="kiyohsnippets/snippets" name="kiyohsnippets"}} to call the block on the homepage</p>]]>
|
52 |
-
</comment>
|
53 |
<fields>
|
54 |
<enabled translate="label">
|
55 |
<label>Enabled</label>
|
56 |
<frontend_type>select</frontend_type>
|
57 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
|
|
58 |
<sort_order>1</sort_order>
|
59 |
<show_in_default>1</show_in_default>
|
60 |
<show_in_website>1</show_in_website>
|
@@ -68,10 +71,19 @@
|
|
68 |
<show_in_website>1</show_in_website>
|
69 |
<show_in_store>1</show_in_store>
|
70 |
</heading_api>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
<shop_id translate="label">
|
72 |
<label>Shop ID</label>
|
73 |
<frontend_type>text</frontend_type>
|
74 |
-
<sort_order>
|
75 |
<show_in_default>1</show_in_default>
|
76 |
<show_in_website>1</show_in_website>
|
77 |
<show_in_store>1</show_in_store>
|
@@ -83,15 +95,7 @@
|
|
83 |
<show_in_default>1</show_in_default>
|
84 |
<show_in_website>1</show_in_website>
|
85 |
<show_in_store>1</show_in_store>
|
86 |
-
</heading_design>
|
87 |
-
<shop_name translate="label">
|
88 |
-
<label>Shopname</label>
|
89 |
-
<frontend_type>text</frontend_type>
|
90 |
-
<sort_order>6</sort_order>
|
91 |
-
<show_in_default>1</show_in_default>
|
92 |
-
<show_in_website>1</show_in_website>
|
93 |
-
<show_in_store>1</show_in_store>
|
94 |
-
</shop_name>
|
95 |
<show_stars translate="label">
|
96 |
<label>Show Stars</label>
|
97 |
<frontend_type>select</frontend_type>
|
@@ -120,7 +124,17 @@
|
|
120 |
<depends><show_link>1</show_link></depends>
|
121 |
</kiyoh_link>
|
122 |
</fields>
|
123 |
-
</api>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
</groups>
|
125 |
</kiyohsnippets>
|
126 |
</sections>
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
+
* Magmodules.eu - http://www.magmodules.eu
|
|
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
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 |
</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>
|
39 |
<groups>
|
40 |
+
<info>
|
41 |
+
<frontend_model>kiyohsnippets/adminhtml_widget_info_info</frontend_model>
|
42 |
+
<sort_order>1</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</info>
|
47 |
<api translate="label" module="kiyohsnippets">
|
48 |
<label>General configuration</label>
|
49 |
<frontend_type>text</frontend_type>
|
52 |
<show_in_website>1</show_in_website>
|
53 |
<show_in_store>1</show_in_store>
|
54 |
<expanded>1</expanded>
|
|
|
|
|
|
|
55 |
<fields>
|
56 |
<enabled translate="label">
|
57 |
<label>Enabled</label>
|
58 |
<frontend_type>select</frontend_type>
|
59 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
60 |
+
<backend_model>kiyohsnippets/system_config_flushcache</backend_model>
|
61 |
<sort_order>1</sort_order>
|
62 |
<show_in_default>1</show_in_default>
|
63 |
<show_in_website>1</show_in_website>
|
71 |
<show_in_website>1</show_in_website>
|
72 |
<show_in_store>1</show_in_store>
|
73 |
</heading_api>
|
74 |
+
<api_url translate="label">
|
75 |
+
<label>Localisation</label>
|
76 |
+
<frontend_type>select</frontend_type>
|
77 |
+
<source_model>kiyoh/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>
|
82 |
+
</api_url>
|
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>
|
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>
|
124 |
<depends><show_link>1</show_link></depends>
|
125 |
</kiyoh_link>
|
126 |
</fields>
|
127 |
+
</api>
|
128 |
+
<snippets translate="label">
|
129 |
+
<label>Usage</label>
|
130 |
+
<frontend_type>text</frontend_type>
|
131 |
+
<sort_order>3</sort_order>
|
132 |
+
<show_in_default>1</show_in_default>
|
133 |
+
<show_in_website>1</show_in_website>
|
134 |
+
<show_in_store>1</show_in_store>
|
135 |
+
<expanded>1</expanded>
|
136 |
+
<comment><![CDATA[<p>Use: {{block type="kiyohsnippets/snippets" name="kiyohsnippets"}} to call the block on the homepage.</p>]]></comment>
|
137 |
+
</snippets>
|
138 |
</groups>
|
139 |
</kiyohsnippets>
|
140 |
</sections>
|
app/design/adminhtml/default/default/layout/magmodules_core.xml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magmodules.eu
|
5 |
+
* http://www.magmodules.eu
|
6 |
+
*
|
7 |
+
* NOTICE OF LICENSE
|
8 |
+
*
|
9 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
10 |
+
* that is bundled with this package in the file LICENSE.txt.
|
11 |
+
* It is also available through the world-wide-web at this URL:
|
12 |
+
* http://opensource.org/licenses/osl-3.0.php
|
13 |
+
* If you did not receive a copy of the license and are unable to
|
14 |
+
* obtain it through the world-wide-web, please send an email
|
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>
|
app/design/frontend/base/default/layout/magmodules_kiyohsnippets.xml
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<layout version="0.1.0">
|
3 |
-
<
|
4 |
<reference name="head">
|
5 |
<action method="addCss"><stylesheet>magmodules/kiyohsnippets/style.css</stylesheet></action>
|
6 |
</reference>
|
7 |
-
</
|
8 |
</layout>
|
1 |
<?xml version="1.0"?>
|
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>
|
app/design/frontend/base/default/template/magmodules/kiyohsnippets/block.phtml
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Magmodules.eu
|
4 |
-
* http://www.magmodules.eu
|
5 |
*
|
6 |
* NOTICE OF LICENSE
|
7 |
*
|
@@ -16,25 +15,18 @@
|
|
16 |
* @category Magmodules
|
17 |
* @package Magmodules_Kiyohsnippets
|
18 |
* @author Magmodules <info@magmodules.eu)
|
19 |
-
* @copyright Copyright (c)
|
20 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
21 |
*/
|
22 |
-
|
23 |
-
if($this->getSnippetsEnabled()) {
|
24 |
-
$snippets = $this->getSnapshopRequest();
|
25 |
-
$kiyohlink = $this->getKiyohLink();
|
26 |
-
$shopname = $this->getShopname();
|
27 |
-
if($snippets) {
|
28 |
?>
|
|
|
29 |
<div class="kiyoh-shop-snippets">
|
30 |
<?php echo $this->getKiyohStars($snippets['avg']); ?>
|
31 |
-
<div class="kiyoh-schema" itemscope="itemscope" itemtype="http://schema.org/
|
32 |
-
<meta itemprop="name" content="<?php echo $shopname; ?>">
|
33 |
<div itemprop="aggregateRating" itemscope="itemscope" itemtype="http://schema.org/AggregateRating">
|
34 |
<meta itemprop="bestRating" content="100">
|
35 |
-
<p><?php echo Mage::helper('kiyohsnippets')->__('Rating %s based on %s customer reviews', '<span itemprop="ratingValue">' . $snippets['avg'] . '</span>%', '<span itemprop="
|
36 |
</div>
|
37 |
</div>
|
38 |
</div>
|
39 |
-
|
40 |
-
<?php } ?>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Magmodules.eu - http://www.magmodules.eu
|
|
|
4 |
*
|
5 |
* NOTICE OF LICENSE
|
6 |
*
|
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 |
+
<?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 } ?>
|
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Magmodules_Kiyohsnippets</name>
|
4 |
-
<version>1.
|
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>auto-converted</user><email>info@magmodules.nl</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magelocal"><dir name="Magmodules"><dir name="Kiyohsnippets"><dir name="Block"><file name="Snippets.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Magmodules_Kiyohsnippets</name>
|
4 |
+
<version>1.1.0</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>auto-converted</user><email>info@magmodules.nl</email></author></authors>
|
13 |
+
<date>2015-02-13</date>
|
14 |
+
<time>14:19:07</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"><dir name="Source"><file name="Kiyoh.php" hash="a6da01d6df71e17c4f39760e737c694a"/></dir><file name="Flushcache.php" hash="4bfbb3e62efba51e03f8acd0f9440898"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="b1e35a5d348c01a00527c7eab95ca281"/><file name="config.xml" hash="fd1c1c61985ca802eb01e1a132855c34"/><file name="system.xml" hash="ecc2f5214bfe65987ac80ab422f4e596"/></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><dir name="Widget"><dir name="Info"><file name="Info.php" hash="eafa9312b3e02bb64ffed5d1ded92d6a"/></dir></dir><file name="Versions.php" hash="06380df9a00d674da609bb277e2c83b3"/></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 name="images"><file name="bkg_rating.gif" hash="0a8777c815350ddf1e316a537ad0c335"/></dir><file name="style.css" hash="845a3fff753b6bcd2e133d6858557080"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Magmodules_Kiyohsnippets.csv" hash="5150919e5bbe895d7f52ea2d8c5c9fbb"/></dir><dir name="nl_NL"><file name="Magmodules_Kiyohsnippets.csv" hash="5f44c5752e32be0cc928da68034d0959"/></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/>
|
18 |
</package>
|
skin/frontend/base/default/magmodules/kiyohsnippets/style.css
CHANGED
@@ -19,23 +19,11 @@
|
|
19 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
*/
|
21 |
|
22 |
-
.kiyoh-shop-snippets
|
23 |
-
|
24 |
-
margin-right: 4px;
|
25 |
-
margin-top: 0px;
|
26 |
-
width:69px;
|
27 |
-
height:13px;
|
28 |
-
font-size:0;
|
29 |
-
line-height:0;
|
30 |
-
background:url('images/bkg_rating.gif') 0 0 repeat-x;
|
31 |
-
text-indent:-999em;
|
32 |
-
overflow:hidden;
|
33 |
}
|
34 |
|
35 |
-
.kiyoh-shop-snippets .rating {
|
36 |
-
float:left;
|
37 |
-
|
38 |
-
background:url('images/bkg_rating.gif') 0 100% repeat-x;
|
39 |
}
|
40 |
-
|
41 |
-
/** FOR DEFAULT USE OF RATING STARTS, REMOVE BOTH CLASSES FROM CSS **/
|
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 |
}
|
|
|
|