Version Notes
No notes
Download this release
Release Info
Developer | Yireo |
Extension | Yireo_DisableLog |
Version | 0.0.4 |
Comparing to | |
See all releases |
Code changes from version 0.0.2 to 0.0.4
app/code/community/Yireo/DisableLog/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 2013
|
8 |
+
* @license Open Source License (OSL)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*
|
13 |
+
* Feed Model
|
14 |
+
*/
|
15 |
+
class Yireo_DisableLog_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=disablelog';
|
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/DisableLog/Model/Observer.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Yireo DisableLog
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package DisableLog
|
7 |
+
* @copyright Copyright 2013
|
8 |
+
* @license Open Software License
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*
|
13 |
+
* DisableLog observer to various Magento events
|
14 |
+
*/
|
15 |
+
class Yireo_DisableLog_Model_Observer extends Mage_Core_Model_Abstract
|
16 |
+
{
|
17 |
+
/*
|
18 |
+
* Method fired on the event <controller_action_predispatch>
|
19 |
+
*
|
20 |
+
* @access public
|
21 |
+
* @param Varien_Event_Observer $observer
|
22 |
+
* @return Yireo_DisableLog_Model_Observer
|
23 |
+
*/
|
24 |
+
public function controllerActionPredispatch($observer)
|
25 |
+
{
|
26 |
+
// Run the feed
|
27 |
+
Mage::getModel('disablelog/feed')->updateIfAllowed();
|
28 |
+
}
|
29 |
+
}
|
app/code/community/Yireo/DisableLog/etc/config.xml
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
|
14 |
<modules>
|
15 |
<Yireo_DisableLog>
|
16 |
-
<version>0.0.
|
17 |
</Yireo_DisableLog>
|
18 |
</modules>
|
19 |
|
@@ -104,7 +104,7 @@
|
|
104 |
<children>
|
105 |
<config>
|
106 |
<children>
|
107 |
-
<disablelog translate="title" module="
|
108 |
<title>DisableLog Section</title>
|
109 |
</disablelog>
|
110 |
</children>
|
@@ -115,6 +115,18 @@
|
|
115 |
</admin>
|
116 |
</resources>
|
117 |
</acl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
</adminhtml>
|
119 |
|
120 |
<default>
|
13 |
|
14 |
<modules>
|
15 |
<Yireo_DisableLog>
|
16 |
+
<version>0.0.4</version>
|
17 |
</Yireo_DisableLog>
|
18 |
</modules>
|
19 |
|
104 |
<children>
|
105 |
<config>
|
106 |
<children>
|
107 |
+
<disablelog translate="title" module="disablelog">
|
108 |
<title>DisableLog Section</title>
|
109 |
</disablelog>
|
110 |
</children>
|
115 |
</admin>
|
116 |
</resources>
|
117 |
</acl>
|
118 |
+
|
119 |
+
<events>
|
120 |
+
<controller_action_predispatch>
|
121 |
+
<observers>
|
122 |
+
<disablelog_controller_action_predispatch>
|
123 |
+
<type>singleton</type>
|
124 |
+
<class>Yireo_DisableLog_Model_Observer</class>
|
125 |
+
<method>controllerActionPredispatch</method>
|
126 |
+
</disablelog_controller_action_predispatch>
|
127 |
+
</observers>
|
128 |
+
</controller_action_predispatch>
|
129 |
+
</events>
|
130 |
</adminhtml>
|
131 |
|
132 |
<default>
|
app/etc/modules/Yireo_DisableLog.xml
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
<config>
|
13 |
<modules>
|
14 |
<Yireo_DisableLog>
|
15 |
-
<active>
|
16 |
<codePool>community</codePool>
|
17 |
<depends>
|
18 |
<Mage_Core />
|
12 |
<config>
|
13 |
<modules>
|
14 |
<Yireo_DisableLog>
|
15 |
+
<active>true</active>
|
16 |
<codePool>community</codePool>
|
17 |
<depends>
|
18 |
<Mage_Core />
|
package.xml
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<package><name>Yireo_DisableLog</name><version>0.0.
|
1 |
<?xml version="1.0"?>
|
2 |
+
<package><name>Yireo_DisableLog</name><version>0.0.4</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>2013-09-14</date><time>9:21:09</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_DisableLog.xml" hash="0401f1790db89417d732f4b13f605a85"/></dir></dir><dir name="code"><dir name="community"><dir name="Yireo"><dir name="DisableLog"><dir name="etc"><file name="config.xml" hash="3bfb483e19bed68251e440ce9a7c71aa"/><file name="system.xml" hash="66c07d087dd0f8499332378db576d1ff"/></dir><dir name="Helper"><file name="Data.php" hash="b5a84b5d039ecc1e09286584aeb1ba29"/></dir><dir name="Model"><file name="Feed.php" hash="45cec351c081211c8fbc7e089905795e"/><file name="Observer.php" hash="fe13dc1d29a7f82d110811d3679b1678"/><dir name="Rewrite"><dir name="Log"><file name="Visitor.php" hash="d2428f2ec4d3a6e8f2ab77d32ce0a86f"/></dir><dir name="Catalogsearch"><file name="Query.php" hash="347b4a45d3b72d0d400cd16862a40ef3"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents></package>
|