Subversion-Projekte lars-tiefland.ci

Revision

Revision 1358 | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

        <style>
        label
        {
                cursor:pointer;
        }
        .fieldOrder 
        {
                list-style-type: none;
                margin: 0;
                padding: 0;
                width: 50%;
        }
        .fieldOrder li
        {
                margin: 0 3px 3px 3px;
                padding: 0.4em;
                padding-left: 1.5em;
                height: 18px;
        }
        .fieldOrder li span
        {
                position: absolute;
                margin-left: -1.3em;
        }
        #products
        {
                float:left;
                width: 500px;
                margin-right: 2em;
        }
        .fieldOrder
        {
                width: 300px;
                float: left;
                margin-top: 1em;
        }
        /* style the list to maximize the droppable hitarea */
        .fieldOrder ul
        {
                margin: 0;
                padding: 1em 0 1em 3em;
        }
        </style>
        <script>
                function toggle_csvOpt()
                {
                        format=$("#format").val();
                        if(format=="CSV")
                        {
                                $("#reiter").tabs("enable",1);
                        }
                        else
                        {
                                $("#reiter").tabs("disable",1);
                        }
                }
                function toggle_xmlOpt()
                {
                        format=$("#format").val();
                        if(format=="XML")
                        {
                                $("#reiter").tabs("enable",2);
                        }
                        else
                        {
                                $("#reiter").tabs("disable",2);
                        }
                }
                $(function() {
                        $('#reiter').tabs();
                        $('#format').change(toggle_csvOpt).change(toggle_xmlOpt).change();
                        $( "#sortable, #catalog" ).droppable({
                                accept: ":not(.ui-sortable-helper)",
                                drop: function( event, ui ) {
                                        $( this ).find( ".placeholder" ).remove();
                                        $( "<li></li>" ).text( ui.draggable.text() ).appendTo( this );
                                }
                        }).sortable({
                                connectWith:".fieldOrder",
                                items: "li:not(.placeholder)",
                                sort: function() {
                                        // gets added unintentionally by droppable interacting with sortable
                                        // using connectWithSortable fixes this, but does not allow you to customize active/hoverClass options
                                        $( this ).removeClass( "ui-state-default" );
                                },
                                stop:function(event,ui)
                                {
                                        result=$('#sortable').sortable("serialize");
                                        result+="&"+$('#configForm').serialize();
                                        $.post("/toolbox/preisagentur_config.php",result,function(html)
                                        {
                                                //$('#msg').html(html);
                                                ret=html.split("$$")
                                                $('#content').val(ret[1]);
                                                $('#prefix').val(ret[0])
                                        });
                                }
                        }).css("cursor","pointer").disableSelection();
                });
        </script>
        <form id="configForm" method="post" action="{$SCRIPT_NAME}">
                <div id="reiter">
                        <ul>
                                <li>
                                        <a href="#base">Basisdaten</a>
                                </li>
                                <li id="csvOpt">
                                        <a href="#csv">CSV-Dateioptionen</a>
                                </li>
                                <li id="xmlOpt">
                                        <a href="#xml">XML-Dateioptionen</a>
                                </li>
                                <li>
                                        <a href="#config">Konfiguration der Felder</a>
                                </li>
                        </ul>
                        <div id="base">
                                <table>
                                        <tr>
                                                <td>
                                                        <label for="dateiname">Name der Datei</label>
                                                </td>
                                                <td>
                                                        <input type="text" name="dateiname" id="dateiname" value="{$cfg.dateiname}" />
                                                </td>
                                        </tr>
                                        <tr>
                                                <td>
                                                        <label for="format">Format der Datei</label>
                                                </td>
                                                <td>
                                                        {html_options name="format" id="format" options=$formate selected=$cfg.format}
                                                </td>
                                        </tr>
                                        <tr>
                                                <td>
                                                        <label for="html">HTML entfernen?</label>
                                                </td>
                                                <td>
                                                        <input type="hidden" name="html" value="0" />
                                                        <input type="checkbox" name="html" value="1" {if $cfg.html==1}checked="checked"{/if} id="html" />
                                                </td>
                                        </tr>
                                        <tr>
                                                <td>
                                                        <label for="keinBild">Artikel ohne Bild übertragen?</label>
                                                </td>
                                                <td>
                                                        <input type="hidden" name="keinBild" value="0" />
                                                        <input type="checkbox" name="keinBild" id="keinBild" value="1" {if $cfg.keinBild==1}checked="checked"{/if} />
                                                </td>
                                        </tr>
                                        <tr>
                                                <td>
                                                        <label for="keinAehnlichesBild">Artikel mit ähnlichen Bildern<br /> (Symbolbildern) übertragen?</label>
                                                </td>
                                                <td>
                                                        <input type="hidden" name="keinAehnlichesBild" value="0" />
                                                        <input type="checkbox" name="keinAehnlichesBild" id="keinAehnlichesBild" value="1" {if $cfg.keinAehnlichesBild==1}checked="checked"{/if} />
                                                </td>
                                        </tr>
                                </table>
                        </div>
                        <div id="csv">
                                <table>
                                        <tr>
                                                <td>
                                                        <label for="utf8">Datei in UTF-8 ausgeben?</label>
                                                </td>
                                                <td>
                                                        <input type="hidden" name="utf8" value="0" />
                                                        <input type="checkbox" name="utf8" value="1" {if $cfg.utf8==1}checked="checked"{/if} id="utf8" />
                                                </td>
                                        </tr>
                                        <tr>
                                                <td style="text-align:right;">
                                                        <label for="trenner">Trenner:</label>
                                                </td>
                                                <td>
                                                        {html_options name="trenner" id="trenner" options=$trenner selected=$cfg.trenner}
                                                </td>
                                        </tr>
                                        <tr>
                                                <td style="text-align:right;">
                                                        <label for="quote">Einschließungszeichen</label>
                                                </td>
                                                <td>
                                                        {html_options name="quote" id="quote" options=$quote selected=$cfg.quote}
                                                </td>
                                        </tr>
                                        <tr>
                                                <td>
                                                        <label for="kopfzeile">Datei hat eine Kopfzeile?</label>
                                                </td>
                                                <td>
                                                        <input type="hidden" name="kopfzeile" value="0" />
                                                        <input type="checkbox" name="kopfzeile" value="1" {if $cfg.kopfzeile==1}checked="checked"{/if} id="kopfzeile" />
                                                </td>
                                        </tr>
                                </table>
                        </div>
                        <div id="xml">
                                <table>
                                        <tr>
                                                <td>
                                                        <label for="cdata">Umlaute etc. nicht umwandeln?</label>
                                                </td>
                                                <td>
                                                        <input type="hidden" name="cdata" value="0" />
                                                        <input type="checkbox" name="cdata" value="1" {if $cfg.cdata==1}checked="checked"{/if} id="cdata" />
                                                </td>
                                        </tr>
                                </table>
                        </div>
                        <div id="config">
                                <table>
                                        <tr>
                                                <td style="width:50%;">
                                                        <h2>Verfügbare Felder</h2>
                                                </td>
                                                <td style="width:50%;">
                                                        <h2>benutzte Felder und deren Reihenfolge</h2>
                                                </td>           
                                        </tr>
                                        <tr>
                                                <td style="width:50%;vertical-align:top">
                                                        <ul id="catalog" class="fieldOrder">
                                                                {foreach $feldNamen as $fId=>$name}
                                                                {if !in_array($fId,$felder) && in_array($fId,array_keys($prefixArr))}
                                                                <li id="sortcol_{$fId}">{$name|utf8_encode}</li>
                                                                {/if}
                                                                {/foreach}
                                                                <li></li>
                                                        </ul>
                                                </td>
                                                <td style="width:50%;vertical-align:top">
                                                        <ul id="sortable" class="fieldOrder">
                                                                {if !$felder|count}
                                                                <li>&nbsp;</li>
                                                                {/if}
                                                                {foreach $felder as $fId => $name}
                                                                <li id="sortcol_{$name}">{$feldNamen[$name]|utf8_encode}</li>
                                                                {/foreach}
                                                        </ul>
                                                </td>
                                        </tr>
                                        <tr>
                                                <td colspan="2" style="text-align:center">
                                                        <input type="hidden" name="aid" value="{$id}" />
                                                        <input type="hidden" name="prefix" value="{$cfg.prefix|escape}" id="prefix" />
                                                        <input type="hidden" name="content" value="{$cfg.content|escape}" id="content" />
                                                </td>
                                        </tr>   
                                </table>
                        </div>
                </div>
                <div>
                        <br />
                        <button align="center">Konfiguration speichern</button>
                </div>
        </form>