source: subversion/trunk/roundcubemail/program/steps/addressbook/search.inc @ 3989

Last change on this file since 3989 was 3989, checked in by alec, 3 years ago
  • s/RoundCube/Roundcube/
File size: 1.8 KB
Line 
1<?php
2
3/*
4 +-----------------------------------------------------------------------+
5 | program/steps/addressbook/search.inc                                  |
6 |                                                                       |
7 | This file is part of the Roundcube Webmail client                     |
8 | Copyright (C) 2005-2007, Roundcube Dev. - Switzerland                 |
9 | Licensed under the GNU GPL                                            |
10 |                                                                       |
11 | PURPOSE:                                                              |
12 |   Search step for address book contacts                               |
13 |                                                                       |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16 +-----------------------------------------------------------------------+
17
18 $Id: search.inc 456 2007-01-10 12:34:33Z thomasb $
19
20*/
21
22$CONTACTS->set_page(1);
23$_SESSION['page'] = 1;
24
25$search = trim(get_input_value('_q', RCUBE_INPUT_GET));
26$search_request = md5('addr'.$search);
27
28// get contacts for this user
29$result = $CONTACTS->search(array('name','email'), $search);
30
31if ($result->count > 0)
32{
33  // save search settings in session
34  $_SESSION['search'][$search_request] = $CONTACTS->get_search_set();
35
36  // create javascript list
37  rcmail_js_contacts_list($result);
38}
39else
40{
41  $OUTPUT->show_message('nocontactsfound', 'warning');
42  $search_request = null;
43}
44
45// update message count display
46$OUTPUT->set_env('search_request', $search_request);
47$OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size));
48$OUTPUT->command('set_rowcount', rcmail_get_rowcount_text());
49 
50// send response
51$OUTPUT->send();
Note: See TracBrowser for help on using the repository browser.