Asperience_Notificationmanager - Version 0.1.0

Version Notes

If you have ideas for improvements or find bugs, please send them to Jean-S├ębastien Hederer at www.asperience.fr, with ASPerience AddressComplete as part of the subject line.

Download this release

Release Info

Developer Magento Core Team
Extension Asperience_Notificationmanager
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

app/code/community/Asperience/Notificationmanager/Helper/Data.php ADDED
@@ -0,0 +1,23 @@
1
+ <?php
2
+ /**
3
+ * @category ASPerience
4
+ * @package Asperience_Notificationmanager
5
+ * @author ASPerience - www.asperience.fr
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+
9
+ class Asperience_Notificationmanager_Helper_Data extends Mage_Core_Helper_Data
10
+ {
11
+
12
+ public function createAdminNotification($title, $desc, $url, $severity=Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE) {
13
+ $message = Mage::getModel ( 'adminnotification/inbox' )
14
+ ->setDateAdded(Mage::getModel('core/date')->gmtDate())
15
+ ->setTitle($title)
16
+ ->setDescription($desc)
17
+ ->setUrl($url)
18
+ ->setSeverity($severity);
19
+ $message->save();
20
+ return $this;
21
+ }
22
+
23
+ }
app/code/community/Asperience/Notificationmanager/Model/FeedReader.php ADDED
@@ -0,0 +1,26 @@
1
+ <?php
2
+ /**
3
+ * @category ASPerience
4
+ * @package Asperience_Notificationmanager
5
+ * @author ASPerience - www.asperience.fr
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+
9
+ class Asperience_Notificationmanager_Model_FeedReader extends Mage_AdminNotification_Model_Feed {
10
+
11
+ public function getFeedUrl() {
12
+ return "http://www.asperience.fr/magento_news.rss";
13
+ }
14
+
15
+ public function getLastUpdate()
16
+ {
17
+ return Mage::app()->loadCache('asperience_notificationmanager_lastupdate');
18
+ }
19
+
20
+ public function setLastUpdate($time=False)
21
+ {
22
+ if (!$time) $time=time();
23
+ Mage::app()->saveCache($time, 'asperience_notificationmanager_lastupdate');
24
+ return $this;
25
+ }
26
+ }
app/code/community/Asperience/Notificationmanager/Model/Observer.php ADDED
@@ -0,0 +1,16 @@
1
+ <?php
2
+ /**
3
+ * @category ASPerience
4
+ * @package Asperience_Notificationmanager
5
+ * @author ASPerience - www.asperience.fr
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+
9
+ class Asperience_Notificationmanager_Model_Observer {
10
+
11
+ public function checkNotifications($user) {
12
+ $model = new Asperience_Notificationmanager_Model_FeedReader();
13
+ $model->checkUpdate();
14
+ }
15
+
16
+ }
app/code/community/Asperience/Notificationmanager/Model/Resource/Setup.php ADDED
@@ -0,0 +1,12 @@
1
+ <?php
2
+ /**
3
+ * @category ASPerience
4
+ * @package Asperience_Notificationmanager
5
+ * @author ASPerience - www.asperience.fr
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+
9
+ class Asperience_Notificationmanager_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
10
+ {
11
+
12
+ }
app/code/community/Asperience/Notificationmanager/etc/adminhtml.xml ADDED
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <translate>
4
+ <modules>
5
+ <Asperience_Notificationmanager>
6
+ <files>
7
+ <default>Asperience_Notificationmanager.csv</default>
8
+ </files>
9
+ </Asperience_Notificationmanager>
10
+ </modules>
11
+ </translate>
12
+ </config>
app/code/community/Asperience/Notificationmanager/etc/config.xml ADDED
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Asperience
5
+ * @package Asperience_Notificationmanager
6
+ * @license http://www.asperience.fr
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Asperience_Notificationmanager>
12
+ <version>0.1.0</version>
13
+ </Asperience_Notificationmanager>
14
+ </modules>
15
+ <global>
16
+ <helpers>
17
+ <asperience_notificationmanager>
18
+ <class>Asperience_Notificationmanager_Helper</class>
19
+ </asperience_notificationmanager>
20
+ </helpers>
21
+ <models>
22
+ <asperience_notificationmanager>
23
+ <class>Asperience_Notificationmanager_Model</class>
24
+ </asperience_notificationmanager>
25
+ </models>
26
+ <events>
27
+ <admin_user_authenticate_after>
28
+ <observers>
29
+ <asperience_notificationmanager_observer>
30
+ <type>singleton</type>
31
+ <class>Asperience_Notificationmanager_Model_Observer</class>
32
+ <method>checkNotifications</method>
33
+ </asperience_notificationmanager_observer>
34
+ </observers>
35
+ </admin_user_authenticate_after>
36
+ </events>
37
+ <resources>
38
+ <asperience_notificationmanager_setup>
39
+ <setup>
40
+ <module>Asperience_Notificationmanager</module>
41
+ <class>Asperience_Notificationmanager_Model_Resource_Setup</class>
42
+ </setup>
43
+ </asperience_notificationmanager_setup>
44
+ </resources>
45
+ </global>
46
+ </config>
app/etc/modules/Asperience_Notificationmanager.xml ADDED
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category ASPerience
5
+ * @package Asperience_Notificationmanager
6
+ * @author ASPerience - www.asperience.fr
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Asperience_Notificationmanager>
13
+ <active>true</active>
14
+ <codePool>community</codePool>
15
+ </Asperience_Notificationmanager>
16
+ </modules>
17
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Asperience_Notificationmanager</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This module gives possibility to manage the messages in the backend.</summary>
10
+ <description>This module gives possibility to manage the messages in the backend.</description>
11
+ <notes>If you have ideas for improvements or find bugs, please send them to Jean-S&#xE9;bastien Hederer at www.asperience.fr, with ASPerience AddressComplete as part of the subject line.</notes>
12
+ <authors><author><name>Jean-S&#xE9;bastien Hederer</name><user>auto-converted</user><email>hedererjs@asperience.fr</email></author><author><name>J&#xE9;r&#xF4;me Boyen</name><user>auto-converted</user><email>boyenj@asperience.fr</email></author></authors>
13
+ <date>2014-11-25</date>
14
+ <time>16:27:05</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Asperience_Notificationmanager.xml" hash="88a3edd6e3361b4273e930378ca5b529"/></dir></target><target name="magecommunity"><dir name="Asperience"><dir name="Notificationmanager"><dir name="Helper"><file name="Data.php" hash="d48c424b0529ae25fe0fa67c1efe3481"/></dir><dir name="Model"><file name="FeedReader.php" hash="de1748a5595a1f48f6c6e1d8a5ad5567"/><file name="Observer.php" hash="215be764370a1ccf07ad9e7007d44ba9"/><dir name="Resource"><file name="Setup.php" hash="a402f6177549166049742b250c5f99a5"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="872d07598cc392561054a28344de150c"/><file name="config.xml" hash="04ec2de4ee95972aadf1ee226e48ec79"/></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>