You are here

function brainstorm_theme_status_messages in Brainstorm profile 7

Implements hook_status_messages().

File

themes/brainstorm_theme/template.php, line 119
Process theme data.

Code

function brainstorm_theme_status_messages($variables) {
  $display = $variables['display'];
  $output = '';
  $status_heading = [
    'status' => t('Status message'),
    'error' => t('Error message'),
    'warning' => t('Warning message'),
    'info' => t('Info message'),
  ];
  foreach (drupal_get_messages($display) as $type => $messages) {
    $output .= "<div class=\"messages {$type}\">\n";
    if (!empty($status_heading[$type])) {
      $output .= '<h2>' . $status_heading[$type] . "</h2>\n";
    }
    if (count($messages) > 0) {
      foreach ($messages as $message) {
        $output .= '<p>' . $message . '</p>';
      }
    }
    $output .= " <div class='close'> </div>\n";
    $output .= "</div>\n";
  }
  return $output;
}