ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilMMNullItemFacade.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25
32{
33 private ?string $parent_identification = "";
34 private bool $active_status;
35 protected bool $top_item = false;
36
37
41 public function __construct(IdentificationInterface $identification, Main $collector)
42 {
43 $this->identification = $identification;
44 parent::__construct($identification, $collector);
45 }
46
47
51 #[\Override]
52 public function isTopItem(): bool
53 {
54 return $this->top_item;
55 }
56
57
61 #[\Override]
62 public function setIsTopItm(bool $top_item): void
63 {
64 $this->top_item = $top_item;
65 }
66
67
71 #[\Override]
72 public function isEmpty(): bool
73 {
74 return true;
75 }
76
77
81 #[\Override]
82 public function setActiveStatus(bool $status): void
83 {
84 $this->active_status = $status;
85 }
86
87
91 #[\Override]
92 public function setParent(string $parent): void
93 {
94 $this->parent_identification = $parent;
95 }
96
97
98 #[\Override]
99 public function create(): void
100 {
101 $s = new ilMMCustomItemStorage();
102 $s->setIdentifier(uniqid());
103 $s->setType($this->type);
104 $s->setTopItem($this->isTopItem());
105 $s->setAction($this->action);
106 $s->setDefaultTitle($this->default_title);
107 $s->create();
108
109 $this->custom_item_storage = $s;
110
111 global $DIC;
113 $this->raw_item = $provider->getSingleCustomItem($s);
114 if ($this->parent_identification && $this->raw_item instanceof isChild) {
115 global $DIC;
116 $this->raw_item = $this->raw_item->withParent($DIC->globalScreen()->identification()->fromSerializedIdentification($this->parent_identification));
117 }
118
119 $this->identification = $this->raw_item->getProviderIdentification();
120
121 $this->mm_item = new ilMMItemStorage();
122 $this->mm_item->setPosition(9999999); // always the last on the top item
123 $this->mm_item->setIdentification($this->raw_item->getProviderIdentification()->serialize());
124 $this->mm_item->setParentIdentification($this->parent_identification);
125 $this->mm_item->setActive($this->active_status);
126 if ($this->raw_item instanceof isChild) {
127 $this->mm_item->setParentIdentification($this->raw_item->getParent()->serialize());
128 }
129
130 parent::create();
131 }
132
133
134 #[\Override]
135 public function isAvailable(): bool
136 {
137 return false;
138 }
139
140
144 #[\Override]
145 public function isAlwaysAvailable(): bool
146 {
147 return false;
148 }
149
150
154 #[\Override]
155 public function getProviderNameForPresentation(): string
156 {
157 return $this->identification->getProviderNameForPresentation();
158 }
159
160
164 #[\Override]
165 public function isDeletable(): bool
166 {
167 return true;
168 }
169
170
174 #[\Override]
175 public function supportsRoleBasedVisibility(): bool
176 {
177 return true;
178 }
179}
Class MainMenuMainCollector This Collector will collect and then provide all available slates from th...
Class ilMMCustomItemFacade.
Class ilMMCustomItemStorage.
Class ilMMItemStorage.
Class ilMMNullItemFacade.
__construct(IdentificationInterface $identification, Main $collector)
@inheritDoc
setIsTopItm(bool $top_item)
@inheritDoc
setActiveStatus(bool $status)
@inheritDoc
setParent(string $parent)
@inheritDoc
supportsRoleBasedVisibility()
@inheritDoc
getProviderNameForPresentation()
@inheritDoc
Interface ilMMItemFacadeInterface.
$provider
Definition: ltitoken.php:80
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26