Exemplo n.º 1
0
 /**
  * 
  * @return Aitoc_Aitsys_Model_Notification_News
  */
 public function getNews()
 {
     if (!$this->_news) {
         $this->_news = Mage::getModel('aitsys/notification_news');
         $this->_news->loadData();
     }
     return $this->_news->getNews();
 }
Exemplo n.º 2
0
 public function performPreDispatch(Varien_Event_Observer $observer)
 {
     $news = new Aitoc_Aitsys_Model_Notification_News();
     /* @var $news Aitoc_Aitsys_Model_Notification_News */
     $news->loadData();
     $important = new Aitoc_Aitsys_Model_Notification_Important();
     /* @var $important Aitoc_Aitsys_Model_Notification_Important */
     $important->loadData();
 }
Exemplo n.º 3
0
 /**
  * 
  * @return Aitoc_Aitsys_Model_Notification_News
  */
 public function saveData()
 {
     $feedData = array();
     foreach ($this->_news as $item) {
         if ($item['title'] || $item['content']) {
             $feedData[] = array('severity' => isset($item['severity']) ? $item['severity'] : Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR, 'date_added' => isset($item['pubDate']) ? $item['pubDate'] : date('Y-m-d H:i:s'), 'title' => isset($item['title']) ? $item['title'] : '', 'description' => isset($item['content']) ? $item['content'] : '', 'url' => isset($item['link']) && $item['link'] ? $item['link'] : 'http://aitoc.com/#' . strtolower(preg_replace('/\\W+/', '_', $item['title'])));
         }
     }
     if ($feedData) {
         Mage::getModel('adminnotification/inbox')->parse(array_reverse($feedData));
     }
     return parent::saveData();
 }