Skip to content

Commit

Permalink
add screen ids for dc (ILIAS-eLearning#8586)
Browse files Browse the repository at this point in the history
iszmais authored Dec 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 375d489 commit d58368a
Showing 8 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -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());
}
Original file line number Diff line number Diff line change
@@ -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,26 +120,22 @@ 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());
}

/**
* create field edit form
*/
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());
}

/*
Original file line number Diff line number Diff line change
@@ -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(),
Original file line number Diff line number Diff line change
@@ -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')));
}

Original file line number Diff line number Diff line change
@@ -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()) {
Original file line number Diff line number Diff line change
@@ -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());
Original file line number Diff line number Diff line change
@@ -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());
}
Original file line number Diff line number Diff line change
@@ -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");

0 comments on commit d58368a

Please sign in to comment.