Same name and namespace in other branches
  1. 4.6.x includes/theme.inc \theme_status_messages()
  2. 4.7.x includes/theme.inc \theme_status_messages()
  3. 6.x includes/theme.inc \theme_status_messages()
  4. 7.x includes/theme.inc \theme_status_messages()

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

Parameters

$display: (optional) Set to 'status' or 'error' to display only messages of that type.

Return value

A string containing the messages.

Related topics

6 theme calls to theme_status_messages()
chameleon_page in themes/chameleon/chameleon.theme
phptemplate_page in themes/engines/phptemplate/phptemplate.engine
Prepare the values passed to the theme_page function to be passed into a pluggable template engine. Uses the arg() function to generate a series of page template files suggestions based on the current path. If none are found, the default page.tpl.php…
theme_install_page in includes/theme.inc
theme_maintenance_page in includes/theme.inc
theme_page in includes/theme.inc
Return an entire Drupal page displaying the supplied content.

... See full list

File

includes/theme.inc, line 513
The theme system, which controls the output of Drupal.

Code

function theme_status_messages($display = NULL) {
  $output = '';
  foreach (drupal_get_messages($display) as $type => $messages) {
    $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;
}