X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search.php;h=8051122a078662e024720d27c9cc4c510559218e;hb=34a6b7c2cede50f12a9ce43fef49e28ce324d3b6;hp=d67bd619d025ceef9ecbbe0afeae2681a5901e78;hpb=138f26f6e7092a59ebac3ead587bb6a9b0d28ad3;p=squirrelmail.git diff --git a/src/addrbook_search.php b/src/addrbook_search.php index d67bd619..8051122a 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -1,166 +1,260 @@ - +/** + * addrbook_search.php + * + * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Licensed under the GNU GPL. For full terms see the file COPYING. + * + * Handle addressbook searching in the popup window. + * + * NOTE: A lot of this code is similar to the code in + * addrbook_search_html.html -- If you change one, + * change the other one too! + * + * $Id$ + */ + +require_once('../src/validate.php'); +require_once('../functions/strings.php'); + +/* Function to include JavaScript code */ +function insert_javascript() { + ?> + "; - } else { - echo "\n"; - } - - // Just make a blank page and exit - if(($show == "blank") || (empty($query) && empty($show))) { - printf("


%s

\n\n", - _("Search results will display here")); - exit; - } - - // Create search form - if($show == "form") { - printf("
\n", - $PHP_SELF); - printf(""); - printf("
\n"); - printf(" %s:\n\n", - _("Search for")); - printf(" \n", - htmlspecialchars($query)); - printf("\n"); - printf(" ", - _("Search")); - printf("\n"); - printf("\n", - _("Close window")); - printf("
\n"); - } - - // Include JavaScript code if this is search results - if(!empty($query)) { -?> - - -s_search($query); - - if(!is_array($res)) { - printf("


%s.

\n\n", - _("No persons matching your search was found")); - exit; - } - - // List search results - $line = 0; - print ""; - print "\n"; - - while(list($key, $row) = each($res)) { - printf("\n", - ($line % 2) ? " bgcolor=\"$color[0]\"" : "", $row["email"], - $row["email"], $row["name"], $row["email"], $row["label"], - $row["source"]); - $line++; - } - print "
 NameE-mailInfoSource
To | Cc%s %s %s %s
"; - } +echo "\n"; + ?> - -