Elgg  Version 4.3
groups.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
7 $limit = (int) elgg_extract('limit', $vars, elgg_get_config('default_limit'));
10 
12  'query' => $query,
13  'type' => 'group',
14  'limit' => $limit,
15  'sort_by' => [
16  'property_type' => 'metadata',
17  'property' => 'name',
18  'direction' => 'ASC',
19  ],
20  'fields' => ['metadata' => ['name']],
21  'item_view' => elgg_extract('item_view', $vars, 'search/entity'),
22  'input_name' => $input_name,
23 ];
24 
25 $target_guid = (int) elgg_extract('match_target', $vars);
26 if ($target_guid) {
28 } else {
30 }
31 
32 if (!$target instanceof ElggEntity || !$target->canEdit()) {
33  throw new EntityPermissionsException();
34 }
35 
36 if (elgg_extract('match_owner', $vars, false)) {
37  $options['owner_guid'] = (int) $target->guid;
38 }
39 
40 if (elgg_extract('match_membership', $vars, false)) {
41  $options['relationship'] = 'member';
42  $options['relationship_guid'] = $target->guid;
43 }
44 
45 $body = elgg_list_entities($options, 'elgg_search');
46 
$query
Definition: groups.php:8
if(!$comment instanceof\ElggComment||!$comment->canEdit()) $target
Definition: edit.php:13
if(!$target instanceof ElggEntity||!$target->canEdit()) if(elgg_extract('match_owner', $vars, false)) if(elgg_extract('match_membership', $vars, false)) $body
Definition: groups.php:45
$target_guid
Definition: groups.php:25
canEdit($user_guid=0)
Can a user edit this entity?
elgg_list_entities(array $options=[], $getter= 'elgg_get_entities', $viewer= 'elgg_view_entity_list')
Returns a string of rendered entities.
Definition: entities.php:589
elgg_view_page($title, $body, $page_shell= 'default', $vars=[])
Assembles and outputs a full page.
Definition: views.php:262
Thrown when entity can not be edited or container permissions do not allow it to be written...
$input_name
Definition: groups.php:9
$options
Definition: groups.php:11
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:547
$limit
Definition: groups.php:7
elgg_gatekeeper()
Used at the top of a page to mark it as logged in users only.
Definition: gatekeepers.php:64
elgg echo
Translates a string.
Definition: deprecated.js:530
$vars['head']
Definition: html.php:24
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:24
elgg_get_config($name, $default=null)
Get an Elgg configuration value.
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:69