<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/modules/tadtools/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/modules/tadtools/bootstrap/css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_url}>/modules/tadtools/css/xoops_adm.css" />


<{$jquery_path}>
<{$treetable_code}>
<script type="text/javascript">
function delete_catalog_func(cat_sn){
  var sure = window.confirm("<{$smarty.const._MA_TADUP_DEL_CONFIRM}>");
  if (!sure)	return;
  location.href="main.php?op=delete_catalog&cat_sn=" + cat_sn;
}
</script>

<h2><{$smarty.const._MA_TADUP_LIST_ALL_FILES}></h2>

<form action="main.php" method="POST" enctype="multipart/form-data">
<div class="row-fluid">
  <div class="span5">
    <div class="controls controls-row">
      <label class="span3 text-right"><{$smarty.const._MA_TADUP_FATHER_FOLDER}></label>
      <select name="of_cat_sn" class="span8">
        <option></option>
        <{$cata_select}>
      </select>
    </div>

    <div class="controls controls-row">
      <label class="span3 text-right"><{$smarty.const._MA_TADUP_FOLDER_NAME}></label>
      <input type="text" name="cat_title" value="<{$cat_title}>" class="span8" placeholder="<{$smarty.const._MA_TADUP_FOLDER_NAME}>">
    </div>

    <div class="controls controls-row">
      <label class="span3 text-right"><{$smarty.const._MA_TADUP_ENABLE}></label>
      <label class="radio inline">
        <input type="radio" name="cat_enable" id="cat_enable1" value="1" <{if $cat_enable=="1"}>checked<{/if}>><{$smarty.const._YES}>
      </label>
      <label class="radio inline">
        <input type="radio" name="cat_enable" id="cat_enable0" value="0" <{if $cat_enable=="0"}>checked<{/if}>><{$smarty.const._NO}>
      </label>
    </div>

    <div class="controls controls-row">
      <label class="span3 text-right"><{$smarty.const._MA_TADUP_SHARE}></label>
      <label class="radio inline">
        <input type="radio" name="cat_share" id="cat_share1" value="1" <{if $cat_share=="1"}>checked<{/if}>><{$smarty.const._YES}>
      </label>
      <label class="radio inline">
        <input type="radio" name="cat_share" id="cat_share0" value="0" <{if $cat_share=="0"}>checked<{/if}>><{$smarty.const._NO}>
      </label>
    </div>


  </div>

  <div class="span2">
    <div class="controls controls-row">
      <label><{$smarty.const._MA_TADUP_CAN_ACCESS_GROUPS2}></label>
      <{$enable_group}>
    </div>
  </div>

  <div class="span2">
    <div class="controls controls-row">
      <label><{$smarty.const._MA_TADUP_CAN_UPLOADS_GROUPS}></label>
      <{$enable_upload_group}>
    </div>
  </div>
  <div class="span3">
    <div class="controls controls-row">
      <label><{$smarty.const._MA_TADUP_FOLDER_DESC}></label>
      <textarea name="cat_desc" class="span12" style="height:70px;font-size:12px"><{$cat_desc}></textarea>
  </div>
</div>

<div class="text-center">
  <input type="hidden" name="cat_sn" value="<{$cat_sn}>">
  <input type="hidden" name="cat_sort" value="<{$cat_sort}>">
  <input type="hidden" name="cat_count" value="<{$cat_count}>">
  <input type="hidden" name="op" value="add_catalog">
  <button type="submit" class="btn btn-primary"><{$smarty.const._MA_TADUP_SAVE}></button>
</div>


</form>

<div id="save_msg" style="float:right;"></div>
<div id="save_msg2" style="float:right;"></div>

<table id="tbl" class="table table-striped table-bordered table-hover">
  <tr>
    <th><{$smarty.const._MA_TADUP_FOLDER_NAME}></th>
    <th><{$smarty.const._MA_TADUP_AUTHOR}></th>
    <th><{$smarty.const._MA_TADUP_ENABLE}></th>
    <th><{$smarty.const._MA_TADUP_SHARE}></th>
    <th><{$smarty.const._MA_TADUP_FILE_COUNTER}></th>
    <th><{$smarty.const._MA_TADUP_FUNCTION}></th>
  </tr>
  <tbody class="sort">
    <{foreach from=$get_cata_data item=cate}>
      <tr id="node-_<{$cate.cat_sn}>" <{$cate.class}> style="letter-spacing: 0em;">
      <td>
        <img src="<{$xoops_url}>/modules/tadtools/treeTable/images/move_s.png" class="folder" alt="<{$smarty.const._MA_TREETABLE_MOVE_PIC}>" title="<{$smarty.const._MA_TREETABLE_MOVE_PIC}>">
        <span class="folder">
          <a href="<{$xoops_url}>/modules/tad_uploader/index.php?of_cat_sn=<{$cate.cat_sn}>"><{$cate.cat_title}></a>
        </span>
      </td>
      <td><{$cate.uid_name}></td>
      <td align="center"><{$cate.enable}></td>
      <td align="center"><{$cate.share}></td>
      <td><{$cate.cat_count}></td>
      <td>

      <img src="<{$xoops_url}>/modules/tadtools/treeTable/images/updown_s.png" style="cursor: s-resize;" alt="<{$smarty.const._MA_TREETABLE_SORT_PIC}>" title="<{$smarty.const._MA_TREETABLE_SORT_PIC}>">

      <a href="javascript:delete_catalog_func(<{$cate.cat_sn}>);" class="btn btn-mini btn-danger"><{$smarty.const._MA_TADUP_DEL}></a>
      <a href="main.php?op=catalog_form&cat_sn=<{$cate.cat_sn}>" class="btn btn-mini btn-warning"><{$smarty.const._MA_TADUP_EDIT}></a>
      </td>
      </tr>
    <{/foreach}>
  </tbody>
</table>