Elgg  Version master
icon.php
Go to the documentation of this file.
1 <?php
14 if ($icon === false) {
15  return;
16 }
17 
18 if (isset($icon) && $icon !== true) {
19  echo $icon;
20  return;
21 }
22 
23 $icon_size = elgg_extract('icon_size', $vars, 'small');
24 $icon_entity = elgg_extract('icon_entity', $vars);
25 if ($icon_entity instanceof ElggEntity) {
27  return;
28 }
29 
30 if ($icon !== true) {
31  return;
32 }
33 
34 $entity = elgg_extract('entity', $vars);
35 if (!$entity instanceof ElggEntity) {
36  return;
37 }
38 
39 if ($entity->hasIcon($icon_size)) {
41  return;
42 }
43 
44 $owner = $entity->getOwnerEntity();
45 if (!$owner instanceof ElggEntity) {
46  return;
47 }
48 
$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
$entity
Generic entity icon upload helper.
Definition: icon.php:18
elgg_view_entity_icon(\ElggEntity $entity, string $size= 'medium', array $vars=[])
View the icon of an entity.
Definition: views.php:542
if(!$annotation instanceof ElggAnnotation) $owner
Definition: icon.php:34
$icon_entity
Definition: icon.php:23