[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
[{oxstyle include=$oViewConf->getModuleUrl('d3modcfg_lib', 'out/admin/src/d3_mod_cfg.css')}]
[{oxstyle}]
[{include file="d3_d3importer_views_admin_tpl_errormessages.tpl"}]

[{if $readonly}]
    [{assign var="readonly" value="readonly disabled"}]
[{else}]
    [{assign var="readonly" value=""}]
[{/if}]

<script type="text/javascript">
    <!--
    [{if $updatelist == 1}]
    UpdateList('[{$oxid}]');
    [{/if}]
    function UpdateList(sID) {
        var oSearch = parent.list.document.getElementById("search");
        oSearch.oxid.value = sID;
        oSearch.submit();
    }
    //-->
</script>

<form name="transfer" id="transfer" action="[{$oViewConf->getSelfLink()}]" method="post">
    <div>
        [{$oViewConf->getHiddenSid()}]
        <input type="hidden" name="oxid" value="[{$oxid}]">
        <input type="hidden" name="cl" value="d3_picture_import">
        <input type="hidden" name="editlanguage" value="[{$editlanguage}]">
    </div>
</form>

<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post">
    <div>
        [{$oViewConf->getHiddenSid()}]
        <input type="hidden" name="cl" value="d3_picture_import">
        <input type="hidden" name="fnc" value="">
        <input type="hidden" name="oxid" value="[{$oxid}]">
    </div>
    <table cellspacing="0" cellpadding="0" border="0" width="98%">

        [{assign var="iError" value=$oView->getConfigFailure()}]
        [{if $iError}]
            [{block name="d3_d3importer_views_admin_tpl_d3_picture_import_failure"}]
                <tr>
                    <td valign="top" class="edittext" colspan="2">
                        <div class="errorbox">[{oxmultilang ident="D3_PICTURE_FAILCONFIG_$iError"}]</div>
                    </td>
                </tr>
            [{/block}]
        [{else}]
            [{block name="d3_d3importer_views_admin_tpl_d3_picture_import_options"}]
            <tr>
                <td valign="top" class="edittext" width="50%">
                    <table cellspacing="0" cellpadding="0" border="0">
                        <tr>
                            <td class="edittext">
                                <br>
                                <span class="d3modcfg_btn fixed icon action_download">
                                    <input type="submit" class="edittext" name="save"
                                           onClick="document.myedit.fnc.value='getExternPictures'"
                                           value="[{oxmultilang ident="D3_PICTURE_EXTPICTURE_START"}]" [{$readonly}]>
                                    <span></span>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td class="edittext">
                                <br>
                                 <span class="d3modcfg_btn fixed icon folder">
                                    <input type="submit" class="edittext" name="save"
                                           onClick="document.myedit.fnc.value='scanPictureDir'"
                                           value="[{oxmultilang ident="D3_PICTURE_SCANDIR_START"}]" [{$readonly}]>
                                    <span></span>
                                </span>
                            </td>
                        </tr>
                        [{if $dirinfo.sumfiles && $dirinfo.sumfiles > $dirinfo.finishedfiles}]
                            <tr>
                                <td class="edittext">
                                    <br>
                                    <span class="d3modcfg_btn fixed icon btn_green">
                                        <input type="submit" class="edittext" name="save"
                                               onClick="document.myedit.fnc.value='doImport'"
                                               value="[{oxmultilang ident="D3_PICTURE_IMPORT_START"}]" [{$readonly}]>
                                        <span></span>
                                    </span>
                                </td>
                            </tr>
                        [{/if}]
                    </table>
                </td>
            [{/block}]
            [{block name="d3_d3importer_views_admin_tpl_d3_picture_import_results"}]
                <!-- Anfang rechte Seite -->
                <td valign="top" class="edittext" align="left" width="50%">
                    [{if $oxid != "-1" && !$isfailupload}]

                        [{if $dirinfo}]
                            <table cellspacing="0" cellpadding="0" border="0">
                                <tr>
                                    <td class="edittext" valign="top">
                                        [{oxmultilang ident ="D3_PICTURE_IMPORT_INFO_1"}]
                                    </td>
                                    <td class="edittext">
                                        <table style="border: 1px solid black; padding: 5px">
                                            <tr>
                                                <td class="edittext">[{oxmultilang ident ="D3_PICTURE_IMPORT_INFO_2"}]</td>
                                                <td class="edittext">[{$dirinfo.sumfiles}]</td>
                                            </tr>
                                            <tr>
                                                <td class="edittext">[{oxmultilang ident ="D3_PICTURE_IMPORT_INFO_3"}]</td>
                                                <td class="edittext">[{$dirinfo.finishedfiles}]</td>
                                            </tr>
                                            <tr>
                                                <td class="edittext">[{oxmultilang ident ="D3_PICTURE_IMPORT_INFO_4"}]</td>
                                                <td class="edittext">[{$dirinfo.importedfiles}]</td>
                                            </tr>
                                        </table>

                                    </td>
                                </tr>
                            </table>
                            <div class="edittext" style="padding: 10px; font-weight: bold">
                                [{if !$dirinfo.sumfiles}]
                                    [{oxmultilang ident ="D3_PICTURE_IMPORT_NOTICE_1"}]
                                [{elseif $dirinfo.sumfiles && $dirinfo.sumfiles == $dirinfo.finishedfiles}]
                                    [{oxmultilang ident ="D3_PICTURE_IMPORT_NOTICE_2"}]
                                [{elseif $dirinfo.finishedfiles}]
                                    [{oxmultilang ident ="D3_PICTURE_IMPORT_NOTICE_3"}]
                                [{elseif $dirinfo.sumfiles}]
                                    [{oxmultilang ident ="D3_PICTURE_IMPORT_NOTICE_4"}]
                                [{/if}]
                            </div>
                        [{/if}]
                    [{/if}]
                </td>
            [{/block}]
            </tr>
        [{/if}]
    </table>
</form>

[{include file="bottomnaviitem.tpl"}]
[{include file="bottomitem.tpl"}]
