Source for file display_messages.php

Documentation is available at display_messages.php

  1. <?php
  2.  
  3. /**
  4.  * display_messages.php
  5.  *
  6.  * This contains all messages, including information, error, and just
  7.  * about any other message you can think of.
  8.  *
  9.  * @copyright &copy; 1999-2006 The SquirrelMail Project Team
  10.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  11.  * @version $Id: display_messages.php,v 1.57.2.22 2006/05/14 17:45:29 tokul Exp $
  12.  * @package squirrelmail
  13.  */
  14.  
  15. /**
  16.  * including plugin functions
  17.  */
  18. require_once(SM_PATH 'functions/plugin.php');
  19.  
  20. function error_message($message$mailbox$sort$startMessage$color{
  21.     $urlMailbox urlencode($mailbox);
  22.     $string '<tr><td align="center">' $message '</td></tr>'.
  23.               '<tr><td align="center">'.
  24.               '<a href="'.sqm_baseuri()."src/right_main.php?sort=$sort&amp;startMessage=$startMessage&amp;mailbox=$urlMailbox\">".
  25.               sprintf (_("Click here to return to %s"),
  26.                   htmlspecialchars(imap_utf7_decode_local($mailbox))).
  27.               '</a></td></tr>';
  28.     error_box($string$color);
  29. }
  30.  
  31. function plain_error_message($message$color{
  32.     error_box($message$color);
  33. }
  34.  
  35. function logout_error$errString$errTitle '' {
  36.            $hide_sm_attributions$version$squirrelmail_language
  37.            $color$theme$theme_default;
  38.  
  39.     $base_uri sqm_baseuri();
  40.  
  41.     include_onceSM_PATH 'functions/page_header.php' );
  42.     if !isset$org_logo ) ) {
  43.         // Don't know yet why, but in some accesses $org_logo is not set.
  44.         includeSM_PATH 'config/config.php' );
  45.     }
  46.     /* Display width and height like good little people */
  47.     $width_and_height '';
  48.     if (isset($org_logo_width&& is_numeric($org_logo_width&& $org_logo_width>0{
  49.         $width_and_height " width=\"$org_logo_width\"";
  50.     }
  51.     if (isset($org_logo_height&& is_numeric($org_logo_height&& $org_logo_height>0{
  52.         $width_and_height .= " height=\"$org_logo_height\"";
  53.     }
  54.  
  55.     if (!isset($frame_top|| $frame_top == '' {
  56.         $frame_top '_top';
  57.     }
  58.  
  59.     // load default theme if possible
  60.     if (!isset($color&& @file_exists($theme[$theme_default]['PATH']))
  61.         @include ($theme[$theme_default]['PATH']);
  62.  
  63.     if !isset$color ) ) {
  64.         $color array();
  65.         $color[0]  '#dcdcdc';  /* light gray    TitleBar               */
  66.         $color[1]  '#800000';  /* red                                  */
  67.         $color[2]  '#cc0000';  /* light red     Warning/Error Messages */
  68.         $color[4]  '#ffffff';  /* white         Normal Background      */
  69.         $color[7]  '#0000cc';  /* blue          Links                  */
  70.         $color[8]  '#000000';  /* black         Normal text            */
  71.     }
  72.  
  73.     list($junk$errString$errTitledo_hook('logout_error'$errString$errTitle);
  74.  
  75.     if $errTitle == '' {
  76.         $errTitle $errString;
  77.     }
  78.     set_up_language($squirrelmail_languagetrue);
  79.  
  80.     displayHtmlHeader$org_name.' - '.$errTitle''false );
  81.  
  82.     echo '<body text="'.$color[8].'" bgcolor="'.$color[4].'" link="'.$color[7].'" vlink="'.$color[7].'" alink="'.$color[7]."\">\n\n".
  83.          '<center>';
  84.  
  85.     if (isset($org_logo&& ($org_logo != '')) {
  86.         echo '<img src="'.$org_logo.'" alt="'.sprintf(_("%s Logo")$org_name).
  87.              "\"$width_and_height /><br />\n";
  88.     }
  89.     echo $hide_sm_attributions '' :
  90.             '<small>' sprintf (_("SquirrelMail version %s")$version'<br />'.
  91.             _("By the SquirrelMail Project Team""<br /></small>\n" ).
  92.          '<table cellspacing="1" cellpadding="0" bgcolor="'.$color[1].'" width="70%">'.
  93.          '<tr><td>'.
  94.          '<table width="100%" border="0" bgcolor="'.$color[4].'" align="center">'.
  95.          '<tr><td bgcolor="'.$color[0].'" align="center">'.
  96.          '<font color="'.$color[2].'"><b>' _("ERROR"'</b></font>'.
  97.          '</td></tr>'.
  98.          '<tr><td align="center">' $errString '</td></tr>'.
  99.          '<tr><td bgcolor="'.$color[0].'" align="center">'.
  100.          '<font color="'.$color[2].'"><b>'.
  101.          '<a href="'.$base_uri.'src/login.php" target="'.$frame_top.'">'.
  102.          _("Go to the login page"'</a></b></font></td></tr>'.
  103.          '</table></td></tr></table></center></body></html>';
  104. }
  105.  
  106. function error_box($string$color{
  107.     global $pageheader_sent;
  108.  
  109.     if !isset$color ) ) {
  110.         $color array();
  111.         $color[0]  '#dcdcdc';  /* light gray    TitleBar               */
  112.         $color[1]  '#800000';  /* red                                  */
  113.         $color[2]  '#cc0000';  /* light red     Warning/Error Messages */
  114.         $color[4]  '#ffffff';  /* white         Normal Background      */
  115.         $color[7]  '#0000cc';  /* blue          Links                  */
  116.         $color[8]  '#000000';  /* black         Normal text            */
  117.         $color[9]  '#ababab';  /* mid-gray      Darker version of #0   */
  118.     }
  119.  
  120.     $err _("ERROR");
  121.  
  122.     $ret concat_hook_function('error_box'$string);
  123.     if($ret != ''{
  124.         $string $ret;
  125.     }
  126.  
  127.     /* check if the page header has been sent; if not, send it! */
  128.     if(!isset($pageheader_sent&& !$pageheader_sent{
  129.         /* include this just to be sure */
  130.         include_onceSM_PATH 'functions/page_header.php' );
  131.         displayHtmlHeader('SquirrelMail: '.$err);
  132.         $pageheader_sent TRUE;
  133.         echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n\n";
  134.     }
  135.  
  136.     echo '<table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="'.$color[9].'">'.
  137.          '<tr><td>'.
  138.          '<table width="100%" cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="'.$color[4].'">'.
  139.          '<tr><td align="center" bgcolor="'.$color[0].'">'.
  140.          '<font color="'.$color[2].'"><b>' $err ':</b></font>'.
  141.          '</td></tr><tr><td>'.
  142.          '<table cellpadding="1" cellspacing="5" align="center" border="0">'.
  143.          '<tr>' html_tag'td'$string."\n"'left''</tr></table>'.
  144.          '</td></tr></table></td></tr></table>';
  145. }
  146.  
  147. /**
  148.  * Adds message that informs about non fatal error that can happen while saving preferences
  149.  * @param string $message error message
  150.  * @since 1.5.1 and 1.4.5
  151.  */
  152. function error_option_save($message{
  153.     global $optpage_save_error;
  154.  
  155.     if (is_array($optpage_save_error) )
  156.         $optpage_save_error=array();
  157.  
  158.     $optpage_save_error=array_merge($optpage_save_error,array($message));
  159. }
  160. // vim: et ts=4
  161. ?>

Documentation generated on Sat, 07 Oct 2006 16:31:00 +0300 by phpDocumentor 1.3.0RC6