From 39b83a9318740fbd76080ec2cfbb068d512488c4 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Wed, 7 Mar 2012 17:55:53 +0000 Subject: [PATCH] // More helper forms refactoring --- .../performance/helpers/form/form.tpl | 23 +++---- .../controllers/return/helpers/form/form.tpl | 5 +- .../controllers/shop/helpers/form/form.tpl | 66 +++++++++---------- .../default/template/helpers/form/form.tpl | 32 ++++----- 4 files changed, 62 insertions(+), 64 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl index 0b6d5546c..f0bb9713f 100644 --- a/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl @@ -26,28 +26,25 @@ {extends file="helpers/form/form.tpl"} {block name="label"} - {if $input.type == 'text' && $input.name == 'ps_cache_fs_directory_depth'}
{l s='The system CacheFS should be used only when the infrastructure contain only one front-end server. Ask your hosting company if you don\'t know.'}
+ {else} + {$smarty.block.parent} {/if} - - {if isset($input.label)} - - {/if} - {/block} -{block name="start_field_block"} -
+{block name="input_block"} {if $input.type == 'radio' && $input.name == 'combination' && $input.disabled}
{l s='This feature can\'t be disabled because this is currently in use.'}
{/if} + {$smarty.block.parent} {/block} -{block name="end_field_block"} +{block name="description_block"} + {$smarty.block.parent} {if $input.type == 'radio' && $input.name == 'combination'}
  • {l s='Combinations tab on product page'}
  • @@ -60,10 +57,14 @@
  • {l s='Feature'}
  • {l s='Feature value'}
- {elseif $input.type == 'text' && $input.name == 'ps_cache_fs_directory_depth'} + {/if} +{/block} + +{block name="field_block"} + {$smarty.block.parent} + {if $input.type == 'text' && $input.name == 'ps_cache_fs_directory_depth'}
{/if} -
{/block} {block name="other_input"} diff --git a/admin-dev/themes/default/template/controllers/return/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/return/helpers/form/form.tpl index e1f350806..083443c86 100644 --- a/admin-dev/themes/default/template/controllers/return/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/return/helpers/form/form.tpl @@ -26,8 +26,7 @@ {extends file='helpers/form/form.tpl'} -{block name="start_field_block"} -
+{block name="input_block"} {if $input.type == 'text_customer'} {$customer->firstname} {$customer->lastname}

@@ -104,5 +103,7 @@ + {else} + {$smarty.block.parent} {/if} {/block} \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl index 6b99110c5..31791248a 100644 --- a/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl @@ -24,43 +24,16 @@ * International Registered Trademark & Property of PrestaShop SA *} {extends file="helpers/form/form.tpl"} -{debug} -{block name="label"} +{block name="label"} {if $input.type == 'text' && $input.name == 'name'}

{l s='You can\'t change the GroupShop when you have more than one Shop'}

{/if} - - {if isset($input.label)} - - {/if} - + {$smarty.block.parent} {/block} -{block name="start_field_block"} -
- {if $input.type == 'select' && $input.name == 'id_category'} - - {else if $input.type == 'theme'} +{block name="input_block"} + {if $input.type == 'theme'} {foreach $input.values as $theme}
{$theme->name}
@@ -69,9 +42,32 @@
{/foreach}
 
- {/if} - {if $input.type == 'textGroupShop'} + {elseif $input.type == 'textGroupShop'} {$input.value} + {else} + {if $input.type == 'select' && $input.name == 'id_category'} + + {/if} + {$smarty.block.parent} {/if} {/block} @@ -124,8 +120,7 @@ {/if} {/block} -{block name=script} - +{block name="script"} $(document).ready(function() { $('input[name=useImportData]').click(function() { if ($(this).attr('id') == 'useImportData_on') @@ -134,5 +129,4 @@ $('#shop_list, #data_list').slideUp('slow'); }); }); - {/block} diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index f52ee8ed3..08f14cde5 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -326,21 +326,23 @@ {/if} {/block} {if isset($input.required) && $input.required && $input.type != 'radio'} *{/if} - {if isset($input.desc)} -

- {if is_array($input.desc)} - {foreach $input.desc as $p} - {if is_array($p)} - {$p.text}
- {else} - {$p}
- {/if} - {/foreach} - {else} - {$input.desc} - {/if} -

- {/if} + {block name="description_block"} + {if isset($input.desc)} +

+ {if is_array($input.desc)} + {foreach $input.desc as $p} + {if is_array($p)} + {$p.text}
+ {else} + {$p}
+ {/if} + {/foreach} + {else} + {$input.desc} + {/if} +

+ {/if} + {/block} {if isset($input.lang) && isset($languages)}
{/if} {block name="end_field_block"}