Skip to content

Commit

Permalink
Export: Adjust export option dropdown/button to conform to ilias
Browse files Browse the repository at this point in the history
  • Loading branch information
chlulei committed Dec 19, 2024
1 parent 38e8d54 commit 97026cb
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getSupportedRepositoryObjectTypes(): array
public function getLabel(): string
{
$this->lng->loadLanguageModule('exp');
return $this->lng->txt("exp_html");
return $this->lng->txt("exp_format_dropdown-html");
}

public function onExportOptionSelected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public function getSupportedRepositoryObjectTypes(): array

public function getLabel(): string
{
return "HTML (" . $this->lng->txt("blog_incl_comments") . ")";
$this->lng->loadLanguageModule('exp');
return $this->lng->txt("exp_format_dropdown-html") . " (" . $this->lng->txt("blog_incl_comments") . ")";
}

public function onExportOptionSelected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function isPublicAccessPossible(): bool

public function getLabel(): string
{
return $this->lng->txt("exp_create_file") . " (xml)";
return $this->lng->txt("exp_format_dropdown-xml");
}

public function onExportOptionSelected(
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/Export/classes/class.ilExportGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ final protected function displayExportFiles(): void
}
if (count($infos) === 1) {
$this->toolbar->addComponent($this->ui_services->factory()->button()->standard(
array_keys($infos)[0],
$this->lng->txt("exp_export_dropdown") . " " . array_keys($infos)[0],
array_values($infos)[0]
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function getSupportedRepositoryObjectTypes(): array
public function getLabel(): string
{
$this->lng->loadLanguageModule('exp');
return $this->lng->txt('exp_html');
return $this->lng->txt('exp_format_dropdown-html');
}

public function onExportOptionSelected(ilExportHandlerConsumerContextInterface $context): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getSupportedRepositoryObjectTypes(): array
public function getLabel(): string
{
$this->lng->loadLanguageModule('exp');
return $this->lng->txt("exp_html");
return $this->lng->txt("exp_format_dropdown-html");
}

public function onExportOptionSelected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getSupportedRepositoryObjectTypes(): array
public function getLabel(): string
{
$this->lng->loadLanguageModule('exp');
return $this->lng->txt("exp_html");
return $this->lng->txt("exp_format_dropdown-html");
}

public function onExportOptionSelected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getSupportedRepositoryObjectTypes(): array
public function getLabel(): string
{
$this->lng->loadLanguageModule('exp');
return $this->lng->txt("exp_html");
return $this->lng->txt("exp_format_dropdown-html");
}

public function onDeleteFiles(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function isPublicAccessPossible(): bool
public function getLabel(): string
{
$this->lng->loadLanguageModule('exp');
return $this->lng->txt("exp_xml");
return $this->lng->txt("exp_format_dropdown-xml");
}

public function onExportOptionSelected(\ILIAS\Export\ExportHandler\I\Consumer\Context\HandlerInterface $context): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public function getSupportedRepositoryObjectTypes(): array

public function getLabel(): string
{
return "XML (" . $this->lng->txt("mep_master_language_only") . ")";
$this->lng->loadLanguageModule('exp');
return $this->lng->txt("exp_format_dropdown-xml") . " (" . $this->lng->txt("mep_master_language_only") . ")";
}

public function onDownloadFiles(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function getSupportedRepositoryObjectTypes(): array

public function getLabel(): string
{
$this->lng->loadLanguageModule('exp');
return "XML (" . $this->lng->txt("mep_master_language_only_no_media") . ")";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public function getSupportedRepositoryObjectTypes(): array

public function getLabel(): string
{
return $this->lng->txt('simple_xls');
$this->lng->loadLanguageModule('exp');
return $this->lng->txt('exp_format_dropdown-xls');
}

public function isObjectSupported(ObjectId $object_id): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public function isObjectSupported(ObjectId $object_id): bool

public function getLabel(): string
{
return $this->lng->txt('simple_xml');
$this->lng->loadLanguageModule('exp');
return $this->lng->txt('exp_format_dropdown-xml');
}

public function onExportOptionSelected(ilExportHandlerConsumerContextInterface $context): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public function getSupportedRepositoryObjectTypes(): array

public function getLabel(): string
{
return $this->lng->txt('ass_create_export_test_archive');
$this->lng->loadLanguageModule('exp');
return $this->lng->txt('exp_format_dropdown-arc');
}

public function onDeleteFiles(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public function getSupportedRepositoryObjectTypes(): array

public function getLabel(): string
{
return $this->lng->txt('ass_create_export_file');
$this->lng->loadLanguageModule('exp');
$this->lng->loadLanguageModule('assessment');
return $this->lng->txt("exp_format_dropdown-xml") . " (" . $this->lng->txt('ass_create_export_file') . ")";
}

public function onDeleteFiles(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ public function getExportOptionId(): string

public function getSupportedRepositoryObjectTypes(): array
{
return ['tst'];
return ['tst', 'crs'];
}

public function getLabel(): string
{
return $this->lng->txt('ass_create_export_file_with_results');
$this->lng->loadLanguageModule('exp');
$this->lng->loadLanguageModule('assessment');
return $this->lng->txt("exp_format_dropdown-xml") . " (" . $this->lng->txt('ass_create_export_file_with_results') . ")";
}

public function onDeleteFiles(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public function getSupportedRepositoryObjectTypes(): array

public function getLabel(): string
{
return "{$this->lng->txt('exp_create_file')} (xml)";
$this->lng->loadLanguageModule('exp');
return $this->lng->txt('exp_format_dropdown-xml');
}

public function onDeleteFiles(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getSupportedRepositoryObjectTypes(): array
public function getLabel(): string
{
$this->lng->loadLanguageModule('exp');
return $this->lng->txt('exp_html');
return $this->lng->txt('exp_format_dropdown-html');
}

public function onExportOptionSelected(ilExportHandlerConsumerContextInterface $context): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public function getSupportedRepositoryObjectTypes(): array

public function getLabel(): string
{
return "HTML (" . $this->lng->txt("wiki_incl_comments") . ")";
$this->lng->loadLanguageModule('exp');
return $this->lng->txt("exp_format_dropdown-html") . " (" . $this->lng->txt("wiki_incl_comments") . ")";
}

public function isObjectSupported(ObjectId $object_id): bool
Expand Down
3 changes: 3 additions & 0 deletions lang/ilias_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -9757,6 +9757,9 @@ exp#:#exp_error_disabled#:#Der Export von Container-Objekten ist deaktiviert. Be
exp#:#exp_error_too_many_objects#:#Der Export überschreitet die maximal erlaubte Zahl an Objekten (%1). Bitte wählen Sie eine kleinere Anzahl an Objekten.
exp#:#exp_export_files#:#Exportdateien
exp#:#exp_file_created#:#Eine Exportdatei wurde erstellt.
exp#:#exp_format_dropdown-csv#:#als CSV
exp#:#exp_format_dropdown-html#:#als HTML
exp#:#exp_format_dropdown-xml#:#als XML
exp#:#exp_html#:#HTML
exp#:#exp_import_validation_err_no_matching_xsd#:#Eine Schema Datei für Version %s existiert nicht.
exp#:#exp_print_pdf#:#Drucken/PDF
Expand Down
7 changes: 6 additions & 1 deletion lang/ilias_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -9756,8 +9756,14 @@ exercise#:#exc_your_submission#:#Your Submission
exp#:#exp_create_file#:#Create Export File
exp#:#exp_error_disabled#:#The export feature is disabled for containers. You may contact your system administrator.
exp#:#exp_error_too_many_objects#:#The export exceeds the maximum number of allowerd objects (%1). Please select a lower number of objects.
exp#:#exp_export_dropdown#:#Export
exp#:#exp_export_files#:#Export Files
exp#:#exp_file_created#:#The export file has been created.
exp#:#exp_format_dropdown-arc#:#as ARCHIVE
exp#:#exp_format_dropdown-csv#:#as CSV
exp#:#exp_format_dropdown-html#:#as HTML
exp#:#exp_format_dropdown-xls#:#as XLS
exp#:#exp_format_dropdown-xml#:#as XML
exp#:#exp_html#:#HTML
exp#:#exp_import_validation_err_no_matching_xsd#:#No valid schema file for version %s exists.
exp#:#exp_print_pdf#:#Print/PDF
Expand All @@ -9769,7 +9775,6 @@ exp#:#export_created#:#A new export file has been created.
exp#:#export_files_deleted#:#The selected export files have been deleted.
exp#:#export_options#:#Export Options
exp#:#export_type#:#Export Type
export#:#exp_export_dropdown#:#Export
export#:#exp_file#:#File Name
export#:#exp_public_access#:#Public Access
export#:#exp_size#:#File Size (MB)
Expand Down

0 comments on commit 97026cb

Please sign in to comment.