3declare(strict_types=1);
88 $this->type_information_collection->append(
$provider->provideTypeInformation());
89 $this->map->addMultiple(...
$provider->getStaticTopItems());
90 $this->map->addMultiple(...
$provider->getStaticSubItems());
97 $this->map->filter(
function (
isItem $item) use ($async_only):
bool {
107 foreach ($item->getChildren() as $child) {
108 if ($child->isAlwaysAvailable()) {
116 return $item->isVisible();
127 $item->setTypeInformation(
128 $this->getTypeInformationForItem($item)
133 $item = $this->getTypeHandlerForItem($item)->enrichItem($item);
136 $item = $this->getItemInformation()->customTranslationForUser($item);
140 $item = $this->getItemInformation()->customSymbol($item);
143 $item = $this->getItemInformation()->customPosition($item);
149 $this->map->walk(
function (
isItem $item) {
151 $parent = $this->map->getSingleItemFromFilter($this->information->getParent($item));
153 $parent->appendChild($item);
154 $item->overrideParent($parent->getProviderIdentification());
167 foreach ($item->getChildren() as $child) {
168 if (!$this->map->existsInFilter($child->getProviderIdentification())) {
169 $item->removeChild($child);
176 $this->map->walk(
static function (
isItem &
$i):
void {
177 if (
$i instanceof
isParent && count(
$i->getChildren()) === 0) {
178 $i = $i->withAvailableCallable(static function () {
180 })->withVisibilityCallable(
static function () {
187 $this->map->filter(
static function (isItem
$i):
bool {
188 if (
$i instanceof isParent) {
189 return count(
$i->getChildren()) > 0;
209 foreach ($this->map->getAllFromFilter() as $item) {
210 if ($item->isTop()) {
221 yield from $this->map->getAllFromFilter();
229 yield from $this->map->getAllFromRaw();
235 return $this->map->has();
240 if (!$this->hasItems()) {
243 foreach ($this->getItemsForUIRepresentation() as $item) {
244 return $item instanceof
isItem;
256 return $this->map->getSingleItemFromFilter($identification);
266 return $this->map->getSingleItemFromRaw($identification);
275 $type_information = $this->getTypeInformationForItem($item);
276 if ($type_information ===
null) {
280 return $type_information->getTypeHandler();
288 return $this->information;
297 return $this->getTypeInformationCollection()->get(get_class($item));
305 return $this->type_information_collection;
Class AbstractBaseCollector.
Class TypeInformationCollection.
Class MainMenuMainCollector This Collector will collect and then provide all available slates from th...
prepareItemsForUIRepresentation()
getTypeInformationForItem(isItem $item)
getSingleItemFromRaw(IdentificationInterface $identification)
ItemInformation $information
sortItemsForUIRepresentation()
getItemsForUIRepresentation()
This will return all available isTopItem (and moved isInterchangeableItem), stacked based on the conf...
getSingleItemFromFilter(IdentificationInterface $identification)
cleanupItemsForUIRepresentation()
TypeInformationCollection $type_information_collection
__construct(array $providers, MainMenuItemFactory $factory, ItemInformation $information=null)
MainMenuMainCollector constructor.
filterItemsByVisibilty(bool $async_only=false)
getTypeHandlerForItem(isItem $item)
getTypeInformationCollection()
Class MainMenuItemFactory This factory provides you all available types for MainMenu GlobalScreen Ite...
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface IdentificationInterface.
Interface hasSymbol Methods for Entries with Symbols.
Interface supportsAsynchronousLoading Types, which implement this interface, can load their content a...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...