function theme_disable_messages_status_messages in Disable Messages 7
Same name and namespace in other branches
- 6 disable_messages.module \theme_disable_messages_status_messages()
Theme function for theming status messages.
1 theme call to theme_disable_messages_status_messages()
- _theme_disable_messages_status_messages in ./
disable_messages.module - Implementation of theme_status_messages().
File
- ./
disable_messages.module, line 124 - The disable_messages module file.
Code
function theme_disable_messages_status_messages($vars) {
$messages = $vars['messages'];
$output = '';
$status_heading = array(
'status' => t('Status message'),
'error' => t('Error message'),
'warning' => t('Warning message'),
);
foreach ($messages as $type => $arr_messages) {
$output .= "<div class=\"messages {$type}\">\n";
if (!empty($status_heading[$type])) {
$output .= '<h2 class="element-invisible">' . $status_heading[$type] . "</h2>\n";
}
if (count($arr_messages) > 1) {
$output .= " <ul>\n";
foreach ($arr_messages as $message) {
$output .= ' <li>' . $message . "</li>\n";
}
$output .= " </ul>\n";
}
else {
$output .= array_shift($arr_messages);
}
$output .= "</div>\n";
}
return $output;
}