19declare(strict_types=1);
65 $this->map =
new Map($factory);
73 yield
from $this->providers;
79 $this->type_information_collection->append(
$provider->provideTypeInformation());
80 $this->map->addMultiple(...
$provider->getStaticTopItems());
81 $this->map->addMultiple(...
$provider->getStaticSubItems());
88 $this->map->filter(
function (
isItem $item) use ($async_only):
bool {
98 foreach ($item->getChildren() as $child) {
99 if ($child->isAlwaysAvailable()) {
107 return $item->isVisible();
113 $this->map->walk(
function (
isItem &$item) {
114 if (!$this->information->isItemActive($item)) {
115 $item = $item->withAvailableCallable(fn(): bool => false)
116 ->withNonAvailableReason(
'-deactived_by_configuration-');
117 $this->map->add($item);
124 if ($this->default_topics) {
135 $item->setTypeInformation(
136 $this->getTypeInformationForItem($item)
141 $item = $this->getTypeHandlerForItem($item)->enrichItem($item);
144 $item = $this->getItemInformation()->customTranslationForUser($item);
148 $item = $this->getItemInformation()->customSymbol($item);
151 $item = $this->getItemInformation()->customPosition($item);
159 $parent = $this->map->getSingleItemFromFilter($this->information->getParent($item));
161 $parent->appendChild($item);
162 $item->overrideParent($parent->getProviderIdentification());
171 $item->calculateAmountOfChildren();
182 foreach ($item->getChildren() as $child) {
183 if (!$this->map->existsInFilter($child->getProviderIdentification())) {
184 $item->removeChild($child);
191 $this->map->walk(
static function (
isItem &$i):
void {
192 if ($i instanceof
isParent && $i->getChildren() === []) {
193 $i = $i->withAvailableCallable(static fn(): bool => false)->withVisibilityCallable(static fn(): bool => false);
211 foreach ($this->map->getAllFromFilter() as $item) {
212 if ($item->isTop() && $item->isAvailable() && $item->isVisible()) {
223 yield
from $this->map->getAllFromFilter();
231 yield
from $this->map->getAllFromRaw();
237 return $this->map->has();
242 if (!$this->hasItems()) {
245 foreach ($this->getItemsForUIRepresentation() as $item) {
246 return $item instanceof
isItem;
256 return $this->map->getSingleItemFromFilter($identification);
264 return $this->map->getSingleItemFromRaw($identification);
269 $type_information = $this->getTypeInformationForItem($item);
270 if ($type_information ===
null) {
274 return $type_information->getTypeHandler();
282 return $this->information;
287 return $this->getTypeInformationCollection()->get($item::class);
292 return $this->type_information_collection;
Class AbstractBaseCollector.
Class TypeInformationCollection.
Class MainMenuMainCollector This Collector will collect and then provide all available slates from th...
__construct(protected array $providers, MainMenuItemFactory $factory, private readonly ?ItemInformation $information=null)
prepareItemsForUIRepresentation()
readonly TypeInformationCollection $type_information_collection
getTypeInformationForItem(isItem $item)
getSingleItemFromRaw(IdentificationInterface $identification)
sortItemsForUIRepresentation()
getItemsForUIRepresentation()
This will return all available isTopItem (and moved isInterchangeableItem), stacked based on the conf...
getSingleItemFromFilter(IdentificationInterface $identification)
cleanupItemsForUIRepresentation()
filterItemsByVisibilty(bool $async_only=false)
getTypeHandlerForItem(isItem $item)
getTypeInformationCollection()
Class MainMenuItemFactory This factory provides you all available types for MainMenu GlobalScreen Ite...
This is just a class that marks a string as a help topic.
Interface IdentificationInterface.
Interface supportsAsynchronousLoading Types, which implement this interface, can load their content a...
getProviderIdentification()
if(!file_exists('../ilias.ini.php'))