Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage
  • Mage_Adminhtml_Block_Html_Date
  • Mage_Adminhtml_Block_Html_Select
  • Mage_Api_Model_Wsdl_Config_Element
  • Mage_Captcha_Adminhtml_RefreshController
  • Mage_Captcha_RefreshController
  • Mage_Core_AjaxController
  • Mage_Core_Block_Abstract
  • Mage_Core_Block_Flush
  • Mage_Core_Block_Html_Calendar
  • Mage_Core_Block_Html_Date
  • Mage_Core_Block_Html_Link
  • Mage_Core_Block_Html_Select
  • Mage_Core_Block_Messages
  • Mage_Core_Block_Profiler
  • Mage_Core_Block_Store_Switcher
  • Mage_Core_Block_Template
  • Mage_Core_Block_Template_Facade
  • Mage_Core_Block_Template_Smarty
  • Mage_Core_Block_Template_Zend
  • Mage_Core_Block_Text
  • Mage_Core_Block_Text_List
  • Mage_Core_Block_Text_List_Item
  • Mage_Core_Block_Text_List_Link
  • Mage_Core_Block_Text_Tag
  • Mage_Core_Block_Text_Tag_Css
  • Mage_Core_Block_Text_Tag_Css_Admin
  • Mage_Core_Block_Text_Tag_Debug
  • Mage_Core_Block_Text_Tag_Js
  • Mage_Core_Block_Text_Tag_Meta
  • Mage_Core_Controller_Front_Action
  • Mage_Core_Controller_Front_Router
  • Mage_Core_Controller_Request_Http
  • Mage_Core_Controller_Response_Http
  • Mage_Core_Controller_Varien_Action
  • Mage_Core_Controller_Varien_Front
  • Mage_Core_Controller_Varien_Router_Abstract
  • Mage_Core_Controller_Varien_Router_Admin
  • Mage_Core_Controller_Varien_Router_Default
  • Mage_Core_Controller_Varien_Router_Standard
  • Mage_Core_Helper_Abstract
  • Mage_Core_Helper_Cookie
  • Mage_Core_Helper_Data
  • Mage_Core_Helper_File_Storage
  • Mage_Core_Helper_File_Storage_Database
  • Mage_Core_Helper_Hint
  • Mage_Core_Helper_Http
  • Mage_Core_Helper_Js
  • Mage_Core_Helper_String
  • Mage_Core_Helper_Translate
  • Mage_Core_Helper_Url
  • Mage_Core_Helper_Url_Rewrite
  • Mage_Core_IndexController
  • Mage_Core_Model_Abstract
  • Mage_Core_Model_App
  • Mage_Core_Model_App_Area
  • Mage_Core_Model_App_Emulation
  • Mage_Core_Model_Cache
  • Mage_Core_Model_Calculator
  • Mage_Core_Model_Config
  • Mage_Core_Model_Config_Base
  • Mage_Core_Model_Config_Data
  • Mage_Core_Model_Config_Element
  • Mage_Core_Model_Config_Options
  • Mage_Core_Model_Config_System
  • Mage_Core_Model_Cookie
  • Mage_Core_Model_Date
  • Mage_Core_Model_Design
  • Mage_Core_Model_Design_Package
  • Mage_Core_Model_Design_Source_Design
  • Mage_Core_Model_Email
  • Mage_Core_Model_Email_Info
  • Mage_Core_Model_Email_Template
  • Mage_Core_Model_Email_Template_Filter
  • Mage_Core_Model_Email_Template_Mailer
  • Mage_Core_Model_Email_Transport
  • Mage_Core_Model_Encryption
  • Mage_Core_Model_File_Storage
  • Mage_Core_Model_File_Storage_Abstract
  • Mage_Core_Model_File_Storage_Database
  • Mage_Core_Model_File_Storage_Database_Abstract
  • Mage_Core_Model_File_Storage_Directory_Database
  • Mage_Core_Model_File_Storage_File
  • Mage_Core_Model_File_Storage_Flag
  • Mage_Core_Model_File_Uploader
  • Mage_Core_Model_File_Validator_AvailablePath
  • Mage_Core_Model_File_Validator_NotProtectedExtension
  • Mage_Core_Model_Flag
  • Mage_Core_Model_Input_Filter
  • Mage_Core_Model_Input_Filter_MaliciousCode
  • Mage_Core_Model_Language
  • Mage_Core_Model_Layout
  • Mage_Core_Model_Layout_Data
  • Mage_Core_Model_Layout_Element
  • Mage_Core_Model_Layout_Update
  • Mage_Core_Model_Locale
  • Mage_Core_Model_Locale_Config
  • Mage_Core_Model_Log_Adapter
  • Mage_Core_Model_Magento_Api
  • Mage_Core_Model_Magento_Api_V2
  • Mage_Core_Model_Message
  • Mage_Core_Model_Message_Abstract
  • Mage_Core_Model_Message_Collection
  • Mage_Core_Model_Message_Error
  • Mage_Core_Model_Message_Notice
  • Mage_Core_Model_Message_Success
  • Mage_Core_Model_Message_Warning
  • Mage_Core_Model_Mysql4_Abstract
  • Mage_Core_Model_Mysql4_Cache
  • Mage_Core_Model_Mysql4_Collection_Abstract
  • Mage_Core_Model_Mysql4_Config
  • Mage_Core_Model_Mysql4_Config_Data
  • Mage_Core_Model_Mysql4_Config_Data_Collection
  • Mage_Core_Model_Mysql4_Design
  • Mage_Core_Model_Mysql4_Design_Collection
  • Mage_Core_Model_Mysql4_Design_Package_Collection
  • Mage_Core_Model_Mysql4_Design_Theme
  • Mage_Core_Model_Mysql4_Email_Template
  • Mage_Core_Model_Mysql4_Email_Template_Collection
  • Mage_Core_Model_Mysql4_File_Storage_Abstract
  • Mage_Core_Model_Mysql4_File_Storage_Database
  • Mage_Core_Model_Mysql4_File_Storage_Directory_Database
  • Mage_Core_Model_Mysql4_File_Storage_File
  • Mage_Core_Model_Mysql4_Flag
  • Mage_Core_Model_Mysql4_Language
  • Mage_Core_Model_Mysql4_Language_Collection
  • Mage_Core_Model_Mysql4_Layout
  • Mage_Core_Model_Mysql4_Resource
  • Mage_Core_Model_Mysql4_Session
  • Mage_Core_Model_Mysql4_Store
  • Mage_Core_Model_Mysql4_Store_Collection
  • Mage_Core_Model_Mysql4_Store_Group
  • Mage_Core_Model_Mysql4_Store_Group_Collection
  • Mage_Core_Model_Mysql4_Translate
  • Mage_Core_Model_Mysql4_Translate_String
  • Mage_Core_Model_Mysql4_Url_Rewrite
  • Mage_Core_Model_Mysql4_Url_Rewrite_Collection
  • Mage_Core_Model_Mysql4_Variable
  • Mage_Core_Model_Mysql4_Variable_Collection
  • Mage_Core_Model_Mysql4_Website
  • Mage_Core_Model_Mysql4_Website_Collection
  • Mage_Core_Model_Observer
  • Mage_Core_Model_Resource
  • Mage_Core_Model_Resource_Abstract
  • Mage_Core_Model_Resource_Cache
  • Mage_Core_Model_Resource_Config
  • Mage_Core_Model_Resource_Config_Data
  • Mage_Core_Model_Resource_Config_Data_Collection
  • Mage_Core_Model_Resource_Db_Abstract
  • Mage_Core_Model_Resource_Db_Collection_Abstract
  • Mage_Core_Model_Resource_Design
  • Mage_Core_Model_Resource_Design_Collection
  • Mage_Core_Model_Resource_Design_Package_Collection
  • Mage_Core_Model_Resource_Email_Template
  • Mage_Core_Model_Resource_Email_Template_Collection
  • Mage_Core_Model_Resource_Entity_Abstract
  • Mage_Core_Model_Resource_Entity_Table
  • Mage_Core_Model_Resource_File_Storage_Abstract
  • Mage_Core_Model_Resource_File_Storage_Database
  • Mage_Core_Model_Resource_File_Storage_Directory_Database
  • Mage_Core_Model_Resource_File_Storage_File
  • Mage_Core_Model_Resource_Flag
  • Mage_Core_Model_Resource_Helper_Abstract
  • Mage_Core_Model_Resource_Helper_Mysql4
  • Mage_Core_Model_Resource_Iterator
  • Mage_Core_Model_Resource_Language
  • Mage_Core_Model_Resource_Language_Collection
  • Mage_Core_Model_Resource_Layout
  • Mage_Core_Model_Resource_Resource
  • Mage_Core_Model_Resource_Session
  • Mage_Core_Model_Resource_Setup
  • Mage_Core_Model_Resource_Setup_Query_Modifier
  • Mage_Core_Model_Resource_Store
  • Mage_Core_Model_Resource_Store_Collection
  • Mage_Core_Model_Resource_Store_Group
  • Mage_Core_Model_Resource_Store_Group_Collection
  • Mage_Core_Model_Resource_Transaction
  • Mage_Core_Model_Resource_Translate
  • Mage_Core_Model_Resource_Translate_String
  • Mage_Core_Model_Resource_Type_Abstract
  • Mage_Core_Model_Resource_Type_Db
  • Mage_Core_Model_Resource_Type_Db_Mysqli
  • Mage_Core_Model_Resource_Type_Db_Mysqli_Setup
  • Mage_Core_Model_Resource_Type_Db_Pdo_Mysql
  • Mage_Core_Model_Resource_Url_Rewrite
  • Mage_Core_Model_Resource_Url_Rewrite_Collection
  • Mage_Core_Model_Resource_Variable
  • Mage_Core_Model_Resource_Variable_Collection
  • Mage_Core_Model_Resource_Website
  • Mage_Core_Model_Resource_Website_Collection
  • Mage_Core_Model_Session
  • Mage_Core_Model_Session_Abstract
  • Mage_Core_Model_Session_Abstract_Varien
  • Mage_Core_Model_Session_Abstract_Zend
  • Mage_Core_Model_Source_Email_Variables
  • Mage_Core_Model_Store
  • Mage_Core_Model_Store_Api
  • Mage_Core_Model_Store_Api_V2
  • Mage_Core_Model_Store_Group
  • Mage_Core_Model_Template
  • Mage_Core_Model_Translate
  • Mage_Core_Model_Translate_Expr
  • Mage_Core_Model_Translate_Inline
  • Mage_Core_Model_Translate_String
  • Mage_Core_Model_Url
  • Mage_Core_Model_Url_Rewrite
  • Mage_Core_Model_Url_Validator
  • Mage_Core_Model_Variable
  • Mage_Core_Model_Variable_Config
  • Mage_Core_Model_Variable_Observer
  • Mage_Core_Model_Website
  • Mage_Page_Block_Switch
  • Mage_Page_Block_Template_Container
  • Mage_Page_Block_Template_Links
  • Mage_Page_Block_Template_Links_Block
  • Mage_Sales_Model_Quote_Address_Total_Collector

Exceptions

  • Mage_Core_Controller_Varien_Exception
  • Mage_Core_Exception
  • Mage_Core_Model_Session_Exception
  • Mage_Core_Model_Store_Exception

Functions

  • destruct
  • is_dir_writeable
  • is_empty_date
  • mageCoreErrorHandler
  • mageDebugBacktrace
  • mageDelTree
  • mageFindClassFile
  • mageParseCsv
  • mageSendErrorFooter
  • mageSendErrorHeader
  • mageUndoMagicQuotes
  • now
  • sys_get_temp_dir
  • uc_words
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Core
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * Messages block
 29:  *
 30:  * @category   Mage
 31:  * @package    Mage_Core
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_Core_Block_Messages extends Mage_Core_Block_Template
 35: {
 36:     /**
 37:      * Messages collection
 38:      *
 39:      * @var Mage_Core_Model_Message_Collection
 40:      */
 41:     protected $_messages;
 42: 
 43:     /**
 44:      * Store first level html tag name for messages html output
 45:      *
 46:      * @var string
 47:      */
 48:     protected $_messagesFirstLevelTagName = 'ul';
 49: 
 50:     /**
 51:      * Store second level html tag name for messages html output
 52:      *
 53:      * @var string
 54:      */
 55:     protected $_messagesSecondLevelTagName = 'li';
 56: 
 57:     /**
 58:      * Store content wrapper html tag name for messages html output
 59:      *
 60:      * @var string
 61:      */
 62:     protected $_messagesContentWrapperTagName = 'span';
 63: 
 64:     /**
 65:      * Flag which require message text escape
 66:      *
 67:      * @var bool
 68:      */
 69:     protected $_escapeMessageFlag = false;
 70: 
 71:     /**
 72:      * Storage for used types of message storages
 73:      *
 74:      * @var array
 75:      */
 76:     protected $_usedStorageTypes = array('core/session');
 77: 
 78:     public function _prepareLayout()
 79:     {
 80:         $this->addMessages(Mage::getSingleton('core/session')->getMessages(true));
 81:         parent::_prepareLayout();
 82:     }
 83: 
 84:     /**
 85:      * Set message escape flag
 86:      * @param bool $flag
 87:      * @return Mage_Core_Block_Messages
 88:      */
 89:     public function setEscapeMessageFlag($flag)
 90:     {
 91:         $this->_escapeMessageFlag = $flag;
 92:         return $this;
 93:     }
 94: 
 95:     /**
 96:      * Set messages collection
 97:      *
 98:      * @param   Mage_Core_Model_Message_Collection $messages
 99:      * @return  Mage_Core_Block_Messages
100:      */
101:     public function setMessages(Mage_Core_Model_Message_Collection $messages)
102:     {
103:         $this->_messages = $messages;
104:         return $this;
105:     }
106: 
107:     /**
108:      * Add messages to display
109:      *
110:      * @param Mage_Core_Model_Message_Collection $messages
111:      * @return Mage_Core_Block_Messages
112:      */
113:     public function addMessages(Mage_Core_Model_Message_Collection $messages)
114:     {
115:         foreach ($messages->getItems() as $message) {
116:             $this->getMessageCollection()->add($message);
117:         }
118:         return $this;
119:     }
120: 
121:     /**
122:      * Retrieve messages collection
123:      *
124:      * @return Mage_Core_Model_Message_Collection
125:      */
126:     public function getMessageCollection()
127:     {
128:         if (!($this->_messages instanceof Mage_Core_Model_Message_Collection)) {
129:             $this->_messages = Mage::getModel('core/message_collection');
130:         }
131:         return $this->_messages;
132:     }
133: 
134:     /**
135:      * Adding new message to message collection
136:      *
137:      * @param   Mage_Core_Model_Message_Abstract $message
138:      * @return  Mage_Core_Block_Messages
139:      */
140:     public function addMessage(Mage_Core_Model_Message_Abstract $message)
141:     {
142:         $this->getMessageCollection()->add($message);
143:         return $this;
144:     }
145: 
146:     /**
147:      * Adding new error message
148:      *
149:      * @param   string $message
150:      * @return  Mage_Core_Block_Messages
151:      */
152:     public function addError($message)
153:     {
154:         $this->addMessage(Mage::getSingleton('core/message')->error($message));
155:         return $this;
156:     }
157: 
158:     /**
159:      * Adding new warning message
160:      *
161:      * @param   string $message
162:      * @return  Mage_Core_Block_Messages
163:      */
164:     public function addWarning($message)
165:     {
166:         $this->addMessage(Mage::getSingleton('core/message')->warning($message));
167:         return $this;
168:     }
169: 
170:     /**
171:      * Adding new nitice message
172:      *
173:      * @param   string $message
174:      * @return  Mage_Core_Block_Messages
175:      */
176:     public function addNotice($message)
177:     {
178:         $this->addMessage(Mage::getSingleton('core/message')->notice($message));
179:         return $this;
180:     }
181: 
182:     /**
183:      * Adding new success message
184:      *
185:      * @param   string $message
186:      * @return  Mage_Core_Block_Messages
187:      */
188:     public function addSuccess($message)
189:     {
190:         $this->addMessage(Mage::getSingleton('core/message')->success($message));
191:         return $this;
192:     }
193: 
194:     /**
195:      * Retrieve messages array by message type
196:      *
197:      * @param   string $type
198:      * @return  array
199:      */
200:     public function getMessages($type=null)
201:     {
202:         return $this->getMessageCollection()->getItems($type);
203:     }
204: 
205:     /**
206:      * Retrieve messages in HTML format
207:      *
208:      * @param   string $type
209:      * @return  string
210:      */
211:     public function getHtml($type=null)
212:     {
213:         $html = '<' . $this->_messagesFirstLevelTagName . ' id="admin_messages">';
214:         foreach ($this->getMessages($type) as $message) {
215:             $html.= '<' . $this->_messagesSecondLevelTagName . ' class="'.$message->getType().'-msg">'
216:                 . ($this->_escapeMessageFlag) ? $this->htmlEscape($message->getText()) : $message->getText()
217:                 . '</' . $this->_messagesSecondLevelTagName . '>';
218:         }
219:         $html .= '</' . $this->_messagesFirstLevelTagName . '>';
220:         return $html;
221:     }
222: 
223:     /**
224:      * Retrieve messages in HTML format grouped by type
225:      *
226:      * @param   string $type
227:      * @return  string
228:      */
229:     public function getGroupedHtml()
230:     {
231:         $types = array(
232:             Mage_Core_Model_Message::ERROR,
233:             Mage_Core_Model_Message::WARNING,
234:             Mage_Core_Model_Message::NOTICE,
235:             Mage_Core_Model_Message::SUCCESS
236:         );
237:         $html = '';
238:         foreach ($types as $type) {
239:             if ( $messages = $this->getMessages($type) ) {
240:                 if ( !$html ) {
241:                     $html .= '<' . $this->_messagesFirstLevelTagName . ' class="messages">';
242:                 }
243:                 $html .= '<' . $this->_messagesSecondLevelTagName . ' class="' . $type . '-msg">';
244:                 $html .= '<' . $this->_messagesFirstLevelTagName . '>';
245: 
246:                 foreach ( $messages as $message ) {
247:                     $html.= '<' . $this->_messagesSecondLevelTagName . '>';
248:                     $html.= '<' . $this->_messagesContentWrapperTagName . '>';
249:                     $html.= ($this->_escapeMessageFlag) ? $this->htmlEscape($message->getText()) : $message->getText();
250:                     $html.= '</' . $this->_messagesContentWrapperTagName . '>';
251:                     $html.= '</' . $this->_messagesSecondLevelTagName . '>';
252:                 }
253:                 $html .= '</' . $this->_messagesFirstLevelTagName . '>';
254:                 $html .= '</' . $this->_messagesSecondLevelTagName . '>';
255:             }
256:         }
257:         if ( $html) {
258:             $html .= '</' . $this->_messagesFirstLevelTagName . '>';
259:         }
260:         return $html;
261:     }
262: 
263:     protected function _toHtml()
264:     {
265:         return $this->getGroupedHtml();
266:     }
267: 
268:     /**
269:      * Set messages first level html tag name for output messages as html
270:      *
271:      * @param string $tagName
272:      */
273:     public function setMessagesFirstLevelTagName($tagName)
274:     {
275:         $this->_messagesFirstLevelTagName = $tagName;
276:     }
277: 
278:     /**
279:      * Set messages first level html tag name for output messages as html
280:      *
281:      * @param string $tagName
282:      */
283:     public function setMessagesSecondLevelTagName($tagName)
284:     {
285:         $this->_messagesSecondLevelTagName = $tagName;
286:     }
287: 
288:     /**
289:      * Get cache key informative items
290:      *
291:      * @return array
292:      */
293:     public function getCacheKeyInfo()
294:     {
295:         return array(
296:             'storage_types' => serialize($this->_usedStorageTypes)
297:         );
298:     }
299: 
300:     /**
301:      * Add used storage type
302:      *
303:      * @param string $type
304:      */
305:     public function addStorageType($type)
306:     {
307:         $this->_usedStorageTypes[] = $type;
308:     }
309: }
310: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0