<input type="hidden" /><!-- The template must not start with a script tag. This would be ignored by IE //-->
<script type="text/javascript">
validMainConfig = {$validMainCfg};
lang = {$lang};
</script>
<script type="text/javascript" src="{$htmlBase}/frontend/nagvis-js/js/ManageBackends.js"></script>
<form name="backend_default" id="backend_default" method="POST" action="javascript:submitFrontendForm('{$htmlBase}/server/core/ajax_handler.php?mod=MainCfg&amp;act=doBackendDefault', 'backend_default');">
    <table name="mytable" class="mytable" id="table_backend_default">
        <tr><th class="cat" colspan="2"><h2>{$langSetDefaultBackend}</h2></th></tr>
        <tr>
            <td class="tdlabel" style="color:red;">{$langDefaultBackend}</td>
            <td class="tdfield">
                <select name="defaultbackend" onChange="" onBlur="">
                    {foreach $definedBackends backendId}
                        {if $backendId == $defaultBackend}
                            <option value="{$backendId}" selected>{$backendId}</option>
                        {else}
                            <option value="{$backendId}">{$backendId}</option>
                        {/if}
                    {/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td class="tdlabel" colspan="2" align="center">
                <input class="submit" type="submit" name="submit" value="{$langSave}" />
            </td>
        </tr>
    </table>
</form>

{if $someNotEditable}<p>{$langSomeNotEditable}</p>{/if}

<form name="backend_add" id="backend_add" method="POST" action="javascript:submitFrontendForm('{$htmlBase}/server/core/ajax_handler.php?mod=MainCfg&amp;act=doBackendAdd', 'backend_add');" onsubmit="return check_backend_add();">
    <table name="mytable" class="mytable" id="table_backend_add">
        <tr>
            <th class="cat" colspan="2"><h2>{$langAddBackend}</h2></th>
        </tr>
        <tr>
            <td class="tdlabel" style="color:red;">backendid</td>
            <td class="tdfield"><input type="text" name="backendid" value="" /></td>
        </tr>
        <tr>
            <td class="tdlabel" style="color:red;">backendtype</td>
            <td class="tdfield">
                <select name="backendtype" onChange="updateBackendOptions(this.value, '', 'backend_add');">
                    {foreach $availableBackends type}<option value="{$type}">{$type}</option>{/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td class="tdlabel" colspan="2" align="center">
                <input class="submit" type="submit" name="submit" value="{$langSave}" />
            </td>
        </tr>
    </table>
</form>

<form name="backend_edit" id="backend_edit" method="POST" action="javascript:submitFrontendForm('{$htmlBase}/server/core/ajax_handler.php?mod=MainCfg&amp;act=doBackendEdit', 'backend_edit');" onsubmit="return check_backend_edit();">
    <input type="hidden" name="backendtype" value="" />
    <table name="mytable" class="mytable" id="table_backend_edit">
        <tr><th class="cat" colspan="2"><h2>{$langEditBackend}</h2></th></tr>
        <tr>
            <td class="tdlabel" style="color:red;">backendid</td>
            <td class="tdfield">
                <select name="backendid" onChange="updateBackendOptions('', this.value, 'backend_edit');">
                    {foreach $editableBackends backendId}<option value="{$backendId}">{$backendId}</option>{/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td class="tdlabel" colspan="2" align="center">
                <input class="submit" type="submit" name="submit" value="{$langSave}" />
            </td>
        </tr>
    </table>
</form>

<form name="backend_del" id="backend_del" method="POST" action="javascript:submitFrontendForm('{$htmlBase}/server/core/ajax_handler.php?mod=MainCfg&amp;act=doBackendDel', 'backend_del');" onsubmit="return check_backend_del();">
    <table name="mytable" class="mytable" id="table_backend_del">
        <tr><th class="cat" colspan="2"><h2>{$langDelBackend}</h2></th></tr>
        <tr>
            <td class="tdlabel" style="color:red;">backendid</td>
            <td class="tdfield">
                <select name="backendid">
                    {foreach $editableBackends backendId}<option value="{$backendId}">{$backendId}</option>{/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td class="tdlabel" colspan="2" align="center">
                <input class="submit" type="submit" name="submit" value="{$langDelete}" />
            </td>
        </tr>
    </table>
</form>
