// More helper forms refactoring
This commit is contained in:
@@ -26,28 +26,25 @@
|
|||||||
{extends file="helpers/form/form.tpl"}
|
{extends file="helpers/form/form.tpl"}
|
||||||
|
|
||||||
{block name="label"}
|
{block name="label"}
|
||||||
|
|
||||||
{if $input.type == 'text' && $input.name == 'ps_cache_fs_directory_depth'}
|
{if $input.type == 'text' && $input.name == 'ps_cache_fs_directory_depth'}
|
||||||
<div id="directory_depth">
|
<div id="directory_depth">
|
||||||
<div class="warn">{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.'}</div>
|
<div class="warn">{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.'}</div>
|
||||||
|
{else}
|
||||||
|
{$smarty.block.parent}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if isset($input.label)}
|
|
||||||
<label>{$input.label} </label>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="start_field_block"}
|
{block name="input_block"}
|
||||||
<div class="margin-form">
|
|
||||||
{if $input.type == 'radio' && $input.name == 'combination' && $input.disabled}
|
{if $input.type == 'radio' && $input.name == 'combination' && $input.disabled}
|
||||||
<div class="warn">
|
<div class="warn">
|
||||||
{l s='This feature can\'t be disabled because this is currently in use.'}
|
{l s='This feature can\'t be disabled because this is currently in use.'}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
{$smarty.block.parent}
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="end_field_block"}
|
{block name="description_block"}
|
||||||
|
{$smarty.block.parent}
|
||||||
{if $input.type == 'radio' && $input.name == 'combination'}
|
{if $input.type == 'radio' && $input.name == 'combination'}
|
||||||
<ul style="list-style-type:disc;margin:0 0 0 30px;">
|
<ul style="list-style-type:disc;margin:0 0 0 30px;">
|
||||||
<li>{l s='Combinations tab on product page'}</li>
|
<li>{l s='Combinations tab on product page'}</li>
|
||||||
@@ -60,10 +57,14 @@
|
|||||||
<li>{l s='Feature'}</li>
|
<li>{l s='Feature'}</li>
|
||||||
<li>{l s='Feature value'}</li>
|
<li>{l s='Feature value'}</li>
|
||||||
</ul>
|
</ul>
|
||||||
{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'}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="other_input"}
|
{block name="other_input"}
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
|
|
||||||
{extends file='helpers/form/form.tpl'}
|
{extends file='helpers/form/form.tpl'}
|
||||||
|
|
||||||
{block name="start_field_block"}
|
{block name="input_block"}
|
||||||
<div class="margin-form">
|
|
||||||
{if $input.type == 'text_customer'}
|
{if $input.type == 'text_customer'}
|
||||||
{$customer->firstname} {$customer->lastname}
|
{$customer->firstname} {$customer->lastname}
|
||||||
<p style="clear: both">
|
<p style="clear: both">
|
||||||
@@ -104,5 +103,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
{else}
|
||||||
|
{$smarty.block.parent}
|
||||||
{/if}
|
{/if}
|
||||||
{/block}
|
{/block}
|
||||||
@@ -24,43 +24,16 @@
|
|||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*}
|
*}
|
||||||
{extends file="helpers/form/form.tpl"}
|
{extends file="helpers/form/form.tpl"}
|
||||||
{debug}
|
|
||||||
{block name="label"}
|
|
||||||
|
|
||||||
|
{block name="label"}
|
||||||
{if $input.type == 'text' && $input.name == 'name'}
|
{if $input.type == 'text' && $input.name == 'name'}
|
||||||
<div class="hint" name="help_box" style="display:block;">{l s='You can\'t change the GroupShop when you have more than one Shop'}</div><br />
|
<div class="hint" name="help_box" style="display:block;">{l s='You can\'t change the GroupShop when you have more than one Shop'}</div><br />
|
||||||
{/if}
|
{/if}
|
||||||
|
{$smarty.block.parent}
|
||||||
{if isset($input.label)}
|
|
||||||
<label>{$input.label} </label>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="start_field_block"}
|
{block name="input_block"}
|
||||||
<div class="margin-form">
|
{if $input.type == 'theme'}
|
||||||
{if $input.type == 'select' && $input.name == 'id_category'}
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function(){
|
|
||||||
$("#id_category").change(function(){
|
|
||||||
doAdminAjax(
|
|
||||||
{
|
|
||||||
ajax:"1",
|
|
||||||
id_category : $(this).val(),
|
|
||||||
use_shop_context : 0,
|
|
||||||
action : "getCategoriesFromRootCategory",
|
|
||||||
controller: "AdminShop",
|
|
||||||
token : "{$token}",
|
|
||||||
},
|
|
||||||
function(res)
|
|
||||||
{
|
|
||||||
$('#categories-treeview').parent().html(res);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{else if $input.type == 'theme'}
|
|
||||||
{foreach $input.values as $theme}
|
{foreach $input.values as $theme}
|
||||||
<div class="select_theme {if $theme->id == $fields_value.id_theme_checked}select_theme_choice{/if}" onclick="$(this).find('input').attr('checked', true); $('.select_theme').removeClass('select_theme_choice'); $(this).toggleClass('select_theme_choice');">
|
<div class="select_theme {if $theme->id == $fields_value.id_theme_checked}select_theme_choice{/if}" onclick="$(this).find('input').attr('checked', true); $('.select_theme').removeClass('select_theme_choice'); $(this).toggleClass('select_theme_choice');">
|
||||||
{$theme->name}<br />
|
{$theme->name}<br />
|
||||||
@@ -69,9 +42,32 @@
|
|||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<div class="clear"> </div>
|
<div class="clear"> </div>
|
||||||
{/if}
|
{elseif $input.type == 'textGroupShop'}
|
||||||
{if $input.type == 'textGroupShop'}
|
|
||||||
{$input.value}
|
{$input.value}
|
||||||
|
{else}
|
||||||
|
{if $input.type == 'select' && $input.name == 'id_category'}
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("#id_category").change(function(){
|
||||||
|
doAdminAjax(
|
||||||
|
{
|
||||||
|
ajax:"1",
|
||||||
|
id_category : $(this).val(),
|
||||||
|
use_shop_context : 0,
|
||||||
|
action : "getCategoriesFromRootCategory",
|
||||||
|
controller: "AdminShop",
|
||||||
|
token : "{$token}",
|
||||||
|
},
|
||||||
|
function(res)
|
||||||
|
{
|
||||||
|
$('#categories-treeview').parent().html(res);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{/if}
|
||||||
|
{$smarty.block.parent}
|
||||||
{/if}
|
{/if}
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
@@ -124,8 +120,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name=script}
|
{block name="script"}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('input[name=useImportData]').click(function() {
|
$('input[name=useImportData]').click(function() {
|
||||||
if ($(this).attr('id') == 'useImportData_on')
|
if ($(this).attr('id') == 'useImportData_on')
|
||||||
@@ -134,5 +129,4 @@
|
|||||||
$('#shop_list, #data_list').slideUp('slow');
|
$('#shop_list, #data_list').slideUp('slow');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|||||||
@@ -326,21 +326,23 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/block}
|
{/block}
|
||||||
{if isset($input.required) && $input.required && $input.type != 'radio'} <sup>*</sup>{/if}
|
{if isset($input.required) && $input.required && $input.type != 'radio'} <sup>*</sup>{/if}
|
||||||
{if isset($input.desc)}
|
{block name="description_block"}
|
||||||
<p class="preference_description">
|
{if isset($input.desc)}
|
||||||
{if is_array($input.desc)}
|
<p class="preference_description">
|
||||||
{foreach $input.desc as $p}
|
{if is_array($input.desc)}
|
||||||
{if is_array($p)}
|
{foreach $input.desc as $p}
|
||||||
<span id="{$p.id}">{$p.text}</span><br />
|
{if is_array($p)}
|
||||||
{else}
|
<span id="{$p.id}">{$p.text}</span><br />
|
||||||
{$p}<br />
|
{else}
|
||||||
{/if}
|
{$p}<br />
|
||||||
{/foreach}
|
{/if}
|
||||||
{else}
|
{/foreach}
|
||||||
{$input.desc}
|
{else}
|
||||||
{/if}
|
{$input.desc}
|
||||||
</p>
|
{/if}
|
||||||
{/if}
|
</p>
|
||||||
|
{/if}
|
||||||
|
{/block}
|
||||||
{if isset($input.lang) && isset($languages)}<div class="clear"></div>{/if}
|
{if isset($input.lang) && isset($languages)}<div class="clear"></div>{/if}
|
||||||
{block name="end_field_block"}
|
{block name="end_field_block"}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user