You could implement hook_theme_registry_alter() and modify the status_message entry to process through your function.<br><pre>[status_messages] => Array<br> (<br> [arguments] => Array<br> (<br>
[display] => <br> )<br><br> [type] => module<br> [theme path] => modules/system<br> [function] => theme_status_messages<br> [theme paths] => Array<br>
(<br> [0] => modules/system<br> )<br><br> [preprocess functions] => Array<br> (<br> [0] => template_preprocess<br> )<br>
<br> )<br></pre>You could alter the "theme paths" and "function". Devel Themer does something similar to run every entry in the theme_registry through it's own function.<br><br><br clear="all">
-----<br>Adam A. Gregory<br>Drupal Developer & Consultant<br>Web: AdamAGregory.com<br>Twitter: <a href="http://twitter.com/adamgregory">twitter.com/adamgregory</a><br>Phone: 910.808.1717<br>Cell: 706.761.7375<br>
<br><br><div class="gmail_quote">On Thu, Jan 28, 2010 at 8:22 AM, James Benstead <span dir="ltr"><<a href="mailto:james.benstead@gmail.com">james.benstead@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm working on this now. My approach is to override theme_status_messages(), so that I can change the status messages right before they're output. I know how to do this in a theme, but how do I do it in a module?<div>
<br><div class="gmail_quote">2010/1/25 Adam Gregory <span dir="ltr"><<a href="mailto:arcaneadam@gmail.com" target="_blank">arcaneadam@gmail.com</a>></span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yep, totally agree. There are some issues open to create a hook_message_alter some of which seem to have some traction, but it will be D8 before this makes it in to core.<div><br clear="all">-----<br>Adam A. Gregory<br>
Drupal Developer & Consultant<br>
Web: AdamAGregory.com<br>Twitter: <a href="http://twitter.com/adamgregory" target="_blank">twitter.com/adamgregory</a><br>Phone: 910.808.1717<br>Cell: 706.761.7375<br>
<br><br></div><div><div></div><div><div class="gmail_quote">On Mon, Jan 25, 2010 at 3:10 PM, Michael Favia <span dir="ltr"><<a href="mailto:michael.favia@gmail.com" target="_blank">michael.favia@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Mon, Jan 25, 2010 at 2:07 PM, Adam Gregory <<a href="mailto:arcaneadam@gmail.com" target="_blank">arcaneadam@gmail.com</a>> wrote:<br>
> template_preprocess_page and you can access and alter the message<br>
> array/variable before it hits the theme.<br>
<br>
</div>Technically it has already hit the "theme" because you're editing the<br>
preprocess function. But you are correct that hopefully this will work<br>
for a single site implementation that needs this. However the need and<br>
use for a hook at the module level is still apparent and valid. -mf<br>
</blockquote></div><br>
</div></div></blockquote></div></div></div><br></div>
</blockquote></div><br>