t('Status message'), 'error' => t('Error message'), 'warning' => t('Warning message'), 'info' => t('Informative message'), ); // Map Drupal message types to their corresponding Bootstrap classes. // @see http://twitter.github.com/bootstrap/components.html#alerts $status_class = array( 'status' => 'success', 'error' => 'danger', 'warning' => 'warning', // Not supported, but in theory a module could send any type of message. // @see drupal_set_message() // @see theme_status_messages() 'info' => 'info', ); // Retrieve messages. $message_list = drupal_get_messages($display); // Allow the disabled_messages module to filter the messages, if enabled. if (module_exists('disable_messages') && variable_get('disable_messages_enable', '1')) { $message_list = disable_messages_apply_filters($message_list); } foreach ($message_list as $type => $messages) { $class = (isset($status_class[$type])) ? ' alert-' . $status_class[$type] : ''; $output .= "