From 39bfea8fa9fd939da9766a79381f68ea4b725c23 Mon Sep 17 00:00:00 2001 From: jervfors Date: Sat, 14 Aug 2004 02:41:12 +0000 Subject: [PATCH] XHTML fixes git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7897 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/forms.php | 2 +- src/addrbook_popup.php | 2 +- src/addrbook_search.php | 54 +++++++++++----------- src/addrbook_search_html.php | 86 +++++++++++++++++----------------- src/addressbook.php | 40 ++++++++-------- src/compose.php | 90 ++++++++++++++++++------------------ src/folders.php | 2 +- src/folders_create.php | 4 +- src/help.php | 14 +++--- src/left_main.php | 19 ++++---- src/options.php | 22 ++++----- src/options_highlight.php | 20 ++++---- src/options_identities.php | 12 ++--- src/options_order.php | 4 +- src/read_body.php | 2 +- 15 files changed, 184 insertions(+), 189 deletions(-) diff --git a/functions/forms.php b/functions/forms.php index 3583a33f..b6ce3b37 100644 --- a/functions/forms.php +++ b/functions/forms.php @@ -128,7 +128,7 @@ function addTextArea($name, $text = '', $cols = 40, $rows = 10, $attr = '') { /** * Make a
start-tag. */ -function addForm($action, $method = 'POST', $name = '', $enctype = '', $charset = '') +function addForm($action, $method = 'post', $name = '', $enctype = '', $charset = '') { if($name) { $name = ' name="'.$name.'"'; diff --git a/src/addrbook_popup.php b/src/addrbook_popup.php index 1800c3cf..e10dc451 100644 --- a/src/addrbook_popup.php +++ b/src/addrbook_popup.php @@ -29,7 +29,7 @@ require_once(SM_PATH . 'functions/addressbook.php'); <?php echo "$org_title: " . _("Address Book"); ?> - + To | " . + "'" . $email . "');\">To | " . 'Cc | " . + "'" . $email . "');\">Cc | " . 'Bcc", + "'" . $email . "');\">Bcc", 'center', '', 'valign="top" width="5%" nowrap' ) . html_tag( 'td', ' ' . htmlspecialchars($row['name']), 'left', '', 'valign="top" nowrap' ) . html_tag( 'td', ' ' . '" . htmlspecialchars($row['email']) . '' + "'" . $email . "');\">" . htmlspecialchars($row['email']) . '' , 'left', '', 'valign="top"' ) . html_tag( 'td', htmlspecialchars($row['label']), 'left', '', 'valign="top" nowrap' ); if ($includesource) { @@ -181,22 +181,22 @@ if (!isset($backend)) { $backend = ''; } /* Choose correct colors for top and bottom frame */ if ($show == 'form' && !isset($listall)) { - echo ''; } else { - echo '\n"; + echo '\n"; } /* Empty search */ if (empty($query) && empty($show) && empty($listall)) { - echo html_tag( 'p', '
' . + echo html_tag( 'p', '
' . _("No persons matching your search were found"), 'center' ) . - "\n\n", + "\n\n", exit; } @@ -205,8 +205,8 @@ $abook = addressbook_init(); /* Create search form */ if ($show == 'form' && empty($listall)) { - echo '' . "\n" . + echo '' . "\n" . html_tag( 'table', '', '', '', 'border="0" width="100%" height="100%"' ) . html_tag( 'tr' ) . html_tag( 'td', ' ' . _("Search for") . "\n", 'left', '', 'nowrap valign="middle" width="10%"' ) . @@ -215,7 +215,7 @@ if ($show == 'form' && empty($listall)) { /* List all backends to allow the user to choose where to search */ if ($abook->numbackends > 1) { - echo '' . _("in") . ' '."\n". + echo '' . _("in") . ' '."\n". $selopts['-1'] = _("All address books"); $ret = $abook->get_backend_list(); @@ -231,11 +231,11 @@ if ($show == 'form' && empty($listall)) { html_tag( 'tr', html_tag( 'td', '', 'left' ) . html_tag( 'td', - '' . - ' | ' . "\n" . - ' | ' . "\n" , + '' . + ' | ' . "\n" . + ' | ' . "\n" , 'left' ) ) . '
' . "\n"; @@ -280,19 +280,19 @@ if ($show == 'form' && empty($listall)) { } if (!is_array($res)) { - echo html_tag( 'p', '
' . + echo html_tag( 'p', '
' . _("Your search failed with the following error(s)") . - ':
' . $abook->error . "
\n" , + ':
' . $abook->error . "
\n" , 'center' ) . - "\n\n"; + "\n\n"; exit; } if (sizeof($res) == 0) { - echo html_tag( 'p', '
' . + echo html_tag( 'p', '
' . _("No persons matching your search were found") . "\n" , 'center' ) . - "\n\n"; + "\n\n"; exit; } @@ -301,7 +301,5 @@ if ($show == 'form' && empty($listall)) { } } - -echo "\n"; - ?> + diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index 1e0f8f45..3b128f92 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -19,7 +19,7 @@ * @ignore */ if (! defined('SM_PATH') ) { - define('SM_PATH','../'); + define('SM_PATH','../'); } /** SquirrelMail required files. */ @@ -53,12 +53,12 @@ function addr_insert_hidden() { echo addHidden('session', $session). addHidden('subject', $subject). - addHidden('send_to', $send_to). - addHidden('send_to_bcc', $send_to_bcc). - addHidden('send_to_cc', $send_to_cc). - addHidden('identity', $identity). - addHidden('mailbox', $mailbox). - addHidden('from_htmladdr_search', 'true'); + addHidden('send_to', $send_to). + addHidden('send_to_bcc', $send_to_bcc). + addHidden('send_to_cc', $send_to_cc). + addHidden('identity', $identity). + addHidden('mailbox', $mailbox). + addHidden('from_htmladdr_search', 'true'); } @@ -121,12 +121,12 @@ if ($javascript_on) { { echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) . html_tag( 'td', - ' ' . _("To") . ' ' . - ' ' . _("Cc") . ' ' . - ' ' . _("Bcc") . ' ' , + ' ' . _("To") . ' ' . + ' ' . _("Cc") . ' ' . + ' ' . _("Bcc") . ' ' , 'center', '', 'width="5%" nowrap' ) . html_tag( 'td', ' ' . htmlspecialchars($row['lastname']) . ' ' . htmlspecialchars($row['firstname']) . ' ', 'left', '', 'nowrap' ) . html_tag( 'td', ' ' . htmlspecialchars($row['email']) . ' ', 'left', '', 'nowrap' ) . @@ -134,12 +134,12 @@ if ($javascript_on) { } else { echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) . html_tag( 'td', - addCheckBox('send_to_search[T'.$line.']', FALSE, $email). + addCheckBox('send_to_search[T'.$line.']', FALSE, $email). ' ' . _("To") . ' ' . - addCheckBox('send_to_search[C'.$line.']', FALSE, $email). - ' ' . _("Cc") . ' ' . - addCheckBox('send_to_search[B'.$line.']', FALSE, $email). - ' ' . _("Bcc") . ' ' , + addCheckBox('send_to_search[C'.$line.']', FALSE, $email). + ' ' . _("Cc") . ' ' . + addCheckBox('send_to_search[B'.$line.']', FALSE, $email). + ' ' . _("Bcc") . ' ' , 'center', '', 'width="5%" nowrap' ) . html_tag( 'td', ' ' . htmlspecialchars($row['name']) . ' ', 'left', '', 'nowrap' ) . html_tag( 'td', ' ' . htmlspecialchars($row['email']) . ' ', 'left', '', 'nowrap' ) . @@ -155,13 +155,13 @@ if ($javascript_on) { if ($includesource) { $td_colspan = '5'; } else { $td_colspan = '4'; } echo html_tag( 'tr', html_tag( 'td', - '' , + '' , 'center', '', 'colspan="'. $td_colspan .'"' ) ) . - '' . - addHidden('html_addr_search_done', '1'). - ''; + '' . + addHidden('html_addr_search_done', '1'). + ''; } /* --- End functions --- */ @@ -176,7 +176,7 @@ else { $abook = addressbook_init(); -echo '
' . +echo '
' . html_tag( 'table', html_tag( 'tr', html_tag( 'td', '' . _("Address Book Search") . '', 'center', $color[0] ) @@ -189,9 +189,9 @@ echo '
' . html_tag( 'table', '', 'center', '', 'border="0"' ) . html_tag( 'tr' ) . html_tag( 'td', '', 'left', '', 'nowrap valign="middle"' ) . "\n" . - addForm($PHP_SELF.'?html_addr_search=true', 'POST', 'f'). - "\n
\n" . - ' ' . _("Search for") . "\n"; + addForm($PHP_SELF.'?html_addr_search=true', 'post', 'f'). + "\n
\n" . + ' ' . _("Search for") . "\n"; addr_insert_hidden(); if (! isset($addrquery)) $addrquery = ''; @@ -200,13 +200,13 @@ echo addInput('addrquery', $addrquery, 26); /* List all backends to allow the user to choose where to search */ if (!isset($backend)) { $backend = ''; } if ($abook->numbackends > 1) { - echo '' . _("in") . ' '; + echo '' . _("in") . ' '; $selopts['-1'] = _("All address books"); $ret = $abook->get_backend_list(); while (list($undef,$v) = each($ret)) { - $selopts[$v->bnum] = $v->sname; + $selopts[$v->bnum] = $v->sname; } echo addSelect('backend', $selopts, $backend, TRUE); } else { @@ -216,10 +216,10 @@ if (isset($session)) { echo addHidden('session', $session); } -echo '' . - ' | ' . "\n" . - '
' . "\n"; +echo '' . + ' | ' . "\n" . + '
' . "\n"; addr_insert_hidden(); echo '
'; do_hook('addrbook_html_search_below'); @@ -238,7 +238,7 @@ if ($addrquery == '' && empty($listall)) { $backend = $abook->localbackend; } - /* echo '

' . $abook->backends[$backend]->sname) . "

\n"; */ + /* echo '

' . $abook->backends[$backend]->sname) . "

\n"; */ $res = $abook->list_addr($backend); @@ -246,7 +246,7 @@ if ($addrquery == '' && empty($listall)) { usort($res,'alistcmp'); addr_display_result($res, false); } else { - echo html_tag( 'p', '
' . + echo html_tag( 'p', '
' . sprintf(_("Unable to list addresses from %s"), $abook->backends[$backend]->sname) . "
\n" , 'center' ); @@ -271,17 +271,17 @@ else { } if (!is_array($res)) { - echo html_tag( 'p', '
' . + echo html_tag( 'p', '
' . _("Your search failed with the following error(s)") . - ':
' . $abook->error . "
\n" , + ':
' . $abook->error . "
\n" , 'center' ) . - "\n\n"; + "\n\n"; } else { if (sizeof($res) == 0) { - echo html_tag( 'p', '
' . + echo html_tag( 'p', '
' . _("No persons matching your search were found") . "\n" , 'center' ) . - "\n\n"; + "\n\n"; } else { addr_display_result($res); } @@ -290,11 +290,11 @@ else { } if ($addrquery == '' || sizeof($res) == 0) { - /* printf('
'."\n", $PHP_SELF); */ + /* printf('
'."\n", $PHP_SELF); */ echo '
'. - addForm('compose.php','POST','k'); + addForm('compose.php','POST','k'); addr_insert_hidden(); - echo '' . "\n" . + echo '' . "\n" . '
'; } diff --git a/src/addressbook.php b/src/addressbook.php index 7c3ae718..aaeb00fd 100644 --- a/src/addressbook.php +++ b/src/addressbook.php @@ -79,7 +79,7 @@ function address_form($name, $submittext, $values = array()) { { echo html_tag( 'table', addressbook_inp_field(_("Nickname"), 'nickname', $name, 15, $values, - ' ' . _("Must be unique") . '') . + ' ' . _("Must be unique") . '') . addressbook_inp_field(_("E-mail address"), 'email', $name, 45, $values, '') . addressbook_inp_field(_("Last name"), 'lastname', $name, 45, $values, '') . addressbook_inp_field(_("First name"), 'firstname', $name, 45, $values, '') . @@ -87,15 +87,15 @@ function address_form($name, $submittext, $values = array()) { list_writable_backends($name) . html_tag( 'tr', html_tag( 'td', - '', + '', 'center', $color[4], 'colspan="2"') ) , 'center', '', 'border="0" cellpadding="1" width="90%"') ."\n"; } else { echo html_tag( 'table', addressbook_inp_field(_("Nickname"), 'nickname', $name, 15, $values, - ' ' . _("Must be unique") . '') . + ' ' . _("Must be unique") . '') . addressbook_inp_field(_("E-mail address"), 'email', $name, 45, $values, '') . addressbook_inp_field(_("First name"), 'firstname', $name, 45, $values, '') . addressbook_inp_field(_("Last name"), 'lastname', $name, 45, $values, '') . @@ -103,8 +103,8 @@ function address_form($name, $submittext, $values = array()) { list_writable_backends($name) . html_tag( 'tr', html_tag( 'td', - '', + '', 'center', $color[4], 'colspan="2"') ) , 'center', '', 'border="0" cellpadding="1" width="90%"') ."\n"; @@ -115,12 +115,12 @@ function list_writable_backends($name) { global $color, $abook; if ( $name != 'addaddr' ) { return; } if ( $abook->numbackends > 1 ) { - $ret = "'; $backends = $abook->get_backend_list(); while (list($undef,$v) = each($backends)) { if ($v->writeable) { - $ret .= '\n"; } } $ret .= ""; @@ -247,7 +247,7 @@ if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'P $olddata = $abook->lookup($enick, $ebackend); /* Display the "new address" form */ - echo '
' . + echo '' . "\n" . html_tag( 'table', html_tag( 'tr', @@ -260,7 +260,7 @@ if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'P echo addHidden('oldnick', $olddata['nickname']). addHidden('backend', $olddata['backend']). addHidden('doedit', '1'). - '
'; + ''; } } else { @@ -282,8 +282,8 @@ if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'P 'center', '', 'width="100%"' ); /* Display the "new address" form again */ - echo '
' . "\n" . + echo '' . "\n" . html_tag( 'table', html_tag( 'tr', html_tag( 'td', @@ -296,7 +296,7 @@ if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'P addHidden('oldnick', $oldnick). addHidden('backend', $backend). addHidden('doedit', '1'). - "\n" . '
'; + "\n" . ''; $abortform = true; } } else { @@ -312,7 +312,7 @@ if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'P // Some times we end output before forms are printed if($abortform) { - echo "\n"; + echo "\n"; exit(); } } @@ -328,7 +328,7 @@ if (!empty($formerror)) { echo html_tag( 'table', html_tag( 'tr', html_tag( 'td', - "\n". '
' . _("ERROR") . ': ' . $formerror . '' ."\n", 'center' ) ), @@ -362,14 +362,14 @@ if ($showaddrlist) { echo html_tag( 'table', html_tag( 'tr', html_tag( 'td', - '\n" . - '\n", 'center', '', 'colspan="5"' ) ) . html_tag( 'tr', - html_tag( 'td', ' 
', 'center', '', 'colspan="5"' ) + html_tag( 'td', ' 
', 'center', '', 'colspan="5"' ) ) , 'center' ); echo "\n\n" . @@ -440,7 +440,7 @@ if ($showaddrlist) { if ($abook->backends[$row['backend']]->writeable) { echo html_tag( 'td', '' . - '' , 'center', '', 'valign="top" width="1%"' ); } else { diff --git a/src/compose.php b/src/compose.php index 80e48826..c0fe8795 100644 --- a/src/compose.php +++ b/src/compose.php @@ -929,14 +929,14 @@ function showInputForm ($session, $values=false) { } if ($use_javascript_addr_book) { - echo "\n". '\n\n"; + "// -->\n\n\n"; } echo "\n" . '
'. _("Draft Saved").'
'; + echo '
'. _("Draft Saved").'
'; } if ($mail_sent == 'yes') { - echo '
'. _("Your Message has been sent.").'
'; + echo '
'. _("Your Message has been sent.").'
'; } echo '' . "\n"; if ($compose_new_win == '1') { - echo '
'."\n" . - ' '. html_tag( 'td', '', 'right' ) . ''."\n"; + echo '
'."\n" . + ' '. html_tag( 'td', '', 'right' ) . ''."\n"; } if ($location_of_buttons == 'top') { showComposeButtonRow(); @@ -996,7 +996,7 @@ function showInputForm ($session, $values=false) { echo ' ' . "\n" . html_tag( 'td', '', 'right', $color[4], 'width="10%"' ) . - _("To:") . '' . "\n" . + _("To:") . '' . "\n" . html_tag( 'td', '', 'left', $color[4], 'width="90%"' ) . addInput('send_to', $send_to, 60). '
' . "\n" . ' ' . "\n" . @@ -1029,16 +1029,16 @@ function showInputForm ($session, $values=false) { /* why this distinction? */ if ($compose_new_win == '1') { - echo ' ' . "\n" . - '
' . "\n" . - '