- $ret = concat_hook_function('error_box', $string);
- if($ret != '') {
- $string = $ret;
- }
-
- /* check if the page header has been sent; if not, send it! */
- if(!isset($pageheader_sent) && !$pageheader_sent) {
- displayHtmlHeader('SquirrelMail: '.$err);
+ do_hook('error_box', $string);
+ if ( !isset($org_title) ) $org_title = 'SquirrelMail';
+
+ // check if the page header has been sent; if not, send it!
+ //
+ // (however, if $return_output is turned on, the output of this
+ // should be being used in some other page, so we don't have
+ // to worry about page headers in that case)
+ //
+ if (!$return_output && empty($pageheader_sent)) {
+ displayHtmlHeader($org_title . ': '.$err);