ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
Map.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\GlobalScreen\Scope\Footer\Collector\Map
;
22
23
use
ILIAS\GlobalScreen\Collector\Map\AbstractMap
;
24
use Closure;
25
use
ILIAS\GlobalScreen\Scope\Footer\Factory\isItem
;
26
use
ILIAS\GlobalScreen\Scope\Footer\Factory\hasTitle
;
27
use
ILIAS\GlobalScreen\Scope\Footer\Factory\isGroup
;
28
33
class
Map
extends
AbstractMap
34
{
35
#[\Override]
36
protected
function
getTitleSorter
(): Closure
37
{
38
return
static
function
(
isItem
$item_one,
isItem
$item_two):
int
{
39
if
(!$item_one instanceof
hasTitle
|| !$item_two instanceof
hasTitle
) {
40
return
0;
41
}
42
43
return
strnatcmp($item_one->getTitle(), $item_two->getTitle());
44
};
45
}
46
47
#[\Override]
48
protected
function
getPositionSorter
(): Closure
49
{
50
return
static
fn(
isItem
$item_one,
isItem
$item_two):
int
=> $item_one->
getPosition
() - $item_two->
getPosition
(
51
);
52
}
53
54
#[\Override]
55
public
function
sort
(): void
56
{
57
parent::sort
();
58
59
$replace_children_sorted =
function
(
isItem
&$item):
void
{
60
if
($item instanceof
isGroup
) {
61
$children = $item->getEntries();
62
uasort($children, $this->
getPositionSorter
());
63
$item = $item->withEntries($children);
64
}
65
};
66
$this->
walk
($replace_children_sorted);
67
}
68
}
ILIAS\GlobalScreen\Collector\Map\AbstractMap
Definition:
AbstractMap.php:33
ILIAS\GlobalScreen\Collector\Map\AbstractMap\walk
walk(Closure $c)
Definition:
AbstractMap.php:142
ILIAS\GlobalScreen\Scope\Footer\Collector\Map\Map
Definition:
Map.php:34
ILIAS\GlobalScreen\Scope\Footer\Collector\Map\Map\getPositionSorter
getPositionSorter()
Definition:
Map.php:48
ILIAS\GlobalScreen\Scope\Footer\Collector\Map\Map\sort
sort()
Definition:
Map.php:55
ILIAS\GlobalScreen\Scope\Footer\Collector\Map\Map\getTitleSorter
getTitleSorter()
Definition:
Map.php:36
ILIAS\GlobalScreen\Scope\Footer\Factory\hasTitle
Definition:
hasTitle.php:27
ILIAS\GlobalScreen\Scope\Footer\Factory\isGroup
Definition:
isGroup.php:27
ILIAS\GlobalScreen\Scope\Footer\Factory\isItem
Definition:
isItem.php:29
ILIAS\GlobalScreen\Scope\Footer\Factory\isItem\getPosition
getPosition()
Return the default position for installation, this will be overridden by the configuration later.
ILIAS\GlobalScreen\Scope\Footer\Collector\Map
Definition:
Map.php:21
ILIAS\UI\examples\Symbol\Glyph\Sort\sort
sort()
Definition:
sort.php:41
components
ILIAS
GlobalScreen
src
Scope
Footer
Collector
Map.php
Generated on Sat Oct 18 2025 23:03:07 for ILIAS by
1.9.4 (using
Doxyfile
)