public function checkUpdate() { if ($this->getFrequency() + $this->getLastUpdate() > time()) { return $this; } $this->setLastUpdate(); if (!extension_loaded('curl')) { return $this; } if ($this->_isPromoSubscribed()) { // load all new and relevant updates into inbox $feedData = array(); $feedXml = $this->getFeedData(); $wasInstalled = gmdate('Y-m-d H:i:s', Amasty_Base_Helper_Module::baseModuleInstalled()); if ($feedXml && $feedXml->channel && $feedXml->channel->item) { foreach ($feedXml->channel->item as $item) { $date = $this->getDate((string) $item->pubDate); // compare strings, but they are well-formmatted if ($date < $wasInstalled) { continue; } $feedData[] = array('severity' => 3, 'date_added' => $this->getDate($date), 'title' => (string) $item->title, 'description' => (string) $item->description, 'url' => (string) $item->link); } if ($feedData) { $inbox = Mage::getModel('adminnotification/inbox'); if ($inbox) { $inbox->parse($feedData); } } } } //load all available extensions in the cache Amasty_Base_Helper_Module::reload(); return $this; }
<?php /** * @author Amasty Team * @copyright Copyright (c) 2015 Amasty (https://www.amasty.com) * @package Amasty_Base */ $this->startSetup(); Amasty_Base_Helper_Module::baseModuleInstalled(); $feedData = array(); $feedData[] = array('severity' => 4, 'date_added' => gmdate('Y-m-d H:i:s', time()), 'title' => 'Amasty`s extension has been installed. Remember to flush all cache, recompile, log-out and log back in.', 'description' => 'You can see versions of the installed extensions right in the admin, as well as configure notifications about major updates.', 'url' => 'http://amasty.com/news/updates-and-notifications-configuration-9.html'); Mage::getModel('adminnotification/inbox')->parse($feedData); $this->endSetup();