| ... | ... |
@@ -15,6 +15,6 @@ |
| 15 | 15 |
//$GLOBALS['TL_CSS']['formilicious'] = 'system/modules/eSM_formilicious/assets/css/form.min.css||static'; |
| 16 | 16 |
/*$GLOBALS['TL_HOOKS']['loadDataContainer'][] = array('\FormiliciousHooks','eSMLoadDataContainer');
|
| 17 | 17 |
$GLOBALS['TL_HOOKS']['loadFormField'][] = array('\FormiliciousHooks','eSMLoadFormField');
|
| 18 |
-$GLOBALS['TL_HOOKS']['getAttributesFromDca'][] = array('\FormiliciousHooks','eSMGetAttributesFromDca');
|
|
| 19 |
-$GLOBALS['FE_MOD']['user']['registration'] = '\eSM_formilicious\ModuleRegistration'; |
|
| 20 |
-$GLOBALS['FE_MOD']['user']['personalData'] = '\eSM_formilicious\ModulePersonalData';*/ |
|
| 18 |
+$GLOBALS['TL_HOOKS']['getAttributesFromDca'][] = array('\FormiliciousHooks','eSMGetAttributesFromDca');*/
|
|
| 19 |
+$GLOBALS['FE_MOD']['user']['registration'] = '\vonRotenberg\FormiliciousBundle\Controller\Frontend\Module\ModuleRegistration'; |
|
| 20 |
+$GLOBALS['FE_MOD']['user']['personalData'] = '\vonRotenberg\FormiliciousBundle\Controller\Frontend\Module\ModulePersonalData'; |
| ... | ... |
@@ -1 +1 @@ |
| 1 |
-input[type=date],input[type=datetime],input[type=email],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],select,textarea{width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.widget input.captcha{max-width:4em}.formbody{display:grid;grid-gap:10px;row-gap:.75em;grid-template-columns:repeat(12,1fr);align-items:end}.formbody>:not(.widget){grid-column:auto/span 12}.formbody>fieldset{grid-column-start:1;grid-column:auto/span 12;display:grid;grid-gap:10px;row-gap:.75em;grid-template-columns:repeat(12,1fr);align-items:end}.formbody .widget label{display:block;margin-bottom:.4em;line-height:1.5em}.formbody .submit_container.fl_right_alignment,.formbody .widget.fl_right_alignment{text-align:right}.formbody .submit_container.fl_center_alignment,.formbody .widget.fl_center_alignment{text-align:center}.formbody .submit_container.fl_left_alignment,.formbody .widget.fl_left_alignment{text-align:left}.widget.lblp{padding-top:1.9em}.formbody .widget.w10,.formbody .widget.w11,.formbody .widget.w15,.formbody .widget.w16_5{grid-column:auto/span 2}.formbody .widget.w20,.formbody .widget.w22,.formbody .widget.w25{grid-column:auto/span 3}.formbody .widget.w30,.formbody .widget.w33{grid-column:auto/span 4}.formbody .widget.w35,.formbody .widget.w40{grid-column:auto/span 5}.formbody .widget.w44,.formbody .widget.w45,.formbody .widget.w50{grid-column:auto/span 6}.formbody .widget.w55{grid-column:auto/span 7}.formbody .widget.w60,.formbody .widget.w65,.formbody .widget.w66{grid-column:auto/span 8}.formbody .widget.w70,.formbody .widget.w75{grid-column:auto/span 9}.formbody .widget.w80{grid-column:auto/span 10}.formbody .widget.w85,.formbody .widget.w90,.formbody .widget.w95{grid-column:auto/span 11}.formbody .widget.w100{grid-column:auto/span 12}.formbody .widget.clr{grid-column-start:1}@media screen and (max-width:599px){.formbody .widget.w10,.formbody .widget.w100,.formbody .widget.w11,.formbody .widget.w15,.formbody .widget.w16_5,.formbody .widget.w20,.formbody .widget.w22,.formbody .widget.w25,.formbody .widget.w30,.formbody .widget.w33,.formbody .widget.w35,.formbody .widget.w40,.formbody .widget.w44,.formbody .widget.w45,.formbody .widget.w50,.formbody .widget.w55,.formbody .widget.w60,.formbody .widget.w65,.formbody .widget.w66,.formbody .widget.w70,.formbody .widget.w75,.formbody .widget.w80,.formbody .widget.w85,.formbody .widget.w90,.formbody .widget.w95{grid-column:auto/span 12;grid-column-start:1}}
|
|
| 2 | 1 |
\ No newline at end of file |
| 2 |
+input[type=date],input[type=datetime],input[type=email],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],select,textarea{width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.widget input.captcha{max-width:4em}.formbody,.formbody>.fields:not(.widget){display:grid;grid-gap:10px;row-gap:.75em;grid-template-columns:repeat(12,1fr);align-items:end}.formbody>:not(.widget){grid-column:auto/span 12}.formbody>fieldset{grid-column-start:1;grid-column:auto/span 12;display:grid;grid-gap:10px;row-gap:.75em;grid-template-columns:repeat(12,1fr);align-items:end}.formbody .widget label{display:block;margin-bottom:.4em;line-height:1.5em}.formbody .submit_container.fl_right_alignment,.formbody .widget.fl_right_alignment{text-align:right}.formbody .submit_container.fl_center_alignment,.formbody .widget.fl_center_alignment{text-align:center}.formbody .submit_container.fl_left_alignment,.formbody .widget.fl_left_alignment{text-align:left}.widget.lblp{padding-top:1.9em}.formbody .widget.w10,.formbody .widget.w11,.formbody .widget.w15,.formbody .widget.w16_5{grid-column:auto/span 2}.formbody .widget.w20,.formbody .widget.w22,.formbody .widget.w25{grid-column:auto/span 3}.formbody .widget.w30,.formbody .widget.w33{grid-column:auto/span 4}.formbody .widget.w35,.formbody .widget.w40{grid-column:auto/span 5}.formbody .widget.w44,.formbody .widget.w45,.formbody .widget.w50{grid-column:auto/span 6}.formbody .widget.w55{grid-column:auto/span 7}.formbody .widget.w60,.formbody .widget.w65,.formbody .widget.w66{grid-column:auto/span 8}.formbody .widget.w70,.formbody .widget.w75{grid-column:auto/span 9}.formbody .widget.w80{grid-column:auto/span 10}.formbody .widget.w85,.formbody .widget.w90,.formbody .widget.w95{grid-column:auto/span 11}.formbody .widget,.formbody .widget.w100{grid-column:auto/span 12}.formbody .widget.clr{grid-column-start:1}@media screen and (max-width:599px){.formbody .widget.w10,.formbody .widget.w100,.formbody .widget.w11,.formbody .widget.w15,.formbody .widget.w16_5,.formbody .widget.w20,.formbody .widget.w22,.formbody .widget.w25,.formbody .widget.w30,.formbody .widget.w33,.formbody .widget.w35,.formbody .widget.w40,.formbody .widget.w44,.formbody .widget.w45,.formbody .widget.w50,.formbody .widget.w55,.formbody .widget.w60,.formbody .widget.w65,.formbody .widget.w66,.formbody .widget.w70,.formbody .widget.w75,.formbody .widget.w80,.formbody .widget.w85,.formbody .widget.w90,.formbody .widget.w95{grid-column:auto/span 12;grid-column-start:1}}
|
|
| 3 | 3 |
\ No newline at end of file |
| 4 | 4 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,82 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+/** |
|
| 4 |
+ * eSales Media Formilicious for Contao Open Source CMS |
|
| 5 |
+ * |
|
| 6 |
+ * Copyright (C) 2013-2014 eSalesMedia |
|
| 7 |
+ * |
|
| 8 |
+ * @package eSM_formilicious |
|
| 9 |
+ * @link http://www.esales-media.de |
|
| 10 |
+ * @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL |
|
| 11 |
+ * |
|
| 12 |
+ * @author Benjamin Roth <benjamin@esales-media.de> |
|
| 13 |
+ */ |
|
| 14 |
+ |
|
| 15 |
+ |
|
| 16 |
+/** |
|
| 17 |
+ * Run in a custom namespace, so the class can be replaced |
|
| 18 |
+ */ |
|
| 19 |
+namespace vonRotenberg\FormiliciousBundle\Controller\Frontend\Module; |
|
| 20 |
+ |
|
| 21 |
+use Contao\ModulePersonalData as OrgModulePersonalData; |
|
| 22 |
+use Contao\PageModel; |
|
| 23 |
+use Contao\System; |
|
| 24 |
+ |
|
| 25 |
+/** |
|
| 26 |
+ * Class ModulePersonalData |
|
| 27 |
+ * |
|
| 28 |
+ * Front end module "personal data". |
|
| 29 |
+ * @copyright Leo Feyer 2005-2014 |
|
| 30 |
+ * @author Leo Feyer <https://contao.org> |
|
| 31 |
+ * @package Core |
|
| 32 |
+ */ |
|
| 33 |
+class ModulePersonalData extends OrgModulePersonalData |
|
| 34 |
+{
|
|
| 35 |
+ |
|
| 36 |
+ public function generate() |
|
| 37 |
+ {
|
|
| 38 |
+ $this->loadDataContainer('tl_member');
|
|
| 39 |
+ $originalDca = $GLOBALS['TL_DCA']['tl_member']; |
|
| 40 |
+ $return = parent::generate(); |
|
| 41 |
+ $GLOBALS['TL_DCA']['tl_member'] = $originalDca; |
|
| 42 |
+ |
|
| 43 |
+ return $return; |
|
| 44 |
+ } |
|
| 45 |
+ |
|
| 46 |
+ |
|
| 47 |
+ /** |
|
| 48 |
+ * Generate the module |
|
| 49 |
+ */ |
|
| 50 |
+ protected function compile() |
|
| 51 |
+ {
|
|
| 52 |
+ /** @var PageModel $objPage */ |
|
| 53 |
+ global $objPage; |
|
| 54 |
+ |
|
| 55 |
+ $GLOBALS['TL_LANGUAGE'] = $objPage->language; |
|
| 56 |
+ |
|
| 57 |
+ System::loadLanguageFile('tl_member');
|
|
| 58 |
+ $this->loadDataContainer('tl_member');
|
|
| 59 |
+ |
|
| 60 |
+ |
|
| 61 |
+ $arrEditable = []; |
|
| 62 |
+ foreach ($this->editable as $key=>$fielddata) |
|
| 63 |
+ {
|
|
| 64 |
+ // Split formilicious editable data in single vars |
|
| 65 |
+ list($field, $fieldWidth, $fieldClr, $fieldMandatory) = array_values($fielddata); |
|
| 66 |
+ $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['eSM_fl_width'] = $fieldWidth; |
|
| 67 |
+ $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['eSM_fl_clear'] = $fieldClr; |
|
| 68 |
+ if ($fieldMandatory) |
|
| 69 |
+ {
|
|
| 70 |
+ $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['mandatory'] = $fieldMandatory; |
|
| 71 |
+ } else {
|
|
| 72 |
+ $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['mandatory'] = false; |
|
| 73 |
+ |
|
| 74 |
+ } |
|
| 75 |
+ $arrEditable[$key] = $field; |
|
| 76 |
+ } |
|
| 77 |
+ $this->editable = $arrEditable; |
|
| 78 |
+ |
|
| 79 |
+ parent::compile(); |
|
| 80 |
+ |
|
| 81 |
+ } |
|
| 82 |
+} |
| 0 | 83 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,81 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+/** |
|
| 4 |
+ * eSales Media Formilicious for Contao Open Source CMS |
|
| 5 |
+ * |
|
| 6 |
+ * Copyright (C) 2013-2014 eSalesMedia |
|
| 7 |
+ * |
|
| 8 |
+ * @package eSM_formilicious |
|
| 9 |
+ * @link http://www.esales-media.de |
|
| 10 |
+ * @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL |
|
| 11 |
+ * |
|
| 12 |
+ * @author Benjamin Roth <benjamin@esales-media.de> |
|
| 13 |
+ */ |
|
| 14 |
+ |
|
| 15 |
+ |
|
| 16 |
+/** |
|
| 17 |
+ * Run in a custom namespace, so the class can be replaced |
|
| 18 |
+ */ |
|
| 19 |
+namespace vonRotenberg\FormiliciousBundle\Controller\Frontend\Module; |
|
| 20 |
+ |
|
| 21 |
+use Contao\ModuleRegistration as OrgModuleRegistration; |
|
| 22 |
+use Contao\PageModel; |
|
| 23 |
+use Contao\System; |
|
| 24 |
+ |
|
| 25 |
+/** |
|
| 26 |
+ * Class ModuleRegistration |
|
| 27 |
+ * |
|
| 28 |
+ * Front end module "registration". |
|
| 29 |
+ * @copyright Leo Feyer 2005-2014 |
|
| 30 |
+ * @author Leo Feyer <https://contao.org> |
|
| 31 |
+ * @package Core |
|
| 32 |
+ */ |
|
| 33 |
+class ModuleRegistration extends OrgModuleRegistration |
|
| 34 |
+{
|
|
| 35 |
+ protected $originalDca; |
|
| 36 |
+ |
|
| 37 |
+ public function generate() |
|
| 38 |
+ {
|
|
| 39 |
+ $return = parent::generate(); |
|
| 40 |
+ $GLOBALS['TL_DCA']['tl_member'] = $this->originalDca; |
|
| 41 |
+ |
|
| 42 |
+ return $return; |
|
| 43 |
+ } |
|
| 44 |
+ |
|
| 45 |
+ |
|
| 46 |
+ /** |
|
| 47 |
+ * Generate the module |
|
| 48 |
+ */ |
|
| 49 |
+ protected function compile() |
|
| 50 |
+ {
|
|
| 51 |
+ /** @var PageModel $objPage */ |
|
| 52 |
+ global $objPage; |
|
| 53 |
+ |
|
| 54 |
+ $GLOBALS['TL_LANGUAGE'] = $objPage->language; |
|
| 55 |
+ |
|
| 56 |
+ System::loadLanguageFile('tl_member');
|
|
| 57 |
+ $this->loadDataContainer('tl_member');
|
|
| 58 |
+ $this->originalDca = $GLOBALS['TL_DCA']['tl_member']; |
|
| 59 |
+ |
|
| 60 |
+ $arrEditable = []; |
|
| 61 |
+ foreach ($this->editable as $key=>$fielddata) |
|
| 62 |
+ {
|
|
| 63 |
+ // Split formilicious editable data in single vars |
|
| 64 |
+ list($field, $fieldWidth, $fieldClr, $fieldMandatory) = array_values($fielddata); |
|
| 65 |
+ $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['eSM_fl_width'] = $fieldWidth; |
|
| 66 |
+ $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['eSM_fl_clear'] = $fieldClr; |
|
| 67 |
+ if ($fieldMandatory) |
|
| 68 |
+ {
|
|
| 69 |
+ $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['mandatory'] = $fieldMandatory; |
|
| 70 |
+ } else {
|
|
| 71 |
+ $GLOBALS['TL_DCA']['tl_member']['fields'][$field]['eval']['mandatory'] = false; |
|
| 72 |
+ |
|
| 73 |
+ } |
|
| 74 |
+ $arrEditable[$key] = $field; |
|
| 75 |
+ } |
|
| 76 |
+ $this->editable = $arrEditable; |
|
| 77 |
+ |
|
| 78 |
+ parent::compile(); |
|
| 79 |
+ |
|
| 80 |
+ } |
|
| 81 |
+} |
| 0 | 82 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,90 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+declare(strict_types=1); |
|
| 4 |
+ |
|
| 5 |
+/* |
|
| 6 |
+ * This file is part of formilicious bundle for Contao. |
|
| 7 |
+ * |
|
| 8 |
+ * (c) Benjamin Roth |
|
| 9 |
+ * |
|
| 10 |
+ * @license LGPL-3.0-or-later |
|
| 11 |
+ */ |
|
| 12 |
+ |
|
| 13 |
+namespace vonRotenberg\FormiliciousBundle\EventListener; |
|
| 14 |
+ |
|
| 15 |
+use Contao\Controller; |
|
| 16 |
+use Contao\CoreBundle\DependencyInjection\Attribute\AsHook; |
|
| 17 |
+use Contao\DataContainer; |
|
| 18 |
+ |
|
| 19 |
+#[AsHook('getAttributesFromDca')]
|
|
| 20 |
+class GetAttributesFromDca |
|
| 21 |
+{
|
|
| 22 |
+ public function __invoke(array $arrAttributes, $context): array |
|
| 23 |
+ {
|
|
| 24 |
+ if ($context instanceof DataContainer && $context->field) |
|
| 25 |
+ {
|
|
| 26 |
+ Controller::loadDataContainer($context->table); |
|
| 27 |
+ $arrData = $GLOBALS['TL_DCA'][$context->table]['fields'][$context->field]; |
|
| 28 |
+ |
|
| 29 |
+ if (isset($arrData['eval']['eSM_fl_width'])) |
|
| 30 |
+ {
|
|
| 31 |
+ $arrAttributes['eSM_fl_width'] = $arrData['eval']['eSM_fl_width']; |
|
| 32 |
+ } |
|
| 33 |
+ |
|
| 34 |
+ if (isset($arrData['eval']['eSM_fl_clear'])) |
|
| 35 |
+ {
|
|
| 36 |
+ $arrAttributes['eSM_fl_clear'] = $arrData['eval']['eSM_fl_clear']; |
|
| 37 |
+ } |
|
| 38 |
+ |
|
| 39 |
+ if (isset($arrData['eval']['eSM_fl_class'])) |
|
| 40 |
+ {
|
|
| 41 |
+ $arrAttributes['eSM_fl_class'] = $arrData['eval']['eSM_fl_class']; |
|
| 42 |
+ } |
|
| 43 |
+ |
|
| 44 |
+ if (isset($arrData['eval']['eSM_fl_lblpadding'])) |
|
| 45 |
+ {
|
|
| 46 |
+ $arrAttributes['eSM_fl_lblpadding'] = $arrData['eval']['eSM_fl_lblpadding']; |
|
| 47 |
+ } |
|
| 48 |
+ |
|
| 49 |
+ if (isset($arrData['eval']['eSM_fl_alignment'])) |
|
| 50 |
+ {
|
|
| 51 |
+ $arrAttributes['eSM_fl_alignment'] = $arrData['eval']['eSM_fl_alignment']; |
|
| 52 |
+ } |
|
| 53 |
+ } |
|
| 54 |
+ |
|
| 55 |
+ if (!isset($arrAttributes['class'])) |
|
| 56 |
+ {
|
|
| 57 |
+ $arrAttributes['class'] = ''; |
|
| 58 |
+ } |
|
| 59 |
+ |
|
| 60 |
+ if (isset($arrAttributes['eSM_fl_width']) && is_numeric($arrAttributes['eSM_fl_width'])) |
|
| 61 |
+ {
|
|
| 62 |
+ $arrAttributes['class'].= ' w' . $arrAttributes['eSM_fl_width']; |
|
| 63 |
+ } |
|
| 64 |
+ |
|
| 65 |
+ if (isset($arrAttributes['eSM_fl_class'])) |
|
| 66 |
+ {
|
|
| 67 |
+ $arrAttributes['class'].= ' ' . $arrAttributes['eSM_fl_class']; |
|
| 68 |
+ } |
|
| 69 |
+ |
|
| 70 |
+ if (isset($arrAttributes['eSM_fl_width'])) |
|
| 71 |
+ {
|
|
| 72 |
+ $arrAttributes['class'].= ' clr'; |
|
| 73 |
+ } |
|
| 74 |
+ |
|
| 75 |
+ if (isset($arrAttributes['type']) && $arrAttributes['type'] === 'submit') |
|
| 76 |
+ {
|
|
| 77 |
+ if (isset($arrAttributes['eSM_fl_lblpadding'])) |
|
| 78 |
+ {
|
|
| 79 |
+ $arrAttributes['class'].= ' lblp'; |
|
| 80 |
+ } |
|
| 81 |
+ |
|
| 82 |
+ if (isset($arrAttributes['eSM_fl_alignment'])) |
|
| 83 |
+ {
|
|
| 84 |
+ $arrAttributes['class'].= ' ' . $arrAttributes['eSM_fl_alignment'].'_alignment'; |
|
| 85 |
+ } |
|
| 86 |
+ } |
|
| 87 |
+ |
|
| 88 |
+ return $arrAttributes; |
|
| 89 |
+ } |
|
| 90 |
+} |