{combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'} {combine_css path="themes/default/js/plugins/datatables/css/jquery.dataTables.css"} {combine_css path=$MPS_PATH|@cat:"admin/template/style.css"} {combine_script id='jquery.ui.sortable' load='footer' path='themes/default/js/ui/minified/jquery.ui.sortable.min.js'} {footer_script}{literal} (function($) { $(document).ready(function(){ var $oTable, $nEditing = null, $select = $('#select').html(); $val = $('.val').html(); $('#table_option input[type=checkbox]').each(function(){ $(this).prop('checked', false) }); $('.addedit').click(function() { $('.Tadd').show(); $('.add_content').css('top','100px') $('#add_option').fadeIn(); $("input[name=name]").focus(); _verif_type_opt(); return false; }); $('#close_addoption').click(function() { $('#add_option').fadeOut(function(){ $('.tit').hide(); $('#add_option input[type=text]').attr('value',''); $('.val').remove(); $('.valeur').append($('
').addClass('val').append($val)); $('select#optType option').each(function(){ $(this).removeAttr('selected'); }); }); return false }); $('#addopt_form').submit(function(){ var $return = true; if($.trim($('input#optName',this).val()).length==0){ $return = false; $('.errors').show(); setTimeout(function(){ $('.errors').hide() },3000); } if($('.valeur').is(':hidden')){ $('.valeur').remove(); } return $return }) $(document).on('change','#optType',function(){ _verif_type_opt(); }); function _verif_type_opt(){ var $valSel = $('.addopt_table select#optType option:selected').attr('value'); if($valSel=="text" || $valSel=="textarea"){ $('.valeur').fadeOut('fast'); } else { $('.valeur').fadeIn('fast') } } $('#option_add').click(function(){ if($('.valeur').is(':hidden')){ $('.valeur').remove(); } $('#addopt_form').submit(); return false }) $('.addVal').click(function() { $('.valeur').append($('
').addClass('val').append($val)); return false; }) $(document).on('click','.delVal',function(){ if (confirm("{/literal}{'Are you sure?'|translate|escape:javascript}{literal}")) { var $Nval = $('.addopt_table .valeur input').length; if($Nval>1){ $(this).parents('div.val').remove(); }else{ var $val = $(this).parents('div.val'); $('input', $val).val('').attr('value',''); } } return false }); $oTable = $('#table_option').dataTable({ "bAutoWidth": false, "bStateSave": true, "aoColumns" : [ { sWidth: '2%','sClass': 'center', 'bSortable': false, }, { sWidth: '35%'}, { sWidth: '36%'}, { sWidth: '15%', 'bSortable': false}, { sWidth: '7%' }, { sWidth: '4%','sClass': 'center', 'bSortable': false, }, ], "oLanguage": { "sProcessing": "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}", "sSearch": ''+"{/literal}{'Search'|translate|escape:'javascript'}{literal}", "sLengthMenu": "{/literal}{'Display _MENU_ records per page'|translate|escape:'javascript'}{literal}", "sInfo": "{/literal}{'Showing _START_ to _END_ of _TOTAL_ records'|translate|escape:'javascript'}{literal}", "sInfoEmpty": "{/literal}{'Showing 0 to 0 of 0 records'|translate|escape:'javascript'}{literal}", "sInfoFiltered": "{/literal}{'(filtered from _MAX_ total records)'|translate|escape:'javascript'}{literal}", "sInfoPostFix": "", "sLoadingRecords": "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}", "sZeroRecords": "{/literal}{'No matching option found'|translate|escape:'javascript'}{literal}", "oPaginate": { "sFirst": "{/literal}{'First'|translate|escape:'javascript'}{literal}", "sPrevious": '← '+"{/literal}{'Previous'|translate|escape:'javascript'}{literal}", "sNext": "{/literal}{'Next'|translate|escape:'javascript'}{literal}"+' →', "sLast": "{/literal}{'Last'|translate|escape:'javascript'}{literal}", }, }, }); $(document).on('click','#table_option .optEdit', function () { var $this =$(this), $pos = $(document).scrollTop(), $pos = $pos + 100; $('.add_content').css('top',$pos) $('.Tedit').show(); _rempform($this); $('#add_option').fadeIn(); return false; }); $(document).on('click','#table_option .optDupli', function () { var $this =$(this); $pos = $(document).scrollTop(), $pos = $pos + 100; $('.add_content').css('top',$pos) $('.Tdupli').show(); _rempform($this); $('input#optId').attr('value',''); $('#add_option').fadeIn(); return false; }); function _rempform($this){ var $nRow = $this.parents('tr')[0], $jqInputs = $('input', $nRow), $id = $jqInputs[0].value, $opt = $('#optvar').data('option'), $id = $opt[$id].id, $name = $opt[$id].name, $title = $opt[$id].title, $type = $opt[$id].type, $requi = $opt[$id].requi, $value = $opt[$id].val; $('input#optId').attr('value',$id); $('input#optName').attr('value',$name); $('input#optTitle').attr('value',$title); if($requi==1){ $('input#optRequi').attr('checked','checked'); }; $('select#optType').remove(); $('#typeOpt span:last').append($select) $('select#optType option[value=' +$type+']').attr('selected','selected'); if($value.length != 0){ $('.val').remove(); $.each($value,function(e,val){ $('.valeur').append($('
').addClass('val').append($val)); $('.val').last().find('input').attr('value',val) }); } _verif_type_opt(); } $('#selectAll').click(function () { $('#table_option input[type=checkbox]').prop('checked', true); _delet_button() return false; }); $('#selectNone').click(function () { $('#table_option input[type=checkbox]').prop('checked', false); _delet_button() return false; }); $('#selectInvert').click(function () { $('#table_option input[type=checkbox]').each(function(){ if($(this).is (':checked')){ $(this).prop('checked', false); }else{ $(this).prop('checked', true); } _delet_button() }); return false; }); $('#table_option td.del input[type=checkbox]').change(function () { _delet_button() }); function _delet_button(){ if($('#table_option td.del input[type=checkbox]:checked').length > 0){ $('#forbidAction').css('display','none'); $('#permitAction').css('display','block'); }else{ $('#forbidAction').css('display','block'); $('#permitAction').css('display','none'); } }; $("#listOrder").sortable({ placeholder: 'highlight', update: function() { var $order = $("#listOrder").sortable("toArray"); $('#newOrder').val($order.join(",")); } }); $("#listOrder").disableSelection(); $('#ChangeOrder').click(function() { $("#change_Order").fadeIn( ); return false; }); $('#close_changeOrder').click(function() { $("#change_Order").fadeOut(); return false; }); }) })(jQuery); {/literal}{/footer_script}

{'Options'|translate}

{'Add a option'|translate}

{foreach from=$mps_option item=option name=option} {/if} {if $option.type=="radio"} {html_radios name='option' options=$option.val separator='
'} {/if} {if $option.type=="checkbox"} {html_checkboxes name='option' options=$option.val separator='
'} {/if} {if $option.type=="text"} {/if} {if $option.type=="textarea"} {/if} {/foreach}
{'Name'|@translate} {'Note administrator'|@translate} {'Type'|@translate} {'Required'|@translate}
{$option.name} {'edit'|translate} {'duplicate'|translate} {$option.title} {if $option.type=="select"} {html_options name=option options=$option.val}{$option.type} {if $option.requi=="1"}{'Yes'|@translate}{else}{'No'|@translate}{/if}

{'Select:'|@translate} {'All'|@translate}, {'None'|@translate}, {'Invert'|@translate}

{'No product selected'|@translate}

{'Change the display order of options in the form'|translate}