Advertisement
Guest User

Joomla message template

a guest
Jul 14th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  Template.Isis
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC') or die;
  11.  
  12. function renderMessage($msgList)
  13. {
  14.     $buffer  = null;
  15.     $buffer .= "\n<div id=\"system-message-container\">";
  16.     $alert = array('error' => 'alert-error', 'warning' => '', 'notice' => 'alert-info', 'message' => 'alert-success');
  17.  
  18.     // Only render the message list and the close button if $msgList has items
  19.     if (is_array($msgList) && (count($msgList) >= 1))
  20.     {
  21.         $buffer .= '<button type="button" class="close" data-dismiss="alert">&times;</button>';
  22.         foreach ($msgList as $type => $msgs)
  23.         {
  24.             $buffer .= '<div class="alert ' . $alert[$type]. '">';
  25.             $buffer .= "\n<h4 class=\"alert-heading\">" . JText::_($type) . "</h4>";
  26.             if (count($msgs))
  27.             {
  28.                 foreach ($msgs as $msg)
  29.                 {
  30.                     $buffer .= "\n\t\t<p>" . $msg . "</p>";
  31.                 }
  32.             }
  33.             $buffer .= "\n</div>";
  34.         }
  35.     }
  36.  
  37.     $buffer .= "\n</div>";
  38.  
  39.     return $buffer;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement