{% include "headitem.html.twig" with {title: "GENERAL_ADMIN_TITLE"|translate, box: "list"} %}

<script type="text/javascript">
    <!--
    window.onload = function ()
    {
        top.reloadEditFrame();
        {% if updatelist == 1 %}
        top.oxid.admin.updateList('{{ oxid }}');
        {% endif %}
    }
    //-->
</script>
{% set where = oView.getListFilter() %}
<div id="liste">
    <form name="search" id="search" action="{{ oViewConf.getSelfLink() }}" method="post">
        {% include "_formparams.html.twig" with {cl: oViewConf.getActiveClassname(), lstrt: lstrt, actedit: actedit, oxid: oxid, fnc: "", language: actlang, editlanguage: actlang} %}
        {% if blShowLangSwitch %}
            <label>
                {{ translate({ ident: "D3_CFG_MOD_LIST_SETTLANG" }) }}
                <select name="changelang" class="editinput" onChange="top.oxid.admin.changeLanguage();">
                    {% for lang in languages %}
                        <option value="{{ lang.id }}" {% if lang.selected %}SELECTED{% endif %}>{{ lang.name }}</option>
                    {% endfor %}
                </select>
            </label>
        {% endif %}
        <table width="100%" cellspacing="0" cellpadding="0" border="0">
            <colgroup>
                <col width="3%">
                <col width="3%">
                <col width="30%">
                <col width="30%">
                <col width="3%">
            </colgroup>
            <tr class="listitem">
                <td class="listheader first" width="30" height="15" align="center">
                    <a href="Javascript:top.oxid.admin.setSorting(document.search, '', 'isActive', '{{ nextSorting.isActive }}');document.search.submit();" class="listheader" title="{{ translate({ ident: "GENERAL_ACTIVE" }) }}">A</a>
                </td>
                <td class="listheader" width="30" height="15" align="center">
                    <a href="Javascript:top.oxid.admin.setSorting(document.search, '', 'isTestConfig', '{{ nextSorting.isTestConfig }}');document.search.submit();" class="listheader" title="{{ translate({ ident: "D3UNZER_CONFIG_ISTESTCONFIG" }) }}">T</a>
                </td>
                <td class="listheader">
                    <a href="Javascript:top.oxid.admin.setSorting(document.search, '', 'title', '{{ nextSorting.title }}');document.search.submit();" class="listheader">{{ translate({ ident: "GENERAL_TITLE" }) }}</a>
                </td>
                <td class="listheader" height="15">
                    <a href="Javascript:top.oxid.admin.setSorting(document.search, '', 'heidelPayment', '{{ nextSorting.heidelPayment }}');document.search.submit();" class="listheader">{{ translate({ ident: "D3DYN_HEIDELPAY_PAYTYPE" }) }}</a>
                </td>
                <td class="listheader" colspan="2" height="15">
                    {% if showChannel %}
                    <a href="Javascript:top.oxid.admin.setSorting(document.search, '', 'channel', '{{ nextSorting.channel }}');document.search.submit();" class="listheader">{{ translate({ ident: "D3UNZER_CONFIG_CHANNEL" }) }}</a>
                    {% endif %}
                </td>
            </tr>

            {% set listclass = "listitem" %}
            {% for identifier, channel in channels %}
                {% if identifier == oxid %}
                    {% set listclass = "listitem4" %}
                {% endif %}
                {% set channelId = channel.getId() %}
                {% set heidelPayment = channel.getPaymentType() %}
                <tr id="row.{{ loop.index }}">
                    <td class="{{ listclass }} {% if channel.isActive() %} active{% endif %}" valign="top" height="15" title="{{ translate({ ident: "GENERAL_ACTIVE" }) }}">
                        <div class="listitemfloating">&nbsp;</div>
                    </td>
                    <td class="{{ listclass }} {% if channel.isTestConfig() %} active{% endif %}" valign="top" height="15" title="{{ translate({ ident: "D3UNZER_CONFIG_ISTESTCONFIG" }) }}">
                        <div class="listitemfloating">&nbsp;</div>
                    </td>
                    <td class="{{ listclass }}">
                        <div class="listitemfloating">
                            <a href="Javascript:top.oxid.admin.editThis('{{ channelId }}');"
                               class="{{ listclass }}"
                            >{{ channel.getTitle() }}</a></div>
                    </td>
                    <td class="{{ listclass }}" height="15">
                        <div class="listitemfloating">
                            <a href="Javascript:top.oxid.admin.editThis('{{ channelId }}');" class="{{ listclass }}">
                                {{ translate({ ident: "D3_UNZER_CHANNEL_" ~ channel.getPaymentTypeIdent()|upper }) }}
                            </a>
                        </div>
                    </td>
                    {% if showChannel %}
                    <td class="{{ listclass }}" height="15">
                        <div class="listitemfloating">
                            {{ channel.getChannel() }}
                        </div>
                    </td>
                    {% endif %}
                    <td class="{{ listclass }}"{% if false is same as(showChannel) %} colspan="2"{% endif %}>
                        <a href="Javascript:top.oxid.admin.deleteThis('{{ channelId }}');"
                           class="delete"
                           id="del.{{ loop.index }}"
                           title=""
                        ></a>
                    </td>
                </tr>
                {% set listclass = "listitem" %}
            {% endfor %}

            {% include "pagenavisnippet.html.twig" with {colspan: "6"} %}
        </table>
    </form>
</div>

{% include "pagetabsnippet.html.twig" %}

{% set emptyCapture %}
    <script type="text/javascript">
        {% set d3JavaScript %}
            if (parent.parent) {
                parent.parent.sShopTitle = "";
                parent.parent.sMenuItem = "Heidelpay";
                parent.parent.sMenuSubItem = "Channels verwalten";
                parent.parent.sWorkArea = "{{ _act }}";
                parent.parent.setTitle();
            }
        {% endset %}
    </script>
{% endset %}
{{ script({ add: d3JavaScript.__toString(), dynamic: __oxid_include_dynamic }) }}

{% include "bottomitem.html.twig" %}
