Elgg
Version 6.1
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
views
default
page
elements
header_image.php
Go to the documentation of this file.
1
<?php
6
$header_url
=
elgg_extract
(
'header_url'
,
$vars
);
7
if
(
$header_url
===
false
) {
8
// we do not want a header image
9
return
;
10
}
11
12
$entity
=
elgg_extract
(
'entity'
,
$vars
);
13
$type
=
'header'
;
14
$size
=
'header'
;
15
16
$class
= [
'elgg-header-image'
];
17
18
if
(empty(
$header_url
)) {
19
if
(!
$entity
instanceof \
ElggEntity
|| !
$entity
->hasIcon(
$size
,
$type
)) {
20
return
;
21
}
22
23
$class
[] =
"elgg-header-image-{$entity->type}-{$entity->subtype}"
;
24
25
$header_url
=
$entity
->getIconUrl([
'type'
=>
$type
,
'size'
=>
$size
]);
26
}
27
28
echo
elgg_format_element
(
'div'
, [
29
'class'
=>
$class
,
30
],
elgg_format_element
(
'div'
, [
'style'
=>
"background-image: url({$header_url})"
]));
$entity
if($header_url===false) $entity
Definition:
header_image.php:12
$size
$size
Definition:
header_image.php:14
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:256
$header_url
$header_url
Elgg page header image.
Definition:
header_image.php:6
$vars
$vars
Definition:
theme.php:5
$type
$type
Definition:
header_image.php:13
ElggEntity
Definition:
ElggEntity.php:52
$class
$class
Definition:
header_image.php:16
elgg_format_element
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition:
output.php:145
Generated on Wed Dec 4 2024 00:00:23 for Elgg by
1.8.11