Template fragments are now in a subdirectory

This commit is contained in:
Franck Allimant
2014-07-04 15:27:56 +02:00
parent 3708fb317b
commit 7580d5c869
3 changed files with 7 additions and 7 deletions

View File

@@ -293,15 +293,15 @@ class Form extends AbstractSmartyPlugin
* @param string $templateTypeName * @param string $templateTypeName
* @return string * @return string
*/ */
protected function automaticFormFieldRendering($params, $content, $template, $templateTypeName) protected function automaticFormFieldRendering($params, $content, $template, $templateFile)
{ {
$data = ''; $data = '';
$templateStyle = $this->getParam($params, 'template', 'standard'); $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(), $this->parser->getTemplateDefinition()->getAbsolutePath(),
$templateStyle,
$templateFile $templateFile
); );
@@ -339,18 +339,18 @@ class Form extends AbstractSmartyPlugin
public function customFormFieldRendering($params, $content, $template, &$repeat) public function customFormFieldRendering($params, $content, $template, &$repeat)
{ {
if (! $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) 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) 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) public function renderTaggedFormFields($params, $content, \Smarty_Internal_Template $template, &$repeat)

View File

@@ -11,7 +11,7 @@ fragment uses the following additional variables :
{* Get standard fields attributes *} {* Get standard fields attributes *}
{capture assign=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} {/capture}
{if $type == 'hidden'} {if $type == 'hidden'}