瀏覽代碼

Little bit of tidying up

Bron Gondwana 23 年之前
父節點
當前提交
0198f43746
共有 3 個文件被更改,包括 15 次插入16 次删除
  1. 8 6
      functions/display_messages.php
  2. 1 1
      src/left_main.php
  3. 6 9
      src/right_main.php

+ 8 - 6
functions/display_messages.php

@@ -14,13 +14,15 @@
 
 
 function error_username_password_incorrect() {
 function error_username_password_incorrect() {
     global $frame_top, $color;
     global $frame_top, $color;
+    /* XXX: Should really not start the HTML before this, or close off more
+       cleanly. */
 
 
     if (!isset($frame_top)) {
     if (!isset($frame_top)) {
         $frame_top = '_top';
         $frame_top = '_top';
     }
     }
 
 
     echo '<BR>'.
     echo '<BR>'.
-                '<TABLE COLS=1 WIDTH="75%" NOBORDER BGCOLOR="' . $color[4] . '" ALIGN=CENTER>'.
+                '<TABLE COLS=1 WIDTH="75%" BORDER="0" BGCOLOR="' . $color[4] . '" ALIGN=CENTER>'.
                 '<TR BGCOLOR="' . $color[0] . '">'.
                 '<TR BGCOLOR="' . $color[0] . '">'.
                     '<TH>' . _("ERROR") . '</TH>'.
                     '<TH>' . _("ERROR") . '</TH>'.
                 '</TR>' .
                 '</TR>' .
@@ -37,15 +39,15 @@ function error_username_password_incorrect() {
 function general_info($motd, $org_logo, $version, $org_name, $color) {
 function general_info($motd, $org_logo, $version, $org_name, $color) {
 
 
     echo '<BR>'.
     echo '<BR>'.
-         "<TABLE COLS=1 WIDTH=\"80%\" CELLSPACING=0 CELLPADDING=2 NOBORDER ALIGN=CENTER><TR><TD BGCOLOR=\"$color[9]\">".
-         '<TABLE COLS=1 WIDTH="100%" CELLSPACING=0 CELLPADDING=3 NOBORDER BGCOLOR="' .  $color[4] . '" ALIGN=CENTER>'.
+         "<TABLE COLS=1 WIDTH=\"80%\" CELLSPACING=0 CELLPADDING=2 BORDER=\"0\" ALIGN=CENTER><TR><TD BGCOLOR=\"$color[9]\">".
+         '<TABLE COLS=1 WIDTH="100%" CELLSPACING=0 CELLPADDING=3 BORDER="0" BGCOLOR="' .  $color[4] . '" ALIGN=CENTER>'.
             '<TR>' .
             '<TR>' .
                "<TD BGCOLOR=\"$color[0]\">" .
                "<TD BGCOLOR=\"$color[0]\">" .
                   '<B><CENTER>';
                   '<B><CENTER>';
     printf (_("Welcome to %s's WebMail system"), $org_name);
     printf (_("Welcome to %s's WebMail system"), $org_name);
     echo          '</CENTER></B>'.
     echo          '</CENTER></B>'.
             '<TR><TD BGCOLOR="' . $color[4] .  '">'.
             '<TR><TD BGCOLOR="' . $color[4] .  '">'.
-               '<TABLE COLS=2 WIDTH="90%" CELLSPACING=0 CELLPADDING=3 NOBORDER align="center">'.
+               '<TABLE COLS=2 WIDTH="90%" CELLSPACING=0 CELLPADDING=3 BORDER="0" align="center">'.
                   '<TR>'.
                   '<TR>'.
                      '<TD BGCOLOR="' . $color[4] .  '"><CENTER>';
                      '<TD BGCOLOR="' . $color[4] .  '"><CENTER>';
     if ( strlen($org_logo) > 3 ) {
     if ( strlen($org_logo) > 3 ) {
@@ -71,7 +73,7 @@ function error_message($message, $mailbox, $sort, $startMessage, $color) {
     $urlMailbox = urlencode($mailbox);
     $urlMailbox = urlencode($mailbox);
 
 
     echo '<BR>'.
     echo '<BR>'.
-         "<TABLE COLS=1 WIDTH=\"70%\" NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
+         "<TABLE COLS=1 WIDTH=\"70%\" BORDER=\"0\" BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
             '<TR>'.
             '<TR>'.
                "<TD BGCOLOR=\"$color[0]\">".
                "<TD BGCOLOR=\"$color[0]\">".
                   "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>'.
                   "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>'.
@@ -87,7 +89,7 @@ function error_message($message, $mailbox, $sort, $startMessage, $color) {
 
 
 function plain_error_message($message, $color) {
 function plain_error_message($message, $color) {
     echo '<BR>'.
     echo '<BR>'.
-         "<TABLE COLS=1 WIDTH=\"70%\" NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
+         "<TABLE COLS=1 WIDTH=\"70%\" BORDER=\"0\" BGCOLOR=\"$color[4]\" ALIGN=CENTER>".
             '<TR>'.
             '<TR>'.
                "<TD BGCOLOR=\"$color[0]\">".
                "<TD BGCOLOR=\"$color[0]\">".
                   "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>'.
                   "<FONT COLOR=\"$color[2]\"><B><CENTER>" . _("ERROR") . '</CENTER></B></FONT>'.

+ 1 - 1
src/left_main.php

@@ -341,8 +341,8 @@ for ($i = 0; $i < count($boxes); $i++) {
     }
     }
 }
 }
 
 
-sqimap_logout($imapConnection);
 do_hook('left_main_after');
 do_hook('left_main_after');
+sqimap_logout($imapConnection);
 
 
 echo "</BODY></HTML>\n";
 echo "</BODY></HTML>\n";
 
 

+ 6 - 9
src/right_main.php

@@ -45,6 +45,8 @@ if( isset( $PG_SHOWNUM ) ) {
 
 
 if (isset($newsort) && $newsort != $sort) {
 if (isset($newsort) && $newsort != $sort) {
     setPref($data_dir, $username, 'sort', $newsort);
     setPref($data_dir, $username, 'sort', $newsort);
+    $sort = $newsort;
+    session_register('sort');
 }
 }
 
 
 /* If the page has been loaded without a specific mailbox, */
 /* If the page has been loaded without a specific mailbox, */
@@ -63,11 +65,11 @@ if ($imap_server_type == 'uw' && (strstr($mailbox, '../') ||
                                   substr($mailbox, 0, 1) == '/')) {
                                   substr($mailbox, 0, 1) == '/')) {
    $mailbox = 'INBOX';
    $mailbox = 'INBOX';
 }
 }
-    global $color;
+global $color;
 
 
-    if( isset($do_hook) && $do_hook ) {
-        do_hook ("generic_header");
-    }
+if( isset($do_hook) && $do_hook ) {
+    do_hook ("generic_header");
+}
 
 
 sqimap_mailbox_select($imapConnection, $mailbox);
 sqimap_mailbox_select($imapConnection, $mailbox);
 
 
@@ -109,11 +111,6 @@ if ($just_logged_in == true) {
     }
     }
 }
 }
 
 
-if (isset($newsort)) {
-    $sort = $newsort;
-    session_register('sort');
-}
-
 /*********************************************************************
 /*********************************************************************
  * Check to see if we can use cache or not. Currently the only time  *
  * Check to see if we can use cache or not. Currently the only time  *
  * when you will not use it is when a link on the left hand frame is *
  * when you will not use it is when a link on the left hand frame is *