33 $this->
setId(self::class);
36 parent::__construct($a_parent_obj);
38 $this->lng = $this->parent_obj->lng;
40 $this->
setFormAction($this->ctrl->getFormAction($this->parent_obj));
41 if ($this->access->hasUserPermissionTo(
'write')) {
51 $this->
addColumn($this->lng->txt(
'topitem_position'),
'',
'30px');
52 $this->
addColumn($this->lng->txt(
'topitem_title'));
53 $this->
addColumn($this->lng->txt(
'topitem_active'));
54 $this->
addColumn($this->lng->txt(
'topitem_subentries'));
55 $this->
addColumn($this->lng->txt(
'topitem_css_id'));
56 $this->
addColumn($this->lng->txt(
'topitem_type'));
57 $this->
addColumn($this->lng->txt(
'topitem_provider'));
58 $this->
addColumn($this->lng->txt(
'topitem_actions'));
70 $renderer = $DIC->ui()->renderer();
73 $item_facade = $this->item_repository->repository()->getItemFacade($DIC->globalScreen()->identification()->fromSerializedIdentification($a_set[
'identification']));
76 $this->tpl->setVariable(
'ID', $item_facade->getId());
77 $this->tpl->setVariable(
'TITLE', $item_facade->getDefaultTitle());
78 $this->tpl->setVariable(
'SUBENTRIES', $item_facade->getAmountOfChildren());
79 $this->tpl->setVariable(
'TYPE', $item_facade->getTypeForPresentation());
80 $this->tpl->setVariable(
'CSS_ID',
"mm_" . $item_facade->identification()->getInternalIdentifier());
81 $this->tpl->setVariable(
'POSITION', $position * 10);
82 if ($item_facade->isActivated()) {
83 $this->tpl->touchBlock(
'is_active');
85 if ($item_facade->isAlwaysAvailable() || !$item_facade->isAvailable()) {
86 $this->tpl->touchBlock(
'is_active_blocked');
88 $this->tpl->setVariable(
'PROVIDER', $item_facade->getProviderNameForPresentation());
93 if ($this->access->hasUserPermissionTo(
'write')) {
94 if ($item_facade->isEditable()) {
100 $rendered_modal =
"";
101 if ($item_facade->isDeletable()) {
102 $ditem =
$factory->modal()->interruptiveItem($this->
hash($a_set[
'identification']), $item_facade->getDefaultTitle());
106 ->withAffectedItems([$ditem]);
110 $rendered_modal = $renderer->render([
$m]);
112 $this->tpl->setVariable(
'ACTIONS', $rendered_modal . $renderer->render([
$factory->dropdown()->standard($items)->withLabel($this->lng->txt(
'sub_actions'))]));
122 return $this->item_repository->getTopItems();
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setExternalSorting($a_val)
Set external sorting.
setExternalSegmentation($a_val)
Set external segmentation.
Class ilMMItemRepository.
Class ilMMTopItemGUI ilMMTopItemGUI: ilObjMainMenuGUI ilMMTopItemGUI: ilMMItemTranslationGUI.
__construct(ilMMTopItemGUI $a_parent_obj, ilMMItemRepository $item_repository, ilObjMainMenuAccess $access)
ilMMTopItemTableGUI constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
hash(StreamInterface $stream, $algo, $rawOutput=false)
Calculate a hash of a Stream.
Class ilMMTopItemTableGUI.