19declare(strict_types=1);
64 $this->map =
new Map($factory);
72 yield
from $this->providers;
78 $this->type_information_collection->append(
$provider->provideTypeInformation());
79 $this->map->addMultiple(...
$provider->getStaticTopItems());
80 $this->map->addMultiple(...
$provider->getStaticSubItems());
86 $this->map->walk(
function (
isItem &$item):
void {
87 if (!$this->information->isItemActive($item)) {
88 $item = $item->withAvailableCallable(fn(): bool => false)
89 ->withNonAvailableReason(
'-deactived_by_configuration-');
90 $this->map->add($item);
95 $this->map->filter(
function (
isItem $item) use ($async_only):
bool {
105 foreach ($item->getChildren() as $child) {
106 if ($child->isAlwaysAvailable()) {
114 return $item->isVisible();
125 if ($this->default_topics) {
136 $item->setTypeInformation(
137 $this->getTypeInformationForItem($item)
142 $item = $this->getTypeHandlerForItem($item)->enrichItem($item);
145 $item = $this->getItemInformation()->customTranslationForUser($item);
149 $item = $this->getItemInformation()->customSymbol($item);
152 $item = $this->getItemInformation()->customPosition($item);
160 $parent = $this->map->getSingleItemFromFilter($this->information->getParent($item));
162 $parent->appendChild($item);
163 $item->overrideParent($parent->getProviderIdentification());
172 $item->calculateAmountOfChildren();
183 foreach ($item->getChildren() as $child) {
184 if (!$this->map->existsInFilter($child->getProviderIdentification())) {
185 $item->removeChild($child);
192 $this->map->walk(
static function (
isItem &$i):
void {
193 if ($i instanceof
isParent && $i->getChildren() === []) {
194 $i = $i->withAvailableCallable(static fn(): bool => false)->withVisibilityCallable(static fn(): bool => false);
212 foreach ($this->map->getAllFromFilter() as $item) {
213 if ($item->isTop() && $item->isAvailable() && $item->isVisible()) {
224 yield
from $this->map->getAllFromFilter();
232 yield
from $this->map->getAllFromRaw();
238 return $this->map->has();
243 if (!$this->hasItems()) {
246 foreach ($this->getItemsForUIRepresentation() as $item) {
247 return $item instanceof
isItem;
257 return $this->map->getSingleItemFromFilter($identification);
265 return $this->map->getSingleItemFromRaw($identification);
270 $type_information = $this->getTypeInformationForItem($item);
271 if ($type_information ===
null) {
275 return $type_information->getTypeHandler();
283 return $this->information;
288 return $this->getTypeInformationCollection()->get($item::class);
293 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'))