-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·68 lines (62 loc) · 2.98 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
load([
'TearoomOne\\UniformContactBlock\\ContactFormController' => 'src/ContactFormController.php'
], __DIR__);
use TearoomOne\UniformContactBlock\ContactFormController;
Kirby::plugin('tearoom1/uniform-contact-block', [
'blueprints' => [
'blocks/uniform-contact' => __DIR__ . '/blueprints/blocks/uniform-contact.yml',
],
'snippets' => [
'blocks/uniform-contact' => __DIR__ . '/snippets/blocks/uniform-contact.php',
],
'templates' => [
'emails/success_response_en' => __DIR__ . '/templates/emails/success_response_en.php',
'emails/success_response_de' => __DIR__ . '/templates/emails/success_response_de.php'
],
'translations' => [
'en' => [
'tearoom1.uniform-contact-block.name.required' => 'Please fill in your name.',
'tearoom1.uniform-contact-block.email.required' => 'Please fill in your email.',
'tearoom1.uniform-contact-block.message.required' => 'Please provide a message.',
'tearoom1.uniform-contact-block.successMessage' => 'Thank you for your message!<br>We will get back to you as soon as possible.',
'tearoom1.uniform-contact-block.subject' => 'New contact form submission',
'tearoom1.uniform-contact-block.subject_submitter' => 'Thank you for your message!',
'form-csrf-expired' => 'This form is not valid anymore,<br>please reload the page and try again.',
],
'de' => [
'tearoom1.uniform-contact-block.name.required' => 'Bitte gib einen Namen an.',
'tearoom1.uniform-contact-block.email.required' => 'Bitte gib eine E-Mail an.',
'tearoom1.uniform-contact-block.message.required' => 'Bitte schreib eine Nachricht.',
'tearoom1.uniform-contact-block.successMessage' => 'Vielen Dank für Deine Nachricht!<br>Wir antworten so schnell wie möglich.',
'tearoom1.uniform-contact-block.subject' => 'Neue Nachricht über das Kontaktformular',
'tearoom1.uniform-contact-block.subject_submitter' => 'Danke für Deine Nachricht!',
'form-csrf-expired' => 'Dieses Formular ist nicht mehr gültig,<br>bitte lade die Seite neu und versuche es nochmal.',
],
],
'routes' => [
[
'pattern' => '/uniform-contact-captcha',
'method' => 'GET',
'action' => function () {
// return new captcha image
return simpleCaptcha();
}
],
[
'pattern' => '(:any)/uniform-contact',
'method' => 'POST',
'action' => function ($lang) {
ContactFormController::contactFormSend($lang);
}
],
[
'pattern' => '(:any)/uniform-contact-ajax',
'method' => 'POST',
'action' => function ($lang) {
[$messages, $code] = ContactFormController::contactFormSend($lang, true);
return \Kirby\Cms\Response::json($messages, $code);
}
]
]
]);