<!DOCTYPE >
<html>
<head>
	<title>deituiCMS</title>
	<link href="/static/admin/css/iframe.css?v34" rel="stylesheet" />
	<link href="//at.alicdn.com/t/font_902011_gf4ip479r5r.css" rel="stylesheet" />
</head>
<body>
	<div class="topBox">
		<div class="topa" style="overflow: auto;height: 50px;">
			<div class="top-item js-toggleSide" title="左侧">
				<i class="iconfont icon-goLeft"></i>
			</div>
			<div class="top-item js-back" title="后退">
				<i class="iconfont icon-back"></i>
			</div>
			
			<div onClick="goHome(this)" class="top-item-btn" title="后台主页">
				<i class="iconfont icon-home"></i> 主后台
			</div>
			{foreach item=c from=$topNav}
			<div url="{$c.link_url}"  class="top-item-btn js-goPlugin">
				<i class="iconfont {$c.icon}"></i> {$c.title}
			</div>
			{/foreach}
			<a onclick="goModule(this)" class="top-item-btn">
				<i class="iconfont icon-repair"></i> 插件扩展
			</a>
			<div style="float: right;">
				<?php
				 
					$sites=M("sites")->selectRow("siteid=".SITEID);
					 
					C()->smarty->assign("sites",$sites);
				?>
				<a gourl="/admin.php?m=sites" class="top-item">{$sites.sitename}</a>
				<div class="top-item js-refresh" title="刷新">
					<i class="iconfont icon-refresh"></i>
				</div>
				<a href="/" target="_blank" class="top-item" title="前台首页">
					<i class="iconfont icon-global"></i>
				</a>
				
				 
				
				<div class="top-item" id="nickname">
					{$ssadmin.username}
					 
				</div>
				<div onclick="logout()" class="top-item" title="注销">
					<i class="iconfont icon-logout"></i>
				</div>
				<div  class="top-item" title="更多">
					<i class="iconfont icon-moreandroid"></i>
				</div>
			</div>
		</div>
		 
	</div>
	
	<div class="leftBox">
		<div class="sitename">校园O2O</div>
		<div class="menu-bar" id="menuBar"></div>
		<!--基础后台管理-->
		 <div id="baseMenu">
			{foreach item=c from=$navList}
			<div class="menu">
				<div class="menu-title" ><i class="iconfont {$c.icon}"></i> {$c.title}</div>
				{if $c.child}
				<div class="menu-box">
					{foreach item=cc from=$c.child}
					<div gourl="{$cc.link_url}" class="menu-item">{$cc.title}</div>
					 
					{/foreach}
				</div>
				{/if}
			</div>
			{/foreach}
		</div>
		<!--插件后台管理-->
		<div id="pluginMenu">
			
		</div>
	</div>
	<div class="rightBox">
		<iframe id="mainFrame" class="mainFrame" name="mainFrame" src="/admin.php?m=index&a=main"></iframe>
	</div>
	
	<script src="/plugin/jquery/jquery-2.1.3.min.js"></script>
	 <script>
		 function goPluginMenu(url){
			$.get(url,function(res){
				$("#baseMenu").hide();
				$("#pluginMenu").html(res).show();
			}) 
			
		 }
		 function logout(){
			 $.get("/admin.php?m=login&a=logout",function(){
				 window.location="/admin.php"
			 })
		 }
		 function goHome(obj){
			 window.location.reload();
			 return false;
			 $("#baseMenu").show();
			 $("#pluginMenu").hide();
			 $("#mainFrame").attr("src","/admin.php?m=index&a=main");
			 $(".top-item-btn").removeClass("active");
			 $(obj).addClass("active");
		 }
		 function goModule(obj){
			 $(".top-item-btn").removeClass("active");
			 $(obj).addClass("active");
			$("#mainFrame").attr("src","/admin.php?m=module"); 
		 }
		 $(function(){
			 $(document).on("click",".js-toggleSide",function(){
				 $("body").toggleClass("miniSide");
			 })
			 
			 $(document).on("click",".js-goPlugin",function(){
				 var url=$(this).attr("url");
				 $(".top-item-btn").removeClass("active");
				 $(this).addClass("active");
				 $.get(url,function(res){
				 	$("#baseMenu").hide();
				 	$("#pluginMenu").html(res).show();
				 })
			 })
			 
			 $(document).on("click",".menu",function(){
				 $(this).addClass("menu-active").siblings().removeClass("menu-active");
				 var top=$(this).find(".menu-title").offset().top;
				 $("#menuBar").animate({top:top},100);
			 })
			 $(document).on("mouseenter",".menu",function(){
				 var top=$(this).find(".menu-title").offset().top;
				 $("#menuBar").animate({top:top},100);
			 })
			 $(document).on("click","[gourl]",function(){
				 var url=$(this).attr("gourl");
				 $("#mainFrame").attr("src",url);
				 $("[gourl]").removeClass("menu-item-active");
				 $(this).addClass("menu-item-active");
			 })
			 $(document).on("click",".js-refresh",function(){
				 mainFrame.window.location.reload();
			 })
			 $(document).on("click",".js-back",function(){
				 mainFrame.window.history.back();
			 })
		 })
	 </script>
</body>

</html>