Version Notes
No notes
Download this release
Release Info
Developer | Yireo |
Extension | Yireo_GooglePlusOne |
Version | 1.0.11 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.0.11
- app/code/community/Yireo/GooglePlusOne/Block/Default.php +2 -2
- app/code/community/Yireo/GooglePlusOne/Helper/Data.php +7 -4
- app/code/community/Yireo/GooglePlusOne/Model/Backend/Source/Pagetype.php +2 -2
- app/code/community/Yireo/GooglePlusOne/Model/Backend/Source/Size.php +2 -2
- app/code/community/Yireo/GooglePlusOne/Model/Feed.php +78 -0
- app/code/community/Yireo/GooglePlusOne/Model/Observer.php +15 -2
- app/code/community/Yireo/GooglePlusOne/etc/config.xml +25 -3
- app/code/community/Yireo/GooglePlusOne/etc/system.xml +2 -2
- app/design/frontend/base/default/layout/googleplusone.xml +3 -3
- app/design/frontend/base/default/template/googleplusone/default.phtml +9 -7
- app/etc/modules/Yireo_GooglePlusOne.xml +1 -1
- app/locale/en_US/Yireo_GooglePlusOne.csv +0 -0
- package.xml +1 -17
app/code/community/Yireo/GooglePlusOne/Block/Default.php
CHANGED
@@ -5,8 +5,8 @@
|
|
5 |
* @category design_default
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
-
* @copyright Copyright (
|
9 |
-
* @license Open
|
10 |
*/
|
11 |
|
12 |
class Yireo_GooglePlusOne_Block_Default extends Mage_Core_Block_Template
|
5 |
* @category design_default
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
+
* @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
|
9 |
+
* @license Open Source License (OSL v3)
|
10 |
*/
|
11 |
|
12 |
class Yireo_GooglePlusOne_Block_Default extends Mage_Core_Block_Template
|
app/code/community/Yireo/GooglePlusOne/Helper/Data.php
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
* GooglePlusOne plugin for Magento
|
4 |
*
|
5 |
* @package Yireo_GooglePlusOne
|
6 |
-
* @author Yireo
|
7 |
-
* @copyright Copyright (
|
8 |
-
* @license Open
|
9 |
*/
|
10 |
|
11 |
class Yireo_GooglePlusOne_Helper_Data extends Mage_Core_Helper_Abstract
|
@@ -19,7 +19,10 @@ class Yireo_GooglePlusOne_Helper_Data extends Mage_Core_Helper_Abstract
|
|
19 |
|
20 |
public function getHeaderScript()
|
21 |
{
|
22 |
-
|
|
|
|
|
|
|
23 |
}
|
24 |
|
25 |
/*
|
3 |
* GooglePlusOne plugin for Magento
|
4 |
*
|
5 |
* @package Yireo_GooglePlusOne
|
6 |
+
* @author Yireo (http://www.yireo.com/)
|
7 |
+
* @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
|
8 |
+
* @license Open Source License (OSL v3)
|
9 |
*/
|
10 |
|
11 |
class Yireo_GooglePlusOne_Helper_Data extends Mage_Core_Helper_Abstract
|
19 |
|
20 |
public function getHeaderScript()
|
21 |
{
|
22 |
+
$script = '<script type="text/javascript" src="https://apis.google.com/js/plusone.js">';
|
23 |
+
$script .= '{"lang" : "'.Mage::app()->getLocale()->getLocaleCode().'"}';
|
24 |
+
$script .= '</script>';
|
25 |
+
return $script;
|
26 |
}
|
27 |
|
28 |
/*
|
app/code/community/Yireo/GooglePlusOne/Model/Backend/Source/Pagetype.php
CHANGED
@@ -5,8 +5,8 @@
|
|
5 |
* @category design_default
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
-
* @copyright Copyright (
|
9 |
-
* @license Open
|
10 |
*/
|
11 |
|
12 |
class Yireo_GooglePlusOne_Model_Backend_Source_Pagetype
|
5 |
* @category design_default
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
+
* @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
|
9 |
+
* @license Open Source License (OSL v3)
|
10 |
*/
|
11 |
|
12 |
class Yireo_GooglePlusOne_Model_Backend_Source_Pagetype
|
app/code/community/Yireo/GooglePlusOne/Model/Backend/Source/Size.php
CHANGED
@@ -5,8 +5,8 @@
|
|
5 |
* @category design_default
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
-
* @copyright Copyright (
|
9 |
-
* @license Open
|
10 |
*/
|
11 |
|
12 |
class Yireo_GooglePlusOne_Model_Backend_Source_Size
|
5 |
* @category design_default
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
+
* @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
|
9 |
+
* @license Open Source License (OSL v3)
|
10 |
*/
|
11 |
|
12 |
class Yireo_GooglePlusOne_Model_Backend_Source_Size
|
app/code/community/Yireo/GooglePlusOne/Model/Feed.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Yireo Common
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Yireo_Common
|
7 |
+
* @copyright Copyright 2014
|
8 |
+
* @license Open Source License (OSL v3) (OSL)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*
|
13 |
+
* Feed Model
|
14 |
+
*/
|
15 |
+
class Yireo_GooglePlusOne_Model_Feed extends Mage_AdminNotification_Model_Feed
|
16 |
+
{
|
17 |
+
/**
|
18 |
+
* Return the feed URL
|
19 |
+
*/
|
20 |
+
protected $customFeedUrl = 'www.yireo.com/extfeed?format=feed&platform=magento&extension=googleplusone';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Return the feed URL
|
24 |
+
*
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function getFeedUrl()
|
28 |
+
{
|
29 |
+
return Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://'.$this->customFeedUrl;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Try to update feed
|
34 |
+
*
|
35 |
+
* @return mixed
|
36 |
+
*/
|
37 |
+
public function updateIfAllowed()
|
38 |
+
{
|
39 |
+
// Is this the backend
|
40 |
+
if (Mage::app()->getStore()->isAdmin() == false) {
|
41 |
+
return false;
|
42 |
+
}
|
43 |
+
|
44 |
+
// Is the backend-user logged-in
|
45 |
+
if (Mage::getSingleton('admin/session')->isLoggedIn() == false) {
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
|
49 |
+
// Is the feed disabled?
|
50 |
+
if((bool)Mage::getStoreConfig('yireo/common/disabled')) {
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
|
54 |
+
// Update the feed
|
55 |
+
$this->checkUpdate();
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Override the original method
|
60 |
+
*
|
61 |
+
* @return SimpleXMLElement
|
62 |
+
*/
|
63 |
+
public function getFeedData()
|
64 |
+
{
|
65 |
+
// Get the original data
|
66 |
+
$feedXml = parent::getFeedData();
|
67 |
+
|
68 |
+
if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
|
69 |
+
foreach ($feedXml->channel->item as $item) {
|
70 |
+
|
71 |
+
// Add the severity to each item
|
72 |
+
$feedXml->channel->item->severity = Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
return $feedXml;
|
77 |
+
}
|
78 |
+
}
|
app/code/community/Yireo/GooglePlusOne/Model/Observer.php
CHANGED
@@ -5,8 +5,8 @@
|
|
5 |
* @category design_default
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
-
* @copyright Copyright (
|
9 |
-
* @license Open
|
10 |
*/
|
11 |
|
12 |
class Yireo_GooglePlusOne_Model_Observer
|
@@ -31,4 +31,17 @@ class Yireo_GooglePlusOne_Model_Observer
|
|
31 |
|
32 |
return $this;
|
33 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
5 |
* @category design_default
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
+
* @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
|
9 |
+
* @license Open Source License (OSL v3)
|
10 |
*/
|
11 |
|
12 |
class Yireo_GooglePlusOne_Model_Observer
|
31 |
|
32 |
return $this;
|
33 |
}
|
34 |
+
|
35 |
+
/*
|
36 |
+
* Method fired on the event <controller_action_predispatch>
|
37 |
+
*
|
38 |
+
* @access public
|
39 |
+
* @param Varien_Event_Observer $observer
|
40 |
+
* @return Yireo_DeleteAnyOrder_Model_Observer
|
41 |
+
*/
|
42 |
+
public function controllerActionPredispatch($observer)
|
43 |
+
{
|
44 |
+
// Run the feed
|
45 |
+
Mage::getModel('googleplusone/feed')->updateIfAllowed();
|
46 |
+
}
|
47 |
}
|
app/code/community/Yireo/GooglePlusOne/etc/config.xml
CHANGED
@@ -6,14 +6,14 @@
|
|
6 |
* @category design_default
|
7 |
* @package Yireo_GooglePlusOne
|
8 |
* @author Yireo
|
9 |
-
* @copyright Copyright (
|
10 |
-
* @license Open
|
11 |
*/
|
12 |
-->
|
13 |
<config>
|
14 |
<modules>
|
15 |
<Yireo_GooglePlusOne>
|
16 |
-
<version>1.0.
|
17 |
</Yireo_GooglePlusOne>
|
18 |
</modules>
|
19 |
|
@@ -23,16 +23,19 @@
|
|
23 |
<class>Yireo_GooglePlusOne_Block</class>
|
24 |
</googleplusone>
|
25 |
</blocks>
|
|
|
26 |
<helpers>
|
27 |
<googleplusone>
|
28 |
<class>Yireo_GooglePlusOne_Helper</class>
|
29 |
</googleplusone>
|
30 |
</helpers>
|
|
|
31 |
<models>
|
32 |
<googleplusone>
|
33 |
<class>Yireo_GooglePlusOne_Model</class>
|
34 |
</googleplusone>
|
35 |
</models>
|
|
|
36 |
<events>
|
37 |
<core_block_abstract_to_html_after>
|
38 |
<observers>
|
@@ -43,6 +46,15 @@
|
|
43 |
</googleplusone_observer>
|
44 |
</observers>
|
45 |
</core_block_abstract_to_html_after>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
</events>
|
47 |
</global>
|
48 |
|
@@ -57,6 +69,16 @@
|
|
57 |
</frontend>
|
58 |
|
59 |
<adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
<acl>
|
61 |
<resources>
|
62 |
<admin>
|
6 |
* @category design_default
|
7 |
* @package Yireo_GooglePlusOne
|
8 |
* @author Yireo
|
9 |
+
* @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
|
10 |
+
* @license Open Source License (OSL v3)
|
11 |
*/
|
12 |
-->
|
13 |
<config>
|
14 |
<modules>
|
15 |
<Yireo_GooglePlusOne>
|
16 |
+
<version>1.0.11</version>
|
17 |
</Yireo_GooglePlusOne>
|
18 |
</modules>
|
19 |
|
23 |
<class>Yireo_GooglePlusOne_Block</class>
|
24 |
</googleplusone>
|
25 |
</blocks>
|
26 |
+
|
27 |
<helpers>
|
28 |
<googleplusone>
|
29 |
<class>Yireo_GooglePlusOne_Helper</class>
|
30 |
</googleplusone>
|
31 |
</helpers>
|
32 |
+
|
33 |
<models>
|
34 |
<googleplusone>
|
35 |
<class>Yireo_GooglePlusOne_Model</class>
|
36 |
</googleplusone>
|
37 |
</models>
|
38 |
+
|
39 |
<events>
|
40 |
<core_block_abstract_to_html_after>
|
41 |
<observers>
|
46 |
</googleplusone_observer>
|
47 |
</observers>
|
48 |
</core_block_abstract_to_html_after>
|
49 |
+
<controller_action_predispatch>
|
50 |
+
<observers>
|
51 |
+
<googleplusone_controller_action_predispatch>
|
52 |
+
<type>singleton</type>
|
53 |
+
<class>Yireo_GooglePlusOne_Model_Observer</class>
|
54 |
+
<method>controllerActionPredispatch</method>
|
55 |
+
</googleplusone_controller_action_predispatch>
|
56 |
+
</observers>
|
57 |
+
</controller_action_predispatch>
|
58 |
</events>
|
59 |
</global>
|
60 |
|
69 |
</frontend>
|
70 |
|
71 |
<adminhtml>
|
72 |
+
<translate>
|
73 |
+
<modules>
|
74 |
+
<Yireo_GooglePlusOne>
|
75 |
+
<files>
|
76 |
+
<default>Yireo_GooglePlusOne.csv</default>
|
77 |
+
</files>
|
78 |
+
</Yireo_GooglePlusOne>
|
79 |
+
</modules>
|
80 |
+
</translate>
|
81 |
+
|
82 |
<acl>
|
83 |
<resources>
|
84 |
<admin>
|
app/code/community/Yireo/GooglePlusOne/etc/system.xml
CHANGED
@@ -6,8 +6,8 @@
|
|
6 |
* @category design_default
|
7 |
* @package Yireo_GooglePlusOne
|
8 |
* @author Yireo
|
9 |
-
* @copyright Copyright (
|
10 |
-
* @license Open
|
11 |
*/
|
12 |
-->
|
13 |
<config>
|
6 |
* @category design_default
|
7 |
* @package Yireo_GooglePlusOne
|
8 |
* @author Yireo
|
9 |
+
* @copyright Copyright (C) 2014 Yireo (http://www.yireo.com/)
|
10 |
+
* @license Open Source License (OSL v3)
|
11 |
*/
|
12 |
-->
|
13 |
<config>
|
app/design/frontend/base/default/layout/googleplusone.xml
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
-
*
|
5 |
*
|
6 |
-
* @package
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
-
* @copyright Copyright (c)
|
9 |
* @license Open Source License (OSL)
|
10 |
*/
|
11 |
-->
|
1 |
<?xml version="1.0"?>
|
2 |
<!--
|
3 |
/**
|
4 |
+
* GooglePlusOne extension for Magento
|
5 |
*
|
6 |
+
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
+
* @copyright Copyright (c) 2012 Yireo (http://www.yireo.com/)
|
9 |
* @license Open Source License (OSL)
|
10 |
*/
|
11 |
-->
|
app/design/frontend/base/default/template/googleplusone/default.phtml
CHANGED
@@ -9,10 +9,12 @@
|
|
9 |
* @license Open Software License
|
10 |
*/
|
11 |
?>
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
<?php
|
16 |
-
|
17 |
-
<?php
|
18 |
-
|
|
|
|
9 |
* @license Open Software License
|
10 |
*/
|
11 |
?>
|
12 |
+
<?php if($this->getConfig('active')) : ?>
|
13 |
+
<div class="googleplusone">
|
14 |
+
<?php if($this->getConfig('pagetype') == 'html5') : ?>
|
15 |
+
<div class="g-plusone"<?php echo $this->getArguments(); ?>></div>
|
16 |
+
<?php else: ?>
|
17 |
+
<g:plusone<?php echo $this->getArguments(); ?>></g:plusone>
|
18 |
+
<?php endif; ?>
|
19 |
+
</div>
|
20 |
+
<?php endif; ?>
|
app/etc/modules/Yireo_GooglePlusOne.xml
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
*
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
-
* @copyright Copyright (c)
|
9 |
* @license Open Software License
|
10 |
*/
|
11 |
-->
|
5 |
*
|
6 |
* @package Yireo_GooglePlusOne
|
7 |
* @author Yireo (http://www.yireo.com/)
|
8 |
+
* @copyright Copyright (c) 2013 Yireo (http://www.yireo.com/)
|
9 |
* @license Open Software License
|
10 |
*/
|
11 |
-->
|
app/locale/en_US/Yireo_GooglePlusOne.csv
ADDED
File without changes
|
package.xml
CHANGED
@@ -1,18 +1,2 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<package>
|
3 |
-
<name>Yireo_GooglePlusOne</name>
|
4 |
-
<version>1.0.6</version>
|
5 |
-
<stability>stable</stability>
|
6 |
-
<license uri="http://www.opensource.org/licenses/osl-3.0.php/">Open Software License</license>
|
7 |
-
<channel>community</channel>
|
8 |
-
<extends/>
|
9 |
-
<summary>This module adds Google Plus One to Magento</summary>
|
10 |
-
<description>This module adds Google Plus One to Magento</description>
|
11 |
-
<notes>This module adds Google Plus One to Magento</notes>
|
12 |
-
<authors><author><name>Yireo</name><user>auto-converted</user><email>info@yireo.com</email></author></authors>
|
13 |
-
<date>2011-09-13</date>
|
14 |
-
<time>15:38:57</time>
|
15 |
-
<contents><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="googleplusone"><file name="default.phtml" hash="a31423250199274bc9289792ca6e66fc"/></dir></dir><dir name="layout"><file name="googleplusone.xml" hash="7861b6d8a5d40791ba0848d004e641dd"/></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Yireo"><dir name="GooglePlusOne"><dir name="Block"><file name="Default.php" hash="42bb87fb3a41c491dd9637a198576d11"/></dir><dir name="Model"><dir name="Backend"><dir name="Source"><file name="Size.php" hash="34d71c1b390df747fbed7c22eed28ad6"/><file name="Pagetype.php" hash="7349db7c3292eda4e3971d4291250a1d"/></dir></dir><file name="Observer.php" hash="5b3aab89c03138269a8c877a8bbe1837"/></dir><dir name="Helper"><file name="Data.php" hash="e7a9f894ee468741cf7570573371454d"/></dir><dir name="etc"><file name="config.xml" hash="cc8380cc1d99322463db6cd007f714cb"/><file name="system.xml" hash="34dae4529f07fd1db7e43fb4747ce94e"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Yireo_GooglePlusOne.xml" hash="db7a93cca2a6d87f9b4d8021cace5cf0"/></dir></target></contents>
|
16 |
-
<compatible/>
|
17 |
-
<dependencies/>
|
18 |
-
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<package><name>Yireo_GooglePlusOne</name><version>1.0.11</version><stability>stable</stability><license>Open Source License</license><channel>community</channel><extends></extends><summary>No summary</summary><description>No description</description><notes>No notes</notes><authors><author><name>Yireo</name><user>yireo</user><email>info@yireo.com</email></author></authors><date>2014-03-17</date><time>5:21:27</time><compatible></compatible><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><contents><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Yireo_GooglePlusOne.xml" hash="d7b243d240129a0822515299a821f172"/></dir></dir><dir name="code"><dir name="community"><dir name="Yireo"><dir name="GooglePlusOne"><dir name="Block"><file name="Default.php" hash="71aad7f9e194d3d00f6fff6f3fa2617d"/></dir><dir name="etc"><file name="config.xml" hash="e12b5e27efb78a576d90b30175056b6f"/><file name="system.xml" hash="22b573797d4235d645c9644747db02ba"/></dir><dir name="Helper"><file name="Data.php" hash="42e17724be68c700d2bf6e1d31d0c216"/></dir><dir name="Model"><file name="Feed.php" hash="f2c2a06b88ff8073fa91d97393127da3"/><file name="Observer.php" hash="9b0b86a3428448a83433039784dd4afd"/><dir name="Backend"><dir name="Source"><file name="Pagetype.php" hash="04f354715de0ea60db69c45ee423d00c"/><file name="Size.php" hash="67524d7cde7ccffcd4a45a4118e0fefc"/></dir></dir></dir></dir></dir></dir></dir><dir name="locale"><dir name="en_US"><file name="Yireo_GooglePlusOne.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="googleplusone"><file name="default.phtml" hash="135553404d07cbe45f2e784a3b10dfdd"/></dir></dir><dir name="layout"><file name="googleplusone.xml" hash="05d432cf64455e7962b5c7a4ab9bfe6b"/></dir></dir></dir></dir></dir></dir></target></contents></package>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|