Subversion-Projekte lars-tiefland.content-management

Revision

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

<!-- $Id: auspraegung.tpl 4174 2012-02-02 14:14:10Z tiefland $ -->

    <form action="{$SCRIPT_NAME}" method="post" name="auspraegung" onsubmit="return check_form();">
        <input type="hidden" name="id" value="{$id}">
        <input type="hidden" name="a_id" value="{$a_id}">
        <input type="hidden" name="mode" value="{$mode}">
        <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td class="links" colspan="2" align="center">
                    Ausprägung ändern / hinzufügen
                </td>
            <tr id="name">
                <td class="links">Ausprägungsname</td>
                <td class="rechts">
                    {if !$sub_type}
                    <input type="text" value="{$val}" name="value">
                    {else}
                    <input type="text" value="{$val}" name="value" disabled="disabled">
                    <input type="hidden" value="{$val}" name="value">
                    {/if}
                </td>
            </tr>
            <tr id="suche">
                <td class="links">Suchkriterium?</td>
                <td class="rechts">
                    <input type="hidden" name="suchkriterium" value="0">
                    <input type="checkbox" name="suchkriterium" value="1" {if $suchkriterium==1}checked="checked"{/if}>
                </td>
            </tr>
            {if $auspr_vererbung==1}
            <tr id="vererbung">
                <td class="links">auf alle Unterordner vererben?</td>
                <td class="rechts">
                    <input type="hidden" name="vererbung" value="0">
                    <input type="checkbox" name="vererbung" value="1" {if $vererbung==1}checked="checked"{/if}>
                </td>
            </tr>
            {/if}            
            <tr>
                <td class="links" style="width:30%">Typ der Ausprägung</td>
                <td class="rechts">
                    {if !$sub_type && $mode!="edit"}
                    {html_options options=$options selected=$type name="type" id="type"}
                    {else}
                        {html_options options=$options selected=$type name="type" id="type" disabled="disabled"}
                        <input type="hidden" name="type" value="{$type}">
                    {/if}
                </td>
            </tr>
            
            
            
            {if $type==1}
            <tr>
                <td class="links">Richtung für bessere Werte</td>
                <td class="rechts">
                    {html_options name="richtung" options=$richtungen selected=$richtung}
                </td>
            </tr>
            {/if}
            <tr id="extra">
                <td class="links" style="width:30%">Einheit</td>
                <td class="rechts">
                    {if !$sub_type && $mode!="edit"}
                    <input type="text" name="einheit" value="{$einheit}">
                    {else}
                    <input type="text" value="{$einheit}" disabled="disabled">
                    <input type="hidden" name="einheit" value="{$einheit}">
                    {/if}
                </td>
            </tr>
            <tr id="wertebereiche">
                <td class="links" id="caption_wb">Wertebereiche ({$einheit})</td>
                <td class="rechts">
                    <input type="text" name="wert[0]" value="{$werte[0]}" size="2">
                    {section loop=$werte start=1 name=w_ind}
                    bis <input type="text" name="wert[]" value="{$werte[w_ind]}" size="2">
                    {/section}
                </td>
            </tr>
            <tr id="preisbereiche">
                <td class="links" id="caption_pb">Preisbereiche (EUR)</td>
                <td class="rechts">
                    0
                    <input type="hidden" name="preis[0]" value="0">
                    {section loop=$preise start=1 name=p_ind}
                    bis <input type="text" name="preis[]" value="{$preise[p_ind]}" size="2">
                    {/section}
                </td>
            </tr>
            <tr id="auswahl">
                <td class="links" id="caption_auswahl">Auswahlwerte</td>
                <td class="rechts">
                    {for $i=0;$i<50;$i++}
                        <input type="text" name="auswahl[{$i}]" value="{$auswahl[$i]}">
                    {/for}
                </td>
            </tr>
            <tr id="abh_auspr">
                <td class="links">Abh&auml;ngige Auspr&auml;gung: </td>
                <td class="rechts">
                    <input type="" name="abh_auspr" value="{$abh_auspr}" />
                </td>
            </tr>
            
            <tr id="unterauswahl">
                <td class="links" id="caption_unterauswahl">Auswahlwerte</td>
                <td class="rechts">
                
                    {for $i=0;$i<50;$i++}
                        <input type="text" id="unterauswahl_{$i}" name="unterauswahl[{$i}][ebene1]" value="{$unterauswahl[$i].ebene1}" /> 
                        <a style="cursor:pointer;" onclick="return toggle_div('unterauswahl2_{$i}');" title="Unterauswahl anlegen">[+]</a>
                        
                        <div class="unterauswahl2" id="unterauswahl2_{$i}" style="display:none;">
                            <hr /> 2. Ebene f&uuml;r <span id="ebene2_{$i}"></span><br />
                        
                        {for $k=0;$k<20;$k++}
                            
                            <input type="text" name="unterauswahl[{$i}][{$k}]" value="{$unterauswahl[$i][$k]}" /> 
                               
                        {/for}
                            <hr />
                        </div>
                    {/for}
                </td>
            </tr>
            <tr id="eu_label">
                <td class="links">Eu-Label</td>
                <td class="rechts">
                    {if $type!=7 && $mode!="edit"}
                    {html_options name="eu_label" options=$labels selected=$sub_type}
                    {else}
                    {html_options name="eu_label" options=$labels selected=$sub_type disabled="disabled"}
                    {/if}
                </td>
            </tr>
            {if $type==7}
                {section loop=$sub_ausp name=sa_ind}
                    <tr>
                        <td class="links">{$sub_ausp[sa_ind].name}</td>
                        <td class="rechts">
                            <input type="hidden" name="auspraegung[{$sub_ausp[sa_ind].ID}][suchkriterium]" value="0">
                            <input type="checkbox" name="auspraegung[{$sub_ausp[sa_ind].ID}][suchkriterium]" value="1" {if $sub_ausp[sa_ind].suchkriterium}checked="checked"{/if}> Suchkriterium
                        </td>
                    </tr>
                {/section}
            {/if}
            <tr>
                <td class="links">Erklärung</td>
                <td class="rechts">
                    <input type="text" name="erklaerung" value="{$erklaerung}">
                </td>
            </tr>
            <tr>
                <td class="links" colspan="2" align="center">
                    <input type="submit" value="speichern">
                </td>
            </tr>
        </table>
    </form>
    
    <script>
        function toggle_div(id) {
            for(i=0;i<50;i++) {
                document.getElementById('unterauswahl2_' + i).style.display = "none";
            }
            
            var divstatus = document.getElementById(id).style.display;
            
            if(divstatus=='none') {
                var e_id = id.substr(14);
                document.getElementById('ebene2_'+e_id).innerHTML = document.getElementById('unterauswahl_'+ e_id).value;
                document.getElementById(id).style.display = 'block';
            }else{
                document.getElementById(id).style.display = 'none';
            }
             
        }
    </script>