Elgg  Version 3.0
default.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 $input_name = elgg_extract('input_name', $vars);
15 if (empty($input_name)) {
16  return;
17 }
18 
19 $icon = elgg_view_entity_icon($entity, 'tiny', ['use_hover' => false]);
20 $delete_icon = elgg_view_icon('delete', ['class' => 'elgg-autocomplete-item-remove']);
21 
22 $body = elgg_view_image_block($icon, $entity->getDisplayName(), ['image_alt' => $delete_icon]);
23 $body .= elgg_view('input/hidden', [
24  'name' => "{$input_name}[]",
25  'value' => $entity->guid,
26 ]);
27 
29  'class' => 'elgg-item',
30  'data-guid' => $entity->guid,
31 ], $body);
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=[])
View the icon of an entity.
Definition: views.php:899
if(!$owner) $icon
Definition: default.php:16
elgg_view_image_block($image, $body, $vars=[])
Wrapper function for the image block display pattern.
Definition: views.php:1177
if(!$entity instanceof ElggEntity) $input_name
Definition: default.php:14
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
$delete_icon
Definition: default.php:20
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
$entity
Definition: default.php:16
elgg_view_icon($name, $vars=[])
View an icon glyph.
Definition: views.php:1552
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
$body
Definition: default.php:32