diff --git a/inc/modules/contact/Admin.php b/inc/modules/contact/Admin.php
index 8642d46..9e2c8a1 100644
--- a/inc/modules/contact/Admin.php
+++ b/inc/modules/contact/Admin.php
@@ -34,6 +34,11 @@ class Admin extends AdminModule
$assign['email'] = $value['email'];
}
+ $assign['checkbox'] = [
+ 'switch' => $value['checkbox.switch'],
+ 'content' => $this->tpl->noParse($value['checkbox.content']),
+ ];
+
$assign['driver'] = $value['driver'];
$assign['phpmailer'] = [
'server' => $value['phpmailer.server'],
@@ -50,6 +55,8 @@ class Admin extends AdminModule
{
$update = [
'email' => ($_POST['user'] > 0 ? $_POST['user'] : $_POST['email']),
+ 'checkbox.switch' => $_POST['checkbox']['switch'],
+ 'checkbox.content' => $_POST['checkbox']['content'],
'driver' => $_POST['driver'],
'phpmailer.server' => $_POST['phpmailer']['server'],
'phpmailer.port' => $_POST['phpmailer']['port'],
diff --git a/inc/modules/contact/Info.php b/inc/modules/contact/Info.php
index 70b3d1d..9faf51e 100644
--- a/inc/modules/contact/Info.php
+++ b/inc/modules/contact/Info.php
@@ -13,8 +13,8 @@ return [
'name' => $core->lang['contact']['module_name'],
'description' => $core->lang['contact']['module_desc'],
'author' => 'Sruu.pl',
- 'version' => '1.1',
- 'compatibility' => '1.3.*',
+ 'version' => '1.2',
+ 'compatibility' => '1.3.*',
'icon' => 'envelope',
'install' => function () use ($core) {
@@ -27,7 +27,9 @@ return [
('contact', 'phpmailer.port', '587'),
('contact', 'phpmailer.username', 'login@example.com'),
('contact', 'phpmailer.name', 'Batflat contact'),
- ('contact', 'phpmailer.password', 'yourpassword')");
+ ('contact', 'phpmailer.password', 'yourpassword'),
+ ('contact', 'checkbox.switch', '0'),
+ ('contact', 'checkbox.content', 'I agree to the processing of personal data...')");
},
'uninstall' => function () use ($core) {
$core->db()->pdo()->exec("DELETE FROM `settings` WHERE `module` = 'contact'");
diff --git a/inc/modules/contact/Site.php b/inc/modules/contact/Site.php
index 1b296b3..bddab1b 100644
--- a/inc/modules/contact/Site.php
+++ b/inc/modules/contact/Site.php
@@ -43,7 +43,12 @@ class Site extends SiteModule
private function _insertForm()
{
- return $this->draw('form.html');
+ return $this->draw('form.html', [
+ 'checkbox' => [
+ 'switch' => $this->settings('contact', 'checkbox.switch'),
+ 'content' => $this->settings('contact', 'checkbox.content'),
+ ]
+ ]);
}
private function _initDriver()
diff --git a/inc/modules/contact/lang/admin/en_english.ini b/inc/modules/contact/lang/admin/en_english.ini
index 3a1a01b..a4740d7 100644
--- a/inc/modules/contact/lang/admin/en_english.ini
+++ b/inc/modules/contact/lang/admin/en_english.ini
@@ -9,6 +9,9 @@ save_success = "Contact data saved."
save_failure = "Failed to save contact data."
info = "Place this tag in website template"
+checkbox = "Required checkbox field"
+checkbox_content = "Content to accept"
+
phpmailer_error = "Sorry, I can't find PHPMailer class. Please, execute composer require phpmailer/phpmailer in your project terminal."
driver = "Mail driver"
diff --git a/inc/modules/contact/lang/admin/es_spanish.ini b/inc/modules/contact/lang/admin/es_spanish.ini
index a6b8e82..666131f 100644
--- a/inc/modules/contact/lang/admin/es_spanish.ini
+++ b/inc/modules/contact/lang/admin/es_spanish.ini
@@ -9,6 +9,9 @@ save_success = "Datos de contacto guardados."
save_failure = "Fallo al guardar los datos de contacto."
info = "Ponga esta etiqueta en la plantilla del sitio"
+checkbox = "Required checkbox field"
+checkbox_content = "Content to accept"
+
phpmailer_error = "Disculpas, pero no encuento la clase PHPMailer. Por favor, ejecute composer require phpmailer/phpmailer en su terminal."
driver = "Mail driver"
diff --git a/inc/modules/contact/lang/admin/fr_french.ini b/inc/modules/contact/lang/admin/fr_french.ini
index 13883c5..c3fbd6d 100644
--- a/inc/modules/contact/lang/admin/fr_french.ini
+++ b/inc/modules/contact/lang/admin/fr_french.ini
@@ -6,7 +6,6 @@ save_success = "La configuration du mode de contact a été sauvegardée.
save_failure = "Echec de sauvegarde de la configuration."
info = "Placez cette balise dans le modèle su site"
-
recipient = "Destinataire"
custom = "-- Adresse email personnelle --"
or_mail = "ou adresse email personnelle"
@@ -15,6 +14,9 @@ save_success = "La configuration du mode de contact a été sauvegardée.
save_failure = "Echec de sauvegarde de la configuration."
info = "Placez cette balise dans le modèle su site"
+checkbox = "Required checkbox field"
+checkbox_content = "Content to accept"
+
phpmailer_error = "Sorry, I can't find PHPMailer class. Please, execute composer require phpmailer/phpmailer in your project terminal."
driver = "Mail driver"
diff --git a/inc/modules/contact/lang/admin/it_italian.ini b/inc/modules/contact/lang/admin/it_italian.ini
index 3f58b9a..52b3b11 100644
--- a/inc/modules/contact/lang/admin/it_italian.ini
+++ b/inc/modules/contact/lang/admin/it_italian.ini
@@ -1,18 +1,22 @@
-module_name = "Contatti"
-module_desc = "Visualizza il modulo di contatto nella pagina."
-recipient = "Destinatario"
-custom = "-- Indirizzo e-mail personalizzato --"
-or_mail = "o indirizzo e-mail personalizzato"
-example = "Esempio: contact@johndoe.com"
-save_success = "Dati di contatto salvati"
-save_failure = "Impossibile salvare i dati di contatto."
-info = "Inserisci questo tag nel template"
-phpmailer_error = "Spiacente, non riesco a trovare la classe PHPMailer. Per favore, esegui composer require phpmailer/phpmailer nel tuo terminale di progetto."
-driver = "Servizio E-mail"
-mail = "mail() (default)"
-phpmailer = "PHPMailer (SMTP)"
-server = "Server"
-port = "Porta"
-username = "Username"
-password = "Password"
-name = "Nome mittente"
\ No newline at end of file
+module_name = "Contatti"
+module_desc = "Visualizza il modulo di contatto nella pagina."
+
+recipient = "Destinatario"
+custom = "-- Indirizzo e-mail personalizzato --"
+or_mail = "o indirizzo e-mail personalizzato"
+example = "Esempio: contact@johndoe.com"
+save_success = "Dati di contatto salvati"
+save_failure = "Impossibile salvare i dati di contatto."
+info = "Inserisci questo tag nel template"
+phpmailer_error = "Spiacente, non riesco a trovare la classe PHPMailer. Per favore, esegui composer require phpmailer/phpmailer nel tuo terminale di progetto."
+driver = "Servizio E-mail"
+mail = "mail() (default)"
+phpmailer = "PHPMailer (SMTP)"
+server = "Server"
+port = "Porta"
+username = "Username"
+password = "Password"
+name = "Nome mittente"
+
+checkbox = "Required checkbox field"
+checkbox_content = "Content to accept"
\ No newline at end of file
diff --git a/inc/modules/contact/lang/admin/nl_dutch.ini b/inc/modules/contact/lang/admin/nl_dutch.ini
index 03a5335..515de32 100644
--- a/inc/modules/contact/lang/admin/nl_dutch.ini
+++ b/inc/modules/contact/lang/admin/nl_dutch.ini
@@ -9,6 +9,9 @@ save_success = "Contactgegevens opgeslagen."
save_failure = "Kan contactgegevens niet opslaan."
info = "Plaats deze tag in een website sjabloon"
+checkbox = "Required checkbox field"
+checkbox_content = "Content to accept"
+
phpmailer_error = "Sorry, ik kan de PHPMailer-klasse niet vinden. Voer alsjeblieft composer require phpmailer/phpmailer uit in je projectterminal."
driver = "Mail driver"
diff --git a/inc/modules/contact/lang/admin/pl_polski.ini b/inc/modules/contact/lang/admin/pl_polski.ini
index 4944ab2..148964b 100644
--- a/inc/modules/contact/lang/admin/pl_polski.ini
+++ b/inc/modules/contact/lang/admin/pl_polski.ini
@@ -9,6 +9,9 @@ save_success = "Pomyślnie zaktualizowano dane kontaktowe."
save_failure = "Nie udało się zaktualizować danych kontaktowych."
info = "Aby wyświetlić formularz na stronie, wklej tag"
+checkbox = "Obowiązkowe pole typu checkbox"
+checkbox_content = "Treść do zaakceptowania"
+
phpmailer_error = "Klasa PHPMailer nie jest zainstalowana. Użyj composer require phpmailer/phpmailer aby zainstalować dodatkowy pakiet."
driver = "Wybierz sterownik do wysyłania wiadomości"
diff --git a/inc/modules/contact/lang/admin/ru_russian.ini b/inc/modules/contact/lang/admin/ru_russian.ini
index 9f92eec..49d49e0 100644
--- a/inc/modules/contact/lang/admin/ru_russian.ini
+++ b/inc/modules/contact/lang/admin/ru_russian.ini
@@ -1,18 +1,24 @@
-module_name = "Контакты"
-module_desc = "Отображать контактную форму на странице."
-recipient = "Получатель"
-custom = "-- Свой e-mail --"
-or_mail = "или свой e-mail "
-example = "Пример: contact@johndoe.com"
-save_success = "Данные контактной формы сохранены."
-save_failure = "Ошибка сохранения."
-info = "Поместите этот код на страницу сайта"
-phpmailer_error = "Извините, не могу найти класс PHPMailer. Пожалуйста, выполните composer require phpmailer/phpmailer в вашем терминале."
-driver = "Почтовая служба"
-mail = "mail() (по умолчанию)"
-phpmailer = "PHPMailer (SMTP)"
-server = "Сервер"
-port = "Порт"
-username = "Имя пользователя"
-password = "Пароль"
-name = "Имя отправителя"
\ No newline at end of file
+module_name = "Контакты"
+module_desc = "Отображать контактную форму на странице."
+
+recipient = "Получатель"
+custom = "-- Свой e-mail --"
+or_mail = "или свой e-mail "
+example = "Пример: contact@johndoe.com"
+save_success = "Данные контактной формы сохранены."
+save_failure = "Ошибка сохранения."
+info = "Поместите этот код на страницу сайта"
+
+checkbox = "Required checkbox field"
+checkbox_content = "Content to accept"
+
+phpmailer_error = "Извините, не могу найти класс PHPMailer. Пожалуйста, выполните composer require phpmailer/phpmailer в вашем терминале."
+
+driver = "Почтовая служба"
+mail = "mail() (по умолчанию)"
+phpmailer = "PHPMailer (SMTP)"
+server = "Сервер"
+port = "Порт"
+username = "Имя пользователя"
+password = "Пароль"
+name = "Имя отправителя"
\ No newline at end of file
diff --git a/inc/modules/contact/lang/admin/se_swedish.ini b/inc/modules/contact/lang/admin/se_swedish.ini
index 9f5dbf2..6e376e2 100644
--- a/inc/modules/contact/lang/admin/se_swedish.ini
+++ b/inc/modules/contact/lang/admin/se_swedish.ini
@@ -9,6 +9,9 @@ save_success = "Kontaktinformationen sparades korrekt."
save_failure = "Misslyckades att spara kontaktinformationen."
info = "Placera denna kod i webbplatsens mall."
+checkbox = "Required checkbox field"
+checkbox_content = "Content to accept"
+
phpmailer_error = "Ledsen, kan inte hitta PHPMailer class. Vänligen, aktivera composer require phpmailer/phpmailer i din projektmapp."
driver = "Drivrutin för e-post"
diff --git a/inc/modules/contact/lang/admin/tr_turkish.ini b/inc/modules/contact/lang/admin/tr_turkish.ini
index 45c787d..31e0914 100644
--- a/inc/modules/contact/lang/admin/tr_turkish.ini
+++ b/inc/modules/contact/lang/admin/tr_turkish.ini
@@ -1,18 +1,24 @@
-module_name = "İletişim"
-module_desc = "Ekrana iletişim formu getirir."
-recipient = "Alıcı"
-custom = "-- Özel e-posta adresi --"
-or_mail = "veya özel e-posta adresi."
-example = "Örnek: contact@johndoe.com"
-save_success = "İletişim bilgisi kaydedildi."
-save_failure = "İletişim bilgisi kaydedilemedi."
-info = "Bu etiketi site şablonu içerisine yerleştirin"
-phpmailer_error = "Üzgünüm, PHPMailer sınıfı bulunamadı. Lütfen terminal ekranında composer require phpmailer/phpmailer kodunu çalıştırın."
-driver = "Posta sürücüsü"
-mail = "mail() (öntanımlı)"
-phpmailer = "PHPMailer (SMTP)"
-server = "Sunucu"
-port = "Port"
-username = "Kullanıcı"
-password = "Parola"
-name = "Gönderici adı"
\ No newline at end of file
+module_name = "İletişim"
+module_desc = "Ekrana iletişim formu getirir."
+
+recipient = "Alıcı"
+custom = "-- Özel e-posta adresi --"
+or_mail = "veya özel e-posta adresi."
+example = "Örnek: contact@johndoe.com"
+save_success = "İletişim bilgisi kaydedildi."
+save_failure = "İletişim bilgisi kaydedilemedi."
+info = "Bu etiketi site şablonu içerisine yerleştirin"
+
+checkbox = "Required checkbox field"
+checkbox_content = "Content to accept"
+
+phpmailer_error = "Üzgünüm, PHPMailer sınıfı bulunamadı. Lütfen terminal ekranında composer require phpmailer/phpmailer kodunu çalıştırın."
+
+driver = "Posta sürücüsü"
+mail = "mail() (öntanımlı)"
+phpmailer = "PHPMailer (SMTP)"
+server = "Sunucu"
+port = "Port"
+username = "Kullanıcı"
+password = "Parola"
+name = "Gönderici adı"
\ No newline at end of file
diff --git a/inc/modules/contact/view/admin/settings.html b/inc/modules/contact/view/admin/settings.html
index 31522af..c14183d 100644
--- a/inc/modules/contact/view/admin/settings.html
+++ b/inc/modules/contact/view/admin/settings.html
@@ -15,15 +15,37 @@
-
-
-
-