Elgg  Version 5.1
groups.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
8  'query' => elgg_extract('term', $vars),
9  'type' => 'group',
10  'limit' => elgg_extract('limit', $vars),
11  'sort_by' => [
12  'property_type' => 'metadata',
13  'property' => 'name',
14  'direction' => 'ASC',
15  ],
16  'fields' => ['metadata' => ['name']],
17  'item_view' => elgg_extract('item_view', $vars, 'search/entity'),
18  'input_name' => elgg_extract('name', $vars),
19 ];
20 
21 $target_guid = (int) elgg_extract('match_target', $vars);
22 if ($target_guid) {
24 } else {
26 }
27 
28 if (!$target instanceof \ElggEntity || !$target->canEdit()) {
29  throw new EntityPermissionsException();
30 }
31 
32 if (elgg_extract('match_owner', $vars, false)) {
33  $options['owner_guid'] = (int) $target->guid;
34 }
35 
36 if (elgg_extract('match_membership', $vars, false)) {
37  $options['relationship'] = 'member';
38  $options['relationship_guid'] = $target->guid;
39 }
40 
41 $body = elgg_list_entities($options, 'elgg_search');
42 
43 echo elgg_view_page('', $body);
if(!$comment instanceof\ElggComment||!$comment->canEdit()) $target
Definition: edit.php:15
if(!$target instanceof\ElggEntity||!$target->canEdit()) if(elgg_extract('match_owner', $vars, false)) if(elgg_extract('match_membership', $vars, false)) $body
Definition: groups.php:41
$target_guid
Definition: groups.php:21
canEdit(int $user_guid=0)
Can a user edit this entity?
Definition: ElggEntity.php:946
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:254
get_entity(int $guid)
Loads and returns an entity object from a guid.
Definition: entities.php:67
Thrown when entity can not be edited or container permissions do not allow it to be written...
elgg_view_page(string $title, string|array $body, string $page_shell= 'default', array $vars=[])
Assembles and outputs a full page.
Definition: views.php:256
$options
Definition: groups.php:7
elgg_list_entities(array $options=[], callable $getter=null, callable $viewer=null)
Returns a string of rendered entities.
Definition: entities.php:548
$vars
Definition: theme.php:5
elgg_gatekeeper()
Used at the top of a page to mark it as logged in users only.
Definition: gatekeepers.php:64
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:24