Elgg  Version 6.1
objects.php
Go to the documentation of this file.
1 <?php
2 
4 
5 $subtype = elgg_extract('subtype', $vars);
6 if (empty($subtype)) {
8  $subtype = elgg_extract('object', $searchable);
9 }
10 
12  'query' => elgg_extract('term', $vars),
13  'type' => 'object',
14  'subtype' => $subtype,
15  'limit' => elgg_extract('limit', $vars),
16  'sort_by' => [
17  'property_type' => 'metadata',
18  'property' => 'title',
19  'direction' => 'ASC',
20  ],
21  'fields' => ['metadata' => ['title']],
22  'item_view' => elgg_extract('item_view', $vars, 'search/entity'),
23  'input_name' => elgg_extract('name', $vars),
24 ];
25 
26 $body = elgg_list_entities($options, 'elgg_search');
27 
28 echo elgg_view_page('', $body);
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:256
elgg_view_page(string $title, string|array $body, string $page_shell= 'default', array $vars=[])
Assembles and outputs a full page.
Definition: views.php:235
if(empty($subtype)) $options
Definition: objects.php:11
$subtype
Definition: objects.php:5
$searchable
Definition: numentities.php:18
elgg_list_entities(array $options=[], callable $getter=null, callable $viewer=null)
Returns a string of rendered entities.
Definition: entities.php:551
$vars
Definition: theme.php:5
elgg_entity_types_with_capability(string $capability)
Returns an array of type/subtypes with the requested capability enabled.
Definition: entities.php:757
if(empty($subtype)) $body
Definition: objects.php:26
elgg_gatekeeper()
Used at the top of a page to mark it as logged in users only.
Definition: gatekeepers.php:64