{{ Get_title({
    'index.php?r=adm/lang/show' : Lang_translate('_LANGUAGE', 'admin_lang'),
    '':Lang_translate('_IMPORT', 'admin_lang')
},false) }}
<div class="container">
    <div class="row">
        <div class="col d-col--12--desktop">
            {{ Form_openForm('import_lang', 'index.php?r=adm/lang/doimport', false, 'post', 'multipart/form-data') }}

            {{ Form_getRadioHoriz(Lang_translate('_IMPORT_TYPE','admin_lang'),'import_type','import_type',importTypes,defaultType) }}

            {{ Form_getDropdown(Lang_translate('_LANGUAGE', 'admin_lang'), 'lang_id', 'lang_id', coreLangs) }}

            {{ Form_getFilefield(Lang_translate('_FILE', 'admin_lang'), 'lang_file', 'lang_file') }}

            {{ Form_getCheckbox(Lang_translate('_OVERWRITE_EXISTENT', 'admin_lang'), 'overwrite', 'overwrite', '1') }}
            {{ Form_getCheckbox(Lang_translate('_DO_NOT_ADD_MISS', 'admin_lang'), 'noadd_miss', 'noadd_miss', '1') }}

            {{ Form_openButtonSpace() }}
            {{ Form_getButton('save', 'save', Lang_translate('_SAVE', 'admin_lang')) }}
            {{ Form_getButton('undo', 'undo', Lang_translate('_UNDO', 'admin_lang')) }}
            {{ Form_closeButtonSpace() }}

            {{ Form_closeForm() }}
        </div>
    </div>
</div>

<script>
$(function() {
    var langIdField = $("#lang_id").parents('.form_line_l');
    var langFileField = $("#lang_file").parents('.form_line_l');
    langFileField.hide();

    $("input[type=radio][name=import_type]").change(function(e) {

        if ($(this).val() == 'core') {
            langIdField.show();
            langFileField.hide();
        } else if ($(this).val() == 'file') {
            langFileField.show();
            langIdField.hide();
            
        }
    });
})
</script>