You are here

function theme_original_status_messages in Purr Messages 6.2

Same name and namespace in other branches
  1. 8.2 purr_messages.module \theme_original_status_messages()
  2. 6 purr_messages.module \theme_original_status_messages()
  3. 7.2 purr_messages.module \theme_original_status_messages()
  4. 7 purr_messages.module \theme_original_status_messages()

Return a themed set of status and/or error messages. The messages are grouped by type.

This is the original output which we use if purr messages is turned off.

Parameters

$type: String containing a message type. Used to set the class on the message div.

$messages: An array, each containing a message.

Return value

A string containing the formatted messages.

2 theme calls to theme_original_status_messages()
purr_messages_status_messages in ./purr_messages.module
Checks options and determines which type of message to return to the theme layer.
_purr_messages_purr in ./purr_messages.module
Builds and returns the formatted purr message code

File

./purr_messages.module, line 310
Purr Messages A jQuery based override of Drupal's core message system

Code

function theme_original_status_messages($vars) {
  $type = $vars['type'];
  $messages = $vars['messages'];
  $output = '';
  $output .= "<div class=\"messages {$type}\">\n";
  if (count($messages) > 1) {
    $output .= " <ul>\n";
    foreach ($messages as $message) {
      $output .= '  <li>' . $message . "</li>\n";
    }
    $output .= " </ul>\n";
  }
  else {
    $output .= $messages[0];
  }
  $output .= "</div>\n";
  return $output;
}