19declare(strict_types=1);
97 $this->type_information_collection->append($provider->provideTypeInformation());
98 $this->map->addMultiple(...$provider->getStaticTopItems());
99 $this->map->addMultiple(...$provider->getStaticSubItems());
106 $this->map->filter(
function (
isItem $item) use ($async_only) :
bool {
116 foreach ($item->getChildren() as $child) {
117 if ($child->isAlwaysAvailable()) {
125 return $item->isVisible();
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);
158 $this->map->walk(
function (
isItem $item) {
160 $parent = $this->map->getSingleItemFromFilter($this->information->getParent($item));
162 $parent->appendChild($item);
163 $item->overrideParent($parent->getProviderIdentification());
176 foreach ($item->getChildren() as $child) {
177 if (!$this->map->existsInFilter($child->getProviderIdentification())) {
178 $item->removeChild($child);
185 $this->map->walk(
static function (
isItem &
$i) :
void {
186 if (
$i instanceof
isParent && count(
$i->getChildren()) === 0) {
187 $i = $i->withAvailableCallable(static function () {
189 })->withVisibilityCallable(
static function () {
196 $this->map->filter(
static function (isItem
$i) :
bool {
197 if (
$i instanceof isParent) {
198 return count(
$i->getChildren()) > 0;
218 foreach ($this->map->getAllFromFilter() as $item) {
219 if ($item->isTop()) {
230 yield from $this->map->getAllFromFilter();
238 yield from $this->map->getAllFromRaw();
244 return $this->map->has();
249 if (!$this->hasItems()) {
252 foreach ($this->getItemsForUIRepresentation() as $item) {
253 return $item instanceof
isItem;
265 return $this->map->getSingleItemFromFilter($identification);
275 return $this->map->getSingleItemFromRaw($identification);
284 $type_information = $this->getTypeInformationForItem($item);
285 if ($type_information ===
null) {
289 return $type_information->getTypeHandler();
297 return $this->information;
306 return $this->getTypeInformationCollection()->get(get_class($item));
314 return $this->type_information_collection;
An exception for terminatinating execution or to throw for unit testing.
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)
sortItemsForUIRepresentation()
$type_information_collection
getItemsForUIRepresentation()
This will return all available isTopItem (and moved isInterchangeableItem), stacked based on the conf...
getSingleItemFromFilter(IdentificationInterface $identification)
cleanupItemsForUIRepresentation()
__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'))
registration confirmation script for ilias
Interface IdentificationInterface.
Interface hasSymbol Methods for Entries with Symbols.
Interface supportsAsynchronousLoading Types, which implement this interface, can load their content a...