Elgg  Version master
icon.php
Go to the documentation of this file.
1 <?php
12 $icon = elgg_extract('icon', $vars, '');
13 if ($icon === false) {
14  return;
15 }
16 
17 if ($icon !== '') {
18  echo $icon;
19  return;
20 }
21 
22 $icon_size = elgg_extract('icon_size', $vars, 'small');
23 $icon_entity = elgg_extract('icon_entity', $vars);
24 if ($icon_entity instanceof ElggEntity) {
26  return;
27 }
28 
29 $relationship = elgg_extract('relationship', $vars);
30 if (!$relationship instanceof ElggRelationship) {
31  return;
32 }
33 
35 if (!$entity_one instanceof ElggEntity) {
36  return;
37 }
38 
$vars['class']
Display an icon from the FontAwesome library.
Definition: icon.php:8
if($icon===false) if($icon!== '') $icon_size
Definition: icon.php:22
$icon
Annotation icon.
Definition: icon.php:12
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_entity_icon(\ElggEntity $entity, string $size= 'medium', array $vars=[])
View the icon of an entity.
Definition: views.php:542
get_entity(int $guid)
Loads and returns an entity object from a guid.
Definition: entities.php:70
$icon_entity
Definition: icon.php:23
if($icon_entity instanceof ElggEntity) $relationship
Definition: icon.php:29
if(!$relationship instanceof ElggRelationship) $entity_one
Definition: icon.php:34