Skip to content
Code-Schnipsel Gruppen Projekte
Commit 46e70ee2 erstellt von Dominik Chrzanowski's avatar Dominik Chrzanowski
Dateien durchsuchen

feat: Added new setting (formContent) [SimpleContact] #132

Übergeordneter 38db4d61
No related branches found
No related tags found
1 Merge Request!14Feat#132
Dieser Commit ist Teil des Merge Request !14. Hier erstellte Kommentare werden im Kontext dieses Merge Request erstellt.
......@@ -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>
......
......@@ -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>
......
......@@ -25,6 +25,10 @@
margin-bottom: 10px;
}
.qui-contact-formContent {
margin-bottom: 2rem;
}
/* Message & Message color
================================================================= */
......
......@@ -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"}
......
......@@ -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 />
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren