ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilMMNullItemFacade.php
Go to the documentation of this file.
1<?php
2
6
13{
14
26 protected $top_item = false;
27
28
32 public function __construct(IdentificationInterface $identification, Main $collector)
33 {
35 parent::__construct($identification, $collector);
36 }
37
38
42 public function isTopItem() : bool
43 {
44 return $this->top_item;
45 }
46
47
51 public function setIsTopItm(bool $top_item)
52 {
53 $this->top_item = $top_item;
54 }
55
56
60 public function isEmpty() : bool
61 {
62 return true;
63 }
64
65
69 public function setActiveStatus(bool $status)
70 {
71 $this->active_status = $status;
72 }
73
74
78 public function setParent(string $parent)
79 {
80 $this->parent_identification = $parent;
81 }
82
83
84 public function create()
85 {
86 $s = new ilMMCustomItemStorage();
87 $s->setIdentifier(uniqid());
88 $s->setType($this->type);
89 $s->setTopItem($this->isTopItem());
90 $s->setAction($this->action);
91 $s->setDefaultTitle($this->default_title);
92 $s->create();
93
94 $this->custom_item_storage = $s;
95
96 global $DIC;
97 $provider = new CustomMainBarProvider($DIC);
98 $this->raw_item = $provider->getSingleCustomItem($s);
99 if ($this->parent_identification && $this->raw_item instanceof \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild) {
100 global $DIC;
101 $this->raw_item = $this->raw_item->withParent($DIC->globalScreen()->identification()->fromSerializedIdentification($this->parent_identification));
102 }
103
104 $this->identification = $this->raw_item->getProviderIdentification();
105
106 $this->mm_item = new ilMMItemStorage();
107 $this->mm_item->setPosition(9999999); // always the last on the top item
108 $this->mm_item->setIdentification($this->raw_item->getProviderIdentification()->serialize());
109 $this->mm_item->setParentIdentification($this->parent_identification);
110 $this->mm_item->setActive($this->active_status);
111 if ($this->raw_item instanceof \ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild) {
112 $this->mm_item->setParentIdentification($this->raw_item->getParent()->serialize());
113 }
114
115 parent::create();
116 }
117
118
119 public function isAvailable() : bool
120 {
121 return false;
122 }
123
124
128 public function isAlwaysAvailable() : bool
129 {
130 return false;
131 }
132
133
137 public function getProviderNameForPresentation() : string
138 {
139 return $this->identification->getProviderNameForPresentation();
140 }
141
142
146 public function isDeletable() : bool
147 {
148 return true;
149 }
150
151
155 public function delete()
156 {
157 parent::delete();
158 }
159
163 public function supportsRoleBasedVisibility() : bool
164 {
165 return true;
166 }
167
168}
An exception for terminatinating execution or to throw for unit testing.
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.
$DIC
Definition: xapitoken.php:46