19declare(strict_types=1);
56 $this->cache =
$DIC->globalCache()->get($this);
57 $this->db =
$DIC->database();
58 $this->main_collector =
$DIC->globalScreen()->collector()->mainmenu();
59 $this->main_collector->collectOnce();
60 $this->services =
$DIC->globalScreen();
62 foreach ($this->main_collector->getRawUnfilteredItems() as $top_item) {
79 $this->cache->flush();
84 return $this->main_collector->getSingleItemFromRaw($identification);
89 return $this->main_collector->getSingleItemFromFilter($identification);
94 return $this->services->identification()->fromSerializedIdentification($identification_string);
114 $q =
"SELECT sub_items.* " .
115 "FROM il_mm_items AS sub_items " .
116 "LEFT JOIN il_mm_items AS top_items ON top_items.identification = sub_items.parent_identification " .
117 "WHERE sub_items.parent_identification != '' AND sub_items.parent_identification IS NOT NULL " .
118 "AND (top_items.identification IS NULL OR top_items.identification = '') " .
119 "ORDER BY top_items.position, parent_identification, sub_items.position ASC";
121 $r = $this->db->query(
$q);
123 while (
$data = $this->db->fetchAssoc($r)) {
133 if ($parent !==
null) {
134 $r = $this->db->queryF(
135 "SELECT sub_items.*, top_items.position AS parent_position
136FROM il_mm_items AS sub_items
137LEFT JOIN il_mm_items AS top_items ON top_items.identification = sub_items.parent_identification
138WHERE sub_items.parent_identification != '' AND sub_items.parent_identification = %s
139ORDER BY top_items.position, parent_identification, sub_items.position ASC",
141 [$parent->identification()->serialize()]
144 $r = $this->db->query(
145 "SELECT sub_items.*, top_items.position AS parent_position
146FROM il_mm_items AS sub_items
147LEFT JOIN il_mm_items AS top_items ON top_items.identification = sub_items.parent_identification
148WHERE sub_items.parent_identification != ''
149ORDER BY top_items.position, parent_identification, sub_items.position ASC",
153 while (
$data = $this->db->fetchAssoc($r)) {
164 $this->services->identification()->fromSerializedIdentification($item[
'identification'])
166 $item_facade->delete();
183 if ($identification->getClassName() === CustomMainBarProvider::class) {
187 return new ilMMItemFacade($identification, $this->main_collector);
193 foreach ($identifications as $identification) {
194 $id = $this->services->identification()->fromSerializedIdentification($identification);
198 return $item_facades;
206 $id = $this->services->identification()->fromSerializedIdentification($identification);
214 if ($parents ===
null) {
216 foreach (array_keys($this->
getTopItems()) as $top_item_identification) {
217 $identification = $this->services->identification()->fromSerializedIdentification(
218 $top_item_identification
222 $parents[$top_item_identification] = $this->
getItemFacade($identification)
237 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
238 if ($information->isCreationPrevented()) {
241 if ($information->isChild()) {
243 if ($information->getType() === TopLinkItem::class) {
246 $types[$information->getType()] = $information;
259 foreach ($this->main_collector->getTypeInformationCollection()->getAll() as $information) {
260 if (!$new || $information->isTop()) {
261 $types[$information->getType()] = $information;
275 return $this->main_collector->getTypeHandlerForItem($item);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static where($where, $operator=null)
Class NullIdentification.
Class NullPluginIdentification.
Class MainMenuMainCollector This Collector will collect and then provide all available slates from th...
Class CustomMainBarProvider.
Class ilMMCustomItemFacade.
getSubItemsForTable(?ilMMItemFacadeInterface $parent=null)
getPossibleSubItemTypesWithInformation()
__construct()
ilMMItemRepository constructor.
resolveIdentificationFromString(string $identification_string)
updateItem(ilMMItemFacadeInterface $item_facade)
deleteItem(ilMMItemFacadeInterface $item_facade)
getItemFacadesForIdentificationStrings(array $identifications)
getPossibleParentsForFormAndTable()
getItemFacadeForIdentificationString(string $identification)
createItem(ilMMItemFacadeInterface $item_facade)
getItemFacade(?IdentificationInterface $identification=null)
getSingleItem(IdentificationInterface $identification)
getPossibleTopItemTypesWithInformation(bool $new)
getTypeHandlerForType(string $type)
MainMenuMainCollector $main_collector
getSingleItemFromFilter(IdentificationInterface $identification)
static register(isItem $item)
Class ilMMNullItemFacade.
Interface IdentificationInterface.
Interface ilMMItemFacadeInterface.