Skip to content

Commit

Permalink
renamed contact form to submission form
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Patzer committed Sep 24, 2019
1 parent 0a8d41e commit 21850d5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.7.1] - 2019-09-24

#### Changed
- renamed contact form config element type to submission form config element type

## [1.7.0] - 2019-09-24

#### Added
Expand Down
Expand Up @@ -14,9 +14,9 @@
use HeimrichHannot\UtilsBundle\Model\ModelUtil;
use Twig\Environment;

class ContactFormConfigElementType implements ListConfigElementTypeInterface
class SubmissionFormConfigElementType implements ListConfigElementTypeInterface
{
const TYPE = 'contact_form';
const TYPE = 'submission_form';

public static $recipientEmail;
/**
Expand Down Expand Up @@ -47,7 +47,7 @@ public function addToItemData(ItemInterface $item, ListConfigElementModel $confi

$identifier = $table.'_'.$moduleId.$item->getRawValue('id');

$item->setFormattedValue($configElement->templateVariable ?: 'contactForm', $this->twig->render('@HeimrichHannotContaoList/config_element/contact_form_modal_bootstrap4.html.twig', [
$item->setFormattedValue($configElement->templateVariable ?: 'submissionForm', $this->twig->render('@HeimrichHannotContaoList/config_element/submission_form_modal_bootstrap4.html.twig', [
'identifier' => $identifier,
'item' => $this,
'form' => $this->generateSubmissionReader((int) $configElement->submissionReader),
Expand All @@ -56,7 +56,7 @@ public function addToItemData(ItemInterface $item, ListConfigElementModel $confi

public function addEmailToTokens(&$submissionData, $submission)
{
$submissionData['form_value_contact_form_email'] = static::$recipientEmail;
$submissionData['form_value_submission_form_email'] = static::$recipientEmail;

return true;
}
Expand Down Expand Up @@ -96,7 +96,7 @@ public static function getType(): string
*/
public function getPalette(): string
{
return '{config_legend},contactFormExplanation,submissionReader,emailField;';
return '{config_legend},submissionFormExplanation,submissionReader,emailField;';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/config/services.yml
Expand Up @@ -104,6 +104,6 @@ services:
autowire: true
tags: ['huh.list.config_element_type']

HeimrichHannot\ListBundle\ConfigElementType\ContactFormConfigElementType:
HeimrichHannot\ListBundle\ConfigElementType\SubmissionFormConfigElementType:
autowire: true
tags: ['huh.list.config_element_type']
4 changes: 2 additions & 2 deletions src/Resources/contao/dca/tl_list_config_element.php
Expand Up @@ -188,10 +188,10 @@
'eval' => ['tl_class' => 'w50 autoheight', 'fieldType' => 'checkbox', 'filesOnly' => true, 'extensions' => Config::get('validImageTypes'), 'mandatory' => true, 'multiple' => true],
'sql' => "blob NULL",
],
'contactFormExplanation' => [
'submissionFormExplanation' => [
'inputType' => 'explanation',
'eval' => [
'text' => &$GLOBALS['TL_LANG']['tl_list_config_element']['contactFormExplanation'],
'text' => &$GLOBALS['TL_LANG']['tl_list_config_element']['submissionFormExplanation'],
'class' => 'tl_info',
'tl_class' => 'long',
]
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/contao/languages/de/tl_list_config_element.php
Expand Up @@ -32,7 +32,7 @@
$lang['submissionReader'][1] = 'Wählen Sie hier ein Modul vom Typ "Einsendungsleser" aus.';
$lang['emailField'][0] = 'E-Mail-Feld';
$lang['emailField'][1] = 'Wählen Sie hier das Feld aus, an das die E-Mail verschickt werden soll.';
$lang['contactFormExplanation'] = 'Die E-Mail-Adresse, an die das Formular verschickt wird, finden Sie im Notification-Center-Token ##form_value_contact_form_email##.';
$lang['submissionFormExplanation'] = 'Die E-Mail-Adresse, an die das Formular verschickt wird, finden Sie im Notification-Center-Token ##form_value_submission_form_email##.';

/**
* Legends
Expand All @@ -46,7 +46,7 @@
*/
$lang['reference'] = [
\HeimrichHannot\ListBundle\ConfigElementType\ImageConfigElementType::TYPE => 'Bild',
\HeimrichHannot\ListBundle\ConfigElementType\ContactFormConfigElementType::TYPE => 'Kontaktformular',
\HeimrichHannot\ListBundle\ConfigElementType\SubmissionFormConfigElementType::TYPE => 'Einsendungsformular',
\HeimrichHannot\ListBundle\Backend\ListConfigElement::PLACEHOLDER_IMAGE_MODE_SIMPLE => 'einfach',
\HeimrichHannot\ListBundle\Backend\ListConfigElement::PLACEHOLDER_IMAGE_MODE_GENDERED => 'geschlechtsspezifisch',
\HeimrichHannot\ListBundle\Backend\ListConfigElement::PLACEHOLDER_IMAGE_MODE_RANDOM => 'zufällig',
Expand Down
@@ -1,11 +1,11 @@
<div class="contact-form">
<div class="submission-form">
<!-- Button trigger modal -->
<a href="#" data-toggle="modal" data-target="#contact_{{ identifier }}_modal">
<a href="#" data-toggle="modal" data-target="#submission_{{ identifier }}_modal">
{{ 'huh.list.misc.contact'|trans }}
</a>

<!-- Modal -->
<div class="modal fade" id="contact_{{ identifier }}_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal fade" id="submission_{{ identifier }}_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
Expand Down

0 comments on commit 21850d5

Please sign in to comment.