function theme_status_messages

7.x theme.inc theme_status_messages($variables)
6.x theme.inc theme_status_messages($display = NULL)

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

7 theme calls to theme_status_messages()
chameleon_page in drupal-6.x/themes/chameleon/chameleon.theme
poll_choice_js in drupal-6.x/modules/poll/poll.module
Menu callback for AHAH additions.
template_preprocess_maintenance_page in drupal-6.x/includes/theme.maintenance.inc
The variables generated here is a mirror of template_preprocess_page(). This preprocessor will run it's course when theme_maintenance_page() is invoked. It is also used in theme_install_page() and theme_update_page() to keep all the variables…
template_preprocess_page in drupal-6.x/includes/theme.inc
Process variables for page.tpl.php
theme_install_page in drupal-6.x/includes/theme.maintenance.inc
Generate a themed installation page.

... See full list

File

drupal-6.x/includes/theme.inc, line 1174
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;
}