diff --git a/bricks.xml b/bricks.xml index d6290f10407dfa1c1cc57709a4ae30636f62ed57..b0814346c317c6bcb1384d714e095683eccc138e 100644 --- a/bricks.xml +++ b/bricks.xml @@ -30,6 +30,9 @@ <setting name="useCaptcha" type="checkbox"> <locale group="quiqqer/bricks" var="brick.control.simpleContact.useCaptcha"/> </setting> + <setting name="formContent" data-qui="controls/editors/Input" type="text"> + <locale group="quiqqer/bricks" var="brick.control.simpleContact.formContent"/> + </setting> </settings> </brick> diff --git a/locale.xml b/locale.xml index 505d707a84aaffc440bbd0d6e29a3e08483211a3..c8e172cd1d1184c02979784061460e35a4648943 100644 --- a/locale.xml +++ b/locale.xml @@ -187,6 +187,11 @@ <en> <![CDATA[Protect form submit from spam with a CAPTCHA (requires <b>quiqqer/captcha</b> to be installed!)]]></en> </locale> + <locale name="brick.control.simpleContact.formContent"> + <de><![CDATA[Inhalt des Formulars]]></de> + <en><![CDATA[Form content]]></en> + <pl><![CDATA[Zawartość formularza]]></pl> + </locale> <locale name="brick.control.simpleContact.mail.privacyPolicy_accepted"> <de><![CDATA[Der Benutzer hat die Datenschutzbestimmungen akzeptiert.]]></de> <en><![CDATA[The user has accepted the Privacy Policy.]]></en> diff --git a/src/QUI/Bricks/Controls/SimpleContact.css b/src/QUI/Bricks/Controls/SimpleContact.css index 718d448975d0ec696a87bf719c5b87b00fa56de2..1ae1e660d0a57aa4eda631babcda3071656af736 100644 --- a/src/QUI/Bricks/Controls/SimpleContact.css +++ b/src/QUI/Bricks/Controls/SimpleContact.css @@ -25,6 +25,10 @@ margin-bottom: 10px; } +.qui-contact-formContent { + margin-bottom: 2rem; +} + /* Message & Message color ================================================================= */ diff --git a/src/QUI/Bricks/Controls/SimpleContact.html b/src/QUI/Bricks/Controls/SimpleContact.html index e87638247ad9affb7d735429347838fd6cd4f11f..33611932cbf6130552a4d6cfb9b984238a971e2e 100644 --- a/src/QUI/Bricks/Controls/SimpleContact.html +++ b/src/QUI/Bricks/Controls/SimpleContact.html @@ -31,6 +31,12 @@ </style> </noscript> + {if $formContent} + <div class="qui-contact-formContent default-content"> + {$formContent} + </div> + {/if} + {if $this->getAttribute('labels')} <label for="qui-contact-name"> {locale group="quiqqer/bricks" value="control.simpleContact.name"} diff --git a/src/QUI/Bricks/Controls/SimpleContact.php b/src/QUI/Bricks/Controls/SimpleContact.php index 33f75b51bc7e5ca3898fcdb0b10fbec2c04e2ec9..3d91b5a7efcde3b0e5528fcf8e4a87af976563e6 100644 --- a/src/QUI/Bricks/Controls/SimpleContact.php +++ b/src/QUI/Bricks/Controls/SimpleContact.php @@ -32,7 +32,8 @@ public function __construct($attributes = []) 'data-brickid' => false, 'mailTo' => '', // receiver email 'showPrivacyPolicyCheckbox' => false, - 'useCaptcha' => false + 'useCaptcha' => false, + 'formContent' => '' ]); parent::__construct($attributes); @@ -51,7 +52,7 @@ public function __construct($attributes = []) } $this->addCSSFile( - dirname(__FILE__).'/SimpleContact.css' + dirname(__FILE__) . '/SimpleContact.css' ); } @@ -69,6 +70,7 @@ public function getBody() $message = ''; $privacyPolicyCheckbox = $this->getAttribute('showPrivacyPolicyCheckbox'); $useCaptcha = $this->getAttribute('useCaptcha'); + $formContent = $this->getAttribute('formContent'); $error = false; // Is javascript disabled? @@ -127,7 +129,7 @@ public function getBody() $label = preg_replace( '#\[([^\]]*)\]#i', - '<a href="'.$url.'" target="_blank">$1</a>', + '<a href="' . $url . '" target="_blank">$1</a>', $label ); @@ -160,13 +162,14 @@ public function getBody() } $Engine->assign([ - 'this' => $this, - 'name' => $name, - 'email' => $email, - 'message' => $message + 'this' => $this, + 'name' => $name, + 'email' => $email, + 'message' => $message, + 'formContent' => $formContent ]); - return $Engine->fetch(dirname(__FILE__).'/SimpleContact.html'); + return $Engine->fetch(dirname(__FILE__) . '/SimpleContact.html'); } /** @@ -193,7 +196,7 @@ public function sendMail($Engine) } $receiver = $this->getAttribute('mailTo'); - $url = $this->getProject()->getHost().$Site->getUrlRewritten(); + $url = $this->getProject()->getHost() . $Site->getUrlRewritten(); // fallback: admin email if (!QUI\Utils\Security\Orthos::checkMailSyntax($receiver)) { @@ -204,7 +207,7 @@ public function sendMail($Engine) $Mailer->addRecipient($receiver); $Mailer->addReplyTo($_POST['email']); - $Mailer->setSubject($Site->getAttribute('title').' | '.$url); + $Mailer->setSubject($Site->getAttribute('title') . ' | ' . $url); $body = " <span style=\"font-weight: bold;\">From:</span> {$_POST['name']}<br />