3 declare(strict_types=1);
44 $this->
setId(self::class);
49 $this->
lng = $this->parent_obj->lng;
52 if ($this->
access->hasUserPermissionTo(
'write')) {
61 $this->
addColumn($this->
lng->txt(
'topitem_position'),
'',
'30px');
74 protected function fillRow(array $a_set): void
79 $renderer = $DIC->ui()->renderer();
80 $factory = $DIC->ui()->factory();
82 $item_facade = $this->item_repository->repository()->getItemFacade($DIC->globalScreen()->identification()->fromSerializedIdentification($a_set[
'identification']));
85 $this->tpl->setVariable(
'ID', $this->
hash($item_facade->getId()));
86 $this->tpl->setVariable(
'NATIVE_ID', $item_facade->getId());
87 $this->tpl->setVariable(
'TITLE', $item_facade->getDefaultTitle());
88 $this->tpl->setVariable(
'SUBENTRIES', $item_facade->getAmountOfChildren());
89 $this->tpl->setVariable(
'TYPE', $item_facade->getTypeForPresentation());
90 $this->tpl->setVariable(
'CSS_ID',
"mm_" . $item_facade->identification()->getInternalIdentifier());
91 $this->tpl->setVariable(
'POSITION', $position * 10);
92 $this->tpl->setVariable(
'NATIVE_POSITION', $item_facade->getRawItem()->getPosition());
93 $this->tpl->setVariable(
'SAVED_POSITION', $item_facade->getFilteredItem()->getPosition());
94 if ($item_facade->isActivated()) {
95 $this->tpl->touchBlock(
'is_active');
97 if ($item_facade->isAlwaysAvailable() || !$item_facade->isAvailable()) {
98 $this->tpl->touchBlock(
'is_active_blocked');
100 $this->tpl->setVariable(
'PROVIDER', $item_facade->getProviderNameForPresentation());
105 if ($this->
access->hasUserPermissionTo(
'write')) {
107 if ($item_facade->isEditable()) {
109 $items[] = $factory->button()
113 $rendered_modal =
"";
114 if ($item_facade->isDeletable()) {
115 $ditem = $factory->modal()->interruptiveItem()->standard($this->
hash($a_set[
'identification']), $item_facade->getDefaultTitle());
117 $m = $factory->modal()
119 ->withAffectedItems([$ditem]);
123 $rendered_modal = $renderer->render([$m]);
125 if ($item_facade->isInterchangeable()) {
128 $this->tpl->setVariable(
'ACTIONS', $rendered_modal . $renderer->render([$factory->dropdown()->standard($items)->withLabel($this->
lng->txt(
'sub_actions'))]));
137 return $this->item_repository->getTopItems();
ilMMItemRepository $item_repository
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
Class ilMMItemRepository.
setExternalSorting(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
Class ilMMTopItemGUI ilMMTopItemGUI: ilObjMainMenuGUI ilMMTopItemGUI: ilMMItemTranslationGUI.
__construct(ilMMTopItemGUI $a_parent_obj, ilMMItemRepository $item_repository, ilObjMainMenuAccess $access)
ilMMTopItemTableGUI 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)
Class ilMMTopItemTableGUI.
ilObjMainMenuAccess $access
setExternalSegmentation(bool $a_val)