diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php index a8053cabc..bddc07407 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php @@ -293,15 +293,15 @@ class Form extends AbstractSmartyPlugin * @param string $templateTypeName * @return string */ - protected function automaticFormFieldRendering($params, $content, $template, $templateTypeName) + protected function automaticFormFieldRendering($params, $content, $template, $templateFile) { $data = ''; $templateStyle = $this->getParam($params, 'template', 'standard'); - $templateFile = sprintf($templateTypeName, $templateStyle); - $snippet_path = sprintf('%s/%s.html', + $snippet_path = sprintf('%s'.DS.'forms'.DS.'%s'.DS.'%s.html', $this->parser->getTemplateDefinition()->getAbsolutePath(), + $templateStyle, $templateFile ); @@ -339,18 +339,18 @@ class Form extends AbstractSmartyPlugin public function customFormFieldRendering($params, $content, $template, &$repeat) { if (! $repeat) { - return $this->automaticFormFieldRendering($params, $content, $template, 'forms'.DS.'form-field-%s-renderer'); + return $this->automaticFormFieldRendering($params, $content, $template, 'form-field-renderer'); } } public function standardFormFieldRendering($params, \Smarty_Internal_Template $template) { - return $this->automaticFormFieldRendering($params, '', $template, 'forms'.DS.'form-field-%s-renderer'); + return $this->automaticFormFieldRendering($params, '', $template, 'form-field-renderer'); } public function standardFormFieldAttributes($params, \Smarty_Internal_Template $template) { - return $this->automaticFormFieldRendering($params, '', $template, 'forms'.DS.'form-field-attributes-%s-renderer'); + return $this->automaticFormFieldRendering($params, '', $template, 'form-field-attributes-renderer'); } public function renderTaggedFormFields($params, $content, \Smarty_Internal_Template $template, &$repeat) diff --git a/templates/backOffice/default/forms/form-field-attributes-standard-renderer.html b/templates/backOffice/default/forms/standard/form-field-attributes-renderer.html similarity index 100% rename from templates/backOffice/default/forms/form-field-attributes-standard-renderer.html rename to templates/backOffice/default/forms/standard/form-field-attributes-renderer.html diff --git a/templates/backOffice/default/forms/form-field-standard-renderer.html b/templates/backOffice/default/forms/standard/form-field-renderer.html similarity index 98% rename from templates/backOffice/default/forms/form-field-standard-renderer.html rename to templates/backOffice/default/forms/standard/form-field-renderer.html index 654abff2f..3835288d4 100644 --- a/templates/backOffice/default/forms/form-field-standard-renderer.html +++ b/templates/backOffice/default/forms/standard/form-field-renderer.html @@ -11,7 +11,7 @@ fragment uses the following additional variables : {* Get standard fields attributes *} {capture assign=attributes} - {include file="forms/form-field-attributes-$field_template-renderer.html"} + {include file="forms/$field_template/form-field-attributes-renderer.html"} {/capture} {if $type == 'hidden'}