3 declare(strict_types=1);
55 $this->
setId(self::class);
60 $this->
lng = $this->parent_obj->lng;
64 if ($this->
access->hasUserPermissionTo(
'write')) {
74 $this->
lng->txt(self::F_TABLE_ENTRY_STATUS),
75 self::F_TABLE_ENTRY_STATUS
77 $table_entry_status->setOptions(
79 self::F_TABLE_ALL_VALUE => $this->
lng->txt(
"all"),
80 self::F_TABLE_ONLY_ACTIVE_VALUE => $this->
lng->txt(
"only_active"),
81 self::F_TABLE_ONLY_INACTIVE_VALUE => $this->
lng->txt(
"only_inactive"),
116 protected function fillRow(array $a_set):
void 119 static $parent_identification_string;
123 $renderer = $DIC->ui()->renderer();
128 $item_facade = $a_set[
'facade'];
130 if ($item_facade->isChild()) {
131 if (!$parent_identification_string ||
132 $parent_identification_string !== $item_facade->getParentIdentificationString()) {
133 $parent_identification_string = $item_facade->getParentIdentificationString();
134 $current_parent_identification = $this->item_repository->resolveIdentificationFromString(
135 $parent_identification_string
137 $current_parent_item = $this->item_repository->getSingleItem($current_parent_identification);
138 $this->tpl->setVariable(
140 $current_parent_item instanceof
hasTitle ? $current_parent_item->
getTitle() :
"-" 142 $this->tpl->setVariable(
144 $current_parent_item->getProviderIdentification()->serialize()
146 $this->tpl->setVariable(
148 $this->
hash($current_parent_item->getProviderIdentification()->serialize())
153 $this->tpl->setVariable(
'IDENTIFIER', self::IDENTIFIER);
154 $this->tpl->setVariable(
'ID', $this->
hash($item_facade->getId()));
155 $this->tpl->setVariable(
'NATIVE_ID', $item_facade->getId());
156 $this->tpl->setVariable(
'TITLE', $item_facade->getDefaultTitle());
157 $this->tpl->setVariable(
'PARENT', $this->
getSelect($item_facade)->
render());
158 $this->tpl->setVariable(
'STATUS', $item_facade->getStatus());
159 if ($item_facade->isActivated()) {
160 $this->tpl->touchBlock(
'is_active');
162 if ($item_facade->getRawItem()->isAlwaysAvailable() || !$item_facade->getRawItem()->isAvailable()) {
163 $this->tpl->touchBlock(
'is_active_blocked');
166 $this->tpl->setVariable(
'POSITION', $position * 10);
167 $this->tpl->setVariable(
'NATIVE_POSITION', $item_facade->getRawItem()->getPosition());
168 $this->tpl->setVariable(
'SAVED_POSITION', $item_facade->getFilteredItem()->getPosition());
169 $this->tpl->setVariable(
'TYPE', $item_facade->getTypeForPresentation());
170 $this->tpl->setVariable(
'PROVIDER', $item_facade->getProviderNameForPresentation());
172 $this->
ctrl->setParameterByClass(
173 ilMMSubItemGUI::class,
175 $this->
hash($a_set[
'identification'])
177 $this->
ctrl->setParameterByClass(
178 ilMMItemTranslationGUI::class,
180 $this->
hash($a_set[
'identification'])
183 if ($this->
access->hasUserPermissionTo(
'write')) {
193 $ditem =
$factory->modal()->interruptiveItem(
194 $this->
hash($a_set[
'identification']),
195 $item_facade->getDefaultTitle()
199 if ($item_facade->isDeletable()) {
207 ->withAffectedItems([$ditem]);
212 )->withOnClick($m->getShowSignal());
213 $delete_modal = $renderer->render([$m]);
217 if ($item_facade->isInterchangeable()) {
226 ->withAffectedItems([$ditem]);
230 )->withOnClick($m->getShowSignal());
231 $move_modal = $renderer->render([$m]);
234 $this->tpl->setVariable(
236 $move_modal . $delete_modal . $renderer->render([
$factory->dropdown()->standard($items)->withLabel($this->
lng->txt(
'sub_actions'))])
247 $s =
new ilSelectInputGUI(
'', self::IDENTIFIER .
"[{$this->hash($child->getId())}][parent]");
260 foreach ($this->item_repository->getPossibleParentsForFormAndTable() as $identification =>
$name) {
261 $parents[$this->
hash($identification)] =
$name;
270 $sub_items_for_table = $this->item_repository->getSubItemsForTable();
273 array_walk($sub_items_for_table,
function (&$item) use ($DIC) {
274 $item_ident = $DIC->globalScreen()->identification()->fromSerializedIdentification($item[
'identification']);
275 $item_facade = $this->item_repository->repository()->getItemFacade($item_ident);
276 $item[
'facade'] = $item_facade;
280 array_filter($sub_items_for_table,
function ($item_facade) {
281 if (!isset($this->
filter[self::F_TABLE_ENTRY_STATUS])) {
284 if ($this->
filter[self::F_TABLE_ENTRY_STATUS] !== self::F_TABLE_ALL_VALUE) {
287 if ($this->
filter[self::F_TABLE_ENTRY_STATUS] == self::F_TABLE_ONLY_ACTIVE_VALUE && !$item_facade->isActivated()) {
290 if ($this->
filter[self::F_TABLE_ENTRY_STATUS] == self::F_TABLE_ONLY_INACTIVE_VALUE && $item_facade->isActivated()) {
296 return $sub_items_for_table;
getSelect(ilMMItemFacadeInterface $child)
const F_TABLE_ENTRY_STATUS
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
ilMMItemRepository $item_repository
Class ilMMSubItemTableGUI.
Class ilMMItemRepository.
const F_TABLE_ONLY_ACTIVE_VALUE
setExternalSorting(bool $a_val)
addAndReadFilterItem(ilFormPropertyGUI $field)
fillRow(array $a_set)
Standard Version of Fill Row.
getParentIdentificationString()
ilObjMainMenuAccess $access
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
Class ilMMTopItemGUI ilMMSubItemGUI: ilObjMainMenuGUI ilMMSubItemGUI: ilMMItemTranslationGUI.
const F_TABLE_ONLY_INACTIVE_VALUE
getPossibleParentsForFormAndTable()
__construct(Container $dic, ilPlugin $plugin)
const F_TABLE_SHOW_INACTIVE
__construct(ilMMSubItemGUI $a_parent_obj, ilMMItemRepository $item_repository, ilObjMainMenuAccess $access)
ilMMSubItemTableGUI constructor.
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
Interface ilMMItemFacadeInterface.
setExternalSegmentation(bool $a_val)