From d68323ff96429e9d788a5144aaf8aa1afffc494c Mon Sep 17 00:00:00 2001 From: kink Date: Sun, 22 Dec 2002 13:39:43 +0000 Subject: [PATCH] A small start in making Sqm XHTML 1.0 valid git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4302 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/html.php | 25 +++++----- functions/page_header.php | 32 ++++++------- src/left_main.php | 84 ++++++++++++++++----------------- src/login.php | 21 ++++----- src/printer_friendly_bottom.php | 4 +- src/printer_friendly_main.php | 6 +-- src/printer_friendly_top.php | 6 +-- src/signout.php | 2 +- src/webmail.php | 12 ++--- 9 files changed, 95 insertions(+), 97 deletions(-) diff --git a/functions/html.php b/functions/html.php index b926f736..0aac1864 100644 --- a/functions/html.php +++ b/functions/html.php @@ -14,7 +14,7 @@ */ function html_tag( $tag, // Tag to output - $val = '', // Value between tags (if empty only start tag is issued) + $val = '', // Value between tags $align = '', // Alignment $bgcolor = '', // Back color $xtra = '' ) { // Extra options @@ -23,10 +23,10 @@ $align = strtolower( $align ); $bgc = ''; - $tag = strtoupper( $tag ); + $tag = strtolower( $tag ); if ( isset( $languages[$squirrelmail_language]['DIR']) ) { - $dir = $languages[$squirrelmail_language]['DIR']; + $dir = $languages[$squirrelmail_language]['DIR']; } else { $dir = 'ltr'; } @@ -40,7 +40,7 @@ } if ( $bgcolor <> '' ) { - $bgc = " BGCOLOR=\"$bgcolor\""; + $bgc = " bgcolor=\"$bgcolor\""; } switch ( $align ) { @@ -48,31 +48,32 @@ $alg = ''; break; case 'right': - $alg = " ALIGN=\"$rgt\""; + $alg = " align=\"$rgt\""; break; case 'left': - $alg = " ALIGN=\"$lft\""; + $alg = " align=\"$lft\""; break; default: - $alg = " ALIGN=\"$align\""; + $alg = " align=\"$align\""; break; } $ret = "<$tag"; if ( $dir <> 'ltr' ) { - $ret .= " DIR=\"$dir\""; + $ret .= " dir=\"$dir\""; } - $ret .= "$bgc$alg"; + $ret .= $bgc . $alg; if ( $xtra <> '' ) { $ret .= " $xtra"; } - $ret .= '>'; if ( $val <> '' ) { - $ret .= "$val"; - } + $ret .= ">$val"; + } else { + $ret .= ' />'; + } return( $ret ); } diff --git a/functions/page_header.php b/functions/page_header.php index ae0a1046..07f53446 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -31,19 +31,19 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE global $theme_css, $custom_css; echo '' . - "\n\n\n\n"; + "\n\n\n\n"; if ( !isset( $custom_css ) || $custom_css == 'none' ) { if ($theme_css != '') { - echo ""; + echo ""; } } else { - echo ''; + echo ''; } if ($do_hook) { - do_hook("generic_header"); + do_hook('generic_header'); } echo "\n$title$xtra\n"; @@ -100,7 +100,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { } if ($session) { - $compose_uri = $base_uri.'src/compose.php?mailbox='. urlencode($mailbox).'&attachedmessages=true&session='."$session"; + $compose_uri = $base_uri.'src/compose.php?mailbox='.urlencode($mailbox).'&attachedmessages=true&session='."$session"; } else { $compose_uri = $base_uri.'src/compose.php?newmessage=1'; $session = 0; @@ -166,7 +166,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { $js .= "// -->\n". "\n"; - $onload = "onLoad=\"checkForm();\""; + $onload = 'onload="checkForm();"'; displayHtmlHeader ('SquirrelMail', $js); break; @@ -215,7 +215,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { $js .= "// -->\n". "\n"; - $onload = "onLoad=\"checkForm();\""; + $onload = 'onload="checkForm();"'; displayHtmlHeader ('SquirrelMail', $js); break; @@ -246,24 +246,24 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { . html_tag( 'td', '', 'left' ) ."\n"; $urlMailbox = urlencode($mailbox); if ($compose_new_win == '1') { - echo "". _("Compose"). ''; + echo ''. _("Compose").''; } else { displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), 'right'); } echo "  \n"; - displayInternalLink ("src/addressbook.php", _("Addresses"), 'right'); + displayInternalLink ('src/addressbook.php', _("Addresses"), 'right'); echo "  \n"; - displayInternalLink ("src/folders.php", _("Folders"), 'right'); + displayInternalLink ('src/folders.php', _("Folders"), 'right'); echo "  \n"; - displayInternalLink ("src/options.php", _("Options"), 'right'); + displayInternalLink ('src/options.php', _("Options"), 'right'); echo "  \n"; displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), 'right'); echo "  \n"; - displayInternalLink ("src/help.php", _("Help"), 'right'); + displayInternalLink ('src/help.php', _("Help"), 'right'); echo "  \n"; - do_hook("menuline"); + do_hook('menuline'); echo " \n" . html_tag( 'td', '', 'right' ) ."\n"; @@ -294,7 +294,7 @@ function compose_Header($color, $mailbox) { switch ( $module ) { case 'src/search.php': $pos = getPref($data_dir, $username, 'search_pos', 0 ) - 1; - $onload = "onLoad=\"document.forms[$pos].elements[2].focus();\""; + $onload = "onload=\"document.forms[$pos].elements[2].focus();\""; displayHtmlHeader (_("Compose")); break; default: @@ -321,7 +321,7 @@ function compose_Header($color, $mailbox) { "}\n"; $js .= "// -->\n". "\n"; - $onload = "onLoad=\"checkForm();\""; + $onload = 'onload="checkForm();"'; displayHtmlHeader (_("Compose"), $js); break; diff --git a/src/left_main.php b/src/left_main.php index 3330a5fe..1b8afaae 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -336,33 +336,33 @@ function listBoxes ($boxes, $j=0 ) { if ($numMessages > 0) { $urlMailbox = urlencode($mailbox); $pre .= "\n\n" . - "  ("._("purge").")" . + "  ("._("purge").")" . ""; } } else { if (!$boxes->is_noselect) { - $pre .= ""; + $pre .= ""; $end .= ''; } } /* If there are unseen message, close bolding. */ - if ($unseen > 0) { $end .= ""; } + if ($unseen > 0) { $end .= ""; } /* Print unseen information. */ if (isset($unseen_found) && $unseen_found) { - $end .= " $unseen_string"; + $end .= " $unseen_string"; } $font = ''; $fontend = ''; if ($boxes->is_special) { - $font = ""; - $fontend = ""; + $font = ""; + $fontend = ""; } if (!$boxes->is_root) { - echo "" . $pre .$font. $boxes->mailboxname_sub .$fontend . $end. '
'; + echo "" . $pre .$font. $boxes->mailboxname_sub .$fontend . $end. '
'; $j++; } if (!$collapse || $boxes->is_root) { @@ -401,16 +401,16 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) { } else $unseen = 0; /* If there are unseen message, bold the line. */ - if ($unseen > 0) { $pre .= ''; } + if ($unseen > 0) { $pre .= ''; } /* color special boxes */ if ($boxes->is_special) { - $pre .= ""; - $end .= ""; + $pre .= ""; + $end .= ''; } /* If there are unseen message, close bolding. */ - if ($unseen > 0) { $end .= ""; } + if ($unseen > 0) { $end .= ''; } /* Print unseen information. */ if (isset($unseen_found) && $unseen_found) { @@ -424,12 +424,12 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) { if ($numMessages > 0) { $urlMailbox = urlencode($mailbox); $pre .= "\n\n" . - "  ("._("purge").")" . + "  ("._("purge").")" . ""; } } else { if (!$boxes->is_noselect) { /* \Noselect boxes can't be selected */ - $pre .= ""; + $pre .= ""; $end .= ''; } } @@ -445,7 +445,7 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) { } else if ($boxes->is_draft) { $folder_img = '../images/draft.gif'; } else $folder_img = '../images/folder.gif'; - $folder_img = '  '; + $folder_img = '  '; } else $folder_img = ''; if (!isset($boxes->mbxs[0])) { echo ' ' . html_tag( 'div', @@ -469,9 +469,9 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) { $collapse = ($collapse == '' ? SM_BOX_UNCOLLAPSED : $collapse); } if ($collapse) { - $link = ''." "; + $link = ''." "; } else { - $link = ''.""; + $link = ''.""; } $collapse_link = $link; } else $collapse_link=''; @@ -479,13 +479,13 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) { $collapse_link . $pre . $folder_img . ' '. $boxes->mailboxname_sub . $end , 'left', '', 'class="mbx_par" id="' .$j. 'P"' ) . "\n"; - echo ' '."\n"; + echo ' '."\n"; } } if ($collapse) { - $visible = ' STYLE="display:none;"'; + $visible = ' style="display:none;"'; } else { - $visible = ' STYLE="display:block;"'; + $visible = ' style="display:block;"'; } if (isset($boxes->mbxs[0]) && !$boxes->is_root) /* mailbox contains childs */ @@ -526,10 +526,10 @@ $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 1 * Using stristr since older preferences may contain "None" and "none". */ if (isset($left_refresh) && ($left_refresh != '') && - !stristr($left_refresh, "none")){ - $xtra = "\n\n" . - "\n". - "\n"; + !stristr($left_refresh, 'none')){ + $xtra = "\n\n" . + "\n". + "\n"; } else { $xtra = ''; } @@ -714,7 +714,7 @@ ECHO; $xtra .= << + + ECHO; @@ -815,23 +815,23 @@ if ($auto_create_special && !isset($auto_create_done)) { sqsession_register($auto_create_done, 'auto_create_done'); } -echo "\n\n"; +echo "\n\n"; do_hook('left_main_before'); if ($advanced_tree) { /* nice future feature, needs layout !! volunteers? */ $right_pos = $left_size - 20; echo '
'; - echo ''; - echo ''; - echo '
'; - echo '


'; + echo ''; + echo ''; + echo '
'; + echo '


'; } echo "\n\n" . html_tag( 'table', '', 'left', '', 'border="0" cellspacing="0" cellpadding="0" width="99%"' ) . html_tag( 'tr' ) . html_tag( 'td', '', 'left' ) . - '
'. _("Folders") . "
\n\n"; + '
'. _("Folders") . "
\n\n"; if ($date_format != 6) { /* First, display the clock. */ @@ -870,7 +870,7 @@ if ($date_format != 6) { /* Next, display the refresh button. */ echo '('. - _("refresh folder list") . ')

'; + _("refresh folder list") . ')

'; /* Lastly, display the folder list. */ if ( $collapse_folders ) { @@ -910,7 +910,7 @@ for ($i = 0; $i < count($boxes); $i++) { } else { $prefix = str_replace(' ',' ',$prefix); } - $line = "$prefix"; + $line = "$prefix"; /* Add the folder name and link. */ if (! isset($color[15])) { @@ -919,21 +919,21 @@ for ($i = 0; $i < count($boxes); $i++) { if (in_array('noselect', $boxes[$i]['flags'])) { if( isSpecialMailbox( $boxes[$i]['unformatted']) ) { - $line .= ""; + $line .= ""; } else { - $line .= ""; + $line .= ""; } if (ereg("^( *)([^ ]*)", $mailbox, $regs)) { $mailbox = str_replace(' ','',$mailbox); $line .= str_replace(' ', ' ', $mailbox); } - $line .= ''; + $line .= ''; } else { $line .= formatMailboxName($imapConnection, $boxes[$i]); } /* Put the final touches on our folder line. */ - $line .= "
\n"; + $line .= "
\n"; /* Output the line for this folder. */ echo $line; @@ -942,14 +942,14 @@ for ($i = 0; $i < count($boxes); $i++) { } else { /* expiremental code */ $boxes = sqimap_mailbox_tree($imapConnection); if (isset($advanced_tree) && $advanced_tree) { - echo '


'; - echo '
'."\n\n"; + echo '

'; + echo '
'."\n\n"; if (!isset($mbx)) $mbx=NULL; ListAdvancedBoxes($boxes, $mbx); echo '
'."\n"; - echo ''."\n"; + echo ''."\n"; } else { ListBoxes($boxes); } diff --git a/src/login.php b/src/login.php index 65e04999..a554a8bf 100644 --- a/src/login.php +++ b/src/login.php @@ -52,7 +52,7 @@ do_hook('login_cookie'); /* Output the javascript onload function. */ -$header = "