From 2be6e3fc90746bcafa7a200b599e6d48409b5e43 Mon Sep 17 00:00:00 2001 From: stevetruckstuff Date: Tue, 28 Mar 2006 22:39:52 +0000 Subject: [PATCH] Adding template for error box. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11005 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/display_messages.php | 30 +++++---------------- templates/default/error_box.tpl | 45 ++++++++++++++++++++++++++++++++ templates/default/stylesheet.tpl | 12 +++++++-- 3 files changed, 61 insertions(+), 26 deletions(-) create mode 100644 templates/default/error_box.tpl diff --git a/functions/display_messages.php b/functions/display_messages.php index 22abf4fc..7f94acd5 100644 --- a/functions/display_messages.php +++ b/functions/display_messages.php @@ -142,21 +142,9 @@ function logout_error( $errString, $errTitle = '' ) { * @since 1.3.2 */ function error_box($string, $color) { - global $pageheader_sent; - - if ( !isset( $color ) ) { - $color = array(); - $color[0] = '#dcdcdc'; /* light gray TitleBar */ - $color[1] = '#800000'; /* red */ - $color[2] = '#cc0000'; /* light red Warning/Error Messages */ - $color[4] = '#ffffff'; /* white Normal Background */ - $color[7] = '#0000cc'; /* blue Links */ - $color[8] = '#000000'; /* black Normal text */ - $color[9] = '#ababab'; /* mid-gray Darker version of #0 */ - } + global $pageheader_sent, $oTemplate; $err = _("ERROR"); - $ret = concat_hook_function('error_box', $string); if($ret != '') { $string = $ret; @@ -168,18 +156,13 @@ function error_box($string, $color) { include_once( SM_PATH . 'functions/page_header.php' ); displayHtmlHeader('SquirrelMail: '.$err); $pageheader_sent = TRUE; - echo "\n\n"; + echo "\n\n"; } - echo ''. - '
'. - ''. - '
'. - '' . $err . ':'. - '
'. - ''. - '' . html_tag( 'td', $string."\n", 'left') . '
'. - '
'; + /** ERROR is pre-translated to avoid multiple translation calls. **/ + $oTemplate->assign('error', $err); + $oTemplate->assign('errorMessage', $string); + $oTemplate->display('error_box.tpl'); } /** @@ -195,5 +178,4 @@ function error_option_save($message) { $optpage_save_error=array_merge($optpage_save_error,array($message)); } -// vim: et ts=4 ?> diff --git a/templates/default/error_box.tpl b/templates/default/error_box.tpl new file mode 100644 index 00000000..b0ebd9c0 --- /dev/null +++ b/templates/default/error_box.tpl @@ -0,0 +1,45 @@ + +
+ + + + +
+ + + + + + + +
+ +
+ +
+
+
+
\ No newline at end of file diff --git a/templates/default/stylesheet.tpl b/templates/default/stylesheet.tpl index 5a2b9936..f8af6a7d 100644 --- a/templates/default/stylesheet.tpl +++ b/templates/default/stylesheet.tpl @@ -36,7 +36,6 @@ /* retrieve the template vars */ extract($t); - ?> /* older css template */ body, td, th, dd, dt, h1, h2, h3, h4, h5, h6, p, ol, ul, li { @@ -320,7 +319,16 @@ img { text-align:center; margin-left:auto; margin-right:auto; - background: ; + background: ; +} +.error_header { + color: red; + font-weight:bold; + font-weight:bold; + font-style:normal; +} +.error_message { + background: ; } /* page_header.tpl definitions */ -- 2.25.1