You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
5.5 KiB
HTML

5 years ago
<!-- 分类授权编辑页面 -->
<extend name="Public/base" />
<block name="body">
<div class="main-place">
<span class="main-placetitle">位置</span>
<ul class="main-placeul">
<li><a href="{:U('User/index')}">用户</a></li>
<li><a href="{:U('User/index')}">管理组</a></li>
<li><a href="#">{$meta_title}</a></li>
</ul>
</div>
<div class="tab-wrap">
<div class="tab_nav">
<ul>
<li><a href="{:U('AuthManager/access',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">访问授权</a></li>
<li class="current"><a href="javascript:;">分类授权</a></li>
<li><a href="{:U('AuthManager/dataempower',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">数据授权</a></li>
5 years ago
<li><a href="{:U('AuthManager/user',array('group_name'=>I('group_name') ,'group_id'=> I('group_id')))}">成员授权</a></li>
<li class="fr tab_select">
<select name="group">
<volist name="auth_group" id="vo">
<option value="{:U('AuthManager/category',array('group_id'=>$vo['id'],'group_name'=>$vo['title']))}" <eq name="vo['id']" value="$this_group['id']">selected</eq> >{$vo.title}</option>
</volist>
</select>
</li>
</ul>
</div>
<!-- 表格列表 -->
<div class="tb-unit posr">
<form class="save-category category_list" action="{:U('AuthManager/addToCategory')}" method="post" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="group_id" value="{:I('group_id')}">
<div class="category auth-category jsauth_category">
<div class="hd cf">
<div class="fold">折叠</div>
<div class="order" style="text-indent:0;"><input type="checkbox" class="jsall_cate_id" title="全选" alt="全选" style="vertical-align:middle;"></div>
<div class="name">栏目名称</div>
</div>
{:R('AuthManager/tree', array($group_list))}
</div>
<div class="tb-unit-bar box_mt">
<button class="category_btn ajax-post" type="submit" target-form="save-category">确 定</button>
<a class="category_return" style="display: inline-block;text-align: center;top: -10px" href="{:U('index')}" ><span style=" line-height: 36px;">返 回</span></a>
5 years ago
</div>
</form>
</div>
</div>
<!-- /表格列表 -->
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="AuthManager/index">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script type="text/javascript">
+function($){
/* 分类展开收起 */
$(".category dd").prev().find(".fold i").addClass("icon-unfold")
.click(function(){
var self = $(this);
if(self.hasClass("icon-unfold")){
self.closest("dt").next().slideUp("fast", function(){
self.removeClass("icon-unfold").addClass("icon-fold");
});
} else {
self.closest("dt").next().slideDown("fast", function(){
self.removeClass("icon-fold").addClass("icon-unfold");
});
}
});
var auth_groups = [{$authed_group}];
$('.cate_id').each(function(){
if( $.inArray( parseInt(this.value,10),auth_groups )>-1 ){
$(this).prop('checked',true);
}
});
/* 全选 @鹿文学 */
$('.jscate_id').each(function() {
if(!this.checked) {
select_status($(this),false);
$('.jsall_cate_id').prop('checked',false);return false;
} else {
select_status($(this),true);
$('.jsall_cate_id').prop('checked',true);
}
});
$('select[name=group]').change(function(){
location.href = this.value;
});
$('.jsall_cate_id').on('change',function() {
$('.jscate_id').prop('checked',this.checked);
});
$('.jscate_id').on('change',function() {
var that = $(this);
that.closest('.cf').siblings('dd').find('.jscate_id').prop('checked',this.checked);
select_status(that,this.checked);
$('.jscate_id').each(function() {
if(!this.checked) {
select_status($(this),false);
$('.jsall_cate_id').prop('checked',false);return false;
} else {
select_status($(this),true);
$('.jsall_cate_id').prop('checked',true);
}
});
});
/* 全选 @鹿文学 */
}(jQuery);
/* 递归选择 @鹿文学 */
function select_status(that,flag) {
if(that.parent().hasClass('jsauth_category')) {
that.children('.cf').find('.jscate_id').prop('checked',flag);
return true;
} else {
if(that.children('.cf')) {
that.children('.cf').find('.jscate_id').prop('checked',flag);
}
return select_status(that.parent(),flag);
}
}
/* 递归选择 @鹿文学 */
//导航高亮
highlight_subnav('{:U('AuthManager/index')}');
</script>
</block>