getData(); $buffer = null; $app = JFactory::getApplication(); $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/message.php'; $itemOverride = false; if (file_exists($chromePath)) { include_once $chromePath; if (function_exists('renderMessage')) { $itemOverride = true; } } $buffer = ($itemOverride) ? renderMessage($msgList) : $this->renderDefaultMessage($msgList); return $buffer; } /** * Get and prepare system message data for output * * @return array An array contains system message * * @since 12.2 */ private function getData() { // Initialise variables. $lists = array(); // Get the message queue $messages = JFactory::getApplication()->getMessageQueue(); // Build the sorted message list if (is_array($messages) && !empty($messages)) { foreach ($messages as $msg) { if (isset($msg['type']) && isset($msg['message'])) { $lists[$msg['type']][] = $msg['message']; } } } return $lists; } /** * Render the system message if no message template file found * * @param array $msgList An array contains system message * * @return string System message markup * * @since 12.2 */ private function renderDefaultMessage($msgList) { // Build the return string $buffer = ''; $buffer .= "\n
"; return $buffer; } }