X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search.php;h=15ea0e04947cfaa4ba079a4630b4f7c56f1e4716;hb=39bfea8fa9fd939da9766a79381f68ea4b725c23;hp=b1bc299e16534a3efc54d4149f59bd36f0fdaafd;hpb=8f6f9ba5df6491d396aa690dcf3e5b9070a565ca;p=squirrelmail.git diff --git a/src/addrbook_search.php b/src/addrbook_search.php index b1bc299e..15ea0e04 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -3,7 +3,7 @@ /** * addrbook_search.php * - * Copyright (c) 1999-2003 The SquirrelMail Project Team + * Copyright (c) 1999-2004 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Handle addressbook searching in the popup window. @@ -12,12 +12,13 @@ * addrbook_search_html.html -- If you change one, * change the other one too! * - * $Id$ + * @version $Id$ * @package squirrelmail */ /** * Path for SquirrelMail required files. + * @ignore */ define('SM_PATH','../'); @@ -26,6 +27,7 @@ require_once(SM_PATH . 'include/validate.php'); require_once(SM_PATH . 'functions/strings.php'); require_once(SM_PATH . 'functions/global.php'); require_once(SM_PATH . 'functions/html.php'); +require_once(SM_PATH . 'functions/forms.php'); /** lets get the global vars we may need */ sqgetGlobalVar('key', $key, SQ_COOKIE); @@ -134,22 +136,25 @@ function display_result($res, $includesource = true) { echo "\n"; while (list($undef, $row) = each($res)) { - $tr_bgcolor = ''; $email = htmlspecialchars(addcslashes(AddressBook::full_address($row), "'"), ENT_QUOTES); - if ($line % 2) { $tr_bgcolor = $color[0]; } + if ($line % 2) { + $tr_bgcolor = $color[12]; + } else { + $tr_bgcolor = $color[4]; + } echo html_tag( 'tr', '', '', $tr_bgcolor, 'nowrap' ) . html_tag( 'td', '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) { @@ -176,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', '
' . - _("No persons matching your search was found"), + echo html_tag( 'p', '
' . + _("No persons matching your search were found"), 'center' ) . - "\n\n", + "\n\n", exit; } @@ -200,37 +205,37 @@ $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%"' ) . html_tag( 'td', '', 'left', '', '' ) . - '\n"; + addInput('query', $query, 28); /* List all backends to allow the user to choose where to search */ if ($abook->numbackends > 1) { - echo '' . _("in") . ' \n"; + echo addSelect('backend', $selopts, '-1', TRUE); } else { - echo '' . "\n"; + echo addHidden('backend', '-1'); } echo '' . html_tag( 'tr', html_tag( 'td', '', 'left' ) . html_tag( 'td', - '' . - ' | ' . "\n" . - ' | ' . "\n" , + '' . + ' | ' . "\n" . + ' | ' . "\n" , 'left' ) ) . '
' . "\n"; @@ -275,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', '
' . - _("No persons matching your search was found") . "\n" , + echo html_tag( 'p', '
' . + _("No persons matching your search were found") . "\n" , 'center' ) . - "\n\n"; + "\n\n"; exit; } @@ -296,7 +301,5 @@ if ($show == 'form' && empty($listall)) { } } - -echo "\n"; - ?> +