42 $this->
setId(self::class);
45 parent::__construct($a_parent_obj);
47 $this->lng = $this->parent_obj->lng;
50 $this->
setFormAction($this->ctrl->getFormAction($this->parent_obj));
51 if ($this->access->hasUserPermissionTo(
'write')) {
61 $table_entry_status =
new ilSelectInputGUI($this->lng->txt(self::F_TABLE_ENTRY_STATUS), self::F_TABLE_ENTRY_STATUS);
64 self::F_TABLE_ALL_VALUE => $this->lng->txt(
"all"),
65 self::F_TABLE_ONLY_ACTIVE_VALUE => $this->lng->txt(
"only_active"),
66 self::F_TABLE_ONLY_INACTIVE_VALUE => $this->lng->txt(
"only_inactive"),
81 $this->filter[$field->
getPostVar()] = $field->getChecked();
83 $this->filter[$field->
getPostVar()] = $field->getValue();
90 $this->
addColumn($this->lng->txt(
'sub_parent'));
91 $this->
addColumn($this->lng->txt(
'sub_position'));
92 $this->
addColumn($this->lng->txt(
'sub_title'));
93 $this->
addColumn($this->lng->txt(
'sub_type'));
94 $this->
addColumn($this->lng->txt(
'sub_active'));
95 $this->
addColumn($this->lng->txt(
'sub_status'));
96 $this->
addColumn($this->lng->txt(
'sub_provider'));
97 $this->
addColumn($this->lng->txt(
'sub_actions'));
104 protected function fillRow($a_set)
107 static $current_parent;
111 $renderer = $DIC->ui()->renderer();
116 $item_facade = $a_set[
'facade'];
118 if (!$current_parent || $current_parent->getProviderIdentification() !== $item_facade->item()->getParent()) {
119 $current_parent = $this->item_repository->getSingleItem($item_facade->item()->getParent());
120 $this->tpl->setVariable(
"PARENT_TITLE", $current_parent->getTitle());
123 $this->tpl->setVariable(
'IDENTIFIER', self::IDENTIFIER);
124 $this->tpl->setVariable(
'ID', $this->
hash($item_facade->getId()));
125 $this->tpl->setVariable(
'TITLE', $item_facade->getDefaultTitle());
126 $this->tpl->setVariable(
'PARENT', $this->
getSelect($item_facade)->
render());
127 $this->tpl->setVariable(
'STATUS', $item_facade->getStatus());
128 if ($item_facade->isActivated()) {
129 $this->tpl->touchBlock(
'is_active');
131 if ($item_facade->item()->isAlwaysAvailable() || !$item_facade->item()->isAvailable()) {
132 $this->tpl->touchBlock(
'is_active_blocked');
135 $this->tpl->setVariable(
'POSITION', $position * 10);
136 $this->tpl->setVariable(
'TYPE', $item_facade->getTypeForPresentation());
137 $this->tpl->setVariable(
'PROVIDER', $item_facade->getProviderNameForPresentation());
142 if ($this->access->hasUserPermissionTo(
'write')) {
146 $rendered_modal =
"";
147 if ($item_facade->isDeletable()) {
148 $ditem =
$factory->modal()->interruptiveItem($this->
hash($a_set[
'identification']), $item_facade->getDefaultTitle());
152 ->withAffectedItems([$ditem]);
156 $rendered_modal = $renderer->render([
$m]);
159 $this->tpl->setVariable(
'ACTIONS', $rendered_modal . $renderer->render([
$factory->dropdown()->standard($items)->withLabel($this->lng->txt(
'sub_actions'))]));
171 $s =
new ilSelectInputGUI(
'', self::IDENTIFIER .
"[{$this->hash($child->getId())}][parent]");
185 foreach ($this->item_repository->getPossibleParentsForFormAndTable() as $identification =>
$name) {
186 $parents[$this->
hash($identification)] =
$name;
196 $sub_items_for_table = $this->item_repository->getSubItemsForTable();
198 foreach ($sub_items_for_table as $k => $item) {
199 $item_facade = $this->item_repository->repository()->getItemFacade($DIC->globalScreen()->identification()->fromSerializedIdentification($item[
'identification']));
200 $sub_items_for_table[$k][
'facade'] = $item_facade;
201 if (isset($this->filter[self::F_TABLE_ENTRY_STATUS]) && $this->filter[self::F_TABLE_ENTRY_STATUS] !== self::F_TABLE_ALL_VALUE) {
202 if (($this->filter[self::F_TABLE_ENTRY_STATUS] == self::F_TABLE_ONLY_ACTIVE_VALUE && !$item_facade->isActivated())
203 || ($this->filter[self::F_TABLE_ENTRY_STATUS] == self::F_TABLE_ONLY_INACTIVE_VALUE && $item_facade->isActivated())
205 unset($sub_items_for_table[$k]);
210 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()
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.
Class ilObjMainMenuAccess.
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.
hash(StreamInterface $stream, $algo, $rawOutput=false)
Calculate a hash of a Stream.
Interface ilMMItemFacadeInterface.