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 $this->parent_item = $this->
repository->getItemFacadeForIdentificationString(
46 $this->pons->in()->getFirstFromRequest($this->top_token->token())
53 $this->pons->in()->keep($this->top_token->token());
54 if ($this->pons->handle(
'sub_items')) {
58 match ($this->pons->flow()->getCommand(self::CMD_DEFAULT)) {
60 self::CMD_MOVE => $this->
move(),
61 default => parent::executeCommand()
68 return $this->
repository->getItemFacadeForIdentificationString(
69 $this->pons->in()->getFirstFromRequest($this->sub_token->token())
75 $ids = $this->pons->in()->getAllFromRequest($this->sub_token->token());
76 if (($ids[0] ??
null) === Input::ALL_OBJECTS) {
79 $data[
'identification']
81 $this->repository->getSubItemsForTable($this->parent_item)
84 return $this->
repository->getItemFacadesForIdentificationStrings($ids);
90 $this->top_token->token(),
91 $this->sub_token->token(),
97 $item = $this->
repository->getItemFacadeForIdentificationString(
98 $this->pons->in()->getFirstFromRequest($this->sub_token->token())
102 $this->ui->factory(),
103 $this->ui->renderer(),
105 $this->pons->in()->request(),
112 protected function form(
bool $save =
false): void
115 $this->pons->in()->keep($this->sub_token->token());
120 if ($save && $form->save()) {
121 $this->pons->out()->success($this->
lng->t(
'item_updated'),
true);
122 $this->pons->flow()->redirect(self::CMD_DEFAULT);
125 $this->pons->out()->outAsyncAsModal(
126 $this->
lng->txt(
'subitem'),
127 $this->flow->getLinkTarget($this, self::CMD_UPDATE),
134 $write_access = $this->
access->hasUserPermissionTo(
'write');
138 $add_modal = $this->
ui->factory()->modal()->roundtrip(
139 $this->
lng->t(
'subitem_add'),
141 $form->get()->getInputs(),
142 $this->flow->getLinkTarget($this, self::CMD_CREATE)
145 $btn_add = $this->
ui->factory()->button()->primary(
146 $this->
lng->t(
'subitem_add'),
147 $add_modal->getShowSignal()
149 $this->
toolbar->addComponent($add_modal);
150 $this->
toolbar->addComponent($btn_add);
161 $this->pons->out()->out(...$table->get());
170 $items[] = $this->
ui->factory()->modal()->interruptiveItem()->standard(
171 $this->hash($item->getId()),
172 $item->getDefaultTitle(),
176 $this->pons->out()->outAsyncAsConfirmation(
177 $this->
lng->t(
'move'),
178 $this->lng->t(
'confirm_move'),
179 $this->lng->t(
'move'),
180 $this->flow->getLinkTarget($this, self::CMD_MOVE),
188 if (empty($mutliple_items)) {
189 $this->pons->out()->error($this->
lng->t(
'msg_not_moved'),
true);
190 $this->pons->flow()->redirect(self::CMD_DEFAULT);
193 foreach ($mutliple_items as $item) {
194 $item->setParent(
'');
198 $this->pons->out()->success($this->
lng->t(
'msg_moved'),
true);
199 $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