You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
512 lines
14 KiB
512 lines
14 KiB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>shop Menu</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<link href="styles/general.css" rel="stylesheet" type="text/css" />
|
|
<script language="JavaScript">
|
|
<!--
|
|
var noHelp = "<p align='center' style='color: #666'>{$lang.no_help}</p>";
|
|
var helpLang = "{$help_lang}";
|
|
//-->
|
|
</script>
|
|
{literal}
|
|
<style type="text/css">
|
|
body {
|
|
background: #212121;
|
|
}
|
|
.tab-front {
|
|
line-height: 33px;
|
|
font-weight: bold;
|
|
padding: 4px 15px 4px 18px;
|
|
cursor: hand;
|
|
cursor: pointer; font-size:14px; font-family:"微软雅黑"; color:#fff;
|
|
}
|
|
.tab-back {
|
|
color: #F4FAFB;
|
|
line-height: 20px;
|
|
padding: 4px 15px 4px 18px;
|
|
cursor: hand;
|
|
cursor: pointer;
|
|
}
|
|
.tab-hover {
|
|
color: #F4FAFB;
|
|
line-height: 20px;
|
|
padding: 4px 15px 4px 18px;
|
|
cursor: hand;
|
|
cursor: pointer;
|
|
background: #2F9DB5;
|
|
}
|
|
#top-div
|
|
{
|
|
padding: 3px 0 2px;
|
|
background: #BBDDE5;
|
|
margin: 5px;
|
|
text-align: center;
|
|
}
|
|
#main-div {
|
|
|
|
|
|
}
|
|
#menu-list {
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
#menu-list ul {
|
|
padding: 0;
|
|
margin: 0;
|
|
list-style-type: none;
|
|
color: #335B64;
|
|
}
|
|
#menu-list li {
|
|
|
|
cursor: hand;
|
|
cursor: pointer;
|
|
}
|
|
#menu-list li:hover{ color:#000;}
|
|
#menu-list li.collapse ul{}
|
|
#menu-list li span {
|
|
font-size:14px;padding: 0px 12px; color:#FFF;
|
|
|
|
|
|
}
|
|
|
|
.collapse, .explode{
|
|
display: block;
|
|
width:100%; color:#0c83bc; line-height: 42px; text-align:left;}
|
|
#main-div a:visited, #menu-list a:link, #menu-list a:hover {
|
|
color: #666
|
|
text-decoration: none;
|
|
}
|
|
#menu-list a:active {
|
|
color: #fff;
|
|
}
|
|
.collapse , .explode {
|
|
text-indent:40px;
|
|
|
|
}
|
|
.ico_1{ background:#ddd url(images/menu_1.png) 9px 0 no-repeat ; }
|
|
.ico_2{ background:#ddd url(images/menu_2.png) 9px 0 no-repeat ; }
|
|
.ico_3{ background:#ddd url(images/menu_3.png) 9px 0 no-repeat ; }
|
|
.ico_4{ background:#ddd url(images/menu_4.png) 9px 0 no-repeat ; }
|
|
.ico_5{ background:#ddd url(images/menu_5.png) 9px 0 no-repeat ; }
|
|
.ico_6{ background:#ddd url(images/menu_6.png) 9px 0 no-repeat ; }
|
|
.ico_7{ background:#ddd url(images/menu_7.png) 9px 0 no-repeat ; }
|
|
.ico_8{ background:#ddd url(images/menu_8.png) 9px 0 no-repeat ; }
|
|
.ico_9{ background:#ddd url(images/menu_9.png) 9px 0 no-repeat ; }
|
|
.ico_10{ background:#ddd url(images/menu_10.png) 9px 0 no-repeat ; }
|
|
.ico_11{ background:#ddd url(images/menu_11.png) 9px 0 no-repeat ; }
|
|
.ico_12{ background:#ddd url(images/menu_12.png) 9px 0 no-repeat ; }
|
|
.ico_13{ background:#ddd url(images/menu_13.png) 9px 0 no-repeat ; }
|
|
.ico_14{ background:#ddd url(images/menu_14.png) 9px 0 no-repeat ; }
|
|
.ico_15{ background:#ddd url(images/menu_15.png) 9px 0 no-repeat ; }
|
|
.ico_16{ background:#ddd url(images/menu_16.png) 9px 0 no-repeat ; }
|
|
|
|
|
|
.ico2_1{ background:#C6C6C6 url(images/menu1_1.png) 9px 0px no-repeat ; }
|
|
.ico2_2{ background:#C6C6C6 url(images/menu1_2.png) 9px 0px no-repeat ; }
|
|
.ico2_3{ background:#C6C6C6 url(images/menu1_3.png) 9px 0px no-repeat ; }
|
|
.ico2_4{ background:#C6C6C6 url(images/menu1_4.png) 9px 0px no-repeat ; }
|
|
.ico2_5{ background:#C6C6C6 url(images/menu1_5.png) 9px 0px no-repeat ; }
|
|
.ico2_6{ background:#C6C6C6 url(images/menu1_6.png) 9px 0px no-repeat ; }
|
|
.ico2_7{ background:#C6C6C6 url(images/menu1_7.png) 9px 0px no-repeat ; }
|
|
.ico2_8{ background:#C6C6C6 url(images/menu1_8.png) 9px 0px no-repeat ; }
|
|
.ico2_9{ background:#C6C6C6 url(images/menu1_9.png) 9px 0px no-repeat ; }
|
|
.ico2_10{ background:#C6C6C6 url(images/menu1_10.png) 9px 0px no-repeat ; }
|
|
.ico2_11{ background:#C6C6C6 url(images/menu1_11.png) 9px 0px no-repeat ; }
|
|
.ico2_12{ background:#C6C6C6 url(images/menu1_12.png) 9px 0px no-repeat ; }
|
|
.ico2_13{ background:#C6C6C6 url(images/menu1_13.png) 9px 0px no-repeat ; }
|
|
.ico2_14{ background:#C6C6C6 url(images/menu1_14.png) 9px 0px no-repeat ; }
|
|
.ico2_15{ background:#C6C6C6 url(images/menu1_15.png) 9px 0px no-repeat ; }
|
|
.ico2_16{ background:#C6C6C6 url(images/menu1_16.png) 9px 0px no-repeat ; }
|
|
|
|
|
|
#menu-list li.collapse {
|
|
|
|
|
|
}
|
|
|
|
.menu-item {font-size: 12px;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
display: block;
|
|
font-weight: normal; background:#ECECEC;
|
|
}
|
|
.menu-item a{font-size: 12px;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
display: block; color:#000;}
|
|
.menu-item a:hover,.menu-item a.on{background-color:#797979; text-decoration:none; color:#fff;}
|
|
#help-title {
|
|
font-size: 14px;
|
|
color: #000080;
|
|
margin: 5px 0;
|
|
padding: 0px;
|
|
}
|
|
#help-content {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
.tips {
|
|
color: #CC0000;
|
|
}
|
|
.link {
|
|
color: #000099;
|
|
}
|
|
</style>
|
|
{/literal}
|
|
</head>
|
|
<body>
|
|
<div id="main-div">
|
|
<div id="menu-list">
|
|
<ul id="menu-ul">
|
|
{foreach from=$menus item=menu key=k name=foo}
|
|
{if $menu.action}
|
|
<li class="collapse ico_{$smarty.foreach.foo.iteration}" key_data1="lis ico_{$smarty.foreach.foo.iteration}" key_data2="lis ico2_{$smarty.foreach.foo.iteration}"><a href="{$menu.action}" target="main-frame">{$menu.label}</a></li>
|
|
{else}
|
|
<li class="collapse lis ico_{$smarty.foreach.foo.iteration}" key="{$k}" name="menu" key_data1="lis ico_{$smarty.foreach.foo.iteration}" key_data2="lis ico2_{$smarty.foreach.foo.iteration}">
|
|
{$menu.label}
|
|
{if $menu.children}
|
|
<ul style="display:none;">
|
|
{foreach from=$menu.children item=child}
|
|
<li class="menu-item"><a href="{$child.action}" target="main-frame">{$child.label}</a></li>
|
|
{/foreach}
|
|
</ul>
|
|
{/if}
|
|
</li>
|
|
{/if}
|
|
{/foreach}
|
|
</ul>
|
|
</div>
|
|
<div id="help-div" style="display:none">
|
|
<h1 id="help-title"></h1>
|
|
<div id="help-content"></div>
|
|
</div>
|
|
</div>
|
|
{insert_scripts files="../js/jquery-1.9.1.min.js,../js/jquery.json.js"}
|
|
{insert_scripts files="../js/global.js,../js/utils.js,transport_jquery.js"}
|
|
<script language="JavaScript">
|
|
<!--
|
|
var collapse_all = "{$lang.collapse_all}";
|
|
var expand_all = "{$lang.expand_all}";
|
|
var collapse = true;
|
|
{literal}
|
|
|
|
var getClass=function(name){
|
|
var ele=document.getElementById("menu-ul").getElementsByTagName("li"),arr=[];
|
|
var reg=new RegExp("(^|\\s)"+name+"(\\s|$)");
|
|
for(var i=0;i<ele.length;i++){
|
|
if(reg.test(ele[i].className)){
|
|
arr.push(ele[i]);
|
|
}
|
|
}
|
|
return arr;
|
|
|
|
}
|
|
|
|
function toggleCollapse()
|
|
{
|
|
var items = document.getElementsByTagName('LI');
|
|
var span=document.getElementById('menu-ul').getElementsByTagName("span");
|
|
for (i = 0; i < items.length; i++)
|
|
{
|
|
if (collapse)
|
|
{
|
|
if (items[i].className == "explode")
|
|
{
|
|
toggleCollapseExpand(items[i], "collapse");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if ( items[i].className == "collapse")
|
|
{
|
|
toggleCollapseExpand(items[i], "explode");
|
|
ToggleHanlder.Reset();
|
|
}
|
|
}
|
|
}
|
|
|
|
collapse = !collapse;
|
|
var toggleImg = document.getElementById('toggleImg');
|
|
if(toggleImg)
|
|
{
|
|
toggleImg.src = collapse ? 'images/menu_minus.gif' : 'images/menu_plus.gif';
|
|
toggleImg.alt = collapse ? collapse_all : expand_all;
|
|
}
|
|
}
|
|
|
|
|
|
function toggleCollapseExpand(obj, status)
|
|
{
|
|
var lis=getClass("lis");
|
|
var explode=getClass("explode");
|
|
var ie=/ie 7/i.test(navigator.userAgent),dis=null;
|
|
var ul=document.getElementById("menu-ul").getElementsByTagName("ul");
|
|
|
|
|
|
if (obj.tagName.toLowerCase() == 'li' && obj.className != 'menu-item')
|
|
{
|
|
for (i = 0; i < obj.childNodes.length; i++)
|
|
{
|
|
if (obj.childNodes[i].tagName == "UL")
|
|
{
|
|
if (status == null)
|
|
{
|
|
if(ie){
|
|
dis=obj.childNodes[1].style.display;
|
|
}else{
|
|
dis=obj.childNodes[1].style.display;
|
|
}
|
|
if (dis!= "none")
|
|
{
|
|
|
|
for(var j=0;j<ul.length;j++){
|
|
ul[j].style["display"]="none";
|
|
|
|
}
|
|
|
|
if(ie){
|
|
obj.childNodes[1].style.display = "none";
|
|
}else{
|
|
obj.childNodes[1].style.display = "none";
|
|
}
|
|
|
|
|
|
ToggleHanlder.RecordState(obj.getAttribute("key"), "collapse");
|
|
var s = obj.getAttribute("key_data1");
|
|
|
|
obj.className = "collapse "+s;
|
|
}
|
|
else
|
|
{
|
|
|
|
for(var j=0;j<ul.length;j++){
|
|
ul[j].style["display"]="none";
|
|
}
|
|
|
|
if(ie){
|
|
obj.childNodes[1].style.display = "block";
|
|
}else{
|
|
obj.childNodes[1].style.display = "block";
|
|
}
|
|
for(var i=0;i<lis.length;i++){
|
|
var tmp=lis[i].getAttribute("key_data1");
|
|
lis[i].className="collapse "+tmp;
|
|
}
|
|
ToggleHanlder.RecordState(obj.getAttribute("key"), "explode");
|
|
var s = obj.getAttribute("key_data2");
|
|
|
|
obj.className = "explode "+s;
|
|
}
|
|
break;
|
|
}
|
|
else
|
|
{
|
|
if( status == "collapse")
|
|
{
|
|
ToggleHanlder.RecordState(obj.getAttribute("key"), "collapse");
|
|
var s = obj.getAttribute("key_data1");
|
|
|
|
obj.className = "collapse "+s;
|
|
}
|
|
else
|
|
{
|
|
ToggleHanlder.RecordState(obj.getAttribute("key"), "explode");
|
|
var s = obj.getAttribute("key_data2");
|
|
|
|
obj.className = "explode "+s;
|
|
}
|
|
if(ie){
|
|
obj.childNodes[1].style.display = (status == "explode") ? "block" : "none";
|
|
}else{
|
|
obj.childNodes[1].style.display = (status == "explode") ? "block" : "none";
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
document.getElementById('menu-list').onclick = function(e)
|
|
{
|
|
var obj = Utils.srcElement(e);
|
|
toggleCollapseExpand(obj);
|
|
var target = e.target;
|
|
if(target.nodeName == "A"){
|
|
var menu_a = document.getElementById('menu-list').getElementsByTagName("a");
|
|
var alength = menu_a.length;
|
|
for(var i = 0 ; i < alength; i ++){
|
|
removeClass(menu_a[i],"on");
|
|
}
|
|
addClass(target,"on");
|
|
}
|
|
}
|
|
//原生js addClass,hasClass,removeClass
|
|
function addClass(obj, cls) {
|
|
if (!this.hasClass(obj, cls)) obj.className += " " + cls;
|
|
}
|
|
function hasClass(obj, cls) {
|
|
return obj.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
|
|
}
|
|
function removeClass(obj, cls) {
|
|
if (hasClass(obj, cls)) {
|
|
var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
|
|
obj.className = obj.className.replace(reg, ' ');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* 创建XML对象
|
|
*/
|
|
function createDocument()
|
|
{
|
|
var xmlDoc;
|
|
|
|
// create a DOM object
|
|
if (window.ActiveXObject)
|
|
{
|
|
try
|
|
{
|
|
xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
|
|
}
|
|
catch (e)
|
|
{
|
|
try
|
|
{
|
|
xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
|
|
}
|
|
catch (e)
|
|
{
|
|
try
|
|
{
|
|
xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
|
|
}
|
|
catch (e)
|
|
{
|
|
try
|
|
{
|
|
xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
|
|
}
|
|
catch (e)
|
|
{
|
|
alert(e.message);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (document.implementation && document.implementation.createDocument)
|
|
{
|
|
xmlDoc = document.implementation.createDocument("","doc",null);
|
|
}
|
|
else
|
|
{
|
|
alert("Create XML object is failed.");
|
|
}
|
|
}
|
|
xmlDoc.async = false;
|
|
|
|
return xmlDoc;
|
|
}
|
|
|
|
//菜单展合状态处理器
|
|
var ToggleHanlder = new Object();
|
|
|
|
Object.extend(ToggleHanlder ,{
|
|
SourceObject : new Object(),
|
|
CookieName : 'Toggle_State',
|
|
RecordState : function(name,state)
|
|
{
|
|
if(state == "collapse")
|
|
{
|
|
this.SourceObject[name] = state;
|
|
}
|
|
else
|
|
{
|
|
if(this.SourceObject[name])
|
|
{
|
|
delete(this.SourceObject[name]);
|
|
}
|
|
}
|
|
var date = new Date();
|
|
date.setTime(date.getTime() + 99999999);
|
|
document.setCookie(this.CookieName, $.toJSON(this.SourceObject), date.toGMTString());
|
|
},
|
|
|
|
Reset :function()
|
|
{
|
|
var date = new Date();
|
|
date.setTime(date.getTime() + 99999999);
|
|
document.setCookie(this.CookieName, "{}" , date.toGMTString());
|
|
},
|
|
|
|
Load : function()
|
|
{
|
|
if (document.getCookie(this.CookieName) != null)
|
|
{
|
|
//this.SourceObject = t_eval();
|
|
var items = document.getElementsByTagName('LI');
|
|
for (var i = 0; i < items.length; i++)
|
|
{
|
|
if ( items[0].getAttribute("name") == "menu" && items[0].getAttribute("id") != '20_yun')
|
|
{
|
|
for (var k in this.SourceObject)
|
|
{
|
|
if ( typeof(items[i]) == "object")
|
|
{
|
|
if (items[i].getAttribute('key') == k)
|
|
{
|
|
toggleCollapseExpand(items[i], this.SourceObject[k]);
|
|
collapse = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var toggleImg = document.getElementById('toggleImg');
|
|
if(toggleImg)
|
|
{
|
|
toggleImg.src = collapse ? 'images/menu_minus.gif' : 'images/menu_plus.gif';
|
|
toggleImg.alt = collapse ? collapse_all : expand_all;
|
|
}
|
|
}
|
|
});
|
|
{/literal}
|
|
ToggleHanlder.CookieName += "_{$admin_id}";
|
|
//初始化菜单状态
|
|
ToggleHanlder.Load();
|
|
//Ajax.call('cloud.php?is_ajax=1&act=menu_api','', start_menu_api, 'GET', 'JSON');
|
|
function start_menu_api(result)
|
|
{
|
|
if(result.content==0)
|
|
{
|
|
}
|
|
else
|
|
{
|
|
document.getElementById("menu-ul").innerHTML = document.getElementById("menu-ul").innerHTML + result.content;
|
|
var arr=[{key_data1:"lis ico_15",key_data2:"lis ico2_15"},{key_data1:"lis ico_16",key_data2:"lis ico2_16"}]
|
|
var explode=getClass("explode");
|
|
for(var i=0;i<explode.length;i++){
|
|
explode[i].childNodes[1].style["display"]="none";
|
|
var o=arr[i],obj=explode[i];
|
|
for(var index in o){
|
|
obj.setAttribute(index,o[index]);
|
|
}
|
|
explode[i].className="collapse "+explode[i].getAttribute("key_data1");
|
|
}
|
|
|
|
}
|
|
}
|
|
//-->
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html> |