Skip to content

Commit a637615

Browse files
sukhwinder33445nilmerg
authored andcommitted
Change remove occurrences to delete to maintain consistency
- When an entry is being permanently deleted. Example: A contact, the success message, and the button label should use the keyword ‘Delete’. What is changed: - Form button name and labels - From success message - Some variable names
1 parent f9f7d98 commit a637615

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

application/controllers/ContactGroupController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function editAction(): void
8484
if ($form->hasBeenRemoved()) {
8585
$form->removeContactgroup();
8686
Notification::success(sprintf(
87-
t('Successfully removed contact group %s'),
87+
t('Deleted contact group "%s" successfully'),
8888
$form->getValue('group_name')
8989
));
9090
$this->switchToSingleColumnLayout();

application/forms/ContactGroupForm.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,17 @@ protected function assemble(): void
9090
);
9191

9292
if ($this->contactgroupId) {
93-
$removeBtn = new SubmitElement(
94-
'remove',
93+
$deleteBtn = new SubmitElement(
94+
'delete',
9595
[
96-
'label' => $this->translate('Remove'),
96+
'label' => $this->translate('Delete'),
9797
'class' => 'btn-remove',
9898
'formnovalidate' => true
9999
]
100100
);
101101

102-
$this->registerElement($removeBtn);
103-
$this->getElement('submit')->prependWrapper((new HtmlDocument())->setHtmlContent($removeBtn));
102+
$this->registerElement($deleteBtn);
103+
$this->getElement('submit')->prependWrapper((new HtmlDocument())->setHtmlContent($deleteBtn));
104104
}
105105
}
106106

@@ -114,7 +114,7 @@ public function hasBeenRemoved(): bool
114114
$btn = $this->getPressedSubmitElement();
115115
$csrf = $this->getElement('CSRFToken');
116116

117-
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'remove';
117+
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'delete';
118118
}
119119

120120
/**

application/forms/ScheduleForm.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function hasBeenRemoved(): bool
6565
$btn = $this->getPressedSubmitElement();
6666
$csrf = $this->getElement('CSRFToken');
6767

68-
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'remove';
68+
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'delete';
6969
}
7070

7171
public function loadSchedule(int $id): void
@@ -181,8 +181,8 @@ protected function assemble(): void
181181
]);
182182

183183
if ($this->showRemoveButton) {
184-
$removeBtn = $this->createElement('submit', 'remove', [
185-
'label' => $this->translate('Remove'),
184+
$removeBtn = $this->createElement('submit', 'delete', [
185+
'label' => $this->translate('Delete'),
186186
'class' => 'btn-remove',
187187
'formnovalidate' => true
188188
]);

0 commit comments

Comments
 (0)