search.php 1.85 KB
Newer Older
Martyn Smith's avatar
Martyn Smith committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
 * This program is part of Mahara
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 *
 * @package    mahara
 * @subpackage admin
 * @author     Martyn Smith <martyn@catalyst.net.nz>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
 *
 */

define('INTERNAL', 1);
define('ADMIN', 1);
29
define('MENUITEM', 'configusers/usersearch');
Martyn Smith's avatar
Martyn Smith committed
30
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
Martyn Smith's avatar
Martyn Smith committed
31
define('TITLE', get_string('usersearch', 'admin'));
Penny Leach's avatar
Penny Leach committed
32
33
34
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'usersearch');
35
36
37
38
39
40
41
42
43
require('searchlib.php');

$search = (object) array(
    'query' => trim(param_variable('query', '')),
    'sort' => param_alpha('sort', 'lastname'),
    'f' => param_alpha('f', null),
    'l' => param_alpha('l', null),
    'offset' => param_integer('offset', 0),
    'limit' => param_integer('limit', 10)
Martyn Smith's avatar
Martyn Smith committed
44
45
);

46
47
48
49
$smarty = smarty(array('usersearch'));
$smarty->assign('search', $search);
$smarty->assign('alphabet', explode(',', get_string('alphabet')));
$smarty->assign('results', build_admin_user_search_results($search));
Martyn Smith's avatar
Martyn Smith committed
50
51
52
$smarty->display('admin/users/search.tpl');

?>