<include file="Public/header" />
<hc:loadcssjs type="Validform,calendar"/>
<div class="pad-lr-10 w_auto col-sm-12">
  <div class="col-lg-12">
    <form id="myform" name="myform" action="{:U('delete')}" method="post">
        <div class="mt15">
          <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="{:U('Addons/index')}">插件列表</a></li>
            <li role="presentation"><a href="{:U('Addons/hooks')}">钩子管理</a></li>
          </ul>
          <div class="cont_hanchao pd15 tab-content" id="myTabContent">
            <div class="present  tab-pane fade active in" id="group_common">
          	<a href="{:U('create')}" class="btn btn-primary">快速创建</a>
              
                <table class="table table-hover table-striped table-hanchao mt15 table-bordered">
                    <thead>
                        <tr>
                            <th width="35"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');" class="check_box_c" /></th>
                            <th width="60" align="center">{:orderurl('LAN_ID','id');}</th>
                            <th width="120">{:orderurl('LAN_NAME','title');}</th>
                            <th width="100">{:orderurl('标识','name');}</th>
                            <th width="200">{:orderurl('描述','description');}</th>
                            <th width="60">{:orderurl('LAN_STATUS','status');}</th>
                            <th width="60">{:orderurl('作者','author');}</th>
                            <th width="150">{:orderurl('版本','version');}</th>
                            <th width="120">{:L('MANAGE')}</th>
                        </tr>
                    </thead>
                    <tbody>
                        <volist name="list" id="val" >
                            <tr>
                                <td><input type="checkbox" value="{$val.id}" name="id[]"></td>
                                <td>{$val.id}</td>
                                <td>{$val.title}</td>
                                <td>{$val.name}</td>
                                <td>{$val.description}</td>
                                <td onclick="status({$val.id},'status')" id="status_{$val.id}"><img src="__PUBLIC__/images/status_{$val.status|default=0}.gif" /></td>
                                <td>{$val.author}</td>
                                <td>{$val.version}</td>
                                <td>
                                    <empty name="val.uninstall">
                                        <notempty name="val.has_adminlist">
                                            <a href="{:U('Addons/adminList',array('name'=>$val['name']))}">管理</a>
                                        </notempty>
                                        <?php
                            $class	= get_addon_class($val['name']);
                            if(!class_exists($class)){
                                    $has_config = 0;
                            }else{
                                    $addon = new $class();
                                    $has_config = count($addon->getConfig());
                                        }
                                        ?>
                                        <?php if ($has_config): ?>
                                        <a href="{:U('config',array('id'=>$val['id']))}">设置</a>
                                        <?php endif ?>
                                        <a class="ajax-get" href="{:U('uninstall?id='.$val['id'])}">卸载</a>
                                        <else />
                                        <a class="ajax-get" href="{:U('install?addon_name='.$val['name'])}">安装</a>
                                    </empty>
                                </td>
                            </tr>
                        </volist>
                    </tbody>
                </table>
        
                <div class="btn_party mt15">
                    <label for="check_box" class="btn btn-default f_l">{$Think.lang.select_all}/{$Think.lang.cancel}</label>
                    <button type="button" class="btn btn-danger" onclick="$.showConfirm('{:L('SURE_DELETE')}',function(){$('#myform').submit();},'hc')">{:L('ALL_DEL')}</button>
        
                </div>
            </form>
            <nav class="pages_hanchao" id="pages">
            	{$_page}
        	</nav>
          </div>
          </div>
      	</div>
    </form>
</div>
</div>
<include file="Public/footer" />