From d58368aae2a543eb3587d77e46f45e9dbe9e33af Mon Sep 17 00:00:00 2001 From: iszmais <45942348+iszmais@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:11:13 +0100 Subject: [PATCH] add screen ids for dc (#8586) --- .../Content/class.ilDclRecordEditGUI.php | 2 ++ .../Fields/class.ilDclFieldEditGUI.php | 14 +++++----- .../Fields/class.ilDclFieldListGUI.php | 2 ++ .../classes/Table/class.ilDclTableEditGUI.php | 4 +++ .../classes/Table/class.ilDclTableListGUI.php | 3 +++ .../TableView/class.ilDclTableViewEditGUI.php | 26 ++++++------------- .../TableView/class.ilDclTableViewGUI.php | 2 ++ .../classes/class.ilObjDataCollectionGUI.php | 3 +-- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/components/ILIAS/DataCollection/classes/Content/class.ilDclRecordEditGUI.php b/components/ILIAS/DataCollection/classes/Content/class.ilDclRecordEditGUI.php index 34b10b36c9a4..474450c67272 100755 --- a/components/ILIAS/DataCollection/classes/Content/class.ilDclRecordEditGUI.php +++ b/components/ILIAS/DataCollection/classes/Content/class.ilDclRecordEditGUI.php @@ -170,6 +170,8 @@ public function getRecord(): void */ public function create(): void { + global $DIC; + $DIC->help()->setSubScreenId('create'); $this->initForm(); $this->tpl->setContent($this->form->getHTML()); } diff --git a/components/ILIAS/DataCollection/classes/Fields/class.ilDclFieldEditGUI.php b/components/ILIAS/DataCollection/classes/Fields/class.ilDclFieldEditGUI.php index 0fec2f777553..81001758e717 100755 --- a/components/ILIAS/DataCollection/classes/Fields/class.ilDclFieldEditGUI.php +++ b/components/ILIAS/DataCollection/classes/Fields/class.ilDclFieldEditGUI.php @@ -29,6 +29,7 @@ class ilDclFieldEditGUI protected ilDclBaseFieldModel $field_obj; private ilGlobalTemplateInterface $main_tpl; private ilLanguage $lng; + protected ilHelpGUI $help; protected ILIAS\HTTP\Services $http; protected ILIAS\Refinery\Factory $refinery; protected int $field_id; @@ -44,6 +45,7 @@ public function __construct(ilDclTableListGUI $a_parent_obj) $this->obj_id = $a_parent_obj->getObjId(); $this->parent_obj = $a_parent_obj; + $this->help = $DIC->help(); $this->http = $DIC->http(); $this->refinery = $DIC->refinery(); $this->lng = $DIC->language(); @@ -118,11 +120,10 @@ public function executeCommand(): void */ public function create(): void { - global $DIC; - $tpl = $DIC['tpl']; + $this->help->setSubScreenId('create'); $this->initForm(); - $tpl->setContent($this->form->getHTML()); + $this->main_tpl->setContent($this->form->getHTML()); } /** @@ -130,14 +131,11 @@ public function create(): void */ public function edit(): void { - global $DIC; - $tpl = $DIC['tpl']; + $this->help->setSubScreenId('edit'); $this->initForm("edit"); - $this->field_obj->fillPropertiesForm($this->form); - - $tpl->setContent($this->form->getHTML()); + $this->main_tpl->setContent($this->form->getHTML()); } /* diff --git a/components/ILIAS/DataCollection/classes/Fields/class.ilDclFieldListGUI.php b/components/ILIAS/DataCollection/classes/Fields/class.ilDclFieldListGUI.php index acd1795a2567..7ec68d866dc6 100755 --- a/components/ILIAS/DataCollection/classes/Fields/class.ilDclFieldListGUI.php +++ b/components/ILIAS/DataCollection/classes/Fields/class.ilDclFieldListGUI.php @@ -55,6 +55,8 @@ public function __construct(ilDclTableListGUI $a_parent_obj) $this->ui_factory = $DIC->ui()->factory(); $this->renderer = $DIC->ui()->renderer(); + $DIC->help()->setScreenId('dcl_fields'); + $this->ctrl->saveParameterByClass(ilDclTableEditGUI::class, 'table_id'); $locator->addItem( ilDclCache::getTableCache($this->table_id)->getTitle(), diff --git a/components/ILIAS/DataCollection/classes/Table/class.ilDclTableEditGUI.php b/components/ILIAS/DataCollection/classes/Table/class.ilDclTableEditGUI.php index 358a5442cb87..7b9709f60acc 100755 --- a/components/ILIAS/DataCollection/classes/Table/class.ilDclTableEditGUI.php +++ b/components/ILIAS/DataCollection/classes/Table/class.ilDclTableEditGUI.php @@ -31,6 +31,7 @@ class ilDclTableEditGUI protected ilGlobalTemplateInterface $tpl; protected ilToolbarGUI $toolbar; protected Form $form; + protected ilHelpGUI $help; protected ILIAS\HTTP\Services $http; protected ILIAS\Refinery\Factory $refinery; protected ilDclTableListGUI $parent_object; @@ -48,6 +49,7 @@ public function __construct(ilDclTableListGUI $a_parent_obj) $this->toolbar = $DIC->toolbar(); $this->parent_object = $a_parent_obj; $this->obj_id = $a_parent_obj->getObjId(); + $this->help = $DIC->help(); $this->http = $DIC->http(); $this->refinery = $DIC->refinery(); $this->ui_factory = $DIC->ui()->factory(); @@ -85,11 +87,13 @@ public function executeCommand(): void public function create(): void { + $this->help->setSubScreenId('create'); $this->tpl->setContent($this->lng->txt('dcl_new_table') . $this->ui_renderer->render($this->initForm())); } public function edit(): void { + $this->help->setSubScreenId('edit'); $this->tpl->setContent(sprintf($this->lng->txt('dcl_edit_table'), $this->table->getTitle()) . $this->ui_renderer->render($this->initForm('edit'))); } diff --git a/components/ILIAS/DataCollection/classes/Table/class.ilDclTableListGUI.php b/components/ILIAS/DataCollection/classes/Table/class.ilDclTableListGUI.php index bc368fa00bff..61858dfebc66 100755 --- a/components/ILIAS/DataCollection/classes/Table/class.ilDclTableListGUI.php +++ b/components/ILIAS/DataCollection/classes/Table/class.ilDclTableListGUI.php @@ -50,6 +50,9 @@ public function __construct(ilObjDataCollectionGUI $a_parent_obj) $this->ui_factory = $DIC->ui()->factory(); $this->renderer = $DIC->ui()->renderer(); + $this->tabs->setSetupMode(true); + $DIC->help()->setScreenId('dcl_tables'); + $this->parent_obj = $a_parent_obj; if (!$this->checkAccess()) { diff --git a/components/ILIAS/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php b/components/ILIAS/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php index f37dd557c02d..55ec87acbfe5 100755 --- a/components/ILIAS/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php +++ b/components/ILIAS/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php @@ -34,6 +34,7 @@ class ilDclTableViewEditGUI protected ilDclTableViewEditFieldsTableGUI $table_gui; protected ilTabsGUI $tabs_gui; public ilDclTable $table; + protected ilHelpGUI $help; protected ILIAS\HTTP\Services $http; protected ILIAS\Refinery\Factory $refinery; @@ -52,6 +53,7 @@ public function __construct(ilDclTableViewGUI $parent_obj, ilDclTable $table, il $this->parent_obj = $parent_obj; $this->tableview = $tableview; $this->tabs_gui = $ilTabs; + $this->help = $DIC->help(); $this->http = $DIC->http(); $this->refinery = $DIC->refinery(); @@ -85,40 +87,25 @@ public function executeCommand(): void switch ($next_class) { case 'ildcldetailedviewdefinitiongui': + $this->help->setSubScreenId('detailed_view'); $this->setTabs('detailed_view'); $recordedit_gui = new ilDclDetailedViewDefinitionGUI($this->tableview->getId()); $ret = $this->ctrl->forwardCommand($recordedit_gui); if ($ret != "") { $this->tpl->setContent($ret); } - global $DIC; - $ilTabs = $DIC['ilTabs']; - $ilTabs->removeTab('edit'); - $ilTabs->removeTab('history'); - $ilTabs->removeTab('clipboard'); // Fixme - $ilTabs->removeTab('pg'); break; case 'ildclcreateviewdefinitiongui': + $this->help->setSubScreenId('record_create'); $this->setTabs('create_view'); $creation_gui = new ilDclCreateViewDefinitionGUI($this->tableview->getId()); $this->ctrl->forwardCommand($creation_gui); - global $DIC; - $ilTabs = $DIC['ilTabs']; - $ilTabs->removeTab('edit'); - $ilTabs->removeTab('history'); - $ilTabs->removeTab('clipboard'); // Fixme - $ilTabs->removeTab('pg'); break; case 'ildcleditviewdefinitiongui': + $this->help->setSubScreenId('record_edit'); $this->setTabs('edit_view'); $edit_gui = new ilDclEditViewDefinitionGUI($this->tableview->getId()); $this->ctrl->forwardCommand($edit_gui); - global $DIC; - $ilTabs = $DIC['ilTabs']; - $ilTabs->removeTab('edit'); - $ilTabs->removeTab('history'); - $ilTabs->removeTab('clipboard'); // Fixme - $ilTabs->removeTab('pg'); break; default: switch ($cmd) { @@ -130,15 +117,18 @@ public function executeCommand(): void } break; case 'add': + $this->help->setSubScreenId('create'); $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview); $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML()); break; case 'editGeneralSettings': + $this->help->setSubScreenId('edit'); $this->setTabs('general_settings'); $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview); $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML()); break; case 'editFieldSettings': + $this->help->setSubScreenId('overview'); $this->setTabs('field_settings'); $this->initTableGUI(); $this->tpl->setContent($this->table_gui->getHTML()); diff --git a/components/ILIAS/DataCollection/classes/TableView/class.ilDclTableViewGUI.php b/components/ILIAS/DataCollection/classes/TableView/class.ilDclTableViewGUI.php index 17d27a8aa0c6..3c669047991e 100755 --- a/components/ILIAS/DataCollection/classes/TableView/class.ilDclTableViewGUI.php +++ b/components/ILIAS/DataCollection/classes/TableView/class.ilDclTableViewGUI.php @@ -58,6 +58,8 @@ public function __construct(ilDclTableListGUI $a_parent_obj, int $table_id = 0) $this->ui_factory = $DIC->ui()->factory(); $this->renderer = $DIC->ui()->renderer(); + $DIC->help()->setScreenId('dcl_views'); + if ($table_id == 0) { $table_id = $this->http->wrapper()->query()->retrieve('table_id', $this->refinery->kindlyTo()->int()); } diff --git a/components/ILIAS/DataCollection/classes/class.ilObjDataCollectionGUI.php b/components/ILIAS/DataCollection/classes/class.ilObjDataCollectionGUI.php index f76ebab9a18b..ce9dc50fe73e 100755 --- a/components/ILIAS/DataCollection/classes/class.ilObjDataCollectionGUI.php +++ b/components/ILIAS/DataCollection/classes/class.ilObjDataCollectionGUI.php @@ -124,8 +124,7 @@ public function executeCommand(): void global $DIC; $ilNavigationHistory = $DIC['ilNavigationHistory']; - $ilHelp = $DIC['ilHelp']; - $ilHelp->setScreenIdComponent('bibl'); + $DIC->help()->setScreenIdComponent('dcl'); // Navigation History $link = $this->ctrl->getLinkTarget($this, "render");