ILIAS
trunk Revision v11.0_alpha-2658-ge2404539063
◀ ilDoc Overview
CssCollection.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media
;
22
26
class
CssCollection
extends
AbstractCollection
27
{
28
public
function
addItem
(
Css
$item): void
29
{
30
$content = $item->
getContent
();
31
32
// Add external URLs to the collection if allowed
33
if
($this->allow_external && $this->
isExternalURI
($content)) {
34
$this->items[] = $item;
35
return
;
36
}
37
38
if
($this->
isURI
($content)) {
39
$this->items[] = $item;
40
return
;
41
}
42
43
// add item only if it is not already in the collection
44
$real_path = realpath(parse_url($content, PHP_URL_PATH));
45
if
(!$this->allow_non_existing && $real_path ===
false
) {
46
return
;
47
}
48
foreach
($this->
getItems
() as
$css
) {
49
if
(!$this->allow_non_existing && realpath(parse_url((
string
) $css->getContent(), PHP_URL_PATH)) === $real_path) {
50
return
;
51
}
52
}
53
$this->items[] = $item;
54
}
55
56
}
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\Css
Definition:
Css.php:28
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractCollection
Definition:
AbstractCollection.php:29
ILIAS\GlobalScreen\Scope\Layout\MetaContent\MetaContent\$css
CssCollection $css
Definition:
MetaContent.php:48
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractCollection\isURI
isURI(string $content)
Definition:
AbstractCollection.php:50
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\CssCollection\addItem
addItem(Css $item)
Definition:
CssCollection.php:28
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractCollection\getItems
getItems()
Definition:
AbstractCollection.php:84
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media
Definition:
AbstractCollection.php:21
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractMedia\getContent
getContent()
Definition:
AbstractMedia.php:32
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\CssCollection
Definition:
CssCollection.php:26
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractCollection\isExternalURI
isExternalURI(string $content)
Definition:
AbstractCollection.php:64
components
ILIAS
GlobalScreen
src
Scope
Layout
MetaContent
Media
CssCollection.php
Generated on Tue Sep 2 2025 23:03:08 for ILIAS by
1.8.13 (using
Doxyfile
)