/**
* 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.
* 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','../');
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);
/* Empty search */
if (empty($query) && empty($show) && empty($listall)) {
echo html_tag( 'p', '<br>' .
- _("No persons matching your search was found"),
+ _("No persons matching your search were found"),
'center' ) .
"\n</BODY></HTML>\n",
exit;
html_tag( 'tr' ) .
html_tag( 'td', ' <strong>' . _("Search for") . "</strong>\n", 'left', '', 'nowrap valign="middle" width="10%"' ) .
html_tag( 'td', '', 'left', '', '' ) .
- '<INPUT TYPE=text NAME=query VALUE="' . htmlspecialchars($query) .
- "\" SIZE=28>\n";
+ addInput('query', $query, 28);
/* List all backends to allow the user to choose where to search */
if ($abook->numbackends > 1) {
- echo '<STRONG>' . _("in") . '</STRONG> <SELECT NAME=backend>'."\n".
- '<OPTION VALUE=-1 SELECTED>' . _("All address books") . "\n";
+ echo '<STRONG>' . _("in") . '</STRONG> '."\n".
+ $selopts['-1'] = _("All address books");
+
$ret = $abook->get_backend_list();
while (list($undef,$v) = each($ret)) {
- echo '<OPTION VALUE=' . $v->bnum . '>' . $v->sname . "\n";
+ $selopts[$v->bnum] = $v->sname;
}
- echo "</SELECT>\n";
+ echo addSelect('backend', $selopts, '-1', TRUE);
} else {
- echo '<INPUT TYPE=hidden NAME=backend VALUE=-1>' . "\n";
+ echo addHidden('backend', '-1');
}
echo '</td></tr>' .
if (sizeof($res) == 0) {
echo html_tag( 'p', '<br><b>' .
- _("No persons matching your search was found") . "</b>\n" ,
+ _("No persons matching your search were found") . "</b>\n" ,
'center' ) .
"\n</BODY></HTML>\n";
exit;