Skip to content

Commit 0da94d1

Browse files
authored
refactor dashboard manage modal translations (ILIAS-eLearning#9975)
1 parent c159366 commit 0da94d1

File tree

8 files changed

+41
-63
lines changed

8 files changed

+41
-63
lines changed

components/ILIAS/Dashboard/Block/classes/class.ilDashboardBlockGUI.php

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ public function getViewSettings(): ilPDSelectedItemsBlockViewSettings
173173
public function init(): void
174174
{
175175
$this->lng->loadLanguageModule('dash');
176-
$this->lng->loadLanguageModule('rep');
177176
$this->lng->loadLanguageModule('pd');
178177
$this->initViewSettings();
179178
$this->viewSettings->parse();
@@ -383,7 +382,7 @@ public function addCommandActions(): void
383382
if ($this->removeMultipleEnabled()) {
384383
$this->addBlockCommand(
385384
$this->ctrl->getLinkTarget($this, 'manage'),
386-
$this->getRemoveMultipleActionText(),
385+
$this->lng->txt('dash_' . $this->getBlockType() . '_remove_multiple'),
387386
'',
388387
$this->getRemoveModal()
389388
);
@@ -394,27 +393,21 @@ public function getRemoveModal(): RoundTrip
394393
{
395394
$items = $this->getManageFields();
396395
if ($items !== []) {
397-
if ($this->viewSettings->isSelectedItemsViewActive()) {
398-
$question = $this->lng->txt('dash_info_sure_remove_from_favs');
399-
} else {
400-
$this->lng->loadLanguageModule('mmbr');
401-
$question = $this->lng->txt('mmbr_info_delete_sure_unsubscribe');
402-
}
403396
$modal = $this->ui->factory()->modal()->roundtrip(
404-
$this->getRemoveMultipleActionText(),
397+
$this->lng->txt('dash_' . $this->getBlockType() . '_remove_multiple'),
405398
[
406-
$this->ui->factory()->messageBox()->confirmation($question),
399+
$this->ui->factory()->messageBox()->confirmation($this->lng->txt('dash_' . $this->getBlockType() . '_remove_info')),
407400
$this->ui->factory()->messageBox()->info($this->lng->txt('select_one')),
408401
],
409402
$items,
410403
$this->ctrl->getLinkTargetByClass([ilDashboardGUI::class, $this::class], 'confirmedRemove')
411-
)->withSubmitLabel($this->getRemoveMultipleActionText());
404+
)->withSubmitLabel($this->lng->txt('dash_' . $this->getBlockType() . '_remove'));
412405

413406
$modal = $modal->withOnLoadCode(static fn($id) => "il.Dashboard.confirmModal($id)");
414407
} else {
415408
$modal = $this->ui->factory()->modal()->roundtrip(
416-
$this->getRemoveMultipleActionText(),
417-
$this->ui->factory()->messageBox()->info($this->lng->txt('pd_no_items_to_manage'))
409+
$this->lng->txt('dash_' . $this->getBlockType() . '_remove_multiple'),
410+
$this->ui->factory()->messageBox()->info($this->lng->txt('dash_no_items_to_manage'))
418411
);
419412
}
420413

@@ -540,9 +533,10 @@ public function removeFromDeskObject(): void
540533
$this->ctrl->redirectByClass(ilDashboardGUI::class, 'show');
541534
}
542535

543-
abstract public function removeMultipleEnabled(): bool;
544-
545-
abstract public function getRemoveMultipleActionText(): string;
536+
public function removeMultipleEnabled(): bool
537+
{
538+
return false;
539+
}
546540

547541
/**
548542
* @param int[] $ids

components/ILIAS/Dashboard/Block/classes/class.ilMembershipBlockGUI.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function initData(): void
6666

6767
public function getBlockType(): string
6868
{
69-
return 'pdmem';
69+
return 'dash_mem';
7070
}
7171

7272
public function confirmedRemove(array $ids): void
@@ -114,9 +114,4 @@ public function removeMultipleEnabled(): bool
114114
{
115115
return true;
116116
}
117-
118-
public function getRemoveMultipleActionText(): string
119-
{
120-
return $this->lng->txt('pd_unsubscribe_multiple_memberships');
121-
}
122117
}

components/ILIAS/Dashboard/Block/classes/class.ilSelectedItemsBlockGUI.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function initData(): void
8484

8585
public function getBlockType(): string
8686
{
87-
return 'pditems';
87+
return 'dash_fav';
8888
}
8989

9090
public function confirmedRemove(array $ids): void
@@ -101,9 +101,4 @@ public function removeMultipleEnabled(): bool
101101
{
102102
return true;
103103
}
104-
105-
public function getRemoveMultipleActionText(): string
106-
{
107-
return $this->lng->txt('pd_remove_multiple');
108-
}
109104
}

components/ILIAS/LearningSequence/classes/class.ilDashboardLearningSequenceGUI.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function initData(): void
8888

8989
public function getBlockType(): string
9090
{
91-
return 'pdlern';
91+
return 'dash_ls';
9292
}
9393

9494
public function confirmedRemove(array $ids): void
@@ -114,9 +114,4 @@ public function removeMultipleEnabled(): bool
114114
{
115115
return true;
116116
}
117-
118-
public function getRemoveMultipleActionText(): string
119-
{
120-
return $this->lng->txt('pd_unsubscribe_multiple_memberships');
121-
}
122117
}

components/ILIAS/Repository/RecommendedContent/classes/class.ilDashboardRecommendedContentGUI.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function initData(): void
102102

103103
public function getBlockType(): string
104104
{
105-
return 'pdrecc';
105+
return 'dash_rc';
106106
}
107107

108108
public function addCustomCommandsToActionMenu(ilObjectListGUI $itemListGui, int $ref_id): void
@@ -128,9 +128,4 @@ public function removeMultipleEnabled(): bool
128128
{
129129
return true;
130130
}
131-
132-
public function getRemoveMultipleActionText(): string
133-
{
134-
return $this->lng->txt('pd_remove_multiple');
135-
}
136131
}

components/ILIAS/StudyProgramme/classes/class.ilStudyProgrammeDashboardViewGUI.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,7 @@ protected function getVisibleOnPDMode(): string
114114

115115
public function getBlockType(): string
116116
{
117-
return 'pdprg';
118-
}
119-
120-
public function removeMultipleEnabled(): bool
121-
{
122-
return false;
123-
}
124-
125-
public function getRemoveMultipleActionText(): string
126-
{
127-
return '';
117+
return 'dash_sp';
128118
}
129119

130120
protected function maybeGetCertificateLink(int $usr_id, int $prg_obj_id, int $prg_ref_id): ?string

lang/ilias_de.lang

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8137,6 +8137,18 @@ dash#:#dash_click_here#:#Hier klicken
81378137
dash#:#dash_co_delete#:#Dashboard-Gestaltung löschen
81388138
dash#:#dash_co_lang#:#Dashboard-Gestaltung nach Sprachen
81398139
dash#:#dash_customization#:#Gestaltung der Dashboard-Seite
8140+
dash#:#dash_dash_fav_remove#:#Entfernen
8141+
dash#:#dash_dash_fav_remove_info#:#Wollen Sie die folgenden Objekte wirklich aus Ihren Favoriten entfernen?
8142+
dash#:#dash_dash_fav_remove_multiple#:#Mehrere Favoriten entfernen
8143+
dash#:#dash_dash_ls_remove#:#Mitgliedschaften beenden
8144+
dash#:#dash_dash_ls_remove_info#:#Wollen Sie die folgenden Mitgliedschaften für Lernsequenzen wirklich beenden?
8145+
dash#:#dash_dash_ls_remove_multiple#:#Mehrere Mitgliedschaften beenden
8146+
dash#:#dash_dash_mem_remove#:#Mitgliedschaften beenden
8147+
dash#:#dash_dash_mem_remove_info#:#Wollen Sie die folgenden Mitgliedschaften für Kurse und Gruppen wirklich beenden?
8148+
dash#:#dash_dash_mem_remove_multiple#:#Mehrere Mitgliedschaften beenden
8149+
dash#:#dash_dash_rc_remove#:#Entfernen
8150+
dash#:#dash_dash_rc_remove_info#:#Wollen Sie die folgenden Objekte wirklich aus Ihren empfohlenen Inhalten entfernen?
8151+
dash#:#dash_dash_rc_remove_multiple#:#Mehrere Inhalte entfernen
81408152
dash#:#dash_dashboard#:#Dashboard
81418153
dash#:#dash_default_presentation#:#Standardpräsentation
81428154
dash#:#dash_default_sortation#:#Standardsortierung
@@ -8150,14 +8162,14 @@ dash#:#dash_enable_recommended_content#:#Empfohlene Inhalte
81508162
dash#:#dash_enable_study_programmes#:#Studienprogramme
81518163
dash#:#dash_enable_task#:#To-Dos
81528164
dash#:#dash_favourites#:#Favoriten
8153-
dash#:#dash_info_sure_remove_from_favs#:#Sollen die folgenden Objekte wirklich aus Ihren Favoriten entfernt werden?
81548165
dash#:#dash_item_removed#:#Der Eintrag wurde aus der Liste entfernt.
81558166
dash#:#dash_learning_sequences#:#Meine Lernsequenzen
81568167
dash#:#dash_list#:#Liste
81578168
dash#:#dash_main_panel#:#Hauptbereich
81588169
dash#:#dash_make_favourite#:#Zu Favoriten hinzufügen
81598170
dash#:#dash_member_main_alt#:#Eine Ansicht der Mitgliedschaften kann auch direkt im Haupmenü eingebunden werden.
81608171
dash#:#dash_memberships#:#Meine Kurse und Gruppen
8172+
dash#:#dash_no_items_to_manage#:#Keine Objekte zum Entfernen verfügbar.
81618173
dash#:#dash_page_edit_info#:#Der Inhalt dieser Seite wird allen Nutzern auf ihrem Dashboard angezeigt. Die Inhaltsblöcke des Dashboards werden darunter angezeigt.
81628174
dash#:#dash_presentation#:#Präsentation
81638175
dash#:#dash_recommended_content#:#Empfohlene Inhalte
@@ -12747,7 +12759,6 @@ mmbr#:#info_refuse_sure#:#Sind Sie sicher, dass Sie den/die folgenden Benutzer a
1274712759
mmbr#:#mmbr_awrn_my_groups_courses#:#Meine Kurse und Gruppen
1274812760
mmbr#:#mmbr_awrn_my_groups_courses_info#:#Alle Mitglieder von Gruppen und Kursen eines Benutzers werden aufgelistet.
1274912761
mmbr#:#mmbr_btn_mail_selected_users#:#Mail verschicken
12750-
mmbr#:#mmbr_info_delete_sure_unsubscribe#:#Wollen Sie wirklich die Mitgliedschaft für die folgenden Kurse und Gruppen beenden?
1275112762
mmbr#:#mmbr_memberships#:#Mitgliedschaften
1275212763
mmbr#:#mmbr_selected_users#:#Ausgewählte Teilnehmer
1275312764
mmbr#:#mmbr_unsubscribed_from_objs#:#Sie wurden von den ausgewählten Objekten abgemeldet.
@@ -13283,7 +13294,6 @@ pd#:#pd_ended#:#Beendet
1328313294
pd#:#pd_export_profile#:#Persönliche Daten exportieren
1328413295
pd#:#pd_import_personal_data#:#Persönliche Daten importieren
1328513296
pd#:#pd_my_memberships_sort_default#:#Standard-Sortierung
13286-
pd#:#pd_no_items_to_manage#:#Keine Objekte zum Entfernen verfügbar.
1328713297
pd#:#pd_not_dated#:#Nicht datiert
1328813298
pd#:#pd_ongoing#:#Aktuell
1328913299
pd#:#pd_personal_items_default_view#:#Standard-Sicht
@@ -13293,9 +13303,6 @@ pd#:#pd_presentation_mode_tile#:#Kachelansicht
1329313303
pd#:#pd_private_calendars#:#Private Kalender
1329413304
pd#:#pd_profile_data#:#Profildaten
1329513305
pd#:#pd_remove_multi_confirm#:#Die Objekte wurden entfernt.
13296-
pd#:#pd_remove_multiple#:#Mehrere Objekte entfernen
13297-
pd#:#pd_unsubscribe_memberships#:#Mitgliedschaften beenden
13298-
pd#:#pd_unsubscribe_multiple_memberships#:#Mehrere Mitgliedschaften beenden
1329913306
pd#:#pd_upcoming#:#Bevorstehend
1330013307
pd#:#pd_view_select_at_least_one#:#Bitte wählen Sie mindestens eine Sicht, entweder 'Ausgewählte Angebote' und/oder 'Kurse und Gruppen'.
1330113308
pdesk#:#bookmark_moved_ok#:#Bookmark wurde verschoben.

lang/ilias_en.lang

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8138,6 +8138,18 @@ dash#:#dash_click_here#:#Click here
81388138
dash#:#dash_co_delete#:#Delete Dashboard style
81398139
dash#:#dash_co_lang#:#Dashboard style by languages
81408140
dash#:#dash_customization#:#Customize Dashboard Content
8141+
dash#:#dash_dash_fav_remove#:#Remove
8142+
dash#:#dash_dash_fav_remove_info#:#Are you sure you want to remove the following objects from your Favourites?
8143+
dash#:#dash_dash_fav_remove_multiple#:#Remove Multiple Favorites
8144+
dash#:#dash_dash_ls_remove#:#Unsubscribe
8145+
dash#:#dash_dash_ls_remove_info#:#Are you sure you want to unsubscribe from the following learning sequences?
8146+
dash#:#dash_dash_ls_remove_multiple#:#Unsubscribe Multiple Learning Sequences
8147+
dash#:#dash_dash_mem_remove#:#Unsubscribe
8148+
dash#:#dash_dash_mem_remove_info#:#Are you sure you want to unsubscribe from the following courses and groups?
8149+
dash#:#dash_dash_mem_remove_multiple#:#Unsubscribe Multiple Courses and Groups
8150+
dash#:#dash_dash_rc_remove#:#Remove
8151+
dash#:#dash_dash_rc_remove_info#:#Are you sure you want to remove the following objects from your recommended content?
8152+
dash#:#dash_dash_rc_remove_multiple#:#Remove Multiple Contents
81418153
dash#:#dash_dashboard#:#Dashboard
81428154
dash#:#dash_default_presentation#:#Default Presentation
81438155
dash#:#dash_default_sortation#:#Default Sortation
@@ -8151,14 +8163,14 @@ dash#:#dash_enable_recommended_content#:#Recommended Content
81518163
dash#:#dash_enable_study_programmes#:#Study Programmes
81528164
dash#:#dash_enable_task#:#Tasks
81538165
dash#:#dash_favourites#:#Favourites
8154-
dash#:#dash_info_sure_remove_from_favs#:#Are you sure you want to remove the following objects from your Favourites?
81558166
dash#:#dash_item_removed#:#Recommendation has been removed from the list.
81568167
dash#:#dash_learning_sequences#:#My Learning Sequences
81578168
dash#:#dash_list#:#List
81588169
dash#:#dash_main_panel#:#Main Panel
81598170
dash#:#dash_make_favourite#:#Add to Favourites
81608171
dash#:#dash_member_main_alt#:#Courses and groups can also be configured as a separate main menu entry.
81618172
dash#:#dash_memberships#:#My Courses and Groups
8173+
dash#:#dash_no_items_to_manage#:#No items available for removal.
81628174
dash#:#dash_page_edit_info#:#The content of this page is displayed to all users on their dashboard. The contents of the various blocks of the dashboard are presented below.
81638175
dash#:#dash_presentation#:#Presentation
81648176
dash#:#dash_recommended_content#:#Recommended Content
@@ -12748,7 +12760,6 @@ mmbr#:#info_refuse_sure#:#Are you sure you want to refuse the following user(s)?
1274812760
mmbr#:#mmbr_awrn_my_groups_courses#:#My Groups and Courses
1274912761
mmbr#:#mmbr_awrn_my_groups_courses_info#:#All members of groups or courses of the current user are listed.
1275012762
mmbr#:#mmbr_btn_mail_selected_users#:#Send Mail
12751-
mmbr#:#mmbr_info_delete_sure_unsubscribe#:#Are you sure you want to unsubscribe from the following objects?
1275212763
mmbr#:#mmbr_memberships#:#Memberships
1275312764
mmbr#:#mmbr_selected_users#:#Selected Participants
1275412765
mmbr#:#mmbr_unsubscribed_from_objs#:#You have been unsubscribed from the selected objects.
@@ -13284,7 +13295,6 @@ pd#:#pd_ended#:#Ended
1328413295
pd#:#pd_export_profile#:#Export Personal Data
1328513296
pd#:#pd_import_personal_data#:#Import Personal Data
1328613297
pd#:#pd_my_memberships_sort_default#:#Default of Sort Option
13287-
pd#:#pd_no_items_to_manage#:#No items available for removal.
1328813298
pd#:#pd_not_dated#:#Not Dated
1328913299
pd#:#pd_ongoing#:#Ongoing
1329013300
pd#:#pd_personal_items_default_view#:#Default View
@@ -13294,9 +13304,6 @@ pd#:#pd_presentation_mode_tile#:#Tile Presentation
1329413304
pd#:#pd_private_calendars#:#Private Calendars
1329513305
pd#:#pd_profile_data#:#Profile Data
1329613306
pd#:#pd_remove_multi_confirm#:#The objects were removed.
13297-
pd#:#pd_remove_multiple#:#Remove Multiple Objects
13298-
pd#:#pd_unsubscribe_memberships#:#Unsubscribe
13299-
pd#:#pd_unsubscribe_multiple_memberships#:#Unsubscribe Multiple
1330013307
pd#:#pd_upcoming#:#Upcoming
1330113308
pd#:#pd_view_select_at_least_one#:#You have to select at least one view, either ‘Selected Items’ and/or ‘My Memberships’.
1330213309
pdesk#:#bookmark_moved_ok#:#Bookmark has been moved.

0 commit comments

Comments
 (0)