X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search_html.php;h=e8faf646111a4b7d1016bab100f9c220156f3314;hb=30553e2888fa18c4283c366cb48dd4df8bf2f299;hp=51d2b538e77d27c168dfe862c3e325363fa9f9a9;hpb=bd9bbfefba8fa274260a37c965f7510bb6670599;p=squirrelmail.git diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index 51d2b538..e8faf646 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -3,167 +3,243 @@ /** * addrbook_search_html.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2005 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$ + * @version $Id$ + * @package squirrelmail + * @subpackage addressbook */ -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'); +/** + * Path for SquirrelMail required files. + * @ignore + */ +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; - - echo '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '\n" . '' . - "\n"; + $identity, $session; + + if (substr($body, 0, 1) == "\r") { + echo addHidden('body', "\n".$body); + } else { + echo addHidden('body', $body); } + 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'); +} -/* 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, $PHP_SELF; + global $color, $javascript_on, $PHP_SELF, $squirrelmail_language; if (sizeof($res) <= 0) return; - echo '
'; + 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'). + ''; } /* --- End functions --- */ -global $mailbox; -displayPageHeader($color, $mailbox); - +if ($compose_new_win == '1') { + compose_Header($color, $mailbox); +} +else { + displayPageHeader($color, $mailbox); +} /* Initialize addressbook */ $abook = addressbook_init(); -?> -
- |
\n" . - ' |
' . - sprintf(_("Unable to list addresses from %s"), - $abook->backends[$backend]->sname) . - "
\n"; + echo html_tag( 'p', '
' .
- _("Your search failed with the following error(s)") . ':
' .
- $abook->error . "