You are here

function theme_absolute_messages_messages in Absolute Messages 7

Same name and namespace in other branches
  1. 6 absolute_messages.module \theme_absolute_messages_messages()

Theme function, which could be overriden by other modules/themes.

1 theme call to theme_absolute_messages_messages()
theme_absolute_messages in ./absolute_messages.module
Theme function, overriding Drupal's theme_status_messages().

File

./absolute_messages.module, line 171
Module displaying system messages in colored horizontal bars on top of the page, similar to Stack Overflow / Stack Exchange network notifications.

Code

function theme_absolute_messages_messages($variables) {
  $output = '';
  if (isset($variables['messages']) && count($variables['messages'])) {
    foreach ($variables['messages'] as $message) {

      // Devel messages should be displayed in standard Drupal format,
      // so let's just set them again and at the end pass through
      // default theme_status_messages().
      if (_absolute_messages_is_devel_message($message)) {
        drupal_set_message($message, $variables['type']);
        continue;
      }

      // All other messages will be AM-themed.
      $vars = array(
        'type' => $variables['type'],
        'message' => $message,
        'dismiss' => t('Dismiss this message'),
      );
      $output .= theme('absolute_messages_message', array(
        'vars' => $vars,
      ));
    }
  }
  return $output;
}