<?php if (!defined('ROOT')){ echo 'Deny ...'; exit; } extract($data); ?>

<div class="place">
    <span>文件管理器</span>
    <ul class="placeul" style="float:right;">
        <li onclick="_file_close();" style="cursor: pointer; color: red; font-weight: bold;">[关闭]</li>
    </ul>
</div>

<div class="formbody" style="margin-top: 10px;">
    <div class="usual"> 
        <div class="itab">
            <ul> 
                <li><a href="javascript:;" class="<?php if ($tab == 0){?>selected<?php }?>" onclick="_file_view(0);">图片</a></li> 
                <li><a href="javascript:;" class="<?php if ($tab == 1){?>selected<?php }?>" onclick="_file_view(1);">远程地址</a></li>
                <li><a href="javascript:;" class="<?php if ($tab == 2){?>selected<?php }?>" onclick="_file_view(2);">图片上传</a></li>
            </ul>
        </div> 
    </div>
</div>

<?php if ($tab == 0){?>
<div class="rightinfo">
    <ul class="imglist">
        <?php if ($files){ foreach ($files as $file){?>
        <li id="file_no_<?php echo $file['id'];?>" fileID="<?php echo $file['id'];?>">
            <span><img src="<?php echo $domain.$file['hash'];?>?imageView/1/w/168/h/126" width="168" height="126" onclick="_file_pick('<?php echo $domain.$file['hash'];?>', $(this));"/></span>
            <h2><?php echo $file['intro'] ? $file['intro'] : '--'; ?></h2>
            <p><a href="javascript:;" onclick="_file_edit_intro(<?php echo $file['id'];?>);">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="_file_delete(<?php echo $file['id'];?>);">删除</a></p>
        </li>
        <?php }}?>    
    </ul>
    <input type="button" class="btn" value="确认选择" id="fileConfirmBtn" onclick="_file_more_pick();" style="margin-left: 12px; display: none;"/>
</div>
<div class="formbody" style="margin-top: 10px;">
    <div class="usual" class="filePager"> 
        <?php echo $pager; ?>
    </div>
</div>
<?php }elseif ($tab == 1){?>
<div class="formbody" style="margin-top: 10px;">
    <div class="usual"> 
        <div class="tabson">
            <?php echo form::tip($admin['username'], '使用远程附件功能');?>
            <ul class="forminfo">
                <li>
                    <label>网址<b>*</b></label>
                    <input type="text" class="dfinput" id="ajaxFileUrl">
                </li>
                <li>
                    <label>&nbsp;</label>
                    <input name="btn88" type="button" class="btn" onclick="_file_url();" value="提交">
                </li>
            </ul>
        </div> 
    </div>
</div>
<?php }elseif ($tab == 2){?>
<div class="formbody" style="margin-top: 10px;">
    <div class="usual" style="position: relative;"> 
        <input type="button" class="btn" value="选择文件" />
        <input type="file" multiple="true" onchange="_file_select($(this));" style="width: 137px; height: 35px;position: absolute;top: 0;left: 0;margin: 0;opacity: 0;"/>
        <input type="button" class="btn" value="开始上传" onclick="_file_start_upload($(this));" style="background-image: linear-gradient(to bottom,#fff 0,#e0e0e0 100%);border:1px solid #ccc;color: #333;"/>
    </div>
</div>
<div class="rightinfo">
    <ul class="imglist" id="files_the_lists"></ul>
</div>
<?php }
