<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title>{:C('WEB_SITE_TITLE')}_管理中心</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="renderer" content="webkit">
		<meta name="author" content="客服QQ：351075088 网站：http://www.69kz.com" />
		<link rel="stylesheet" type="text/css" href="__TPLPUBLIC__/css/amazeui.min.css">
		<link rel="stylesheet" type="text/css" href="__TPLPUBLIC__/css/css-1.4.min.css">
		<link rel="stylesheet" type="text/css" href="__TPL__/css/style.css">
	</head>

	<body id="list">
		<div id="location">
			<a href="javascript:history.back(-1);"><i class="iconfont fz13">&#xe609;</i> <span>返回上一页</span></a>
			<a href="{:U('Index/main')}" class="home"><i class="iconfont fz14">&#xe60a;</i> <span>首页</span></a>
			<i class="iconfont fz14">&#xe604;</i>
			<span>{$model['title']}列表</span>
		</div>
		<ul id="nav">
			<wdlist model="menu_often" order="id asc">
			    <li <if condition="I('menuid') eq $v['menuid']">class="current"</if>><a href="{:U($v['url'])}">{$v.title}</a> <a href="javascript:;" class="close" data-id='{$v.id}'>X</a></li>
			</wdlist>
		</ul>
		<dl class="tools">
			<dd class="c1">
				<ul>
					<li><a href="{:U('create')}" class="am-btn am-btn-primary am-radius am-btn-sm"><i class="iconfont">&#xe60;</i>快速创建</a></li>
				</ul>
			</dd>
			<dd class="c2">
				<form action="{$_SERVER['PHP_SELF']}" method="get">
				<input type="hidden" name="m" value="Admin" />
				<input type="hidden" name="c" value="Think" />
				<input type="hidden" name="a" value="lists" />
				<input type="hidden" name="model" value="{$model.name}" />
				<div class="am-input-group search">
					<input type="text" name="{$model.search_key}" value="{:I($model['search_key'],'')}" class="am-form-field" >
					<span class="am-input-group-label"><button type="submit"><i class="iconfont">&#xe60d;</i></button></span>
				</div>
				</form>
			</dd>
		</dl>
		<table class="am-table am-table-hover am-table-striped">
			<tbody>
				<tr>
					<th>名称</th>
					<th>标识</th>
					<th >描述</th>
					<th width="43px">状态</th>
					<th>作者</th>
					<th width="43px">版本</th>
					<th width="94px">操作</th>
				</tr>
				<volist name="_list" id="vo">
					<tr>
<td>{$vo.title}</td>
					<td>{$vo.name}</td>
					<td>{$vo.description}</td>
					<td>{$vo.status_text|default="未安装"}</td>
					<td><a target="_blank" href="{$vo.url|default='http://www.onethink.cn'}">{$vo.author}</a></td>
					<td>{$vo.version}</td>
					<td>
						<empty name="vo.uninstall">
							<?php
								$class	= get_addon_class($vo['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'=>$vo['id']))}">设置</a>
							<?php endif ?>
						<?php if ($vo['status'] >=0): ?>
							<eq name="vo.status" value="0">
								<a class="ajax-get" href="{:U('enable',array('id'=>$vo['id']))}">启用</a>
							<else />
								<a class="ajax-get" href="{:U('disable',array('id'=>$vo['id']))}">禁用</a>
							</eq>
						<?php endif ?>
							{// <eq name="vo.author" value="thinkphp">}
								<a class="ajax-get" href="{:U('uninstall?id='.$vo['id'])}">卸载</a>
							{// </eq>}
						<else />
							<a class="ajax-get" href="{:U('install?addon_name='.$vo['name'])}">安装</a>
						</empty>
					</td>
					</tr>
				</volist>
			</tbody>
		</table>

		<div class="g_page_div tl">
			{$_page|default=''}
		</div>
		<script type="text/javascript">
		root = "__TPL__/js";
		</script>
		<script src="__TPLPUBLIC__/js/jquery.min.js"></script> 
		<script src="__TPLPUBLIC__/js/amazeui.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="__TPL__/js/js-1.0.min.js"></script>
		<script type="text/javascript">
		window.onerror=function(){return true;}
		jQuery(document).ready(function($){ 
			try{
		
				$(".ajax-post").on("click",function () {
					if (!confirm("即将删除数据，且不可恢复，是否确认？")) {
						return false;
					}
					var the=$(this);
					$.get(
						the.attr('href'),
						function (data) {
							window.location.reload();
						}
					);
					return false;
				})	
			}catch(e){}
		});
		</script>
	</body>

</html>