<!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":
                        document.forms[0].action = "export_" + format + ".php";
                        document.forms[0].submit();
                        break;
                    case "cancel":
                        self.returnValue = null;
                        self.close();
                        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=" + (document.forms[0].osl[0].checked ? "1" : "0");
                url += "&iln=" + (document.forms[0].iln.checked ? "1" : "0");
                url += "&hit=" + (document.forms[0].hit.checked ? "1" : "0");
                url += "&ilg=" + (document.forms[0].ilg.checked ? "1" : "0");
                document.getElementById("ifrsample").src = url;
            }
        </script>
    </head>
    <body onload="loaded();" class="dialog">
    <center>
        <br/>
        <form onsubmit="clkBut('submit');return(false);" 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' 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' value='0' onclick="chgFormat();">
                                    {{ 'thesaurus:: exporter avec une ligne par synonyme' | trans }}
                                </div>
                                <div style="white-space:nowrap">
                                    <input type='checkbox' name='iln' value='1' onclick="chgFormat();">
                                    {{ 'thesaurus:: export : numeroter les lignes' | trans }}
                                </div>
                                <div style="white-space:nowrap">
                                    <input type='checkbox' name='ilg' value='1' onclick="chgFormat();">
                                    {{ 'thesaurus:: export : inclure la langue' | trans }}
                                </div>
                                <div style="white-space:nowrap">
                                    <input type='checkbox' name='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/>
            <br/>
            <input type="button" id="cancel_button" value="{{ 'boutton::annuler' | trans }}" onclick="clkBut('cancel');" style="width:100px;">
            &nbsp;&nbsp;&nbsp;
            <input type="button" id="submit_button" value="{{ 'boutton::valider' | trans }}" onclick="clkBut('submit');" style="width:100px;">
        </form>
    </center>
</body>
</html>
