{include file="./index_top.tpl"}
<script type="text/javascript" src="mybic.js?{$revision}"></script>
<script language="JavaScript" type="text/javascript">
</script>
<div align=center>
    <br>{$lang.ext_files_list}<br><br>
    {if $error_mess}
        <div class=error_mess>{$error_mess}</div>
        <br>
    {/if}
    <table class='lost_files_table'>
        <tr>
            <td colspan=3></td>
            <td><b>{$lang.File_name}</b></td>
            <td><b>{$lang.Size}</b></td>
        </tr>
        {foreach $ext_files as $one_file}
            <tr>
                <td style="border-right:none;">
                    {if $one_file.can_edit}
                        <a class="no_border" onclick="open_calc('ext_file_id={$one_file.id}',1000);return false;"
                           href="#"><img style="vertical-align:middle;" alt="{$lang.Edit}" title="{$lang.Edit}"
                                         src="images/b_edit.png" border=0></a>
                    {/if}
                </td>
                <td style="border-left:none;border-right:none;">
                    {if $one_file.can_view}
                        <a class="no_border" target=_blank href="{$config.site_root}/{$one_file.name}"><img
                                    style="vertical-align:middle;" alt="{$lang.View}" title="{$lang.View}"
                                    src="images/b_view.png" border=0></a>
                    {/if}
                </td>
                <td style="border-left:none;">
                    <a class="no_border href_post"
                       onclick='return href_post=jconfirm("{$lang.confirm_delete_file} ({$one_file.file_name})", this);'
                       href="edit_files.php?sel=del_ext&file_id={$one_file.id}"><img style="vertical-align:middle;"
                                                                                     alt="{$lang.delete}"
                                                                                     title="{$lang.Delete}"
                                                                                     src="images/b_drop.png"
                                                                                     border=0></a>
                </td>
                <td>{$one_file.file_name}</td>
                <td nowrap align=right>{$one_file.size}</td>
            </tr>
        {/foreach}
    </table>
    <br>
    <p>{$lang.Add_ext_file_msg}</p>
    <form enctype="multipart/form-data" action="edit_files.php" id="edit_form" method="post">
        <input type=text name='ext_file_name' id='ext_file_name' {if !$all_modules.pro_tariff}disabled{/if}>
        <input type=submit value='{$lang.Add_file}' {if !$all_modules.pro_tariff}disabled title="{$lang.Pro_tariff_func_message}"{/if}
               onclick='if (!document.getElementById("ext_file_name").value) { jalert(window.lang.No_filename); return false;}'>
        <input type=hidden name='sel' value='list_ext_add_file'>
        <input type=hidden name='csrf' value='{$csrf}'>
    </form>
    <br>
    <a href="edit_files.php">{$lang.return_to_files_settings}</a>
    <br>