Skip to content

Commit 627f667

Browse files
author
Roman Gsponer
committed
Add nl. Fix translation problems
1 parent 1fc7beb commit 627f667

File tree

23 files changed

+1246
-499
lines changed

23 files changed

+1246
-499
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ With the integrated mailview field you can display requests allover the panel.
3232

3333
⭐️   Pre-styled form
3434

35-
⭐️   Full language support for English, German, Italian, French, Lithuanian & Hungarian
35+
⭐️   Full language support for English, German, Italian, French, Lithuanian, Hungarian & Netherlands
3636

3737
# Table of content
3838

autoload/api.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
use Plain\Formblock\Request;
4+
5+
return [
6+
'routes' => [
7+
[
8+
'pattern' => 'formblock',
9+
'action' => function() {
10+
$formRequest = new Request($this->requestQuery());
11+
return $formRequest->api($this->requestQuery());
12+
}
13+
]
14+
]
15+
];

autoload/blockModels.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
use Plain\Formblock\Form;
4+
5+
return [ 'form' => Form::class ];

autoload/blueprints.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
use Plain\Formblock\Blueprint;
4+
5+
return [
6+
'blocks/form' => [
7+
'name' => 'form.block.name',
8+
'icon' => 'email',
9+
'tabs' => [
10+
'inbox' => Blueprint::getInbox(),
11+
'form' => Blueprint::getForm(),
12+
'options' => Blueprint::getOptions()
13+
]
14+
],
15+
'pages/formrequest' => Blueprint::getBlueprint('pages/formrequest'),
16+
'pages/formcontainer' => Blueprint::getBlueprint('pages/formcontainer'),
17+
];

autoload/fields.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
return ['mailview' => []];

autoload/options.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
use Kirby\Cms\App;
4+
use Plain\Formblock\Blueprint;
5+
6+
return [
7+
'from_email' => 'no-reply@' . App::instance()->environment()->host(),
8+
'placeholders' => Blueprint::getPlaceholders(),
9+
'honeypot_variants' => ["email", "name", "url", "tel", "given-name", "family-name", "street-address", "postal-code", "address-line2", "address-line1", "country-name", "language", "bday"],
10+
'default_language' => 'en',
11+
'disable_confirm' => false,
12+
'disable_notify' => false,
13+
'disable_html' => false,
14+
'email_field' => 'email',
15+
'dynamic_validation' => true
16+
]
17+
18+
?>

autoload/routes.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
use Kirby\Toolkit\Str;
4+
use Plain\Formblock\Request;
5+
6+
return [
7+
[
8+
'pattern' => 'form/validator',
9+
'method' => "POST",
10+
'action' => function () {
11+
12+
//Get Page
13+
if ((get('page') ?? "site") === 'site') {
14+
$page = site();
15+
} else {
16+
$page = site()->index(true)->find(get('page'));
17+
}
18+
site()->visit($page, get('lang'));
19+
$rendered_page = page()->render();
20+
preg_match('/\<\!--\[Startvalidation:' . get('id') . '\]--\>(.*?)\<\!--\[Endvalidation\]--\>/s', $rendered_page, $out);
21+
22+
if (empty($out)) {
23+
return json_encode([
24+
'state' => "fatal",
25+
'error_message' => t('form.block.message.fatal_message'),
26+
'success_message' => "",
27+
'redirect' => "",
28+
'fields' => [],
29+
]);
30+
}
31+
32+
return end($out);
33+
34+
}
35+
],
36+
[
37+
'pattern' => 'form/download/(:all)',
38+
'action' => function ($params) {
39+
40+
[$csrf, $page_id, $form_id, $filename] = Str::split($params, '/');
41+
42+
$page_id = str_replace('__DS__', '/', $page_id);
43+
44+
if (csrf($csrf) === false) {
45+
return go('error');
46+
}
47+
48+
header('Content-Type: text/csv');
49+
header("Content-Disposition: attachment;filename={$filename}");
50+
51+
$formRequest = new Request(compact('page_id', 'form_id'));
52+
return $formRequest->download();
53+
54+
}
55+
]
56+
];

autoload/snippets.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
use Plain\Formblock\Form;
4+
5+
return Form::snippets(__DIR__);

classes/Blueprint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private static function getInfoText()
190190
return false;
191191
};
192192

193-
$text = '** With & #123;&#123; &#125;&#125; you can insert incoming values using placeholder.**';
193+
$text = '** With &#123;&#123; &#125;&#125; you can insert incoming values using placeholder.**';
194194
foreach (static::getPlaceholders() as $key => $value) {
195195
$text .= "\n**\{\{ $key \}\}**: ".$value['label'];
196196
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "plain/kirby-form-block-suite",
33
"description": "Contactform based on Kirby blocks.",
44
"type": "kirby-plugin",
5-
"version": "5.1.4",
5+
"version": "5.1.5",
66
"license": "GPL-3.0-only",
77
"homepage": "https://plain-solutions.net/801346",
88
"authors": [

0 commit comments

Comments
 (0)