ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Map.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 use Closure;
30 
35 class Map extends AbstractMap
36 {
37  private readonly MetaBarItemFactory $factory;
38 
39  public function __construct(?MetaBarItemFactory $factory = null)
40  {
42  // $this->factory = $factory;
43  }
44 
45  #[\Override]
46  protected function getTitleSorter(): Closure
47  {
48  return static function (isItem $item_one, isItem $item_two): int {
49  if (!$item_one instanceof hasTitle || !$item_two instanceof hasTitle) {
50  return 0;
51  }
52 
53  return strnatcmp($item_one->getTitle(), $item_two->getTitle());
54  };
55  }
56 
57  #[\Override]
58  protected function getPositionSorter(): Closure
59  {
60  return static fn(isItem $item_one, isItem $item_two): int => $item_one->getPosition() - $item_two->getPosition();
61  }
62 
63  protected function getLostItem(IdentificationInterface $identification): isGlobalScreenItem
64  {
65  return $this->factory->topParentItem($identification)
66  ->withVisibilityCallable(
67  fn(): bool => false
68  )->withTitle('Lost');
69  }
70 }
Class MetaBarItemFactory This factory provides you all available types for MainMenu GlobalScreen Item...
factory()
getPosition()
Return the default position for installation, this will be overridden by the configuration later...
__construct(?MetaBarItemFactory $factory=null)
Definition: Map.php:39
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
readonly MetaBarItemFactory $factory
Definition: Map.php:37
getLostItem(IdentificationInterface $identification)
Definition: Map.php:63
__construct(Container $dic, ilPlugin $plugin)