-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch_box_results.php
41 lines (35 loc) · 1.36 KB
/
search_box_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
<?php
/**
* Elgg form display
* Displays the specified Elgg form
*
* @package Elgg
* @subpackage Form
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Kevin Jardine <[email protected]>
* @copyright Radagast Solutions 2008
* @link http://radagast.biz/
*/
// Load Elgg engine
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
// Load form model
require_once(dirname(__FILE__)."/models/model.php");
// Define context
elgg_set_context('form:content');
$form_id = get_input('id',0);
$offset = get_input('offset',0);
$limit = 10;
$tag = get_input('tag','');
$form = get_entity($form_id);
if ($form && $form->getSubtype() == 'form:form') {
elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
$title = sprintf(elgg_echo('form:search_box_results_title'),form_form_t($form,'title'));
$entities = form_search_box_results($form,$tag,$offset,$limit);
$count = form_search_box_count($form,$tag);
$body = form_view_entity_list($entities, $form, $count, $offset, $limit, false, false);
elgg_view_page($title,elgg_view_layout("two_column_left_sidebar", '<br />'.elgg_view("form/search_box",array('form_id'=>$form_id)), elgg_view_title($title) . $body));
} else {
register_error(elgg_echo('form:not_found'));
forward();
}
?>