Elgg  Version 4.3
users.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' => 'user',
14  'limit' => $limit,
15  'sort_by' => [
16  'property_type' => 'metadata',
17  'property' => 'name',
18  'direction' => 'ASC',
19  ],
20  'fields' => ['metadata' => ['name', 'username']],
21  'item_view' => elgg_extract('item_view', $vars, 'search/entity'),
22  'input_name' => $input_name,
23 ];
24 
25 if (elgg_extract('friends_only', $vars, false)) {
26  $target_guid = (int) elgg_extract('match_target', $vars);
27  if ($target_guid) {
29  } else {
31  }
32 
33  if (!$target || !$target->canEdit()) {
34  throw new EntityPermissionsException();
35  }
36 
37  $options['relationship'] = 'friend';
38  $options['relationship_guid'] = $target->guid;
39 }
40 
41 // by default search in all users,
42 // with 'include_banned' => false, only search in 'allowed' users
43 if (!(bool) elgg_extract('include_banned', $vars, true)) {
44  $options['metadata_name_value_pairs'][] = [
45  'name' => 'banned',
46  'value' => 'no',
47  ];
48 }
49 
50 $body = elgg_list_entities($options, 'elgg_search');
51 
if(!$comment instanceof\ElggComment||!$comment->canEdit()) $target
Definition: edit.php:13
$limit
Definition: users.php:7
$target_guid
Definition: groups.php:25
$options
Definition: users.php:11
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...
if(elgg_extract('friends_only', $vars, false)) if(!(bool) elgg_extract('include_banned', $vars, true)) $body
Definition: users.php:50
$query
Definition: users.php:8
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
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
$input_name
Definition: users.php:9
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