source: github/program/steps/addressbook/search.inc @ 0501b63

HEADcourier-fixdev-browser-capabilitiespdorelease-0.6release-0.7release-0.8
Last change on this file since 0501b63 was 0501b63, checked in by thomascube <thomas@…>, 2 years ago

Merge branch devel-addressbook (r4193:4382) back into trunk

  • Property mode set to 100644
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-2011, The Roundcube Dev Team                       |
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
31// save search settings in session
32$_SESSION['search'][$search_request] = $CONTACTS->get_search_set();
33
34if ($result->count > 0)
35{
36  // create javascript list
37  rcmail_js_contacts_list($result);
38}
39else
40{
41  $OUTPUT->show_message('nocontactsfound', 'notice');
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.