Skip to content
Snippets Groups Projects
Commit b46bde40 authored by Tim Steiner's avatar Tim Steiner
Browse files

Fixes to the status message display code.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@69 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 4c5920d5
No related branches found
No related tags found
No related merge requests found
...@@ -86,23 +86,6 @@ if (isset($site_slogan) && $site_slogan) { ...@@ -86,23 +86,6 @@ if (isset($site_slogan) && $site_slogan) {
} }
if ($messages) {
$messages = <<<EOF
<script type="text/javascript">
WDN.initializePlugin('notice');
</script>
<div class="wdn_notice">
<div class="close">
<a href="#" title="Close this notice">Close this notice</a>
</div>
<div class="message">
$messages
</div>
</div>
EOF;
}
$t->maincontentarea = $messages . PHP_EOL $t->maincontentarea = $messages . PHP_EOL
. render($tabs) . PHP_EOL . render($tabs) . PHP_EOL
. render($action_links) . PHP_EOL . render($action_links) . PHP_EOL
......
...@@ -125,12 +125,19 @@ function unl_wdn_menu_local_task($variables) ...@@ -125,12 +125,19 @@ function unl_wdn_menu_local_task($variables)
return '<li' . (!empty($variables['element']['#active']) ? ' class="selected"' : '') . '>' . l($link_text, $link['href'], $link['localized_options']) . "</li>\n"; return '<li' . (!empty($variables['element']['#active']) ? ' class="selected"' : '') . '>' . l($link_text, $link['href'], $link['localized_options']) . "</li>\n";
} }
function unl_wdn_status_messages()
function unl_wdn_status_messages($display)
{ {
$output = ''; $output = '';
foreach (drupal_get_messages($display) as $type => $messages) { foreach (drupal_get_messages($display) as $type => $messages) {
$output .= '<div>' . PHP_EOL; $type = ucfirst($type);
$output .= <<<EOF
<div class="wdn_notice">
<div class="close">
<a href="#" title="Close this notice">Close this notice</a>
</div>
<div class="message">
<h3>$type</h3>
EOF;
if (count($messages) > 1) { if (count($messages) > 1) {
$output .= '<ul>' . PHP_EOL; $output .= '<ul>' . PHP_EOL;
foreach ($messages as $message) { foreach ($messages as $message) {
...@@ -140,7 +147,22 @@ function unl_wdn_status_messages($display) ...@@ -140,7 +147,22 @@ function unl_wdn_status_messages($display)
} else { } else {
$output .= $messages[0]; $output .= $messages[0];
} }
$output .= '</div>' . PHP_EOL; $output .= <<<EOF
</div>
</div>
EOF;
}
if (!$output) {
return '';
} }
$output = <<<EOF
<script type="text/javascript">
WDN.initializePlugin('notice');
</script>
$output
EOF;
return $output; return $output;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment