Skip to content

Commit

Permalink
Fixes 44013
Browse files Browse the repository at this point in the history
  • Loading branch information
juanma1331 committed Feb 5, 2025
1 parent 786bbba commit 2bea755
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ class ilLTIConsumerAdministrationGUI
private array $_importedXmlData = [];
private \ilGlobalTemplateInterface $main_tpl;

public function __construct()
private bool $hasWritePermission;

public function __construct(bool $hasWritePermission = false)
{
global $DIC;
$this->hasWritePermission = $hasWritePermission;
$this->main_tpl = $DIC->ui()->mainTemplate(); /* @var \ILIAS\DI\Container $DIC */

$DIC->language()->loadLanguageModule("rep");

//$this->performProviderImport($this->xml2());
}

Expand Down Expand Up @@ -146,19 +148,23 @@ protected function showGlobalProviderCmd(): void

$DIC->tabs()->activateSubTab('global_provider');

$button = $DIC->ui()->factory()->button()->standard(
$DIC->language()->txt('lti_add_global_provider'),
$DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_GLOBAL_PROVIDER_FORM)
);
if ($this->hasWritePermission) {
$button = $DIC->ui()->factory()->button()->standard(
$DIC->language()->txt('lti_add_global_provider'),
$DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_GLOBAL_PROVIDER_FORM)
);

$DIC->toolbar()->addComponent($button);
$DIC->toolbar()->addComponent($button);

$button = $DIC->ui()->factory()->button()->standard(
$DIC->language()->txt('lti_import_global_provider'),
$DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_GLOBAL_PROVIDER_IMPORT)
);

$DIC->toolbar()->addComponent($button);
}

$button = $DIC->ui()->factory()->button()->standard(
$DIC->language()->txt('lti_import_global_provider'),
$DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_GLOBAL_PROVIDER_IMPORT)
);

$DIC->toolbar()->addComponent($button);

$table = $this->buildProviderTable($this, self::CMD_SHOW_GLOBAL_PROVIDER);
$table->setEditProviderCmd(self::CMD_SHOW_GLOBAL_PROVIDER_FORM);
Expand Down Expand Up @@ -820,13 +826,14 @@ protected function buildProviderTable(ilLTIConsumerAdministrationGUI $parentGui,
$parentCmd
);


$table->setFilterCommand(self::CMD_APPLY_GLOBAL_PROVIDER_FILTER);
$table->setResetCommand(self::CMD_RESET_GLOBAL_PROVIDER_FILTER);

$table->setAvailabilityColumnEnabled(true);
$table->setProviderCreatorColumnEnabled(true);

$table->setActionsColumnEnabled(true);
$table->setActionsColumnEnabled($this->hasWritePermission);
$table->setDetailedUsagesEnabled(true);

return $table;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function executeCommand(): void

case 'illticonsumeradministrationgui':
$this->tabs_gui->activateTab('lti_consuming');
$gui = new ilLTIConsumerAdministrationGUI();
$gui = new ilLTIConsumerAdministrationGUI($this->checkPermissionBool('write'));
$this->ctrl->forwardCommand($gui);
break;

Expand Down

0 comments on commit 2bea755

Please sign in to comment.