Elgg  Version 6.0
subtitle.php
Go to the documentation of this file.
1 <?php
9 $entity = elgg_extract('entity', $vars);
10 if (!$entity instanceof ElggUser) {
11  return;
12 }
13 
14 $subtitle = '';
15 if (!$entity->isBanned() && $entity->isValidated() !== false) {
16  $subtitle = elgg_extract('subtitle', $vars);
17  if (!isset($subtitle)) {
18  $subtitle = elgg_view('user/elements/imprint', $vars);
19  }
20 } elseif ($entity->isBanned()) {
21  // user is banned
22  $subtitle = elgg_echo('banned');
23 } elseif ($entity->isValidated() === false) {
24  $subtitle = elgg_echo('unvalidated');
25 }
26 
28  return;
29 }
30 
31 echo elgg_format_element('div', [
32  'class' => [
33  'elgg-listing-summary-subtitle',
34  'elgg-subtext',
35  ]
36 ], $subtitle);
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof\ElggRelationship) elseif(is_callable([$item, 'getType']))
Definition: item.php:48
$subtitle
Output annotation subtitle.
Definition: subtitle.php:9
elgg_is_empty($value)
Check if a value isn&#39;t empty, but allow 0 and &#39;0&#39;.
Definition: input.php:176
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
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$vars
Definition: theme.php:5
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
$entity
Outputs user subtitle.
Definition: subtitle.php:9