19declare(strict_types=1);
43 $this->sub_token = $this->pons->in()->buildToken(
'sub',
'id');
44 $this->top_token = $this->pons->in()->buildToken(
'top',
'id');
45 $identification = $this->pons->in()->getFirstFromRequest($this->top_token->token());
46 if ($identification ===
'lost_items' || $identification ===
null) {
47 $this->parent_item =
null;
49 $this->parent_item = $this->
repository->getItemFacadeForIdentificationString(
58 $this->pons->in()->keep($this->top_token->token());
59 if ($this->pons->handle(
'sub_items')) {
63 match ($this->pons->flow()->getCommand(self::CMD_DEFAULT)) {
65 self::CMD_MOVE => $this->
move(),
66 default => parent::executeCommand()
73 return $this->
repository->getItemFacadeForIdentificationString(
74 $this->pons->in()->getFirstFromRequest($this->sub_token->token())
80 $ids = $this->pons->in()->getAllFromRequest($this->sub_token->token());
81 if (($ids[0] ??
null) === Input::ALL_OBJECTS) {
84 $data[
'identification']
86 $this->repository->getSubItemsForTable($this->parent_item)
89 return $this->
repository->getItemFacadesForIdentificationStrings($ids);
95 $this->top_token->token(),
96 $this->sub_token->token(),
102 $item = $this->
repository->getItemFacadeForIdentificationString(
103 $this->pons->in()->getFirstFromRequest($this->sub_token->token())
107 $this->ui->factory(),
108 $this->ui->renderer(),
110 $this->pons->in()->request(),
117 protected function form(
bool $save =
false): void
120 $this->pons->in()->keep($this->sub_token->token());
127 $this->pons->out()->success($this->
lng->t(
'item_updated'),
true);
128 $this->pons->flow()->redirect(self::CMD_DEFAULT);
130 $this->pons->in()->keep($this->sub_token->token());
131 $this->pons->out()->out($form->get());
136 $this->pons->out()->outAsyncAsModal(
137 $this->
lng->txt(
'subitem'),
138 $this->flow->getLinkTarget($this, self::CMD_UPDATE),
145 $write_access = $this->
access->hasUserPermissionTo(
'write');
146 if ($write_access && $this->parent_item !==
null) {
149 $add_modal = $this->
ui->factory()->modal()->roundtrip(
150 $this->
lng->t(
'subitem_add'),
152 $form->get()->getInputs(),
153 $this->flow->getLinkTarget($this, self::CMD_CREATE)
156 $btn_add = $this->
ui->factory()->button()->primary(
157 $this->
lng->t(
'subitem_add'),
158 $add_modal->getShowSignal()
160 $this->
toolbar->addComponent($add_modal);
161 $this->
toolbar->addComponent($btn_add);
172 $this->pons->out()->out(...$table->get());
181 $items[] = $this->
ui->factory()->modal()->interruptiveItem()->standard(
182 $this->hash($item->getId()),
183 $item->getDefaultTitle(),
187 $this->pons->out()->outAsyncAsConfirmation(
188 $this->
lng->t(
'move'),
189 $this->lng->t(
'confirm_move'),
190 $this->lng->t(
'move'),
191 $this->flow->getLinkTarget($this, self::CMD_MOVE),
199 if (empty($mutliple_items)) {
200 $this->pons->out()->error($this->
lng->t(
'msg_not_moved'),
true);
201 $this->pons->flow()->redirect(self::CMD_DEFAULT);
204 foreach ($mutliple_items as $item) {
205 $item->setParent(
'');
209 $this->pons->out()->success($this->
lng->t(
'msg_moved'),
true);
210 $this->pons->flow()->redirect(self::CMD_DEFAULT);
@ilCtrl_IsCalledBy ilMMSubItemGUI: ilMMTopItemGUI @ilCtrl_Calls ilMMSubItemGUI: ILIAS\GlobalScreen\GU...
TokenContainer $sub_token
TokenContainer $top_token
ilMMItemFacadeInterface $parent_item
Interface ilMMItemFacadeInterface.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc