Mage_Adminhtml_Block_Notification_Window Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Notification_Window:

Mage_Adminhtml_Block_Notification_Toolbar Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 canShow ()
 getObjectUrl ()
 getLastNotice ()

Protected Member Functions

 _construct ()
 _isAllowed ()

Protected Attributes

 $_available


Detailed Description

Definition at line 27 of file Window.php.


Member Function Documentation

_construct (  )  [protected]

Initialize block window

Reimplemented from Mage_Adminhtml_Block_Notification_Toolbar.

Definition at line 40 of file Window.php.

00041     {
00042         parent::_construct();
00043 
00044         $this->setHeaderText(addslashes($this->__('Incoming Message')));
00045         $this->setCloseText(addslashes($this->__('close')));
00046         $this->setReadDetailsText(addslashes($this->__('Read details')));
00047         $this->setNoticeText(addslashes($this->__('NOTICE')));
00048         $this->setMinorText(addslashes($this->__('MINOR')));
00049         $this->setMajorText(addslashes($this->__('MAJOR')));
00050         $this->setCriticalText(addslashes($this->__('CRITICAL')));
00051 
00052 
00053         $this->setNoticeMessageText(addslashes($this->getLastNotice()->getTitle()));
00054         $this->setNoticeMessageUrl(addslashes($this->getLastNotice()->getUrl()));
00055 
00056         switch ($this->getLastNotice()->getSeverity()) {
00057             default:
00058             case Mage_AdminNotification_Model_Inbox::SEVERITY_NOTICE:
00059                 $severity = 'SEVERITY_NOTICE';
00060                 break;
00061             case Mage_AdminNotification_Model_Inbox::SEVERITY_MINOR:
00062                 $severity = 'SEVERITY_MINOR';
00063                 break;
00064             case Mage_AdminNotification_Model_Inbox::SEVERITY_MAJOR:
00065                 $severity = 'SEVERITY_MAJOR';
00066                 break;
00067             case Mage_AdminNotification_Model_Inbox::SEVERITY_CRITICAL:
00068                 $severity = 'SEVERITY_CRITICAL';
00069                 break;
00070         }
00071 
00072         $this->setNoticeSeverity($severity);
00073     }

_isAllowed (  )  [protected]

Check if current block allowed in ACL

Parameters:
string $resourcePath
Returns:
bool

Definition at line 134 of file Window.php.

00135     {
00136         if (!is_null($this->_aclResourcePath)) {
00137             return Mage::getSingleton('admin/session')
00138                 ->isAllowed('admin/system/adminnotification/show_toolbar');
00139         }
00140         else {
00141             return true;
00142         }
00143     }

canShow (  ) 

Can we show notification window

Returns:
bool

Definition at line 80 of file Window.php.

00081     {
00082         if (!$this->isOutputEnabled('Mage_AdminNotification')) {
00083             $this->_available = false;
00084             return false;
00085         }
00086 
00087         if (!$this->_getHelper()->isReadablePopupObject()) {
00088             $this->_available = false;
00089             return false;
00090         }
00091 
00092         if (!$this->_isAllowed()) {
00093             $this->_available = false;
00094             return false;
00095         }
00096 
00097         if (is_null($this->_available)) {
00098             if (!Mage::getSingleton('admin/session')->isFirstPageAfterLogin()) {
00099                 $this->_available = false;
00100                 return false;
00101             }
00102             $this->_available = $this->isShow();
00103         }
00104         return $this->_available;
00105     }

getLastNotice (  ) 

Retrieve Last Notice object

Returns:
Mage_AdminNotification_Model_Inbox

Definition at line 123 of file Window.php.

00124     {
00125         return $this->_getHelper()->getLatestNotice();
00126     }

getObjectUrl (  ) 

Return swf object url

Returns:
string

Definition at line 113 of file Window.php.

00114     {
00115         return $this->_getHelper()->getPopupObjectUrl();
00116     }


Member Data Documentation

$_available [protected]

Definition at line 34 of file Window.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:53 2009 for Magento by  doxygen 1.5.8