<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="{{ app['locale'] }}">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>{{ 'thesaurus:: export au format texte' | trans }}</title>

        <link type="text/css" rel="stylesheet" href="/assets/thesaurus/css/thesaurus{% if not app.debug %}.min{% endif %}.css" />
        <script type="text/javascript">
            var format = "text";

            function clkBut(button)
            {
                switch(button)
                {
                    case "submit":
                        $('.export-form').attr('action',"export_" + format + ".php");
                        $('.export-form').submit();
                        $('.close-dialog').trigger('click');
                        break;
                    case "cancel":
                        self.returnValue = null;
                        $('.close-dialog').trigger('click');
                        break;
                }
            }
            function loaded()
            {
                chgFormat();
            }
            function ckis()
            {
                document.getElementById("submit_button").disabled = document.forms[0].t.value=="";
            }
            function enable_inputs(o, stat)
            {
                if(o.nodeType==1)  // element
                {
                    if(o.nodeName=='INPUT')
                    {
                        if(stat)
                            o.removeAttribute('disabled');
                        else
                            o.setAttribute('disabled', true);
                    }
                    for(var oo=o.firstChild; oo; oo=oo.nextSibling)
                        enable_inputs(oo, stat)
                }
            }
            function chgFormat()
            {
                var i, f;
                url = "./export_"+format+".php?bid={{ bid }}&piv={{ piv }}&id={{ id }}&typ={{ typ }}&dlg=0&smp=1";
                url += "&osl=" + ($('.osl_1')[0].checked ? "1" : $('.osl_0')[0].checked ? "0" : "0");
                url += "&iln=" + ($('.iln')[0].checked ? "1" : "0");
                url += "&hit=" + ($('.hit')[0].checked ? "1" : "0");
                url += "&ilg=" + ($('.ilg')[0].checked ? "1" : "0");
                document.getElementById("ifrsample").src = url;
            }
            $( document ).ready(function() {
                loaded();
            });
        </script>
    </head>
    <body class="dialog">
    <center>
        <br/>
        <form class="export-form" action="export_topics.php" target="EXPORT2">
            <input type="hidden" name="bid" value="{{ bid }}">
            <input type="hidden" name="piv" value="{{ piv }}" >
            <input type="hidden" name="id" value="{{ id }}" >
            <input type="hidden" name="typ" value="{{ typ }}" >
            <input type="hidden" name="dlg" value="{{ dlg }}" >
            <table>
                <thead>
                    <tr>
                        <th>{{ 'thesaurus:: options d\'export :' | trans }}</th>
                        <th>{{ 'thesaurus:: example' | trans }}</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td valign="top" style="padding:5px">
                            <div style="white-space:nowrap">
                                <input type='radio' name='ofm' checked value='text'>
                                {{ 'thesaurus:: export au format texte' | trans }}
                            </div>
                            <div id='subform_text' style="margin-left:10px;">
                                <div style="white-space:nowrap">
                                    <input type='radio' name='osl' class="osl_1" checked value='1' onclick="chgFormat();">
                                    {{ 'thesaurus:: exporter avec les synonymes sur la meme ligne' | trans }}
                                </div>
                                <div style="white-space:nowrap">
                                    <input type='radio' name='osl' class="osl_0" value='0' onclick="chgFormat();">
                                    {{ 'thesaurus:: exporter avec une ligne par synonyme' | trans }}
                                </div>
                                <div style="white-space:nowrap">
                                    <input type='checkbox' name='iln' class="iln" value='1' onclick="chgFormat();">
                                    {{ 'thesaurus:: export : numeroter les lignes' | trans }}
                                </div>
                                <div style="white-space:nowrap">
                                    <input type='checkbox' name='ilg' class="ilg" value='1' onclick="chgFormat();">
                                    {{ 'thesaurus:: export : inclure la langue' | trans }}
                                </div>
                                <div style="white-space:nowrap">
                                    <input type='checkbox' name='hit' class="hit" value='1' onclick="chgFormat();">
                                    {{ 'thesaurus:: export : inclure les hits' | trans }}
                                </div>
                            </div>
                        </td>
                        <td valign="top" style="padding:10px">
                            <iframe id="ifrsample" frameborder="0" scrolling="No" style="width:400px;height:150px;overflow:hidden;border: 0px solid #b0b0b0; " ></iframe>
                        </td>
                    </tr>
                </tbody>
            </table>
            <br/>

            <div class="thesaurus_confirm_bottom_block">
                <input type="button" id="cancel_button" class="cancel_btn" value="{{ 'boutton::annuler' | trans }}" onclick="clkBut('cancel');">
                <input type="button" id="submit_button" class="validate_btn" value="{{ 'boutton::valider' | trans }}" onclick="clkBut('submit');">
            </div>
        </form>
    </center>
</body>
</html>
