X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Faddrbook_search_html.php;h=4361d31f0493e793bd04d69a1bc00998b4ec13be;hb=4b4abf93a9624311afef0c385023724ee46a2b60;hp=bfb0797ddc9c6a8d1c89b92c1ac7fd466a117819;hpb=623662614b34b6f05a5ba6330bc5a624c8e9b731;p=squirrelmail.git
diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php
index bfb0797d..4361d31f 100644
--- a/src/addrbook_search_html.php
+++ b/src/addrbook_search_html.php
@@ -3,35 +3,39 @@
/**
* addrbook_search_html.php
*
- * Copyright (c) 1999-2004 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
* Handle addressbook searching with pure html.
*
* This file is included from compose.php
*
- * $Id$
+ * @copyright © 1999-2005 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
* @package squirrelmail
+ * @subpackage addressbook
*/
-/** Path for SquirrelMail required files. */
+/**
+ * Path for SquirrelMail required files.
+ * @ignore
+ */
if (! defined('SM_PATH') ) {
- define('SM_PATH','../');
+ define('SM_PATH','../');
}
/** SquirrelMail required files. */
require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/global.php');
-require_once(SM_PATH . 'functions/date.php');
-require_once(SM_PATH . 'functions/display_messages.php');
-require_once(SM_PATH . 'functions/addressbook.php');
-require_once(SM_PATH . 'functions/plugin.php');
-require_once(SM_PATH . 'functions/strings.php');
-require_once(SM_PATH . 'functions/html.php');
+include_once(SM_PATH . 'functions/global.php');
+include_once(SM_PATH . 'functions/date.php');
+include_once(SM_PATH . 'functions/display_messages.php');
+include_once(SM_PATH . 'functions/addressbook.php');
+include_once(SM_PATH . 'functions/plugin.php');
+include_once(SM_PATH . 'functions/strings.php');
+include_once(SM_PATH . 'functions/html.php');
sqgetGlobalVar('session', $session, SQ_POST);
sqgetGlobalVar('mailbox', $mailbox, SQ_POST);
-sqgetGlobalVar('addrquery', $addrquery, SQ_POST);
+if (! sqgetGlobalVar('addrquery', $addrquery, SQ_POST))
+ $addrquery='';
sqgetGlobalVar('listall', $listall, SQ_POST);
sqgetGlobalVar('backend', $backend, SQ_POST);
@@ -50,12 +54,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');
}
@@ -69,7 +73,7 @@ function addr_display_result($res, $includesource = true) {
if (sizeof($res) <= 0) return;
- echo addForm($PHP_SELF, 'POST', 'addrbook').
+ echo addForm($PHP_SELF, 'post', 'addrbook').
addHidden('html_addr_search_done', 'true');
addr_insert_hidden();
$line = 0;
@@ -88,11 +92,11 @@ if ($javascript_on) {
"}\n" .
"//-->\n" .
"\n";
- $chk_all = '' . _("All") . ' To'.
+ $chk_all = '' . _("All") . ' '._("To").''.
' '.
- '' . _("All") . ' Cc'.
+ '' . _("All") . ' '._("Cc").''.
' '.
- '' . _("All") . '';
+ '' . _("All") . '';
}
echo html_tag( 'table', '', 'center', '', 'border="0" width="98%"' ) .
html_tag( 'tr', '', '', $color[9] ) .
@@ -108,40 +112,43 @@ if ($javascript_on) {
echo "\n";
foreach ($res as $row) {
- $tr_bgcolor = '';
$email = AddressBook::full_address($row);
- if ($line % 2) { $tr_bgcolor = $color[0]; }
+ if ($line % 2) {
+ $tr_bgcolor = $color[12];
+ } else {
+ $tr_bgcolor = $color[4];
+ }
if ($squirrelmail_language == 'ja_JP')
{
- echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
+ echo html_tag( 'tr', '', '', $tr_bgcolor, 'style="white-space: nowrap;"' ) .
html_tag( 'td',
- ' ' . _("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' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['label']) . ' ', 'left', '', 'nowrap' );
+ ' ' . _("To") . ' ' .
+ ' ' . _("Cc") . ' ' .
+ ' ' . _("Bcc") . ' ' ,
+ 'center', '', 'width="5%" style="white-space: nowrap;"' ) .
+ html_tag( 'td', ' ' . htmlspecialchars($row['lastname']) . ' ' . htmlspecialchars($row['firstname']) . ' ', 'left', '', 'style="white-space: nowrap;"' ) .
+ html_tag( 'td', ' ' . htmlspecialchars($row['email']) . ' ', 'left', '', 'style="white-space: nowrap;"' ) .
+ html_tag( 'td', ' ' . htmlspecialchars($row['label']) . ' ', 'left', '', 'style="white-space: nowrap;"' );
} else {
- echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) .
+ echo html_tag( 'tr', '', '', $tr_bgcolor, 'style="white-space: 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") . ' ' ,
- 'center', '', 'width="5%" nowrap' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['name']) . ' ', 'left', '', 'nowrap' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['email']) . ' ', 'left', '', 'nowrap' ) .
- html_tag( 'td', ' ' . htmlspecialchars($row['label']) . ' ', 'left', '', 'nowrap' );
+ addCheckBox('send_to_search[C'.$line.']', FALSE, $email).
+ ' ' . _("Cc") . ' ' .
+ addCheckBox('send_to_search[B'.$line.']', FALSE, $email).
+ ' ' . _("Bcc") . ' ' ,
+ 'center', '', 'width="5%" style="white-space: nowrap;"' ) .
+ html_tag( 'td', ' ' . htmlspecialchars($row['name']) . ' ', 'left', '', 'style="white-space: nowrap;"' ) .
+ html_tag( 'td', ' ' . htmlspecialchars($row['email']) . ' ', 'left', '', 'style="white-space: nowrap;"' ) .
+ html_tag( 'td', ' ' . htmlspecialchars($row['label']) . ' ', 'left', '', 'style="white-space: nowrap;"' );
}
if ($includesource) {
- echo html_tag( 'td', ' ' . $row['source'] . ' ', 'left', '', 'nowrap' );
+ echo html_tag( 'td', ' ' . $row['source'] . ' ', 'left', '', 'style="white-space: nowrap;"' );
}
echo "\n";
$line ++;
@@ -149,13 +156,15 @@ 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 --- */
@@ -166,11 +175,16 @@ if ($compose_new_win == '1') {
else {
displayPageHeader($color, $mailbox);
}
+
+/** set correct value of $default_charset */
+global $default_charset;
+set_my_charset();
+
/* Initialize addressbook */
$abook = addressbook_init();
-echo '
' .
+echo '
' .
html_tag( 'table',
html_tag( 'tr',
html_tag( 'td', '' . _("Address Book Search") . '', 'center', $color[0] )
@@ -182,25 +196,23 @@ html_tag( 'table',
echo '