<?php
/**
 * The buildform view file of file module of ZDOO.
 *
 * @copyright   Copyright 2009-2018 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
 * @license     ZPL (http://zpl.pub/page/zplv12.html)
 * @author      Chunsheng Wang <chunsheng@cnezsoft.com>
 * @package     file
 * @version     $Id: buildform.html.php 4029 2016-08-26 06:50:41Z liugang $
 * @link        http://www.zdoo.com
 */
?>
<?php if(commonModel::hasPriv('file', 'upload')):?>
<?php if(!$writable):?>
<div class='text-danger text-left'> <?php echo $this->lang->file->errorUnwritable;?> </div>
<?php else:?>
<?php $maxUploadSize = strtoupper(ini_get('upload_max_filesize'));?>
<style>
.file-input-list .input-group-btn .btn {padding: 4px 8px;}
.file-input .input-group>.input-group-cell:first-child {padding-left: 0}
</style>
<div class="file-input-list" data-provide="fileInputList" data-each-file-max-size="<?php echo $maxUploadSize;?>" data-file-size-error="<?php echo sprintf($lang->file->errorFileSize, $maxUploadSize);?>">
  <div class="file-input">
    <div class="file-input-empty">
      <button type="button" class="btn btn-link file-input-btn"><i class="icon icon-plus"></i> <?php echo $lang->file->addFile;?></button> <small class="muted"><?php echo sprintf($lang->file->maxUploadSize, $maxUploadSize);?></small>
    </div>
    <div class="file-input-edit input-group">
      <div class="input-group-cell"><i class="icon icon-paper-clip text-muted"></i></div>
      <input type="text" name="<?php echo $labelsName;?>[]" class="form-control file-editbox" placeholder="<?php echo $lang->file->title;?>">
      <div class="input-group-btn">
        <button type="button" class="btn btn-success file-name-confirm"><i class="icon icon-check"></i></button>
      </div>
      <div class="input-group-btn">
        <button type="button" class="btn btn-gray file-name-cancel"><i class="icon icon-close"></i></button>
      </div>
    </div>
    <div class="file-input-normal input-group">
      <div class="input-group-cell"><i class="icon icon-paperclip text-muted"></i></div>
      <div class="input-group-cell">
        <span class="file-title"></span>
        <small class="file-size muted"></small>
      </div>
      <div class="input-group-btn">
        <button type="button" class="btn btn-link file-input-rename"><?php echo $lang->file->edit;?></button>
      </div>
      <div class="input-group-btn">
        <button type="button" class="btn btn-link file-input-delete"><?php echo $lang->delete;?></button>
      </div>
    </div>
    <input type="file" name="<?php echo $filesName;?>[]">
  </div>
</div>
<?php endif;?>
<?php endif;?>
