X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search_html.php;h=887c93703cfb0275756444a484c92413e5a5c80c;hb=8f6f9ba5df6491d396aa690dcf3e5b9070a565ca;hp=1e71b23dc7b6c0d7dd1cd77af42ada670b7e43e8;hpb=3d0cada30b60e39d6627ab1df7b44b3e9c2e3c91;p=squirrelmail.git diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index 1e71b23d..887c9370 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -3,30 +3,41 @@ /** * addrbook_search_html.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2003 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 * - * NOTE: A lot of this code is similar to the code in - * addrbook_search.html -- If you change one, change - * the other one too! - * * $Id$ + * @package squirrelmail */ -require_once('../src/validate.php'); -require_once('../functions/date.php'); -require_once('../functions/smtp.php'); -require_once('../functions/display_messages.php'); -require_once('../functions/addressbook.php'); -require_once('../functions/plugin.php'); -require_once('../functions/strings.php'); -require_once('../functions/html.php'); +/** Path for SquirrelMail required files. */ +if (! defined('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'); + +sqgetGlobalVar('session', $session, SQ_POST); +sqgetGlobalVar('mailbox', $mailbox, SQ_POST); +sqgetGlobalVar('addrquery', $addrquery, SQ_POST); +sqgetGlobalVar('listall', $listall, SQ_POST); +sqgetGlobalVar('backend', $backend, SQ_POST); -/* Insert hidden data */ +/** + * Insert hidden data + */ function addr_insert_hidden() { global $body, $subject, $send_to, $send_to_cc, $send_to_bcc, $mailbox, $identity, $session; @@ -53,9 +64,13 @@ function addr_insert_hidden() { } -/* List search results */ +/** + * List search results + * @param array $res Array containing results of search + * @param bool $includesource UNDOCUMENTED [Default=true] + */ function addr_display_result($res, $includesource = true) { - global $color, $javascript_on, $PHP_SELF; + global $color, $javascript_on, $PHP_SELF, $squirrelmail_language; if (sizeof($res) <= 0) return; @@ -101,6 +116,21 @@ if ($javascript_on) { $tr_bgcolor = ''; $email = AddressBook::full_address($row); if ($line % 2) { $tr_bgcolor = $color[0]; } + if ($squirrelmail_language == 'ja_JP') + { + echo html_tag( 'tr', '', '', $tr_bgcolor, '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' ); + } else { echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) . html_tag( 'td', ' ' . _("Bcc") . ' ' , 'center', '', 'width="5%" nowrap' ) . - html_tag( 'td', ' ' . $row['name'] . ' ', 'left', '', 'nowrap' ) . - html_tag( 'td', ' ' . $row['email'] . ' ', 'left', '', 'nowrap' ) . - html_tag( 'td', ' ' . $row['label'] . ' ', 'left', '', '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' ); + } if ($includesource) { echo html_tag( 'td', ' ' . $row['source'] . ' ', 'left', '', 'nowrap' ); @@ -134,7 +165,6 @@ if ($javascript_on) { /* --- End functions --- */ -global $mailbox; if ($compose_new_win == '1') { compose_Header($color, $mailbox); }