Elgg  Version 3.0
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 
if(!$entity instanceof ElggEntity) if($entity->hasIcon($icon_size)) $owner
Definition: icon.php:44
$vars['class']
Definition: icon.php:14
if($icon===false) if(isset($icon)&&$icon!==true) $icon_size
Definition: icon.php:23
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=[])
View the icon of an entity.
Definition: views.php:899
$entity
Generic entity icon upload helper.
Definition: icon.php:17
elgg echo
Translates a string.
Definition: languages.js:43
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
$icon_entity
Definition: icon.php:24
$icon
Object icon.
Definition: icon.php:13