Skip to content

Commit c413ade

Browse files
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 6d193d1 commit c413ade

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
@@ -85,7 +85,7 @@ public function editAction(): void
8585
if ($form->hasBeenRemoved()) {
8686
$form->removeContactgroup();
8787
Notification::success(sprintf(
88-
t('Successfully removed contact group %s'),
88+
t('Deleted contact group "%s" successfully'),
8989
$form->getValue('group_name')
9090
));
9191
$this->switchToSingleColumnLayout();

application/forms/ContactGroupForm.php

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

8585
if ($this->contactgroupId) {
86-
$removeBtn = new SubmitElement(
87-
'remove',
86+
$deleteBtn = new SubmitElement(
87+
'delete',
8888
[
89-
'label' => $this->translate('Remove'),
89+
'label' => $this->translate('Delete'),
9090
'class' => 'btn-remove',
9191
'formnovalidate' => true
9292
]
9393
);
9494

95-
$this->registerElement($removeBtn);
96-
$this->getElement('submit')->prependWrapper((new HtmlDocument())->setHtmlContent($removeBtn));
95+
$this->registerElement($deleteBtn);
96+
$this->getElement('submit')->prependWrapper((new HtmlDocument())->setHtmlContent($deleteBtn));
9797
}
9898
}
9999

@@ -107,7 +107,7 @@ public function hasBeenRemoved(): bool
107107
$btn = $this->getPressedSubmitElement();
108108
$csrf = $this->getElement('CSRFToken');
109109

110-
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'remove';
110+
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'delete';
111111
}
112112

113113
/**

application/forms/ScheduleForm.php

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

64-
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'remove';
64+
return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'delete';
6565
}
6666

6767
public function loadSchedule(int $id): void
@@ -164,8 +164,8 @@ protected function assemble()
164164
]);
165165

166166
if ($this->showRemoveButton) {
167-
$removeBtn = $this->createElement('submit', 'remove', [
168-
'label' => $this->translate('Remove'),
167+
$removeBtn = $this->createElement('submit', 'delete', [
168+
'label' => $this->translate('Delete'),
169169
'class' => 'btn-remove',
170170
'formnovalidate' => true
171171
]);

0 commit comments

Comments
 (0)