Skip to content

Commit

Permalink
SendForm: translate texts
Browse files Browse the repository at this point in the history
  • Loading branch information
Timm Ortloff committed Jan 31, 2023
1 parent 5c0a242 commit 815dd63
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions library/Reporting/Web/Forms/SendForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
use Icinga\Module\Reporting\ProvidedReports;
use Icinga\Module\Reporting\Report;
use Icinga\Module\Reporting\Web\Forms\Decorator\CompatDecorator;
use ipl\I18n\Translation;
use ipl\Web\Compat\CompatForm;

class SendForm extends CompatForm
{
use Database;
use ProvidedReports;
use Translation;

/** @var Report */
protected $report;
Expand All @@ -34,34 +36,34 @@ protected function assemble()
(new SendMail())->initConfigForm($this, $this->report);

$radio = $this->addElement('radio', 'source_radio', [
'label' => 'E-Mail Source',
'label' => $this->translate('E-Mail Source'),
'options' => [
'manual' => 'Manual',
'contacts' => 'Contacts',
'manual' => $this->translate('Manual input'),
'contacts' => $this->translate('Contacts'),
],
'value' => 'contacts',
'class' => 'autosubmit'
]);

if ($radio->getValue('source_radio') === 'contacts') {
$emails = [null => 'Select Contacts'];
$emails = [null => $this->translate('Select Contacts')];
foreach (EmailProviderHook::getProviders() as $provider) {
$emails = array_merge($emails, $provider->getContactEmails());
}

$this->addElement('select', 'emails_list', [
'multiple' => true,
'label' => 'Contacts',
'label' => $this->translate('Contacts'),
'options' => $emails
]);
} else {
$this->addElement('textarea', 'emails_manual', [
'label' => 'Contact E-Mails'
'label' => $this->translate('Contact E-Mails')
]);
}

$this->addElement('submit', 'submit', [
'label' => 'Send Report'
'label' => $this->translate('Send Report')
]);
}

Expand Down

0 comments on commit 815dd63

Please sign in to comment.