Elgg  Version 3.0
default.php
Go to the documentation of this file.
1 <?php
10 $entity = elgg_extract('entity', $vars);
11 if (!$entity instanceof ElggUser) {
12  return;
13 }
14 
15 $size = elgg_extract('size', $vars, 'small');
16 
17 if (elgg_get_context() == 'gallery') {
19  return;
20 }
21 
23 if (!$title) {
24  $title = elgg_view('output/url', [
25  'href' => $entity->getUrl(),
26  'text' => $entity->getDisplayName(),
27  ]);
28 }
29 
31  'entity' => $entity,
32  'title' => $title,
33  'icon_entity' => $entity,
34  'icon_size' => $size,
35  'tags' => false,
36 ];
37 
38 if ($entity->isBanned()) {
39  $params['subtitle'] = elgg_echo('banned');
40 } else {
41  $subtitle = '';
42  $location = $entity->location;
43  if (is_string($location) && $location !== '') {
44  $location = elgg_view_icon('map-marker') . ' ' . $location;
46  }
47 
48  $subtitle .= elgg_format_element('div', [], $entity->briefdescription);
49 
50  $params['subtitle'] = $subtitle;
51  if (elgg_view_exists('user/status')) {
52  $params['content'] = elgg_view('user/status', ['entity' => $entity]);
53  }
54 }
55 
57 
58 echo elgg_view('user/elements/summary', $params);
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:205
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=[])
View the icon of an entity.
Definition: views.php:899
if(is_string($location)&&$location!== '') $subtitle
Definition: default.php:48
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_context()
Get the current context.
Definition: pageowner.php:201
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:27
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:1131
$size
Definition: default.php:23
$entity
Definition: default.php:16
elgg_view_icon($name, $vars=[])
View an icon glyph.
Definition: views.php:1552
$title
Definition: default.php:31
$location
Definition: default.php:42
$params
Definition: default.php:50
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246