X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search.php;h=cfbe3ba8b6c296026aad418691ccefd89ca84794;hb=6a2f68354009082148e09f5c82a29d1b17f69190;hp=1c172079dcc0ed3c81eee8f52dbdd097b060a74e;hpb=dfadb5533df0c17fa7737d4aaf5738064b55429e;p=squirrelmail.git
diff --git a/src/addrbook_search.php b/src/addrbook_search.php
index 1c172079..cfbe3ba8 100644
--- a/src/addrbook_search.php
+++ b/src/addrbook_search.php
@@ -1,188 +1,143 @@
-
-
-
-
-
-
+/**
+ * addrbook_search.php
+ *
+ * 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!
+ *
+ * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage addressbook
+ */
+
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../include/init.php');
+
+include_once(SM_PATH . 'functions/forms.php');
+include_once(SM_PATH . 'functions/addressbook.php');
+include_once(SM_PATH . 'templates/util_addressbook.php');
+
+/**
+ * List search results
+ * @param array $res Array of search results
+ * @param bool $includesource [Default=true]
+ * @return void
+ */
+function display_result($res, $includesource = true) {
+ global $oTemplate, $oErrorHandler;
+
+ if(sizeof($res) <= 0) return;
+
+ $oTemplate->assign('use_js', true);
+ $oTemplate->assign('include_abook_name', $includesource);
+ $oTemplate->assign('addresses', formatAddressList($res));
+
+ $oTemplate->display('addrbook_search_list.tpl');
+}
-";
- } 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");
- }
-
- // Include JavaScript code if this is search results
- if(!empty($query)) {
-?>
-
-
-s_search($query);
-
- if(!is_array($res)) {
- printf("
%s:
%s
\n