Skip to content

Commit

Permalink
add screen ids for dc (#8585)
Browse files Browse the repository at this point in the history
  • Loading branch information
iszmais authored Dec 2, 2024
1 parent 580133e commit a3a807e
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class ilDclFieldEditGUI
protected ilPropertyFormGUI $form;
protected ilDclBaseFieldModel $field_obj;
private ilGlobalTemplateInterface $main_tpl;
protected ilHelpGUI $help;
protected ILIAS\HTTP\Services $http;
protected ILIAS\Refinery\Factory $refinery;
protected int $field_id;
Expand All @@ -43,6 +44,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();

Expand Down Expand Up @@ -116,26 +118,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());
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class ilDclTableEditGUI
protected ilGlobalTemplateInterface $tpl;
protected ilToolbarGUI $toolbar;
protected ilPropertyFormGUI $form;
protected ilHelpGUI $help;
protected ILIAS\HTTP\Services $http;
protected ILIAS\Refinery\Factory $refinery;
protected ilDclTableListGUI $parent_object;
Expand All @@ -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();
Expand Down Expand Up @@ -75,7 +77,6 @@ public function __construct(ilDclTableListGUI $a_parent_obj)
public function executeCommand(): void
{
$cmd = $this->ctrl->getCmd();

switch ($cmd) {
case 'update':
$this->save("update");
Expand All @@ -88,13 +89,17 @@ public function executeCommand(): void

public function create(): void
{
$this->help->setSubScreenId('create');

$this->initForm();
$this->getStandardValues();
$this->tpl->setContent($this->form->getHTML());
}

public function edit(): void
{
$this->help->setSubScreenId('edit');

if (!$this->table_id) {
$this->ctrl->redirectByClass(ilDclFieldEditGUI::class, "listFields");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ 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;
$this->obj_id = 0;
if ($a_parent_obj->getRefId() >= 0) {
$this->obj_id = ilObject::_lookupObjectId($a_parent_obj->getRefId());
}



if (!$this->checkAccess()) {
$main_tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
$this->ctrl->redirectByClass(ilDclRecordListGUI::class, 'listRecords');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();

Expand Down Expand Up @@ -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) {
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,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");
Expand Down

0 comments on commit a3a807e

Please sign in to comment.