<!--<?php
include_once PrintEot('left');
if ($adminitem == 'level'){
if (empty($action)){
print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li class="current"><a href="$admin_file?adminjob=level&adminitem=level">用戶組權限</a></li>
		<li><a href="$admin_file?adminjob=level&adminitem=batch">導入導出</a></li>
		<li><a href="$admin_file?adminjob=level&adminitem=help">詳細幫助</a></li>
	</ul>
</div>
<div class="admin_info mb10">
	<h3 class="h1"><b>提示信息</b></h3>
    <div class="legend">
        <a onClick="javascript:scroller('level_1', 800);" class="b cp">會員組</a>:級別按照會員發的帖子數自動進行級別判斷並更新。<br />
<a onClick="javascript:scroller('level_2', 800);" class="b cp">系統組</a>:屬于站點管理層，系統組成員由站點管理員設定，管理員可以在 <a href="$admin_file?adminjob=usermanage&adminitem=edit">用戶管理</a> 內編輯用戶組成員。<br />
<a onClick="javascript:scroller('level_3', 800);" class="b cp">特殊組</a>:可以設置管理權限的組別，區別于系統組，特殊組可以進行出售<br />
<a onClick="javascript:scroller('level_4', 800);" class="b cp">默認組</a>:默認組別不可刪除，當其他組別未設置權限時，則使用該默認權限<br />
注:批量添加的用戶組權限設置為默認，需要單獨進行權限編輯。
    </div>
</div>
<form action="$basename&" method="post">
<input type="hidden" name="action" value="menedit" />
<a name="level_1" id="level_1"></a>
<h2 class="h1"><span class="mr20"><b>會員組編輯</b></span><span class="linka"><a href="javascript:void(0)" class="mr10" title="收起" onclick="showGroup('memBody',0)">[收起]</a><a href="javascript:void(0)" title="展開" onclick="showGroup('memBody',1)">[展開]</a></span></h2>
<div class="admin_table mb10">
	<table cellpadding="0" cellspacing="0" width="100%" style="table-layout:fixed;">
   		<tr class="tr2 vt">
        	<td style="width:60px;">&nbsp;</td>
            <td width="180">頭餃</td>
            <td width="200">等級圖片號</td>
            <td width="105">升級點數需求</td>
            <td>操作</td>
        </tr>
		<tbody id="memBody">
<!--
EOT;
foreach ($gdb['member'] as $member) {
$key = $member[gid];
$j_url = EncodeUrl("$basename&action=delgroup&delid=$key");
print <<<EOT
-->
        <tr class="tr1">
        	<td class="td2">組ID$member[gid]</td>
            <td class="td2"><input type="text" class="input input_wa" name="memtitle[$key]" value="$member[grouptitle]" onchange="pwJsCheck(this,true)" /></td>
            <td class="td2">
            	<input type="hidden" class="input input_wd mr10" name="mempic[$key]" value="$member[groupimg]" onchange="getImg(this)" />
            	<img id="img_member_{$member[gid]}" src="$imgpath/$stylepath/level/$member[groupimg].gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
             </td>
            <td class="td2"><input type="text" class="input input_wc" name="mempost[$key]" value="$member[grouppost]" onchange="pwJsCheck(this,true)" /></td>
            <td class="td2">
            	<a href="javascript:;" class="mr20" onclick="location.href='$basename&action=editgroup&gid=$key';return false;">[編輯]</a>
            	<a href="javascript:;" onclick="return checkgroupset('$j_url')">[刪除]</a>
            </td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
		</tbody>
        <tbody id="memTable">
            <tr><td colspan="5"><!--a name="add1"></a--></td></tr>
            <tr id="addmem" class="tr1 td_bgA" style="display:none">
            	<td class="td2"><a href="javascript:;" onclick="addRecord('addmem','memTable')"><i class="expand expand_c" style="margin:4px 2px 0 0;"></i>添加</a></td>
                <td class="td2"><input type="text" class="input input_wa" name="memtitle[add][]" /></td>
				<td class="td2">
                	<input type="hidden" class="input input_wd mr10" name="mempic[add][]" value="" onchange="getImg(this)" />
                	<img id="img_member_{$member[gid]}" src="$imgpath/$stylepath/level/0.gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
                </td>
                <td class="td2"><input name="mempost[add][]" type="text" class="input input_wc" /></td>
				<td class="td2"><span class="mr20" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                <a href="javascript:;" class="mr20" onclick="delRecord('addmem','memTable',this)">[刪除]</a></td>
            </tr>
            <tr class="tr1 td_bgA">
            	<td class="td2"><a href="javascript:;" onclick="addRecord('addmem','memTable')"><i class="expand expand_c" style="margin:4px 2px 0 0;"></i>添加</a></td>
                <td class="td2"><input type="text" class="input input_wa" name="memtitle[add][]" /></td>
				<td class="td2">
                	<input type="hidden" class="input input_wd mr10" name="mempic[add][]" value="" onchange="getImg(this)" />
                	<img id="img_member_new" src="$imgpath/$stylepath/level/0.gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
                </td>
                <td class="td2"><input name="mempost[add][]" type="text" class="input input_wc" /></td>
				<td class="td2"><span class="mr20" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                <a href="javascript:;" onclick="delRecord('addmem','memTable',this)">[刪除]</a></td>
            </tr>
        </tbody>
    </table>
</div>
<div class="mb10 tac"><span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span></div></form>
<form action="$basename&" method="post">
<input type="hidden" name="action" value="sysedit" />
<a name="level_2" id="level_2"></a>
<h2 class="h1"><span class="mr20"><b>系統組編輯</b></span><span class="linka"><a href="javascript:void(0)" class="mr10" title="收起" onclick="showGroup('sysBody',0)">[收起]</a><a href="javascript:void(0)" title="展開" onclick="showGroup('sysBody',1)">[展開]</a></span></h2>
<div class="admin_table mb10">
	<table cellpadding="0" cellspacing="0" width="100%" style="table-layout:fixed;">
   		<tr class="tr2 vt">
        	<td style="width:60px;">&nbsp;</td>
            <td width="180">頭餃</td>
            <td width="200">等級圖片號</td>
            <td width="105">&nbsp;</td>
            <td>操作</td>
        </tr>
		<tbody id="sysBody">
<!--
EOT;
foreach($gdb['system'] as $sys){
$key = $sys[gid];
$j_url = EncodeUrl("$basename&action=delgroup&delid=$key");
print <<<EOT
-->
        <tr class="tr1">
            <td class="td2">組ID$sys[gid]</td>
            <td class="td2">
                <input type="text" class="input input_wa" name="systitle[$key]" value="$sys[grouptitle]" onchange="pwJsCheck(this,true)" />
            </td>
            <td class="td2">
                <input type="hidden" class="input input_wd mr10" name="syspic[$key]" value="$sys[groupimg]" onchange="getImg(this)" />
                <img id="img_system_{$sys[gid]}" src="$imgpath/$stylepath/level/$sys[groupimg].gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
            </td>
            <td class="td2">&nbsp;</td>
            <td class="td2">
            	<a href="javascript:;" class="mr20" onclick="location.href='$basename&action=editgroup&gid=$key';return false;">[編輯]</a>

<!--
EOT;
if ($key > 7) {print <<<EOT
-->
				<a href="javascript:;" onclick="return checkgroupset('$j_url')">[刪除]</a>
<!--
EOT;
}print <<<EOT
-->
            </td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
		</tbody>
        <tbody id="sysTable">
            <tr><td colspan="5"><!--a name="add2"></a--></td></tr>
            <tr id="addsys" class="tr1 td_bgA" style="display:none">
            	<td class="td2"><a href="javascript:;" onclick="addRecord('addsys','sysTable')"><i class="expand expand_c" style="margin:4px 2px 0 0;"></i>添加</a></td>
                <td class="td2"><input type="text" class="input input_wa" name="systitle[add][]" value="" /></td>
                <td class="td2">
                    <input type="hidden" class="input input_wd mr10" name="syspic[add][]" value="" onchange="getImg(this)" />
                    <img id="img_system_$sys[gid]" src="$imgpath/$stylepath/level/21.gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
                </td>
                <td class="td2">&nbsp;</td>
                <td class="td2">
                	<span class="mr20" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                    <a href="javascript:;" onclick="delRecord('addsys','sysTable',this)">[刪除]</a>
                </td>
            </tr>
            <tr id="addsys" class="tr1 td_bgA">
            	<td class="td2"><a href="javascript:;" onclick="addRecord('addsys','sysTable')"><i class="expand expand_c" style="margin:4px 2px 0 0;"></i>添加</a></td>
                <td class="td2"><input type="text" class="input input_wa" name="systitle[add][]" value="" /></td>
                <td class="td2">
                    <input type="hidden" class="input input_wd mr10" name="syspic[add][]" value="" onchange="getImg(this)" />
                    <img id="img_system_new" src="$imgpath/$stylepath/level/21.gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
                </td>
                <td class="td2">&nbsp;</td>
                <td class="td2">
                	<span class="mr20" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                    <a href="javascript:;" onclick="delRecord('addsys','sysTable',this)">[刪除]</a>
                </td>
            </tr>
        </tbody>
    </table>
</div>
<div class="mb10 tac"><span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span></div>
</form>
<form action="$basename&" method="post">
<input type="hidden" name="action" value="vipedit" />
<a name="level_3" id="level_3"></a>
<h2 class="h1"><span class="mr20"><b>特殊組編輯</b></span><span class="linka"><a href="javascript:void(0)" class="mr10" title="收起" onclick="showGroup('speBody',0)">[收起]</a><a href="javascript:void(0)" title="展開" onclick="showGroup('speBody',1)">[展開]</a></span></h2>
<div class="admin_table mb10">
	<table cellpadding="0" cellspacing="0" width="100%" style="table-layout:fixed;">
   		<tr class="tr2 vt">
        	<td style="width:60px;">&nbsp;</td>
            <td width="180">頭餃</td>
            <td width="200">等級圖片號</td>
            <td width="105">&nbsp;</td>
            <td>操作</td>
        </tr>
		<tbody id="speBody">
<!--
EOT;
foreach ($gdb['special'] as $vip) {
$key = $vip[gid];
$j_url = EncodeUrl("$basename&action=delgroup&delid=$key");
print <<<EOT
-->
        <tr class="tr1">
            <td class="td2">組ID$vip[gid]</td>
            <td class="td2">
                <input type="text" class="input input_wa" name="viptitle[$key]" value="$vip[grouptitle]" onchange="pwJsCheck(this,true)" />
            </td>
            <td class="td2">
                <input type="hidden" class="input input_wd mr10" name="vippic[$key]" value="$vip[groupimg]" onchange="getImg(this)" />
                <img id="img_special_{$vip[gid]}" src="$imgpath/$stylepath/level/$vip[groupimg].gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
            </td>
            <td class="td2">&nbsp;</td>
            <td class="td2">
            	<a href="javascript:;" class="mr20" onclick="location.href='$basename&action=editgroup&gid=$key';return false;">[編輯]</a>
                <a href="javascript:;" onclick="return checkgroupset('$j_url')">[刪除]</a>
            </td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
		</tbody>
        <tbody id="splTable">
            <tr><td colspan="5"><!--a name="add3"></a--></td></tr>
            <tr id="addspl" class="tr1 td_bgA" style="display:none">
                <td class="td2"><a href="javascript:;" onclick="addRecord('addspl','splTable')"><i class="expand expand_c" style="margin:4px 2px 0 0;"></i>添加</a></td>
                <td class="td2"><input type="text" class="input input_wa" name="viptitle[add][]" value="" /></td>
                <td class="td2">
                    <input type="hidden" class="input input_wd mr10" name="vippic[add][]" value="" onchange="getImg(this)" />
                    <img id="img_special_{$vip[gid]}" src="$imgpath/$stylepath/level/16.gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
                </td>
                <td class="td2">&nbsp;</td>
                <td class="td2">
                    <span class="mr20" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                    <a href="javascript:;" onclick="delRecord('addspl','splTable',this)">[刪除]</a>
                </td>
            </tr>
            <tr class="tr1 td_bgA">
                <td class="td2"><a href="javascript:;" onclick="addRecord('addspl','splTable')"><i class="expand expand_c" style="margin:4px 2px 0 0;"></i>添加</a></td>
                <td class="td2"><input type="text" class="input input_wa" name="viptitle[add][]" value="" /></td>
                <td class="td2">
                    <input type="hidden" class="input input_wd mr10" name="vippic[add][]" value="" onchange="getImg(this)" />
                    <img id="img_special_new" src="$imgpath/$stylepath/level/16.gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
                </td>
                <td class="td2">&nbsp;</td>
                <td class="td2">
                    <span class="mr20" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                    <a href="javascript:;" onclick="delRecord('addspl','splTable',this)">[刪除]</a>
                </td>
            </tr>
        </tbody>
	</table>
</div>
<div class="mb10 tac"><span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span></div>
</form>
<form action="$basename&" method="post">
<input type="hidden" name="action" value="defedit" />
<a name="level_4" id="level_4"></a>
<h2 class="h1">默認用戶組</h2>
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0" style="table-layout:fixed">
		<tr class="tr2 vt">
        	<td style="width:60px;">&nbsp;</td>
            <td width="180">頭餃</td>
            <td width="200">等級圖片號</td>
            <td width="105">&nbsp;</td>
            <td>操作</td>
        </tr>
<!--
EOT;
foreach ($gdb['default'] as $default) {
$key = $default[gid];
print <<<EOT
-->
        <tr class="tr1">
            <td class="td2">組ID$default[gid]</td>
            <td class="td2"><input type="text" class="input input_wa" name='deftitle[$key]' value='$default[grouptitle]' onchange="pwJsCheck(this,true)"></td>
            <td class="td2">
                <input type="hidden" class="input input_wd mr10" name='defpic[$key]' value='$default[groupimg]' onchange="getImg(this)" />
                <img id="img_default_{$default[gid]}" src="$imgpath/$stylepath/level/$default[groupimg].gif" title="選擇等級圖片" onclick="showImg(this)" style="cursor:pointer" align="absmiddle" />
            </td>
            <td class="td2">&nbsp;</td>
            <td class="td2"><a href="javascript:;" class="mr20" onclick="location.href='$basename&action=editgroup&gid=$key';return false;">[編輯]</a></td>
        </tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<div class="mb10 tac"><span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span></div>
</form>
<script type="text/javascript">
function intval(v) {
    v = parseInt(v);
    return isNaN(v) ? 0 : v;
}
// 獲取元素信息
function getPos(e) {
    var l = 0;
    var t = 0;
    var w = intval(e.style.width);
    var h = intval(e.style.height);
    var wb = e.offsetWidth;
    var hb = e.offsetHeight;
    while (e.offsetParent) {
        l += e.offsetLeft + (e.currentStyle ? intval(e.currentStyle.borderLeftWidth) : 0);
        t += e.offsetTop + (e.currentStyle ? intval(e.currentStyle.borderTopWidth) : 0);
        e = e.offsetParent;
    }
    l += e.offsetLeft + (e.currentStyle ? intval(e.currentStyle.borderLeftWidth) : 0);
    t += e.offsetTop + (e.currentStyle ? intval(e.currentStyle.borderTopWidth) : 0);
    return {
        x: l,
        y: t,
        w: w,
        h: h,
        wb: wb,
        hb: hb
    };
}
// 獲取滾動條信息
function getScroll() {
    var t, l, w, h;
    if (document.documentElement && document.documentElement.scrollTop) {
        t = document.documentElement.scrollTop;
        l = document.documentElement.scrollLeft;
        w = document.documentElement.scrollWidth;
        h = document.documentElement.scrollHeight;
    } else if (document.body) {
        t = document.body.scrollTop;
        l = document.body.scrollLeft;
        w = document.body.scrollWidth;
        h = document.body.scrollHeight;
    }
    return {
        t: t,
        l: l,
        w: w,
        h: h
    };
}
// 錨點(Anchor)間平滑跳轉
function scroller(el, duration) {
    if (typeof el != 'object') {
        el = document.getElementById(el);
    }
    if (!el) return;
    var z = this;
    z.el = el;
    z.p = getPos(el);
    z.s = getScroll();
    z.clear = function() {
        window.clearInterval(z.timer);
        z.timer = null
    };
    z.t = (new Date).getTime();
    z.step = function() {
        var t = (new Date).getTime();
        var p = (t - z.t) / duration;
        if (t >= duration + z.t) {
            z.clear();
            window.setTimeout(function() {
                z.scroll(z.p.y, z.p.x)
            },
            13);
        } else {
            st = (( - Math.cos(p * Math.PI) / 2) + 0.5) * (z.p.y - z.s.t) + z.s.t;
            sl = (( - Math.cos(p * Math.PI) / 2) + 0.5) * (z.p.x - z.s.l) + z.s.l;
            z.scroll(st, sl);
        }
    };
    z.scroll = function(t, l) {
        window.scrollTo(l, t)
    };
    z.timer = window.setInterval(function() {
        z.step();
    },
    13);
}
</script>
<div id="imgTab" class="menu_level" style="display:none;">
<h2 onmousedown="read.move(event)" style="cursor:move;" class="h1"><a href="javascript:;" class="del_img fr" onclick="closep()">關閉</a>等級圖片選擇</h2>
<ul class="leve">
<!--
EOT;
foreach ($levelImg as $key=>$value) {print <<<EOT
-->
<li><span>編號:$key</span><img src="$imgpath/$stylepath/level/$value" align="absmiddle" title="點擊選擇" onclick="selImg('$key')" /></li>
<!--
EOT;
}print <<<EOT
-->
</ul>
</div>
<script type="text/javascript">
var curObj;
function showImg(_this) {
	curObj = _this;
	read.open('imgTab',_this.id,2);
}
function selImg(l) {
	var o=curObj.parentNode;
	for (var i=0;i<o.childNodes.length;i++) {
		if (o.childNodes[i].nodeName.toLowerCase() == 'img') {
			o.childNodes[i].src = "$imgpath/$stylepath/level/"+l+".gif";
		} else if (o.childNodes[i].nodeName.toLowerCase() == 'input') {
			o.childNodes[i].value = l;
		}
	}
	pwJsCheck(curObj,true);
	closep();
}
function getImg(_this) {
	var o=_this.parentNode;
	for (var i=0;i<o.childNodes.length;i++) {
		if (o.childNodes[i].nodeName.toLowerCase() == 'img') {
			o.childNodes[i].src = "$imgpath/$stylepath/level/"+_this.value+".gif";
			pwJsCheck(_this,true);
			break;
		}
	}
}
function addRecord(s,t) {
	var l = getObj(t).lastChild;
	var n = getObj(s).cloneNode(true);
	n.style.display = '';
	n.id = '';
	getObj(t).insertBefore(n,l);
}
function delRecord(s,t,o) {
	getObj(t).removeChild(o.parentNode.parentNode);
	if (getObj(t).getElementsByTagName('TR').length<=2)addRecord(s,t);
}
function editGroup(_this,t) {
	var url = "&gtype="+t;
	var v = _this.parentNode.parentNode.getElementsByTagName('INPUT');

	for (var i=0;i<v.length;i++) {
		if (i == 0) {
			url += "&newtitle="+v[0].value;
		} else if (i == 1) {
			url += "&newpic="+v[1].value;
		} else if (i == 2) {
			url += "&newpost="+v[2].value;
		}
	}
	window.location = '$basename&action=addgroup'+url;
}
function showGroup(id,s) {
	if (s == 1) {
		getObj(id).style.display = '';
	} else {
		getObj(id).style.display = 'none';
	}
}
</script>
<!--
EOT;
} elseif ($action == 'editgroup') {print <<<EOT
-->
<!--div class="nav3">
    <ul class="cc">
        <li><a href="$basename">用戶組設置</a></li>
		<li class="current"><a href="$basename&action=editgroup&gid=$gid">$gp_grouptitle</a></li>
	</ul>
</div-->
<div class="nav3 mb10 cc">
	<ul class="fl mr10" id="tab3_editgroup">
		<li id="basic" onclick="showtab('tab3_editgroup','basic')"><a href="javascript:;">基本權限</a></li>
		<li id="read" onclick="showtab('tab3_editgroup','read')"><a href="javascript:;">帖子權限</a></li>
		<li id="att" onclick="showtab('tab3_editgroup','att')"><a href="javascript:;">附件權限</a></li>
		<li id="group" onclick="showtab('tab3_editgroup','group')"><a href="javascript:;">群組權限</a></li>
		<li id="message" onclick="showtab('tab3_editgroup','message')"><a href="javascript:;">消息權限</a></li>
<!--
EOT;
if($gp_gptype == 'special'){print <<<EOT
-->
		<li id="special" onclick="showtab('tab3_editgroup','special')"><a href="javascript:;">用戶組購買</a></li>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
foreach($levelHook->getOtherLevelTitles() as $key=>$value){print <<<EOT
-->
		<li id="$key" onclick="showtab('tab3_editgroup','$key')"><a href="javascript:;">$value</a></li>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if($gp_gptype == 'system' || $gp_gptype == 'special'){print <<<EOT
-->
		<li id="system" onclick="showtab('tab3_editgroup','system')"><a href="javascript:;">管理權限</a></li>
<!--
EOT;
}print <<<EOT
-->
	</ul>
    <a href="$basename" class="fl mt5 ">返回上一級<span class="f9">▲</span></a>
</div>
<script type="text/javascript">
function level_jump(admin_file) {
	var URL = document.mod.selectfid.options[document.mod.selectfid.selectedIndex].value;
	location.href = admin_file + "?adminjob=level&action=editgroup&gid=" + URL;
}
function addcols(mode,ft){
	var s = getObj(mode).firstChild.cloneNode(true);
	getObj(ft).appendChild(s);
}
function removecols(obj){
	var o = obj.parentNode.parentNode;
	o.parentNode.removeChild(o);
}
function showGroup(id,s) {
	if (s == 1) {
		getObj(id).style.display = '';
	} else {
		getObj(id).style.display = 'none';
	}
}
</script>

<div id="addform">
<form action="$basename&" method="post" name="mod">
<h2 class="h1">用戶組設置</h2>
<div class="admin_table mb10">
    <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1"><td class="td1">用戶組頭餃</td>
    <td class="td2" width="160"><input name="grouptitle" type="text" class="input input_wa" value="$grouptitle" />
    </td>
    <td class="td2 tar"><a id="linkCtrlCrossConfig" href="javascript:;">橫向擴展</a></td>
    </tr></table>
</div>

<input type="hidden" name="action" value="editgroup" />
<input type="hidden" name="gid" value="$gid" />
<input type="hidden" name="step" value="2" />
<!--
EOT;
foreach ($lang['right'] as $key => $value) {
if ($key == 'special' && $gp_gptype <> 'special' || $key == 'system' && in_array($gp_gptype,array('member','default'))) {
	continue;
}
print <<<EOT
-->
<div id="c_$key" style="display:none">
<h2 class="h1">{$lang[right_title][$key]}</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
<!--
EOT;
foreach ($value as $k => $v) {
$tmpTitle = $k == 'specialtopics' ? "<a href=\"javascript:;\">$v[title]</a>" : "<a href=\"$basename&action=setright&rkey=$k&gid=$gid\">$v[title]</a>";
print <<<EOT
-->
	<tr class="tr1 vt">
		<td class="td1">$tmpTitle</td>
<!--
EOT;
if ($k == 'markset') {
print <<<EOT
-->
		<td class="td2" colspan="2">
<script>
function init(ids,cons){
	getObj(ids).onclick=function(o){onmousOver(o,ids,cons);}//點擊激發效果
}
function onmousOver(o,ids,cons){
	var o = o || window.event;
	var obj=o.target || o.srcElement;
	/* add by zph, checkbox click handler Aug 12,2010 */
	if(obj.tagName=='INPUT' && obj.type == 'checkbox'){
		if(typeof obj.parentNode == 'object') obj = obj.parentNode;
	}
	/* end zph*/
	if (obj.tagName=='LI'){
		if (obj.className=='current'||obj.id=='more')return;
		var o=getObj(ids).getElementsByTagName('li');
		for (var i=0;i<=o.length-1;i++){
			if (o[i].id != obj.id) {
				o[i].className='';
				getObj(cons+'_'+o[i].id).style.display='none';
			} else {
				o[i].className='current';
				getObj(cons+'_'+o[i].id).style.display='';
			}
		}
	}
}
</script>
<div class="cond cc">
    <ul class="cond_l" id='cond_l'>
<!--
EOT;
$i=0;
foreach ($v[html] as $keys=>$val) {
$i=$i+1;
$tmpstyle = $i == 1 ? 'class="current"' : '';
$markctype_Y = $_G['markset'][$keys]['markctype'] == $keys ? 'checked' : '';
print <<<EOT
-->
        <li id="l$keys" $tmpstyle><input type="checkbox" name="group[markset][$keys][markctype]" value="$keys" $markctype_Y/>$val</li>
<!--
EOT;
}print <<<EOT
-->
    </ul>
    <div class="cond_r">
<!--
EOT;
$i=0;
foreach (array_keys($v[html]) as $keys) {
$i=$i+1;
$tmpstyle = $i == 1 ? '' : 'style="display:none;"';
$markdt_Y = $markdt_N = '';
$_G['markset'][$keys]['markdt'] ? $markdt_Y = 'checked' : $markdt_N = 'checked';
print <<<EOT
-->
        <div class="cond_r_height" id="cond_r_l$keys" $tmpstyle>
            <div class="admin_table">
                <table cellpadding="0" cellspacing="0" width="100%" style="table-layout:auto;">
                	<tr class="vt tr3">
                		<td colspan="2" align="center" class="s2" id="cond_r_title">{$v['html'][$keys]}評分設置</td>
                	</tr>
                    <tr class="vt tr3">
                        <td width="100">每次評分限制</td>
                        <td><ul class="cc list_80 list_A">
                        <li>最小 <input value="{$_G[markset][$keys][marklimit][0]}" name="group[markset][$keys][marklimit][0]" type="text" class="input input_we" /></li><li>最大 <input value="{$_G[markset][$keys][marklimit][1]}" name="group[markset][$keys][marklimit][1]" type="text" class="input input_we" /></li></ul></td>
                    </tr>
                    <tr class="vt tr3">
                        <td>每日評分上限</td>
                        <td><input value="{$_G[markset][$keys][maxcredit]}" name="group[markset][$keys][maxcredit]" class="input input_wa" /></td>
                    </tr>
                    <tr class="vt tr3">
                        <td>扣除自身相應積分</td>
                        <td><ul class="cc list_80 list_A"><li><input type="radio" value="1" name="group[markset][$keys][markdt]" $markdt_Y />開啟</li><li><input type="radio" value="0" name="group[markset][$keys][markdt]" $markdt_N />關閉</li></ul></td>
                    </tr>
                </table>
            </div>
        </div>
<!--
EOT;
}print <<<EOT
-->
    </div>
<script>
init('cond_l','cond_r');
</script>
</div>
</td>
<!--
EOT;
}else{
eval("\$v[html] = \"".addcslashes($v['html'],'"')."\";");
print <<<EOT
-->
		<td class="td2">$v[html]</td>
        <td class="td2"><div class="help_a">$v[desc]</div></td>
<!--
EOT;
}print <<<EOT
-->
    	<td class="td2" style="width:40px;"><div class="none_pw"><input type="checkbox" name="othergroup[]" value="$k" onclick="pwJsCheck(this)" /></div></td>
	</tr>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if ($key == 'system' && $extentSystem) {
foreach ($extentSystem as $k => $v) {
print <<<EOT
-->
		<tr class="tr1 vt">
			<td class="td1"><a href="$basename&action=setright&rkey=$k&gid=$gid">$v[name]</a></td>
			<td class="td2">$v[html]</td>
       		<td class="td2"><div class="help_a">$v[descrip]</div></td>
       		<td class="td2" style="width:40px;"><div class="none_pw"><input type="checkbox" name="othergroup[]" value="$k" onclick="pwJsCheck(this)" /></div></td>
		</tr>
<!--
EOT;
}}print <<<EOT
-->
</table>
</div>
</div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
foreach($levelHook->getLevels() as $key=>$value){print <<<EOT
-->
<div id="c_$key" style="display:none">
	<h2 class="h1">{$value[title]}</h2>
	<div class="admin_table mb10">
		<table width="100%" cellspacing="0" cellpadding="0">
<!--
EOT;
foreach ($value['field'] as $k => $v) {
print <<<EOT
-->
			<tr class="tr1 vt">
				<td class="td1"><a href="$basename&action=setright&rkey=$k&gid=$gid">$v[name]</a></td>
				<td class="td2">$v[html]</td>
        		<td class="td2"><div class="help_a">$v[descrip]</div></td>
        		<td class="td2" style="width:40px;"><div class="none_pw"><input type="checkbox" name="othergroup[]" value="$k" onclick="pwJsCheck(this)" /></div></td>
			</tr>
<!--
EOT;
}print <<<EOT
-->
		</table>
	</div>
</div>
<!--
EOT;
}print <<<EOT
-->
<div class="admin_table mb10">
    <h2 id="headCtrlCrossConfig" class="h1 cp">橫向擴展</h2>
    <div class="admin_table mb10 none_pw">
        <table width="100%" cellspacing="0" cellpadding="0" style="table-layout:fixed">
            <tr class="tr1 vt">
                <td class="td1">用戶組權限橫向設置</td>
                <td class="td2"><select name="othergid[]" size="16" class="select_wa" multiple>$groupselect</select></td>
                <td class="td2"><div class="help_a">利用此功能可將一個或多個設置同時應用到其它用戶組中，使操作更加簡便<br />
    操作說明:<br />
    選中需要進行橫向操作的權限設置後面的復選框<br />
    在左邊的復選框中選擇需要進行橫向操作的用戶組<br />
    然後提交即可完成橫向操作<br />
    注:<br />
    選擇用戶組時可使用 ‘Ctrl’ 鍵進行多選，也可使用 ‘Shift’ 鍵或拖動鼠標連續選擇多個版塊<br />
    不使用此功能，請不要選中權限設置後面的復選框和左邊的復選框中版塊</div></td>
            </tr>
        </table>
    </div>
</div>
<div class="tac mb10"><span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span></div></form>
<script type="text/javascript">
function showtab(t,a){
	if (getObj(t)) {
		var hasCurrent = false;
		var obj = getObj(t).getElementsByTagName('li');
		for (var i=0;i<obj.length;i++) {
			try{
			if (obj[i].id==a) {
				getObj(obj[i].id).className = 'current';
				getObj('c_'+a).style.display = '';
				setCookie('thisPWTabs',a);
				hasCurrent = true;
			} else {
				getObj(obj[i].id).className = '';
				getObj('c_'+obj[i].id).style.display = 'none';
			}
			}catch(e){}
		}
		if (!hasCurrent) {
			getObj('basic').className = 'current';
			getObj('c_basic').style.display = '';
			setCookie('thisPWTabs','basic');
		}
	}
}
showtab('tab3_editgroup','$thisPWTabs');

function displayCrossConfigDiv() {
	var frm = document.getElementById('addform');
	frm.className = (frm.className=='addform') ? '' : 'addform';
}
getObj('linkCtrlCrossConfig').onclick = displayCrossConfigDiv;
getObj('headCtrlCrossConfig').onclick = displayCrossConfigDiv;
</script>
<!--
EOT;
} elseif ($action == 'setright') {print <<<EOT
-->
<div class="nav3 mb10 cc">
	<ul class="fl mr10">
		<li><a href="$basename&action=editgroup&gid=$gid&tab=basic">基本權限</a></li>
		<li><a href="$basename&action=editgroup&gid=$gid&tab=read">帖子權限</a></li>
		<li><a href="$basename&action=editgroup&gid=$gid&tab=att">附件權限</a></li>
		<li><a href="$basename&action=editgroup&gid=$gid&tab=group">群組權限</a></li>
		<li><a href="$basename&action=editgroup&gid=$gid&tab=message">消息權限</a></li>
<!--
EOT;
if($gp_gptype == 'special'){print <<<EOT
-->
		<li><a href="$basename&action=editgroup&gid=$gid&tab=special">用戶組購買</a></li>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
if($gp_gptype == 'system' || $gp_gptype == 'special'){print <<<EOT
-->
		<li><a href="$basename&action=editgroup&gid=$gid&tab=system">管理權限</a></li>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
foreach($levelHook->getOtherLevelTitles() as $key=>$value){print <<<EOT
-->
		<li><a href="$basename&action=editgroup&gid=$gid&tab={$key}">$value</a></li>
<!--
EOT;
}print <<<EOT
-->
		<li class="current"><a href="javascript:;">權限橫向設置</a></li>
	</ul>
    <a href="$basename" class="fl mt5 ">返回上一級<span class="f9">▲</span></a>
</div>
<script type="text/javascript">
function addcols(mode,ft){
	var s = getObj(mode).firstChild.cloneNode(true);
	getObj(ft).appendChild(s);
}
function removecols(obj){
	var o = obj.parentNode.parentNode;
	o.parentNode.removeChild(o);
}
</script>
<form action="$basename&action=$action" method="post" name="mod">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="rkey" value="$rkey" />
<h2 class="h1">用戶組權限設置</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr1 vt">
		<td class="td1">用戶組</td>
		<td class="td2">$setdb[title]</td>
	</tr>
<!--
EOT;
$lang_title = array('default' => '默認用戶組','member' => '會員組','system' => '系統組','special' => '特殊組');
foreach ($gdb as $key => $value) {print <<<EOT
-->
	<tr class="tr2 td_bgB">
		<td>
			$lang_title[$key]
		<td>
	</tr>
<!--
EOT;
foreach ($value as $k => $v) {
if (is_array($v[1])) {
print <<<EOT
-->
	<tr class="tr1 vt">
		<td class="td2">$v[0]</td>
		<td class="td2">
<!--
EOT;
foreach ($v[1] as $keys => $val) {
$markctype_Y = $markdt_Y = $markdt_N = '';
$marksetdb[$k][$keys]['markctype'] == $keys && $markctype_Y = 'checked';
$marksetdb[$k][$keys]['markdt'] ? $markdt_Y = 'checked' : $markdt_N = 'checked';
print <<<EOT
-->
		<input type="checkbox" name="group[$k][markset][$keys][markctype]" value="$keys" $markctype_Y/><b>$val</b> &nbsp;[需打勾方有效]<br />評分總額<font color=blue> 說明:</font>每天允許的最大評分點數:<input type="text" class="input" value="{$marksetdb[$k][$keys][maxcredit]}" name="group[$k][markset][$keys][maxcredit]" /><br />評分限制<font color=blue> 說明:</font>最小 <input type=text size="3" class="input" value="{$marksetdb[$k][$keys][marklimit][0]}" name="group[$k][markset][$keys][marklimit][0]" /> 最大 <input type=text size="3" class="input" value="{$marksetdb[$k][$keys][marklimit][1]}" name="group[$k][markset][$keys][marklimit][1]" />[不可為0]<br />評分扣除自身相應的積分:<input type="radio" value="1" name="group[$k][markset][$keys][markdt]" $markdt_Y />開啟 <input type="radio" value="0" name="group[$k][markset][$keys][markdt]" $markdt_N />關閉<br />
<!--
EOT;
}print<<<EOT
-->
		</td>
	</tr>
<!--
EOT;
}else{print<<<EOT
-->
	<tr class="tr3 vt">
		<td class="td1">$v[0]</td>
		<td class="td2">$v[1]</td>
	</tr>
<!--
EOT;
}}}print <<<EOT
-->
</table>
</div>
<div class="tac mb10"><span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span></div>
</form>
<!--
EOT;
}} elseif ($adminitem == 'batch') {print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li><a href="$admin_file?adminjob=level&adminitem=level">用戶組權限</a></li>
		<li  class="current"><a href="$admin_file?adminjob=level&adminitem=batch">導入導出</a></li>
		<li><a href="$admin_file?adminjob=level&adminitem=help">詳細幫助</a></li>
	</ul>
</div>
<div class="admin_info mb10">
    <h3 class="h1"><b>提示信息</b></h3>
    <div class="legend">
        批量導入:<br />　　選擇需要導入的文件(txt)，點擊提交<br />　　內容規則:<br />　　1.a=>b (a 為 用戶組ID；b 為用戶組頭餃)<br />　　2.一行一條記錄
    </div>
</div>
<form action="$basename" method="post" enctype="multipart/form-data">
<input type="hidden" name="action" value="batch" />
<input type="hidden" name="step" value="3" />
<h2 class="h1">用戶組頭餃名稱導入</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
<tr class="tr1"><td class="td1">導入文件</td><td class="td2"><input class="input input_wb" type="file" name="upload" /></td></tr>
</table>
</div>
<div class="tac mb10"><span class="btn"><span><button type="submit" onfocus="blur();">提 交</button></span></span></div>
</form>

<form action="$basename" method="post">
<input type="hidden" name="action" value="batch" />
<input type="hidden" name="step" value="5" />
<h2 class="h1">導出列表</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0" style="table-layout:fixed;">
<tr class="tr2">
	<td width="20"></td>
    <td width="55" class="tac">組ID</td>
    <td width="200">用戶組名</td>
    <td>用戶組類型</td>
    <td>&nbsp;</td>
</tr>
<!--
EOT;
$gdb = array('member'=>'會員組','system'=>'系統組','special'=>'特殊組');
foreach($group as $key=>$value){print <<<EOT
-->
<tr class="tr1">
	<td class="td2"><input type="checkbox" name="selid[]" value="$value[gid]" checked /></td>
    <td class="td2 tac">$value[gid]</td>
    <td class="td2">$value[grouptitle]</td>
    <td class="td2">{$gdb[$value[gptype]]}</td>
    <td class="td2">&nbsp;</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<div class="tac mb10">
<span class="bt"><span><button type="button" name="chkall" onfocus="blur();CheckAll(this.form)">全 選</button></span></span>
<span class="btn"><span><button type="submit" name="submit" onfocus="blur();">提 交</button></span></span>
</div>
</form>
<!--
EOT;
}elseif($adminitem=='help'){print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li><a href="$admin_file?adminjob=level&adminitem=level">用戶組權限</a></li>
		<li><a href="$admin_file?adminjob=level&adminitem=batch">導入導出</a></li>
		<li class="current"><a href="$admin_file?adminjob=level&adminitem=help">詳細幫助</a></li>
	</ul>
</div>
<div class="mb10">
    <h3 class="h1"><b>提示信息</b></h3>
    <div class="legend">
        <b>站點的用戶組分為會員組、系統組、特殊組、默認組。</b><br />&nbsp;&nbsp;會員組:級別按照會員發的帖子數自動進行級別判斷並更新。<br />
&nbsp;&nbsp;系統組:屬于站點管理層，系統組成員由站點管理員設定，管理員可以在<a href="$admin_file?adminjob=usermanage&adminitem=edit" onclick="parent.PW.Dialog({id:'usermanage',url:'$admin_file?adminjob=usermanage&adminitem=edit',name:'用戶管理'});return false;"><font color=blue>用戶管理</font></a>內編輯用戶組成員。<br />
&nbsp;&nbsp;特殊組:可以設置管理權限的組別，區別于系統組，特殊組可以進行出售<br />
&nbsp;&nbsp;默認組:默認組別不可刪除，當其他組別未設置權限時，則使用該默認權限<br /><b>默認組說明:</b><br />&nbsp;&nbsp;<b>default</b>:默認權限設置（沒設置過權限的用戶組使用，可以節約不必要的資源）<br />&nbsp;&nbsp;<b>guest</b>:站點游客權限設置<br />&nbsp;&nbsp;<b>禁言組(banned)</b>:此用戶組禁止發言<br />&nbsp;&nbsp;<b>未驗證會員(newrg)</b>:等待驗證的用戶組<br /><b>系統組說明:</b><br />&nbsp;&nbsp;<b>管理員(manager)</b>:由站點創始人在<a href="$admin_file?adminjob=usermanage&adminitem=edit" onclick="parent.PW.Dialog({id:'usermanage',url:'$admin_file?adminjob=usermanage&adminitem=edit',name:'用戶管理'});return false;"><font color=blue>用戶管理</font></a>內進行設置<br />&nbsp;&nbsp;<b>總版主(superadmin)</b>:前台管理員，擁有前台所有管理權限<br />&nbsp;&nbsp;<b>版主(admin)</b>:負責分版塊的管理工作<br /><b>組ID說明:</b><br />&nbsp; &nbsp;所有普通會員組在線標記圖片為: 6.gif &nbsp; <img src="$imgpath/wind/group/6.gif"><br />&nbsp; &nbsp;管理組和特殊組在線標記圖片名為Gid.gif , 例 :<br />&nbsp; &nbsp;比如組ID為 16,會員在線標記圖片為: 16.gif &nbsp; <img src="$imgpath/wind/group/16.gif"><br />&nbsp; &nbsp;比如組ID為 3,會員在線標記圖片為: 3.gif &nbsp; <img src="$imgpath/wind/group/3.gif"><br />&nbsp;&nbsp;&nbsp;<font color=blue>注:</font>可以在<a href="$admin_file?adminjob=interfacesettings" onclick="parent.PW.Dialog({id:'interfacesettings',url:'$admin_file?adminjob=interfacesettings',name:'界面設置'});return false;"><font color=blue>論壇模式-界面設置-首頁</font></a>里選擇參與在線顯示的用戶組
    </div>
</div>
<h2 class="h1">等級圖片號說明</h2>
<div class="p15">
	<ul class="list_C list_200 cc">
<!--
EOT;
foreach ($levelImg as $key=>$value) {print <<<EOT
-->
		<li>$key 代表 <img src="$imgpath/$stylepath/level/$value" align="absmiddle" /></li>
<!--
EOT;
}print <<<EOT
-->
	</ul>
</div>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->
