Elgg
Version master
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
views
default
object
elements
summary
icon.php
Go to the documentation of this file.
1
<?php
13
$icon
=
elgg_extract
(
'icon'
,
$vars
);
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
) {
26
echo
elgg_view_entity_icon
(
$icon_entity
,
$icon_size
,
$vars
);
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
)) {
40
echo
elgg_view_entity_icon
(
$entity
,
$icon_size
,
$vars
);
41
return
;
42
}
43
44
$owner
=
$entity
->getOwnerEntity();
45
if
(!
$owner
instanceof ElggEntity) {
46
return
;
47
}
48
49
echo
elgg_view_entity_icon
(
$owner
,
$icon_size
,
$vars
);
$vars
$vars['class']
Display an icon from the FontAwesome library.
Definition:
icon.php:8
$icon_size
if($icon===false) if($icon!== '') $icon_size
Definition:
icon.php:22
$icon
$icon
Annotation icon.
Definition:
icon.php:12
elgg_extract
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
$entity
Generic entity icon upload helper.
Definition:
icon.php:18
elgg_view_entity_icon
elgg_view_entity_icon(\ElggEntity $entity, string $size= 'medium', array $vars=[])
View the icon of an entity.
Definition:
views.php:542
$owner
if(!$annotation instanceof ElggAnnotation) $owner
Definition:
icon.php:34
$icon_entity
$icon_entity
Definition:
icon.php:23
ElggEntity
Definition:
ElggEntity.php:52
Generated on Sat Dec 21 2024 00:02:53 for Elgg by
1.8.11