From 828c58f18565da37215df7d138ba05485ce8c4cd Mon Sep 17 00:00:00 2001 From: kink Date: Sun, 9 Jul 2006 22:26:05 +0000 Subject: [PATCH] make a start with adding labels for html form elements. this aids disabled users, but also e.g. allows one to click the text next to a checkbox to select it. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11381 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + functions/addressbook.php | 3 ++- functions/folder_manip.php | 4 ++-- src/addrbook_search.php | 8 +++++--- src/addressbook.php | 11 +++++++---- src/compose.php | 20 +++++++++++--------- templates/default/message_list.tpl | 4 ++-- 7 files changed, 30 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fa1d690..ebb08ce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -95,6 +95,7 @@ Version 1.5.2 - CVS in PHP configuration (#1518885). - Make the default attachment dir /var/local/squirrelmail/attach, not $data_dir. + - Add HTML labels for form elements. Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/functions/addressbook.php b/functions/addressbook.php index 9b10a3cc..8c764877 100644 --- a/functions/addressbook.php +++ b/functions/addressbook.php @@ -233,7 +233,8 @@ function addressbook_inp_field($label, $field, $name, $size, $values, $add='') { $td_str .= $add ; return html_tag( 'tr' , - html_tag( 'td', $label . ':', 'right', $color[4]) . + html_tag( 'td', ':', 'right', $color[4]) . html_tag( 'td', $td_str, 'left', $color[4]) ) . "\n"; diff --git a/functions/folder_manip.php b/functions/folder_manip.php index 22ef6e13..75f64d6f 100644 --- a/functions/folder_manip.php +++ b/functions/folder_manip.php @@ -121,7 +121,7 @@ function folders_rename_getname ($imapConnection, $delimiter, $old) { html_tag( 'td', '', 'center', $color[4] ) . addForm('folders.php'). addHidden('smaction', 'rename'). - _("New name:"). + '' . '
' . htmlspecialchars($old_parent) . '' . addInput('new_name', $old_name, 25) . '

' . "\n"; if ( $isfolder ) { @@ -342,4 +342,4 @@ function folders_unsubscribe($imapConnection, $folder_names) } -?> \ No newline at end of file +?> diff --git a/src/addrbook_search.php b/src/addrbook_search.php index b64d16d6..843303cc 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -209,13 +209,15 @@ if ($show == 'form' && ! isset($listall)) { '" method="post">' . "\n" . html_tag( 'table', '', '', '', 'border="0" width="100%" height="100%"' ) . html_tag( 'tr' ) . - html_tag( 'td', ' ' . _("Search for") . "\n", 'left', '', 'style="white-space: nowrap;" valign="middle" width="10%"' ) . + html_tag( 'td', ' \n", 'left', '', + 'style="white-space: nowrap;" valign="middle" width="10%"' ) . html_tag( 'td', '', 'left', '', '' ) . addInput('query', $query, 28); /* List all backends to allow the user to choose where to search */ if ($abook->numbackends > 1) { - echo '' . _("in") . ' '."\n"; + echo ' '."\n"; $selopts = array(); $selopts['-1'] = _("All address books"); @@ -300,4 +302,4 @@ if ($show == 'form' && ! isset($listall)) { } } $oTemplate->display('footer.tpl'); -?> \ No newline at end of file +?> diff --git a/src/addressbook.php b/src/addressbook.php index 68d85244..f3fb8b1a 100644 --- a/src/addressbook.php +++ b/src/addressbook.php @@ -311,22 +311,25 @@ if ($showaddrlist) { } echo html_tag( 'tr', '', '', $tr_bgcolor); if ($abook->backends[$row['backend']]->writeable) { + $id = $row['backend'].':'.$row['nickname']; echo html_tag( 'td', '' . - addCheckBox('sel[]', $selected, $row['backend'].':'.$row['nickname']). + addCheckBox("sel[$id]", $selected, $id). '' , 'center', '', 'valign="top" width="1%"' ); + $label1 = ''; } else { echo html_tag( 'td', ' ' , 'center', '', 'valign="top" width="1%"' ); + $label1 = $label2 = ''; } echo html_tag( 'td', - ' ' . htmlspecialchars($row['nickname']) . ' ', + ' ' . $label1 . htmlspecialchars($row['nickname']) . $label2 . ' ', 'left', '', 'valign="top" width="1%" style="white-space: nowrap;"' ); echo html_tag( 'td', - ' ' . htmlspecialchars($row['name']) . ' ', + ' ' . $label1 . htmlspecialchars($row['name']) . $label2 . ' ', 'left', '', 'valign="top" width="1%" style="white-space: nowrap;"' ); // email address column @@ -377,4 +380,4 @@ echo "\n"; do_hook('addressbook_bottom'); echo "\n\n"; $oTemplate->display('footer.tpl'); -?> \ No newline at end of file +?> diff --git a/src/compose.php b/src/compose.php index cc73869c..2d058d09 100644 --- a/src/compose.php +++ b/src/compose.php @@ -1151,7 +1151,7 @@ function showInputForm ($session, $values=false) { } echo ' ' . "\n" . html_tag( 'td', '', 'right', $color[4], 'width="10%"' ) . - _("From:") . '' . "\n" . + '' . "\n" . html_tag( 'td', '', 'left', $color[4], 'width="90%"' ) . ' '. addSelect('identity', $ident_list, $identity, TRUE); @@ -1162,28 +1162,28 @@ function showInputForm ($session, $values=false) { echo ' ' . "\n" . html_tag( 'td', '', 'right', $color[4], 'width="10%"' ) . - _("To") . ':' . "\n" . + ':' . "\n" . html_tag( 'td', '', 'left', $color[4], 'width="90%"' ) . addInput('send_to', $send_to, 60, 0, $onfocus_array). '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . html_tag( 'td', '', 'right', $color[4] ) . - _("Cc") . ':' . "\n" . + ':' . "\n" . html_tag( 'td', '', 'left', $color[4] ) . addInput('send_to_cc', $send_to_cc, 60, 0, $onfocus_array). '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . html_tag( 'td', '', 'right', $color[4] ) . - _("Bcc") . ':' . "\n" . + ':' . "\n" . html_tag( 'td', '', 'left', $color[4] ) . addInput('send_to_bcc', $send_to_bcc, 60, 0, $onfocus_array).'
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . html_tag( 'td', '', 'right', $color[4] ) . - _("Subject") . ':' . "\n" . + ':' . "\n" . html_tag( 'td', '', 'left', $color[4] ) . "\n"; echo ' '.addInput('subject', $subject, 60, 0, $onfocus_array). ' ' . "\n" . @@ -1370,7 +1370,7 @@ function showComposeButtonRow() { if(!isset($mailprio)) { $mailprio = '3'; } - echo ' ' . _("Priority") . + echo ' : '. addSelect('mailprio', array( '1' => _("High"), '3' => _("Normal"), @@ -1380,8 +1380,10 @@ function showComposeButtonRow() { if ($default_use_mdn) { if ($mdn_user_support) { echo ' ' . _("Receipt") .': '. - addCheckBox('request_mdn', $request_mdn == '1', '1'). _("On Read"). - addCheckBox('request_dr', $request_dr == '1', '1'). _("On Delivery"); + addCheckBox('request_mdn', $request_mdn == '1', '1') . + '' . + addCheckBox('request_dr', $request_dr == '1', '1') . + ''; } } @@ -1732,4 +1734,4 @@ function deliverMessage($composeMessage, $draft=false) { } return $success; } -?> \ No newline at end of file +?> diff --git a/templates/default/message_list.tpl b/templates/default/message_list.tpl index f45ad87c..21fbc18d 100644 --- a/templates/default/message_list.tpl +++ b/templates/default/message_list.tpl @@ -140,7 +140,7 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16]; case 'checkbox': if ($key != 'bypass_trash') { ?> -   +   -   +