ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ 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
23
use
ILIAS\Data\URI
;
24
28
class
CssCollection
extends
AbstractCollection
29
{
30
public
function
addItem
(
Css
$item): void
31
{
32
$content = $item->
getContent
();
33
34
// Add external URLs to the collection if allowed
35
if
($this->allow_external && $this->
isExternalURI
($content)) {
36
$this->items[] = $item;
37
return
;
38
}
39
40
if
($this->
isURI
($content)) {
41
$this->items[] = $item;
42
return
;
43
}
44
45
// add item only if it is not already in the collection
46
$real_path = realpath(parse_url($content, PHP_URL_PATH));
47
if
(!$this->allow_non_existing && $real_path ===
false
) {
48
return
;
49
}
50
foreach
($this->
getItems
() as
$css
) {
51
if
(!$this->allow_non_existing && realpath(parse_url((
string
) $css->getContent(), PHP_URL_PATH)) === $real_path) {
52
return
;
53
}
54
}
55
$this->items[] = $item;
56
}
57
58
}
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:30
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractCollection\getItems
getItems()
Definition:
AbstractCollection.php:84
ILIAS\Data\URI
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:28
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 Wed Sep 10 2025 15:15:41 for ILIAS by
1.8.13 (using
Doxyfile
)