10 defined(
'JPATH_PLATFORM') or die;
32 public function render($name, $params = array (), $content = null)
34 $msgList = $this->getData();
37 $chromePath = JPATH_THEMES .
'/' . $app->getTemplate() .
'/html/message.php';
38 $itemOverride =
false;
40 if (file_exists($chromePath))
42 include_once $chromePath;
43 if (function_exists(
'renderMessage'))
49 $buffer = ($itemOverride) ? renderMessage($msgList) : $this->renderDefaultMessage($msgList);
61 private function getData()
70 if (is_array($messages) && !empty($messages))
72 foreach ($messages as $msg)
74 if (isset($msg[
'type']) && isset($msg[
'message']))
76 $lists[$msg[
'type']][] = $msg[
'message'];
93 private function renderDefaultMessage($msgList)
97 $buffer .=
"\n<div id=\"system-message-container\">";
100 if (is_array($msgList))
102 $buffer .=
"\n<div id=\"system-message\">";
103 foreach ($msgList as $type => $msgs)
105 $buffer .=
"\n<div class=\"alert alert-" . $type .
"\">";
108 $buffer .=
"<a class=\"close\" data-dismiss=\"alert\">×</a>";
112 $buffer .=
"\n<h4 class=\"alert-heading\">" .
JText::_($type) .
"</h4>";
113 $buffer .=
"\n<div>";
114 foreach ($msgs as $msg)
116 $buffer .=
"\n\t\t<p>" . $msg .
"</p>";
118 $buffer .=
"\n</div>";
120 $buffer .=
"\n</div>";
122 $buffer .=
"\n</div>";
125 $buffer .=
"\n</div>";