diff --git a/application/controllers/ChannelController.php b/application/controllers/ChannelController.php index 6dc48e6a..6f97b6fd 100644 --- a/application/controllers/ChannelController.php +++ b/application/controllers/ChannelController.php @@ -22,10 +22,10 @@ public function indexAction(): void $form = (new ChannelForm(Database::get())) ->loadChannel($channelId) ->on(ChannelForm::ON_SUCCESS, function (ChannelForm $form) { - if ($form->getPressedSubmitElement()->getName() === 'delete') { + if ($form->getPressedSubmitElement()->getName() === 'remove') { $form->removeChannel(); Notification::success(sprintf( - t('Deleted channel "%s" successfully'), + t('Removed channel "%s" successfully'), $form->getValue('name') )); } else { diff --git a/application/controllers/ContactController.php b/application/controllers/ContactController.php index 0fc7b429..877784db 100644 --- a/application/controllers/ContactController.php +++ b/application/controllers/ContactController.php @@ -37,7 +37,7 @@ public function indexAction(): void })->on(ContactForm::ON_REMOVE, function (ContactForm $form) { $form->removeContact(); Notification::success(sprintf( - t('Deleted contact "%s" successfully'), + t('Removed contact "%s" successfully'), $form->getContactName() )); diff --git a/application/controllers/SourceController.php b/application/controllers/SourceController.php index 3c442fcc..eb525712 100644 --- a/application/controllers/SourceController.php +++ b/application/controllers/SourceController.php @@ -28,10 +28,10 @@ public function indexAction(): void ->on(SourceForm::ON_SUCCESS, function (SourceForm $form) { /** @var FormSubmitElement $pressedButton */ $pressedButton = $form->getPressedSubmitElement(); - if ($pressedButton->getName() === 'delete') { + if ($pressedButton->getName() === 'remove') { $form->removeSource(); Notification::success(sprintf( - $this->translate('Deleted source "%s" successfully'), + $this->translate('Removed source "%s" successfully'), $form->getSourceName() )); } else { diff --git a/application/forms/ChannelForm.php b/application/forms/ChannelForm.php index a2431edc..383668c1 100644 --- a/application/forms/ChannelForm.php +++ b/application/forms/ChannelForm.php @@ -126,12 +126,12 @@ protected function assemble() ->first(); } - /** @var FormSubmitElement $deleteButton */ - $deleteButton = $this->createElement( + /** @var FormSubmitElement $removeButton */ + $removeButton = $this->createElement( 'submit', - 'delete', + 'remove', [ - 'label' => $this->translate('Delete'), + 'label' => $this->translate('Remove'), 'class' => 'btn-remove', 'formnovalidate' => true, 'disabled' => $isInUse !== null, @@ -144,16 +144,16 @@ protected function assemble() ] ); - $this->registerElement($deleteButton); + $this->registerElement($removeButton); $this->getElement('submit') ->getWrapper() - ->prepend($deleteButton); + ->prepend($removeButton); } } public function isValid() { - if ($this->getPressedSubmitElement()->getName() === 'delete') { + if ($this->getPressedSubmitElement()->getName() === 'remove') { $csrfElement = $this->getElement('CSRFToken'); if (! $csrfElement->isValid()) { @@ -168,7 +168,7 @@ public function isValid() public function hasBeenSubmitted() { - if ($this->getPressedSubmitElement() !== null && $this->getPressedSubmitElement()->getName() === 'delete') { + if ($this->getPressedSubmitElement() !== null && $this->getPressedSubmitElement()->getName() === 'remove') { return true; } diff --git a/application/forms/SourceForm.php b/application/forms/SourceForm.php index ca8f9ee0..63b62d6c 100644 --- a/application/forms/SourceForm.php +++ b/application/forms/SourceForm.php @@ -220,22 +220,22 @@ protected function assemble(): void ); if ($this->sourceId !== null) { - /** @var FormSubmitElement $deleteButton */ - $deleteButton = $this->createElement( + /** @var FormSubmitElement $removeButton */ + $removeButton = $this->createElement( 'submit', - 'delete', + 'remove', [ - 'label' => $this->translate('Delete'), + 'label' => $this->translate('Remove'), 'class' => 'btn-remove', 'formnovalidate' => true ] ); - $this->registerElement($deleteButton); + $this->registerElement($removeButton); /** @var BaseHtmlElement $submitWrapper */ $submitWrapper = $this->getElement('save')->getWrapper(); - $submitWrapper->prepend($deleteButton); + $submitWrapper->prepend($removeButton); } } diff --git a/library/Notifications/Web/Form/ContactForm.php b/library/Notifications/Web/Form/ContactForm.php index 246f015a..1dddfe23 100644 --- a/library/Notifications/Web/Form/ContactForm.php +++ b/library/Notifications/Web/Form/ContactForm.php @@ -26,7 +26,7 @@ class ContactForm extends CompatForm { use CsrfCounterMeasure; - /** @var string Emitted in case the contact should be deleted */ + /** @var string Emitted in case the contact should be removed */ public const ON_REMOVE = 'on_remove'; /** @var Connection */ @@ -56,7 +56,7 @@ private function hasBeenRemoved(): bool $btn = $this->getPressedSubmitElement(); $csrf = $this->getElement('CSRFToken'); - return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'delete'; + return $csrf !== null && $csrf->isValid() && $btn !== null && $btn->getName() === 'remove'; } public function isValidEvent($event) @@ -141,21 +141,21 @@ protected function assemble() ] ); if ($this->contactId !== null) { - /** @var FormSubmitElement $deleteButton */ - $deleteButton = $this->createElement( + /** @var FormSubmitElement $removeButton */ + $removeButton = $this->createElement( 'submit', - 'delete', + 'remove', [ - 'label' => $this->translate('Delete'), + 'label' => $this->translate('Remove'), 'class' => 'btn-remove', 'formnovalidate' => true ] ); - $this->registerElement($deleteButton); + $this->registerElement($removeButton); $this->getElement('submit') ->getWrapper() - ->prepend($deleteButton); + ->prepend($removeButton); } }