Public Member Functions | |
getLatestNotice () | |
getUnreadNoticeCount ($severity) | |
getPopupObjectUrl ($withExt=false) | |
isReadablePopupObject () | |
Public Attributes | |
const | XML_PATH_POPUP_URL = 'system/adminnotification/popup_url' |
Protected Attributes | |
$_popupUrl | |
$_popupReadable | |
$_latestNotice | |
$_unreadNoticeCounts |
Definition at line 35 of file Data.php.
getLatestNotice | ( | ) |
Retrieve latest notice model
Definition at line 72 of file Data.php.
00073 { 00074 if (is_null($this->_latestNotice)) { 00075 $this->_latestNotice = Mage::getModel('adminnotification/inbox')->loadLatestNotice(); 00076 } 00077 return $this->_latestNotice; 00078 }
getPopupObjectUrl | ( | $ | withExt = false |
) |
Retrieve Widget Popup Notification Object URL
bool | $withExt |
Definition at line 100 of file Data.php.
00101 { 00102 if (is_null($this->_popupUrl)) { 00103 $sheme = Mage::app()->getFrontController()->getRequest()->isSecure() 00104 ? 'https://' 00105 : 'http://'; 00106 00107 $this->_popupUrl = $sheme . Mage::getStoreConfig(self::XML_PATH_POPUP_URL); 00108 } 00109 return $this->_popupUrl . ($withExt ? '.swf' : ''); 00110 }
getUnreadNoticeCount | ( | $ | severity | ) |
Retrieve count of unread notes by type
int | $severity |
Definition at line 86 of file Data.php.
00087 { 00088 if (is_null($this->_unreadNoticeCounts)) { 00089 $this->_unreadNoticeCounts = Mage::getModel('adminnotification/inbox')->getNoticeStatus(); 00090 } 00091 return isset($this->_unreadNoticeCounts[$severity]) ? $this->_unreadNoticeCounts[$severity] : 0; 00092 }
isReadablePopupObject | ( | ) |
Check is readable Popup Notification Object
Definition at line 117 of file Data.php.
00118 { 00119 if (is_null($this->_popupReadable)) { 00120 $this->_popupReadable = false; 00121 $curl = new Varien_Http_Adapter_Curl(); 00122 $curl->setConfig(array( 00123 'timeout' => 2 00124 )); 00125 $curl->write(Zend_Http_Client::GET, $this->getPopupObjectUrl(true)); 00126 if ($curl->read()) { 00127 if ($curl->getInfo(CURLINFO_HTTP_CODE) == 200) { 00128 $this->_popupReadable = true; 00129 } 00130 } 00131 } 00132 return $this->_popupReadable; 00133 }
const XML_PATH_POPUP_URL = 'system/adminnotification/popup_url' |