10
10
use Icinga \Module \Reporting \ProvidedReports ;
11
11
use Icinga \Module \Reporting \Report ;
12
12
use Icinga \Module \Reporting \Web \Forms \Decorator \CompatDecorator ;
13
+ use ipl \I18n \Translation ;
13
14
use ipl \Web \Compat \CompatForm ;
14
15
15
16
class SendForm extends CompatForm
16
17
{
17
18
use Database;
18
19
use ProvidedReports;
20
+ use Translation;
19
21
20
22
/** @var Report */
21
23
protected $ report ;
@@ -34,34 +36,34 @@ protected function assemble()
34
36
(new SendMail ())->initConfigForm ($ this , $ this ->report );
35
37
36
38
$ radio = $ this ->addElement ('radio ' , 'source_radio ' , [
37
- 'label ' => 'E-Mail Source ' ,
39
+ 'label ' => $ this -> translate ( 'E-Mail Source ' ) ,
38
40
'options ' => [
39
- 'manual ' => 'Manual ' ,
40
- 'contacts ' => 'Contacts ' ,
41
+ 'manual ' => $ this -> translate ( 'Manual input ' ) ,
42
+ 'contacts ' => $ this -> translate ( 'Contacts ' ) ,
41
43
],
42
44
'value ' => 'contacts ' ,
43
45
'class ' => 'autosubmit '
44
46
]);
45
47
46
48
if ($ radio ->getValue ('source_radio ' ) === 'contacts ' ) {
47
- $ emails = [null => 'Select Contacts ' ];
49
+ $ emails = [null => $ this -> translate ( 'Select Contacts ' ) ];
48
50
foreach (EmailProviderHook::getProviders () as $ provider ) {
49
51
$ emails = array_merge ($ emails , $ provider ->getContactEmails ());
50
52
}
51
53
52
54
$ this ->addElement ('select ' , 'emails_list ' , [
53
55
'multiple ' => true ,
54
- 'label ' => 'Contacts ' ,
56
+ 'label ' => $ this -> translate ( 'Contacts ' ) ,
55
57
'options ' => $ emails
56
58
]);
57
59
} else {
58
60
$ this ->addElement ('textarea ' , 'emails_manual ' , [
59
- 'label ' => 'Contact E-Mails '
61
+ 'label ' => $ this -> translate ( 'Contact E-Mails ' )
60
62
]);
61
63
}
62
64
63
65
$ this ->addElement ('submit ' , 'submit ' , [
64
- 'label ' => 'Send Report '
66
+ 'label ' => $ this -> translate ( 'Send Report ' )
65
67
]);
66
68
}
67
69
0 commit comments