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')) {
62 $table_entry_status =
new ilSelectInputGUI($this->lng->txt(self::F_TABLE_ENTRY_STATUS),
63 self::F_TABLE_ENTRY_STATUS);
64 $table_entry_status->setOptions(
66 self::F_TABLE_ALL_VALUE => $this->lng->txt(
"all"),
67 self::F_TABLE_ONLY_ACTIVE_VALUE => $this->lng->txt(
"only_active"),
68 self::F_TABLE_ONLY_INACTIVE_VALUE => $this->lng->txt(
"only_inactive"),
82 $this->filter[$field->
getPostVar()] = $field->getChecked();
84 $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'));
103 protected function fillRow($a_set)
106 static $parent_identification_string;
110 $renderer = $DIC->ui()->renderer();
115 $item_facade = $a_set[
'facade'];
117 if ($item_facade->isChild()) {
118 if (!$parent_identification_string ||
119 $parent_identification_string !== $item_facade->getParentIdentificationString()) {
120 $parent_identification_string = $item_facade->getParentIdentificationString();
121 $current_parent_identification = $this->item_repository->resolveIdentificationFromString($parent_identification_string);
122 $current_parent_item = $this->item_repository->getSingleItemFromFilter($current_parent_identification);
123 $this->tpl->setVariable(
"PARENT_TITLE",
124 $current_parent_item instanceof
hasTitle ? $current_parent_item->
getTitle() :
"-");
128 $this->tpl->setVariable(
'IDENTIFIER', self::IDENTIFIER);
129 $this->tpl->setVariable(
'ID', $this->
hash($item_facade->getId()));
130 $this->tpl->setVariable(
'NATIVE_ID', $item_facade->getId());
131 $this->tpl->setVariable(
'TITLE', $item_facade->getDefaultTitle());
132 $this->tpl->setVariable(
'PARENT', $this->
getSelect($item_facade)->
render());
133 $this->tpl->setVariable(
'STATUS', $item_facade->getStatus());
134 if ($item_facade->isActivated()) {
135 $this->tpl->touchBlock(
'is_active');
137 if ($item_facade->getRawItem()->isAlwaysAvailable() || !$item_facade->getRawItem()->isAvailable()) {
138 $this->tpl->touchBlock(
'is_active_blocked');
141 $this->tpl->setVariable(
'POSITION', $position * 10);
142 $this->tpl->setVariable(
'NATIVE_POSITION', $item_facade->getRawItem()->getPosition());
143 $this->tpl->setVariable(
'SAVED_POSITION', $item_facade->getFilteredItem()->getPosition());
144 $this->tpl->setVariable(
'TYPE', $item_facade->getTypeForPresentation());
145 $this->tpl->setVariable(
'PROVIDER', $item_facade->getProviderNameForPresentation());
148 $this->
hash($a_set[
'identification']));
150 $this->
hash($a_set[
'identification']));
152 if ($this->access->hasUserPermissionTo(
'write')) {
158 $ditem =
$factory->modal()->interruptiveItem($this->
hash($a_set[
'identification']),
159 $item_facade->getDefaultTitle());
162 if ($item_facade->isCustom()) {
167 ->withAffectedItems([$ditem]);
170 "")->withOnClick($m->getShowSignal());
171 $delete_modal = $renderer->render([$m]);
175 if ($item_facade->isInterchangeable()) {
181 ->withAffectedItems([$ditem]);
183 "")->withOnClick($m->getShowSignal());
184 $move_modal = $renderer->render([$m]);
187 $this->tpl->setVariable(
'ACTIONS',
188 $move_modal . $delete_modal . $renderer->render([
$factory->dropdown()->standard($items)->withLabel($this->lng->txt(
'sub_actions'))]));
198 $s =
new ilSelectInputGUI(
'', self::IDENTIFIER .
"[{$this->hash($child->getId())}][parent]");
211 foreach ($this->item_repository->getPossibleParentsForFormAndTable() as $identification =>
$name) {
212 $parents[$this->
hash($identification)] =
$name;
221 $sub_items_for_table = $this->item_repository->getSubItemsForTable();
224 array_walk($sub_items_for_table,
function (&$item) use ($DIC) {
225 $item_ident = $DIC->globalScreen()->identification()->fromSerializedIdentification($item[
'identification']);
226 $item_facade = $this->item_repository->repository()->getItemFacade($item_ident);
227 $item[
'facade'] = $item_facade;
231 array_filter($sub_items_for_table,
function ($item_facade) {
232 if (!isset($this->filter[self::F_TABLE_ENTRY_STATUS])) {
235 if ($this->filter[self::F_TABLE_ENTRY_STATUS] !== self::F_TABLE_ALL_VALUE) {
238 if ($this->filter[self::F_TABLE_ENTRY_STATUS] == self::F_TABLE_ONLY_ACTIVE_VALUE && !$item_facade->isActivated()) {
241 if ($this->filter[self::F_TABLE_ENTRY_STATUS] == self::F_TABLE_ONLY_INACTIVE_VALUE && $item_facade->isActivated()) {
247 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.