diff --git a/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php b/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php index 3cf44f9d83c2..c55a80a483eb 100644 --- a/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php +++ b/Modules/DataCollection/classes/Content/class.ilDclRecordListGUI.php @@ -34,6 +34,8 @@ class ilDclRecordListGUI private ilAccessHandler $access; private ilGlobalTemplateInterface $tpl; + protected \ILIAS\UI\Factory $ui_factory; + protected \ILIAS\UI\Renderer $renderer; /** * Stores current mode active @@ -47,7 +49,7 @@ class ilDclRecordListGUI protected static array $available_modes = [self::MODE_VIEW, self::MODE_MANAGE]; protected ilCtrl $ctrl; - protected ilToolbarGUI $ilToolbar; + protected ilToolbarGUI $toolbar; protected ilLanguage $lng; protected ilTabsGUI $tabs; protected ILIAS\HTTP\Services $http; @@ -62,7 +64,7 @@ public function __construct(ilObjDataCollectionGUI $a_parent_obj, int $table_id, global $DIC; $this->ctrl = $DIC->ctrl(); - $this->ilToolbar = $DIC->toolbar(); + $this->toolbar = $DIC->toolbar(); $this->lng = $DIC->language(); $this->tabs = $DIC->tabs(); $this->http = $DIC->http(); @@ -70,6 +72,8 @@ public function __construct(ilObjDataCollectionGUI $a_parent_obj, int $table_id, $this->irss = $DIC->resourceStorage(); $this->access = $DIC->access(); $this->tpl = $DIC->ui()->mainTemplate(); + $this->ui_factory = $DIC->ui()->factory(); + $this->renderer = $DIC->ui()->renderer(); $this->table_id = $table_id; $this->tableview_id = $tableview_id; @@ -147,11 +151,6 @@ public function executeCommand(): void public function listRecords(bool $use_tableview_filter = false): void { - global $DIC; - $ilToolbar = $DIC['ilToolbar']; - /** - * @var $ilToolbar ilToolbarGUI - */ $list = $this->getRecordListTableGUI($use_tableview_filter); $this->createSwitchers(); @@ -161,22 +160,23 @@ public function listRecords(bool $use_tableview_filter = false): void $this->table_id ) && $this->table_obj->hasCustomFields(); if ($permission_to_add_or_import) { - $this->ctrl->setParameterByClass("ildclrecordeditgui", "record_id", null); + $this->ctrl->setParameterByClass(ilDclRecordEditGUI::class, "record_id", null); - $add_new = ilLinkButton::getInstance(); - $add_new->setPrimary(true); - $add_new->setCaption("dcl_add_new_record"); - $add_new->setUrl($this->ctrl->getFormActionByClass("ildclrecordeditgui", "create")); - $ilToolbar->addStickyItem($add_new); + $add_new = $this->ui_factory->button()->primary( + $this->lng->txt("dcl_add_new_record"), + $this->ctrl->getFormActionByClass(ilDclRecordEditGUI::class, "create") + ); + $this->toolbar->addStickyItem($add_new); } if ($permission_to_add_or_import && $this->table_obj->getImportEnabled()) { - $this->ctrl->setParameterByClass("ildclrecordeditgui", "record_id", null); + $this->ctrl->setParameterByClass(ilDclRecordEditGUI::class, "record_id", null); - $import = ilLinkButton::getInstance(); - $import->setCaption("dcl_import_records .xls"); - $import->setUrl($this->ctrl->getFormActionByClass("ildclrecordlistgui", self::CMD_SHOW_IMPORT_EXCEL)); - $ilToolbar->addButtonInstance($import); + $import_button = $this->ui_factory->button()->standard( + $this->lng->txt("dcl_import_records .xls"), + $this->ctrl->getFormActionByClass(ilDclRecordListGUI::class, self::CMD_SHOW_IMPORT_EXCEL) + ); + $this->toolbar->addComponent($import_button); } if (count($this->table_obj->getRecordFields()) == 0) { @@ -285,7 +285,7 @@ public function endImport(int $i, array $warnings): void $output->setVariable("WARNING", $this->lng->txt("dcl_no_warnings")); $output->parseCurrentBlock(); } - $output->setVariable("BACK_LINK", $this->ctrl->getLinkTargetByClass("ilDclRecordListGUI", "listRecords")); + $output->setVariable("BACK_LINK", $this->ctrl->getLinkTargetByClass(ilDclRecordListGUI::class, "listRecords")); $output->setVariable("BACK", $this->lng->txt("back")); $this->tpl->setContent($output->get()); } @@ -311,7 +311,7 @@ public function doTableSwitch(): void public function doTableViewSwitch(): void { $tableview_id = $this->http->wrapper()->post()->retrieve('tableview_id', $this->refinery->kindlyTo()->int()); - $this->ctrl->setParameterByClass("ilObjDataCollectionGUI", "tableview_id", $tableview_id); + $this->ctrl->setParameterByClass(ilObjDataCollectionGUI::class, "tableview_id", $tableview_id); $this->ctrl->redirect($this, self::CMD_SHOW); } @@ -585,8 +585,7 @@ protected function getRecordListTableGUI(bool $use_tableview_filter): ilDclRecor protected function createSwitchers(): void { - $ilToolbar = $this->ilToolbar; - $ilToolbar->setFormAction($this->ctrl->getFormActionByClass("ilDclRecordListGUI", "doTableSwitch")); + $this->toolbar->setFormAction($this->ctrl->getFormActionByClass(ilDclRecordListGUI::class, "doTableSwitch")); //table switcher $options = $this->getAvailableTables(); @@ -595,13 +594,13 @@ protected function createSwitchers(): void $table_selection->setOptions($options); $table_selection->setValue($this->table_id); - $ilToolbar->addText($this->lng->txt("dcl_table")); - $ilToolbar->addInputItem($table_selection); + $this->toolbar->addText($this->lng->txt("dcl_table")); + $this->toolbar->addInputItem($table_selection); $button = ilSubmitButton::getInstance(); $button->setCaption('change'); $button->setCommand('doTableSwitch'); - $ilToolbar->addButtonInstance($button); - $ilToolbar->addSeparator(); + $this->toolbar->addButtonInstance($button); + $this->toolbar->addSeparator(); } //tableview switcher @@ -614,14 +613,10 @@ protected function createSwitchers(): void $tableview_selection = new ilSelectInputGUI('', 'tableview_id'); $tableview_selection->setOptions($options); $tableview_selection->setValue($this->tableview_id); - $ilToolbar->addText($this->lng->txt("dcl_tableview")); - $ilToolbar->addInputItem($tableview_selection); - - $button = ilSubmitButton::getInstance(); - $button->setCaption('change'); - $button->setCommand('doTableViewSwitch'); - $ilToolbar->addButtonInstance($button); - $ilToolbar->addSeparator(); + $this->toolbar->addText($this->lng->txt("dcl_tableview")); + $this->toolbar->addInputItem($tableview_selection); + $this->toolbar->addFormButton('change', 'doTableViewSwitch'); + $this->toolbar->addSeparator(); } } diff --git a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php index 580d51af4a89..380ca9958758 100644 --- a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php +++ b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php @@ -86,21 +86,25 @@ public function executeCommand(): string public function showPage(): string { if ($this->getOutputMode() == ilPageObjectGUI::EDIT) { - $delete_button = ilLinkButton::getInstance(); - $delete_button->setCaption('dcl_empty_detailed_view'); - $delete_button->setUrl($this->ctrl->getLinkTarget($this, 'confirmDelete')); - $this->toolbar->addButtonInstance($delete_button); + $delete_button = $this->ui->factory()->button()->standard( + $this->lng->txt('dcl_empty_detailed_view'), + $this->ctrl->getLinkTarget($this, 'confirmDelete') + ); + $this->toolbar->addComponent($delete_button); - $activation_button = ilLinkButton::getInstance(); if ($this->getPageObject()->getActive()) { - $activation_button->setCaption('dcl_deactivate_view'); - $activation_button->setUrl($this->ctrl->getLinkTarget($this, 'deactivate')); + $activation_button = $this->ui->factory()->button()->standard( + $this->lng->txt('dcl_deactivate_view'), + $this->ctrl->getLinkTarget($this, 'deactivate') + ); } else { - $activation_button->setCaption('dcl_activate_view'); - $activation_button->setUrl($this->ctrl->getLinkTarget($this, 'activate')); + $activation_button = $this->ui->factory()->button()->standard( + $this->lng->txt('dcl_activate_view'), + $this->ctrl->getLinkTarget($this, 'activate') + ); } - $this->toolbar->addButtonInstance($activation_button); + $this->toolbar->addComponent($activation_button); $legend = $this->getPageObject()->getAvailablePlaceholders(); if (sizeof($legend)) { diff --git a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php index 5db9f07051dd..b7fb19f6afa3 100644 --- a/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php +++ b/Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewGUI.php @@ -22,6 +22,8 @@ */ class ilDclDetailedViewGUI { + protected \ILIAS\UI\Factory $ui_factory; + protected \ILIAS\UI\Renderer $renderer; protected ILIAS\Style\Content\Object\ObjectFacade $content_style_domain; protected ilObjDataCollectionGUI $dcl_gui_object; protected ilNoteGUI $notes_gui; @@ -54,6 +56,8 @@ public function __construct(ilObjDataCollectionGUI $a_dcl_object, int $tableview $this->http = $DIC->http(); $this->refinery = $DIC->refinery(); $this->main_tpl = $DIC->ui()->mainTemplate(); + $this->ui_factory = $DIC->ui()->factory(); + $this->renderer = $DIC->ui()->renderer(); $this->record_id = null; if ($this->http->wrapper()->query()->has('record_id')) { @@ -94,8 +98,8 @@ public function __construct(ilObjDataCollectionGUI $a_dcl_object, int $tableview $this->notesGUI = new ilNoteGUI($repId, $objId); $this->notesGUI->enablePublicNotes(); $this->notesGUI->enablePublicNotesDeletion(); - $this->ctrl->setParameterByClass("ilnotegui", "record_id", $this->record_id); - $this->ctrl->setParameterByClass("ilnotegui", "rep_id", $repId); + $this->ctrl->setParameterByClass(ilNoteGUI::class, "record_id", $this->record_id); + $this->ctrl->setParameterByClass(ilNoteGUI::class, "rep_id", $repId); $this->tableview_id = $tableview_id; @@ -245,14 +249,15 @@ public function renderRecord(bool $editComments = false): void $ref_id = $this->http->wrapper()->query()->retrieve('ref_id', $this->refinery->kindlyTo()->int()); if ($this->record_obj->hasPermissionToEdit($ref_id)) { - $button = ilLinkButton::getInstance(); - $ilCtrl->setParameterByClass('ildclrecordeditgui', 'table_id', $this->table->getId()); - $ilCtrl->setParameterByClass('ildclrecordeditgui', 'tableview_id', $this->tableview_id); - $ilCtrl->setParameterByClass('ildclrecordeditgui', 'redirect', ilDclRecordEditGUI::REDIRECT_DETAIL); - $ilCtrl->saveParameterByClass('ildclrecordeditgui', 'record_id'); - $button->setUrl($ilCtrl->getLinkTargetByClass('ildclrecordeditgui', 'edit')); - $button->setCaption($this->lng->txt('dcl_edit_record'), false); - $rctpl->setVariable('EDIT_RECORD_BUTTON', $button->render()); + $ilCtrl->setParameterByClass(ilDclRecordEditGUI::class, 'table_id', $this->table->getId()); + $ilCtrl->setParameterByClass(ilDclRecordEditGUI::class, 'tableview_id', $this->tableview_id); + $ilCtrl->setParameterByClass(ilDclRecordEditGUI::class, 'redirect', ilDclRecordEditGUI::REDIRECT_DETAIL); + $ilCtrl->saveParameterByClass(ilDclRecordEditGUI::class, 'record_id'); + $edit_button = $this->ui_factory->button()->standard( + $this->lng->txt('dcl_edit_record'), + $ilCtrl->getLinkTargetByClass(ilDclRecordEditGUI::class, 'edit') + ); + $rctpl->setVariable('EDIT_RECORD_BUTTON', $this->renderer->render($edit_button)); } // Comments diff --git a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldModel.php b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldModel.php index d9744242b8b9..a8b8ce20fa3e 100644 --- a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldModel.php +++ b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceFieldModel.php @@ -27,12 +27,9 @@ public function getRecordQuerySortObject( string $direction = "asc", bool $sort_by_status = false ): ilDclRecordQueryObject { - global $DIC; - $ilDB = $DIC['ilDB']; - $join_str = "LEFT JOIN il_dcl_record_field AS sort_record_field_{$this->getId()} ON (sort_record_field_{$this->getId()}.record_id = record.id AND sort_record_field_{$this->getId()}.field_id = " - . $ilDB->quote($this->getId(), 'integer') . ") "; + . $this->db->quote($this->getId(), 'integer') . ") "; $join_str .= "LEFT JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS sort_stloc_{$this->getId()} ON (sort_stloc_{$this->getId()}.record_field_id = sort_record_field_{$this->getId()}.id) "; $join_str .= "LEFT JOIN object_reference AS sort_object_reference_{$this->getId()} ON (sort_object_reference_{$this->getId()}.ref_id = sort_stloc_{$this->getId()}.value AND sort_object_reference_{$this->getId()}.deleted IS NULL)"; $join_str .= "LEFT JOIN object_data AS sort_object_data_{$this->getId()} ON (sort_object_data_{$this->getId()}.obj_id = sort_object_reference_{$this->getId()}.obj_id)"; @@ -41,7 +38,7 @@ public function getRecordQuerySortObject( global $DIC; $ilUser = $DIC['ilUser']; $join_str .= "LEFT JOIN ut_lp_marks AS ut ON (ut.obj_id = sort_object_data_{$this->getId()}.obj_id AND ut.usr_id = " - . $ilDB->quote($ilUser->getId(), 'integer') . ") "; + . $this->db->quote($ilUser->getId(), 'integer') . ") "; } $select_str = (!$sort_by_status) ? " sort_object_data_{$this->getId()}.title AS field_{$this->getId()}," : " ut.status AS field_{$this->getId()}"; diff --git a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordRepresentation.php b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordRepresentation.php index b0c7ec6871a6..b156a40db203 100644 --- a/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordRepresentation.php +++ b/Modules/DataCollection/classes/Fields/IliasReference/class.ilDclIliasReferenceRecordRepresentation.php @@ -58,24 +58,28 @@ public function getSingleHTML(array $options = null, bool $link = true): string public function getLinkHTML(string $title, bool $show_action_menu = false): string { - $lng = $this->lng; $link = ilLink::_getStaticLink($this->getRecordField()->getValue()); if ($show_action_menu) { $field = $this->getRecordField()->getField(); - $record = $this->getRecordField()->getRecord(); - - $list = new ilAdvancedSelectionListGUI(); - $list->setId('adv_list_copy_link_' . $field->getId() . $record->getId()); - $list->setListTitle($title); + $dropdown_items = []; if ($field->getProperty(ilDclBaseFieldModel::PROP_ILIAS_REFERENCE_LINK)) { - $list->addItem($lng->txt('view'), 'view', $link); + $dropdown_items[] = $this->factory->link()->standard( + $this->lng->txt('view'), + $link + ); } - $list->addItem($lng->txt('copy'), 'copy', $this->getActionLink('copy')); - $list->addItem($lng->txt('link'), 'link', $this->getActionLink('link')); - - return $list->getHTML(); + $dropdown_items[] = $this->factory->link()->standard( + $this->lng->txt('link'), + $this->getActionLink('link') + ); + $dropdown_items[] = $this->factory->link()->standard( + $this->lng->txt('copy'), + $this->getActionLink('copy') + ); + $dropdown = $this->factory->dropdown()->standard($dropdown_items)->withLabel($title); + return $this->renderer->render($dropdown); } else { - return "$title"; + return $this->renderer->render($this->factory->link()->standard($title, $link)); } } @@ -84,18 +88,15 @@ public function getLinkHTML(string $title, bool $show_action_menu = false): stri */ protected function getActionLink(string $mode): string { - global $DIC; - $ilCtrl = $DIC['ilCtrl']; - switch ($mode) { case 'copy': - $ilCtrl->setParameterByClass('ilobjectcopygui', 'item_ref_id', $this->getRecordField()->getValue()); - $ilCtrl->setParameterByClass('ilobjrootfoldergui', 'item_ref_id', $this->getRecordField()->getValue()); - $ilCtrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getRecordField()->getValue()); + $this->ctrl->setParameterByClass(ilObjectCopyGUI::class, 'item_ref_id', $this->getRecordField()->getValue()); + $this->ctrl->setParameterByClass(ilObjRootFolderGUI::class, 'item_ref_id', $this->getRecordField()->getValue()); + $this->ctrl->setParameterByClass(ilObjectCopyGUI::class, 'source_id', $this->getRecordField()->getValue()); - return $ilCtrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection'); + return $this->ctrl->getLinkTargetByClass(ilObjectCopyGUI::class, 'initTargetSelection'); case 'link': - return $ilCtrl->getLinkTargetByClass(['ilrepositorygui', 'ilobjrootfoldergui'], 'link'); + return $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, ilObjRootFolderGUI::class], 'link'); default: return ''; } diff --git a/Modules/DataCollection/classes/Fields/class.ilDclFieldListGUI.php b/Modules/DataCollection/classes/Fields/class.ilDclFieldListGUI.php index ac641c62915b..46ce6051c833 100644 --- a/Modules/DataCollection/classes/Fields/class.ilDclFieldListGUI.php +++ b/Modules/DataCollection/classes/Fields/class.ilDclFieldListGUI.php @@ -21,6 +21,8 @@ class ilDclFieldListGUI { + protected \ILIAS\UI\Factory $ui_factory; + protected \ILIAS\UI\Renderer $renderer; protected ilCtrl $ctrl; protected ilLanguage $lng; protected ilToolbarGUI $toolbar; @@ -50,17 +52,19 @@ public function __construct(ilDclTableListGUI $a_parent_obj) $this->tpl = $DIC->ui()->mainTemplate(); $this->tabs = $DIC->tabs(); $this->toolbar = $DIC->toolbar(); + $this->ui_factory = $DIC->ui()->factory(); + $this->renderer = $DIC->ui()->renderer(); - $this->ctrl->saveParameterByClass('ilDclTableEditGUI', 'table_id'); + $this->ctrl->saveParameterByClass(ilDclTableEditGUI::class, 'table_id'); $locator->addItem( ilDclCache::getTableCache($this->table_id)->getTitle(), - $this->ctrl->getLinkTargetByClass('ilDclTableEditGUI', 'edit') + $this->ctrl->getLinkTargetByClass(ilDclTableEditGUI::class, 'edit') ); $this->tpl->setLocator(); if (!$this->checkAccess()) { $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true); - $this->ctrl->redirectByClass('ildclrecordlistgui', 'listRecords'); + $this->ctrl->redirectByClass(ilDclRecordListGUI::class, 'listRecords'); } } @@ -177,10 +181,10 @@ public function save(): void public function listFields(): void { //add button - $add_new = ilLinkButton::getInstance(); - $add_new->setPrimary(true); - $add_new->setCaption("dcl_add_new_field"); - $add_new->setUrl($this->ctrl->getLinkTargetByClass('ildclfieldeditgui', 'create')); + $add_new = $this->ui_factory->button()->primary( + $this->lng->txt("dcl_add_new_field"), + $this->ctrl->getLinkTargetByClass(ilDclFieldEditGUI::class, 'create') + ); $this->toolbar->addStickyItem($add_new); $this->toolbar->addSeparator(); @@ -196,7 +200,7 @@ public function listFields(): void $table_selection->setOptions($options); $table_selection->setValue($this->table_id); - $this->toolbar->setFormAction($this->ctrl->getFormActionByClass("ilDclFieldListGUI", "doTableSwitch")); + $this->toolbar->setFormAction($this->ctrl->getFormActionByClass(ilDclFieldListGUI::class, "doTableSwitch")); $this->toolbar->addText($this->lng->txt("dcl_select")); $this->toolbar->addInputItem($table_selection); $this->toolbar->addFormButton($this->lng->txt('change'), 'doTableSwitch'); @@ -212,8 +216,8 @@ public function listFields(): void public function doTableSwitch(): void { $table_id = $this->http->wrapper()->post()->retrieve('table_id', $this->refinery->kindlyTo()->int()); - $this->ctrl->setParameterByClass("ilObjDataCollectionGUI", "table_id", $table_id); - $this->ctrl->redirectByClass("ilDclFieldListGUI", "listFields"); + $this->ctrl->setParameterByClass(ilObjDataCollectionGUI::class, "table_id", $table_id); + $this->ctrl->redirectByClass(ilDclFieldListGUI::class, "listFields"); } protected function checkAccess(): bool diff --git a/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php b/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php index 084c2741e9c0..b5b375885f03 100644 --- a/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php +++ b/Modules/DataCollection/classes/Fields/class.ilDclFieldListTableGUI.php @@ -30,16 +30,14 @@ class ilDclFieldListTableGUI extends ilTable2GUI protected ilDclTable $table; protected \ILIAS\UI\Renderer $renderer; - protected \ILIAS\UI\Factory $factory; + protected \ILIAS\UI\Factory $ui_factory; public function __construct(ilDclFieldListGUI $a_parent_obj, string $a_parent_cmd, int $table_id) { global $DIC; - $lng = $DIC['lng']; - $ilCtrl = $DIC['ilCtrl']; - $this->factory = $DIC->ui()->factory(); + $this->ui_factory = $DIC->ui()->factory(); $this->renderer = $DIC->ui()->renderer(); parent::__construct($a_parent_obj, $a_parent_cmd); @@ -49,26 +47,26 @@ public function __construct(ilDclFieldListGUI $a_parent_obj, string $a_parent_cm $this->setId('dcl_field_list'); $this->addColumn('', '', '1', true); - $this->addColumn($lng->txt('dcl_order'), '', '30px'); - $this->addColumn($lng->txt('dcl_fieldtitle'), '', 'auto'); - $this->addColumn($lng->txt('dcl_in_export'), '', '30px'); - $this->addColumn($lng->txt('dcl_description'), '', 'auto'); - $this->addColumn($lng->txt('dcl_field_datatype'), '', 'auto'); - $this->addColumn($lng->txt('dcl_unique'), '', 'auto'); - $this->addColumn($lng->txt('actions'), '', '30px'); + $this->addColumn($this->lng->txt('dcl_order'), '', '30px'); + $this->addColumn($this->lng->txt('dcl_fieldtitle'), '', 'auto'); + $this->addColumn($this->lng->txt('dcl_in_export'), '', '30px'); + $this->addColumn($this->lng->txt('dcl_description'), '', 'auto'); + $this->addColumn($this->lng->txt('dcl_field_datatype'), '', 'auto'); + $this->addColumn($this->lng->txt('dcl_unique'), '', 'auto'); + $this->addColumn($this->lng->txt('actions'), '', '30px'); // Only add mutli command for custom fields if (count($this->table->getRecordFields())) { $this->setSelectAllCheckbox('dcl_field_ids[]'); - $this->addMultiCommand('confirmDeleteFields', $lng->txt('dcl_delete_fields')); + $this->addMultiCommand('confirmDeleteFields', $this->lng->txt('dcl_delete_fields')); } - $ilCtrl->setParameterByClass('ildclfieldeditgui', 'table_id', $this->parent_obj->getTableId()); - $ilCtrl->setParameterByClass('ildclfieldlistgui', 'table_id', $this->parent_obj->getTableId()); + $this->ctrl->setParameterByClass('ildclfieldeditgui', 'table_id', $this->parent_obj->getTableId()); + $this->ctrl->setParameterByClass('ildclfieldlistgui', 'table_id', $this->parent_obj->getTableId()); - $this->setFormAction($ilCtrl->getFormActionByClass('ildclfieldlistgui')); - $this->addCommandButton('save', $lng->txt('dcl_save')); + $this->setFormAction($this->ctrl->getFormActionByClass('ildclfieldlistgui')); + $this->addCommandButton('save', $this->lng->txt('dcl_save')); - $this->setFormAction($ilCtrl->getFormAction($a_parent_obj)); + $this->setFormAction($this->ctrl->getFormAction($a_parent_obj)); $this->setFormName('field_list'); //those two are important as we get our data as objects not as arrays. @@ -83,7 +81,7 @@ public function __construct(ilDclFieldListGUI $a_parent_obj, string $a_parent_cm $this->setEnableTitle(true); $this->setDefaultOrderDirection('asc'); - $this->setTitle($lng->txt('dcl_table_list_fields')); + $this->setTitle($this->lng->txt('dcl_table_list_fields')); $this->setRowTemplate('tpl.field_list_row.html', 'Modules/DataCollection'); $this->setStyle('table', $this->getStyle('table') . ' ' . 'dcl_record_list'); @@ -95,9 +93,6 @@ public function __construct(ilDclFieldListGUI $a_parent_obj, string $a_parent_cm */ public function getHTML(): string { - $lng = $this->lng; - $ilCtrl = $this->ctrl; - if ($this->getExportMode()) { $this->exportData($this->getExportMode(), true); } @@ -105,7 +100,7 @@ public function getHTML(): string $this->prepareOutput(); if (is_object($this->getParentObject()) && $this->getId() == "") { - $ilCtrl->saveParameter($this->getParentObject(), $this->getNavParameter()); + $this->ctrl->saveParameter($this->getParentObject(), $this->getNavParameter()); } if (!$this->getPrintMode()) { @@ -190,7 +185,7 @@ public function getHTML(): string // add standard no items text (please tell me, if it messes something up, alex, 29.8.2008) $no_items_text = (trim($this->getNoEntriesText()) != '') ? $this->getNoEntriesText() - : $lng->txt("no_items"); + : $this->lng->txt("no_items"); $this->css_row = ($this->css_row !== "tblrow1") ? "tblrow1" @@ -218,10 +213,6 @@ public function getHTML(): string public function fillRowFromObject(ilDclBaseFieldModel $a_set): void { - global $DIC; - $lng = $DIC['lng']; - $ilCtrl = $DIC['ilCtrl']; - if (!$a_set->isStandardField()) { $this->tpl->setVariable('FIELD_ID', $a_set->getId()); } @@ -255,35 +246,37 @@ public function fillRowFromObject(ilDclBaseFieldModel $a_set): void if (!$a_set->isStandardField()) { if ($a_set->isUnique()) { - $icon = $this->factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_ok_monochrome.svg'), $this->lng->txt("yes")); + $icon = $this->ui_factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_ok_monochrome.svg'), $this->lng->txt("yes")); } else { - $icon = $this->factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_not_ok_monochrome.svg'), $this->lng->txt("no")); + $icon = $this->ui_factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_not_ok_monochrome.svg'), $this->lng->txt("no")); } $this->tpl->setVariable('ICON_UNIQUE', $this->renderer->render($icon)); } else { $this->tpl->setVariable('NO_UNIQUE'); } - $ilCtrl->setParameterByClass('ildclfieldeditgui', 'field_id', $a_set->getId()); + $this->ctrl->setParameterByClass('ildclfieldeditgui', 'field_id', $a_set->getId()); if (!$a_set->isStandardField()) { - $alist = new ilAdvancedSelectionListGUI(); - $alist->setId($a_set->getId()); - $alist->setListTitle($lng->txt('actions')); - if (ilObjDataCollectionAccess::hasAccessToFields( $this->parent_obj->getDataCollectionObject()->getRefId(), $this->table->getId() )) { - $alist->addItem($lng->txt('edit'), 'edit', $ilCtrl->getLinkTargetByClass('ildclfieldeditgui', 'edit')); - $alist->addItem( - $lng->txt('delete'), - 'delete', - $ilCtrl->getLinkTargetByClass('ildclfieldeditgui', 'confirmDelete') + $dropdown_items = []; + $dropdown_items[] = $this->ui_factory->link()->standard( + $this->lng->txt('edit'), + $this->ctrl->getLinkTargetByClass(ilDclFieldEditGUI::class, 'edit') ); - } + $dropdown_items[] = $this->ui_factory->link()->standard( + $this->lng->txt('delete'), + $this->ctrl->getLinkTargetByClass(ilDclFieldEditGUI::class, 'confirmDelete') + ); + $dropdown = $this->ui_factory->dropdown()->standard($dropdown_items)->withLabel($this->lng->txt('actions')); - $this->tpl->setVariable('ACTIONS', $alist->getHTML()); + $this->tpl->setVariable('ACTIONS', $this->renderer->render($dropdown)); + } else { + $this->tpl->setVariable('ACTIONS'); + } } } } diff --git a/Modules/DataCollection/classes/Table/class.ilDclTableEditGUI.php b/Modules/DataCollection/classes/Table/class.ilDclTableEditGUI.php index 6093bc7d16fb..7777ad23b563 100644 --- a/Modules/DataCollection/classes/Table/class.ilDclTableEditGUI.php +++ b/Modules/DataCollection/classes/Table/class.ilDclTableEditGUI.php @@ -436,10 +436,7 @@ protected function createTableSwitcher(): array $this->toolbar->setFormAction($this->ctrl->getFormActionByClass("ilDclTableEditGUI", "doTableSwitch")); $this->toolbar->addText($this->lng->txt("dcl_select")); $this->toolbar->addInputItem($table_selection); - $button = ilSubmitButton::getInstance(); - $button->setCommand("doTableSwitch"); - $button->setCaption('change'); - $this->toolbar->addButtonInstance($button); + $this->toolbar->addFormButton('change', "doTableSwitch"); return $options; } diff --git a/Modules/DataCollection/classes/Table/class.ilDclTableListGUI.php b/Modules/DataCollection/classes/Table/class.ilDclTableListGUI.php index b919009b667e..3970af3ec4b4 100644 --- a/Modules/DataCollection/classes/Table/class.ilDclTableListGUI.php +++ b/Modules/DataCollection/classes/Table/class.ilDclTableListGUI.php @@ -23,9 +23,11 @@ */ class ilDclTableListGUI { + protected \ILIAS\UI\Factory $ui_factory; + protected \ILIAS\UI\Renderer $renderer; protected ilCtrl $ctrl; protected ilLanguage $lng; - protected ilGlobalPageTemplate $tpl; + protected ilGlobalTemplateInterface $tpl; protected ilTabsGUI $tabs; protected ilToolbarGUI $toolbar; protected ILIAS\HTTP\Services $http; @@ -41,11 +43,15 @@ public function __construct(ilObjDataCollectionGUI $a_parent_obj) { global $DIC; $main_tpl = $DIC->ui()->mainTemplate(); - $ilCtrl = $DIC['ilCtrl']; - $lng = $DIC['lng']; - $tpl = $DIC['tpl']; - $ilTabs = $DIC['ilTabs']; - $ilToolbar = $DIC['ilToolbar']; + $this->ctrl = $DIC->ctrl(); + $this->lng = $DIC->language(); + $this->tpl = $DIC->ui()->mainTemplate(); + $this->tabs = $DIC->tabs(); + $this->toolbar = $DIC->toolbar(); + $this->http = $DIC->http(); + $this->refinery = $DIC->refinery(); + $this->ui_factory = $DIC->ui()->factory(); + $this->renderer = $DIC->ui()->renderer(); $this->parent_obj = $a_parent_obj; $this->obj_id = 0; @@ -53,13 +59,7 @@ public function __construct(ilObjDataCollectionGUI $a_parent_obj) $this->obj_id = ilObject::_lookupObjectId($a_parent_obj->getRefId()); } - $this->ctrl = $ilCtrl; - $this->lng = $lng; - $this->tpl = $tpl; - $this->tabs = $ilTabs; - $this->toolbar = $ilToolbar; - $this->http = $DIC->http(); - $this->refinery = $DIC->refinery(); + if (!$this->checkAccess()) { $main_tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true); @@ -155,10 +155,11 @@ public function executeCommand(): void public function listTables(): void { - $add_new = ilLinkButton::getInstance(); - $add_new->setPrimary(true); - $add_new->setCaption("dcl_add_new_table"); - $add_new->setUrl($this->ctrl->getLinkTargetByClass('ilDclTableEditGUI', 'create')); + + $add_new = $this->ui_factory->button()->primary( + $this->lng->txt("dcl_add_new_table"), + $this->ctrl->getLinkTargetByClass('ilDclTableEditGUI', 'create') + ); $this->toolbar->addStickyItem($add_new); $table_gui = new ilDclTableListTableGUI($this); diff --git a/Modules/DataCollection/classes/Table/class.ilDclTableListTableGUI.php b/Modules/DataCollection/classes/Table/class.ilDclTableListTableGUI.php index 8d630a10aa40..89114eb3f020 100644 --- a/Modules/DataCollection/classes/Table/class.ilDclTableListTableGUI.php +++ b/Modules/DataCollection/classes/Table/class.ilDclTableListTableGUI.php @@ -20,43 +20,45 @@ class ilDclTableListTableGUI extends ilTable2GUI { + protected \ILIAS\UI\Factory $ui_factory; + protected \ILIAS\UI\Renderer $renderer; + /** * ilDclTableListTableGUI constructor. */ public function __construct(ilDclTableListGUI $parent_obj) { global $DIC; - $lng = $DIC['lng']; - $ilCtrl = $DIC['ilCtrl']; + + $this->ui_factory = $DIC->ui()->factory(); + $this->renderer = $DIC->ui()->renderer(); parent::__construct($parent_obj); $this->parent_obj = $parent_obj; - $this->ctrl = $ilCtrl; - $this->lng = $lng; $this->setId('dcl_table_list'); $this->addColumn('', '', '1', true); - $this->addColumn($lng->txt('dcl_order'), "", '30px'); - $this->addColumn($lng->txt('title'), "", 'auto'); - $this->addColumn($lng->txt('dcl_visible'), "", '250px', false, '', $this->lng->txt('dcl_visible_desc')); + $this->addColumn($this->lng->txt('dcl_order'), "", '30px'); + $this->addColumn($this->lng->txt('title'), "", 'auto'); + $this->addColumn($this->lng->txt('dcl_visible'), "", '250px', false, '', $this->lng->txt('dcl_visible_desc')); $this->addColumn( - $lng->txt('dcl_comments'), + $this->lng->txt('dcl_comments'), "", '200px', false, '', $this->lng->txt('dcl_public_comments_desc') ); - $this->addColumn($lng->txt('actions'), "", '30px'); + $this->addColumn($this->lng->txt('actions'), "", '30px'); $this->setSelectAllCheckbox('dcl_table_ids[]'); - $this->addMultiCommand('confirmDeleteTables', $lng->txt('dcl_delete_tables')); + $this->addMultiCommand('confirmDeleteTables', $this->lng->txt('dcl_delete_tables')); - $this->setFormAction($ilCtrl->getFormActionByClass('ildcltablelistgui')); - $this->addCommandButton('save', $lng->txt('dcl_save')); + $this->setFormAction($this->ctrl->getFormActionByClass(ilDclTableListGUI::class)); + $this->addCommandButton('save', $this->lng->txt('dcl_save')); - $this->setFormAction($ilCtrl->getFormAction($parent_obj)); + $this->setFormAction($this->ctrl->getFormAction($parent_obj)); $this->setFormName('table_list'); //those two are important as we get our data as objects not as arrays. @@ -71,7 +73,7 @@ public function __construct(ilDclTableListGUI $parent_obj) $this->setEnableTitle(true); $this->setDefaultOrderDirection('asc'); - $this->setTitle($lng->txt('dcl_table_list_tables')); + $this->setTitle($this->lng->txt('dcl_table_list_tables')); $this->setRowTemplate('tpl.table_list_row.html', 'Modules/DataCollection'); $this->setStyle('table', $this->getStyle('table') . ' ' . 'dcl_record_list'); @@ -84,9 +86,6 @@ public function __construct(ilDclTableListGUI $parent_obj) */ public function getHTML(): string { - $lng = $this->lng; - $ilCtrl = $this->ctrl; - if ($this->getExportMode()) { $this->exportData($this->getExportMode(), true); } @@ -94,7 +93,7 @@ public function getHTML(): string $this->prepareOutput(); if (is_object($this->getParentObject()) && $this->getId() == "") { - $ilCtrl->saveParameter($this->getParentObject(), $this->getNavParameter()); + $this->ctrl->saveParameter($this->getParentObject(), $this->getNavParameter()); } if (!$this->getPrintMode()) { @@ -179,7 +178,7 @@ public function getHTML(): string // add standard no items text (please tell me, if it messes something up, alex, 29.8.2008) $no_items_text = (trim($this->getNoEntriesText()) != '') ? $this->getNoEntriesText() - : $lng->txt("no_items"); + : $this->lng->txt("no_items"); $this->css_row = ($this->css_row !== "tblrow1") ? "tblrow1" @@ -212,8 +211,8 @@ public function fillRowFromObject(ilDclTable $a_set): void $this->tpl->setVariable("ORDER_VALUE", $a_set->getOrder()); $this->tpl->setVariable("TITLE", $a_set->getTitle()); - $this->ctrl->setParameterByClass('ildclfieldlistgui', 'table_id', $a_set->getId()); - $this->tpl->setVariable("TITLE_LINK", $this->ctrl->getLinkTargetByClass('ildclfieldlistgui')); + $this->ctrl->setParameterByClass(ilDclFieldListGUI::class, 'table_id', $a_set->getId()); + $this->tpl->setVariable("TITLE_LINK", $this->ctrl->getLinkTargetByClass(ilDclFieldListGUI::class)); $this->tpl->setVariable("CHECKBOX_NAME_VISIBLE", 'visible[' . $a_set->getId() . ']'); if ($a_set->getIsVisible()) { @@ -228,29 +227,31 @@ public function fillRowFromObject(ilDclTable $a_set): void protected function buildActions(int $id): string { - $alist = new ilAdvancedSelectionListGUI(); - $alist->setId((string) $id); - $alist->setListTitle($this->lng->txt('actions')); - $this->ctrl->setParameterByClass('ildclfieldlistgui', 'table_id', $id); - $this->ctrl->setParameterByClass('ildcltableviewgui', 'table_id', $id); - $this->ctrl->setParameterByClass('ildcltableeditgui', 'table_id', $id); - $alist->addItem( + $dropdown_items = []; + + $this->ctrl->setParameterByClass(ilDclFieldListGUI::class, 'table_id', $id); + $this->ctrl->setParameterByClass(ilDclTableViewGUI::class, 'table_id', $id); + $this->ctrl->setParameterByClass(ilDclTableEditGUI::class, 'table_id', $id); + + $dropdown_items[] = $this->ui_factory->link()->standard( $this->lng->txt('settings'), - '', - $this->ctrl->getLinkTargetByClass('ildcltableeditgui', 'edit') + $this->ctrl->getLinkTargetByClass(ilDclTableEditGUI::class, 'edit') ); - $alist->addItem( + $dropdown_items[] = $this->ui_factory->link()->standard( $this->lng->txt('dcl_list_fields'), - '', - $this->ctrl->getLinkTargetByClass('ildclfieldlistgui', 'listFields') + $this->ctrl->getLinkTargetByClass(ilDclFieldListGUI::class, 'listFields') + ); + $dropdown_items[] = $this->ui_factory->link()->standard( + $this->lng->txt('dcl_tableviews'), + $this->ctrl->getLinkTargetByClass(ilDclTableViewGUI::class) ); - $alist->addItem($this->lng->txt('dcl_tableviews'), '', $this->ctrl->getLinkTargetByClass('ildcltableviewgui')); - $alist->addItem( + $dropdown_items[] = $this->ui_factory->link()->standard( $this->lng->txt('delete'), - '', - $this->ctrl->getLinkTargetByClass('ildcltableeditgui', 'confirmDelete') + $this->ctrl->getLinkTargetByClass(ilDclTableEditGUI::class, 'confirmDelete') ); - return $alist->getHTML(); + $dropdown = $this->ui_factory->dropdown()->standard($dropdown_items)->withLabel($this->lng->txt('actions')); + + return $this->renderer->render($dropdown); } } diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewGUI.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewGUI.php index a7e10744550b..be4239ab7638 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewGUI.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewGUI.php @@ -23,6 +23,8 @@ */ class ilDclTableViewGUI { + protected \ILIAS\UI\Factory $ui_factory; + protected \ILIAS\UI\Renderer $renderer; protected ilCtrl $ctrl; protected ilLanguage $lng; protected ilToolbarGUI $toolbar; @@ -51,6 +53,8 @@ public function __construct(ilDclTableListGUI $a_parent_obj, int $table_id = 0) $this->toolbar = $DIC->toolbar(); $this->http = $DIC->http(); $this->refinery = $DIC->refinery(); + $this->ui_factory = $DIC->ui()->factory(); + $this->renderer = $DIC->ui()->renderer(); if ($table_id == 0) { $table_id = $this->http->wrapper()->query()->retrieve('table_id', $this->refinery->kindlyTo()->int()); @@ -114,10 +118,10 @@ protected function checkAccess(): bool public function show(): void { - $add_new = ilLinkButton::getInstance(); - $add_new->setPrimary(true); - $add_new->setCaption("dcl_add_new_view"); - $add_new->setUrl($this->ctrl->getLinkTargetByClass('ilDclTableViewEditGUI', 'add')); + $add_new = $this->ui_factory->button()->primary( + $this->lng->txt("dcl_add_new_view"), + $this->ctrl->getLinkTargetByClass('ilDclTableViewEditGUI', 'add') + ); $this->toolbar->addStickyItem($add_new); $this->toolbar->addSeparator(); @@ -136,10 +140,7 @@ public function show(): void $this->toolbar->setFormAction($this->ctrl->getFormActionByClass("ilDclTableViewGUI", "doTableSwitch")); $this->toolbar->addText($this->lng->txt("dcl_select")); $this->toolbar->addInputItem($table_selection); - $button = ilSubmitButton::getInstance(); - $button->setCommand("doTableSwitch"); - $button->setCaption('change'); - $this->toolbar->addButtonInstance($button); + $this->toolbar->addFormButton('change', "doTableSwitch"); $table_gui = new ilDclTableViewTableGUI($this, 'show', $this->table, $this->getParentObj()->getRefId()); $this->tpl->setContent($table_gui->getHTML()); diff --git a/Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php b/Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php index 745c67254a40..e478e5fa7ac1 100644 --- a/Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php +++ b/Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php @@ -23,13 +23,13 @@ class ilDclTableViewTableGUI extends ilTable2GUI protected ilDclTable $table; protected \ILIAS\UI\Renderer $renderer; - protected \ILIAS\UI\Factory $factory; + protected \ILIAS\UI\Factory $ui_factory; public function __construct(object $a_parent_obj, string $a_parent_cmd, ilDclTable $table, int $ref_id) { global $DIC; - $this->factory = $DIC->ui()->factory(); + $this->ui_factory = $DIC->ui()->factory(); $this->renderer = $DIC->ui()->renderer(); parent::__construct($a_parent_obj, $a_parent_cmd); @@ -43,8 +43,8 @@ public function __construct(object $a_parent_obj, string $a_parent_cmd, ilDclTab $this->setExternalSorting(true); if ($this->parent_obj instanceof ilDclTableViewGUI) { - $this->ctrl->setParameterByClass('ildcltableviewgui', 'table_id', $table->getId()); - $this->setFormAction($this->ctrl->getFormActionByClass('ildcltableviewgui')); + $this->ctrl->setParameterByClass(ilDclTableViewGUI::class, 'table_id', $table->getId()); + $this->setFormAction($this->ctrl->getFormActionByClass(ilDclTableViewGUI::class)); $this->addMultiCommand('confirmDeleteTableviews', $this->lng->txt('dcl_delete_views')); $this->addCommandButton('saveTableViewOrder', $this->lng->txt('dcl_save_order')); @@ -214,13 +214,13 @@ public function fillRowFromObject(ilDclTableView $a_set): void $this->tpl->setVariable("ORDER_VALUE", $a_set->getOrder()); } $this->tpl->setVariable("TITLE", $a_set->getTitle()); - $this->ctrl->setParameterByClass('ildcltablevieweditgui', 'tableview_id', $a_set->getId()); + $this->ctrl->setParameterByClass(ilDclTableViewEditGUI::class, 'tableview_id', $a_set->getId()); $this->tpl->setVariable("TITLE_LINK", $this->ctrl->getLinkTargetByClass('ildcltablevieweditgui')); $this->tpl->setVariable("DESCRIPTION", $a_set->getDescription()); - $icon = $this->factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_not_ok_monochrome.svg'), $this->lng->txt("yes")); + $icon = $this->ui_factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_not_ok_monochrome.svg'), $this->lng->txt("yes")); if ($a_set->validateConfigCompletion()) { - $icon = $this->factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_ok_monochrome.svg'), $this->lng->txt("no")); + $icon = $this->ui_factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_ok_monochrome.svg'), $this->lng->txt("no")); } $this->tpl->setVariable("ICON_CONFIG", $this->renderer->render($icon)); $this->tpl->setVariable('ACTIONS', $this->buildAction($a_set->getId())); @@ -232,34 +232,32 @@ public function fillRowFromObject(ilDclTableView $a_set): void protected function buildAction(int $id): string { if ($this->parent_obj instanceof ilDclTableViewGUI) { - $alist = new ilAdvancedSelectionListGUI(); - $alist->setId((string) $id); - $alist->setListTitle($this->lng->txt('actions')); - $this->ctrl->setParameterByClass('ildcltableviewgui', 'tableview_id', $id); - $this->ctrl->setParameterByClass('ilDclDetailedViewDefinitionGUI', 'tableview_id', $id); - $alist->addItem( + $dropdown_items = []; + + $this->ctrl->setParameterByClass(ilDclTableViewGUI::class, 'tableview_id', $id); + $this->ctrl->setParameterByClass(ilDclDetailedViewDefinitionGUI::class, 'tableview_id', $id); + + $dropdown_items[] = $this->ui_factory->link()->standard( $this->lng->txt('edit'), - '', - $this->ctrl->getLinkTargetByClass('ildcltablevieweditgui', 'editGeneralSettings') + $this->ctrl->getLinkTargetByClass(ilDclTableViewEditGUI::class, 'editGeneralSettings') ); - $alist->addItem( + $dropdown_items[] = $this->ui_factory->link()->standard( $this->lng->txt('copy'), - '', - $this->ctrl->getLinkTargetByClass('ildcltablevieweditgui', 'copy') + $this->ctrl->getLinkTargetByClass(ilDclTableViewEditGUI::class, 'copy') ); - $alist->addItem( + $dropdown_items[] = $this->ui_factory->link()->standard( $this->lng->txt('delete'), - '', - $this->ctrl->getLinkTargetByClass('ildcltablevieweditgui', 'confirmDelete') + $this->ctrl->getLinkTargetByClass(ilDclTableEditGUI::class, 'confirmDelete') ); + $dropdown = $this->ui_factory->dropdown()->standard($dropdown_items)->withLabel($this->lng->txt('actions')); - return $alist->getHTML(); + return $this->renderer->render($dropdown); } elseif ($this->parent_obj instanceof ilDclDetailedViewGUI) { - $this->ctrl->setParameterByClass('ilDclDetailedViewGUI', 'tableview_id', $id); - $this->ctrl->saveParameterByClass('ilDclDetailedViewGUI', 'record_id'); - $link = $this->factory->link()->standard( + $this->ctrl->setParameterByClass(ilDclDetailedViewGUI::class, 'tableview_id', $id); + $this->ctrl->saveParameterByClass(ilDclDetailedViewGUI::class, 'record_id'); + $link = $this->ui_factory->link()->standard( $this->lng->txt('view'), - $this->ctrl->getLinkTargetByClass('ilDclDetailedViewGUI', 'renderRecord') + $this->ctrl->getLinkTargetByClass(ilDclDetailedViewGUI::class, 'renderRecord') ); return $this->renderer->render($link); }