44 $this->
setId(self::class);
49 $this->lng = $this->parent_obj->lng;
52 $this->
setFormAction($this->ctrl->getFormAction($this->parent_obj));
53 if ($this->access->hasUserPermissionTo(
'write')) {
63 $this->lng->txt(self::F_TABLE_ENTRY_STATUS),
64 self::F_TABLE_ENTRY_STATUS
66 $table_entry_status->setOptions(
68 self::F_TABLE_ALL_VALUE => $this->lng->txt(
"all"),
69 self::F_TABLE_ONLY_ACTIVE_VALUE => $this->lng->txt(
"only_active"),
70 self::F_TABLE_ONLY_INACTIVE_VALUE => $this->lng->txt(
"only_inactive"),
92 $this->
addColumn($this->lng->txt(
'sub_parent'));
93 $this->
addColumn($this->lng->txt(
'sub_position'));
94 $this->
addColumn($this->lng->txt(
'sub_title'));
95 $this->
addColumn($this->lng->txt(
'sub_type'));
96 $this->
addColumn($this->lng->txt(
'sub_active'));
97 $this->
addColumn($this->lng->txt(
'sub_status'));
98 $this->
addColumn($this->lng->txt(
'sub_provider'));
99 $this->
addColumn($this->lng->txt(
'sub_actions'));
105 protected function fillRow($a_set)
108 static $parent_identification_string;
112 $renderer = $DIC->ui()->renderer();
117 $item_facade = $a_set[
'facade'];
119 if ($item_facade->isChild()) {
120 if (!$parent_identification_string ||
121 $parent_identification_string !== $item_facade->getParentIdentificationString()) {
122 $parent_identification_string = $item_facade->getParentIdentificationString();
123 $current_parent_identification = $this->item_repository->resolveIdentificationFromString(
124 $parent_identification_string
126 $current_parent_item = $this->item_repository->getSingleItemFromFilter($current_parent_identification);
127 $this->tpl->setVariable(
129 $current_parent_item instanceof
hasTitle ? $current_parent_item->
getTitle() :
"-" 134 $this->tpl->setVariable(
'IDENTIFIER', self::IDENTIFIER);
135 $this->tpl->setVariable(
'ID', $this->
hash($item_facade->getId()));
136 $this->tpl->setVariable(
'NATIVE_ID', $item_facade->getId());
137 $this->tpl->setVariable(
'TITLE', $item_facade->getDefaultTitle());
138 $this->tpl->setVariable(
'PARENT', $this->
getSelect($item_facade)->
render());
139 $this->tpl->setVariable(
'STATUS', $item_facade->getStatus());
140 if ($item_facade->isActivated()) {
141 $this->tpl->touchBlock(
'is_active');
143 if ($item_facade->getRawItem()->isAlwaysAvailable() || !$item_facade->getRawItem()->isAvailable()) {
144 $this->tpl->touchBlock(
'is_active_blocked');
147 $this->tpl->setVariable(
'POSITION', $position * 10);
148 $this->tpl->setVariable(
'NATIVE_POSITION', $item_facade->getRawItem()->getPosition());
149 $this->tpl->setVariable(
'SAVED_POSITION', $item_facade->getFilteredItem()->getPosition());
150 $this->tpl->setVariable(
'TYPE', $item_facade->getTypeForPresentation());
151 $this->tpl->setVariable(
'PROVIDER', $item_facade->getProviderNameForPresentation());
153 $this->ctrl->setParameterByClass(
154 ilMMSubItemGUI::class,
156 $this->
hash($a_set[
'identification'])
158 $this->ctrl->setParameterByClass(
159 ilMMItemTranslationGUI::class,
161 $this->
hash($a_set[
'identification'])
164 if ($this->access->hasUserPermissionTo(
'write')) {
174 $ditem =
$factory->modal()->interruptiveItem(
175 $this->
hash($a_set[
'identification']),
176 $item_facade->getDefaultTitle()
180 if ($item_facade->isCustom()) {
188 ->withAffectedItems([$ditem]);
193 )->withOnClick($m->getShowSignal());
194 $delete_modal = $renderer->render([$m]);
198 if ($item_facade->isInterchangeable()) {
207 ->withAffectedItems([$ditem]);
211 )->withOnClick($m->getShowSignal());
212 $move_modal = $renderer->render([$m]);
215 $this->tpl->setVariable(
217 $move_modal . $delete_modal . $renderer->render([
$factory->dropdown()->standard($items)->withLabel($this->lng->txt(
'sub_actions'))])
228 $s =
new ilSelectInputGUI(
'', self::IDENTIFIER .
"[{$this->hash($child->getId())}][parent]");
241 foreach ($this->item_repository->getPossibleParentsForFormAndTable() as $identification =>
$name) {
242 $parents[$this->
hash($identification)] =
$name;
251 $sub_items_for_table = $this->item_repository->getSubItemsForTable();
254 array_walk($sub_items_for_table,
function (& $item) use ($DIC) {
255 $item_ident = $DIC->globalScreen()->identification()->fromSerializedIdentification($item[
'identification']);
256 $item_facade = $this->item_repository->repository()->getItemFacade($item_ident);
257 $item[
'facade'] = $item_facade;
261 array_filter($sub_items_for_table,
function ($item_facade) {
262 if (!isset($this->
filter[self::F_TABLE_ENTRY_STATUS])) {
265 if ($this->
filter[self::F_TABLE_ENTRY_STATUS] !== self::F_TABLE_ALL_VALUE) {
268 if ($this->
filter[self::F_TABLE_ENTRY_STATUS] == self::F_TABLE_ONLY_ACTIVE_VALUE && !$item_facade->isActivated()) {
271 if ($this->
filter[self::F_TABLE_ENTRY_STATUS] == self::F_TABLE_ONLY_INACTIVE_VALUE && $item_facade->isActivated()) {
277 return $sub_items_for_table;
getSelect(ilMMItemFacadeInterface $child)
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
const F_TABLE_ENTRY_STATUS
setExternalSorting($a_val)
Set external sorting.
setExternalSegmentation($a_val)
Set external segmentation.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
Class ilMMSubItemTableGUI.
Class ilMMItemRepository.
const F_TABLE_ONLY_ACTIVE_VALUE
addAndReadFilterItem(ilFormPropertyGUI $field)
getParentIdentificationString()
Class ilMMTopItemGUI ilMMSubItemGUI: ilObjMainMenuGUI ilMMSubItemGUI: ilMMItemTranslationGUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
render()
render table public
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
const F_TABLE_ONLY_INACTIVE_VALUE
getPossibleParentsForFormAndTable()
__construct(Container $dic, ilPlugin $plugin)
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
const F_TABLE_SHOW_INACTIVE
__construct(ilMMSubItemGUI $a_parent_obj, ilMMItemRepository $item_repository, ilObjMainMenuAccess $access)
ilMMSubItemTableGUI constructor.
fillRow($a_set)
Standard Version of Fill Row.
Interface ilMMItemFacadeInterface.