-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch_results.php
48 lines (37 loc) · 1.26 KB
/
search_results.php
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
* Elgg Forms
* Kevin Jardine
* Radagast Solutions
* http://radagast.biz
*
* The main form for creating and changing forms.
*
*/
// Load Elgg engine
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
// Define context
elgg_set_context('form:content');
global $CONFIG;
$search_definition_id = get_input('sid',0);
$sd = get_entity($search_definition_id);
if($sd) {
$form = get_entity($sd->form_id);
if ($form && ($form->profile == FORM_GROUP_PROFILE)) {
// this is searching group profiles
elgg_set_context('groups');
} else if ($form && ($form->profile == FORM_FILE)) {
// this is searching files
elgg_set_context('file');
}
}
$_SESSION['last_search_qs'] = $_SERVER["QUERY_STRING"];
$body = elgg_view('form/search_results',array('search_definition'=>$sd));
if ($category = get_input('_hide_category','')) {
$body .= elgg_view('form/forms/search',array('search_definition'=>$sd,'hidden'=>array('group_profile_category'=>$category)));
} else {
$body .= elgg_view('form/forms/search',array('search_definition'=>$sd));
}
$title = elgg_echo('form:search_results_title');
elgg_view_page($title,elgg_view_layout("two_column_left_sidebar", '', elgg_view_title($title) . $body));
?>