theme_status_messages

Versions
4.6 – 4.7
theme_status_messages()
5 – 6
theme_status_messages($display = NULL)
7
theme_status_messages($variables)

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

Return value

A string containing the messages.

Related topics

▾ 3 functions call theme_status_messages()

chameleon_page in themes/chameleon/chameleon.theme
theme_page in includes/theme.inc
Return an entire Drupal page displaying the supplied content.
xtemplate_page in themes/engines/xtemplate/xtemplate.engine

Code

includes/theme.inc, line 421

<?php
function theme_status_messages() {
  if ($data = drupal_get_messages()) {
    $output = '';
    foreach ($data 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;
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.