- if ( !isset( $color ) ) {
- $color = array();
- $color[0] = '#DCDCDC'; /* light gray TitleBar */
- $color[1] = '#800000'; /* red */
- $color[2] = '#CC0000'; /* light red Warning/Error Messages */
- $color[3] = '#A0B8C8'; /* green-blue Left Bar Background */
- $color[4] = '#FFFFFF'; /* white Normal Background */
- $color[5] = '#FFFFCC'; /* light yellow Table Headers */
- $color[6] = '#000000'; /* black Text on left bar */
- $color[7] = '#0000CC'; /* blue Links */
- $color[8] = '#000000'; /* black Normal text */
- $color[9] = '#ABABAB'; /* mid-gray Darker version of #0 */
- $color[10] = '#666666'; /* dark gray Darker version of #9 */
- $color[11] = '#770000'; /* dark red Special Folders color */
- $color[12] = '#EDEDED';
- $color[15] = '#002266'; /* (dark blue) Unselectable folders */
+/**
+ * Displays error message
+ *
+ * Since 1.4.1 function checks if page header is already displayed.
+ *
+ * Since 1.4.3 and 1.5.1, this function contains the error_box hook.
+ * Use plain_error_message() and make sure that page header is created,
+ * if you want compatibility with 1.4.0 and older.
+ *
+ * In 1.5.2 second function argument is changed. Older functions used it
+ * for $color array, new function uses it for optional link data. Function
+ * will ignore color array and use standard colors instead.
+ *
+ * @param string $string Error message to be displayed
+ * @param array $link Optional array containing link details to be displayed.
+ * Array uses three keys. 'URL' key is required and should contain link URL.
+ * 'TEXT' key is optional and should contain link name. 'FRAME' key is
+ * optional and should contain link target attribute.
+ *
+ * @since 1.3.2
+ */
+function error_box($string, $link=NULL) {
+ global $pageheader_sent, $oTemplate;
+
+ $err = _("ERROR");
+ do_hook('error_box', $string);
+
+ /* check if the page header has been sent; if not, send it! */
+ if (!isset($pageheader_sent) && !$pageheader_sent) {
+ displayHtmlHeader('SquirrelMail: '.$err);
+ $pageheader_sent = TRUE;
+ echo "<body>\n\n";