<extend name="Public:common" />

<block name="main">


    <form action="{:U('setGroupAll')}" id="j_custom_form" callback="TabAjaxDone" url="{:U('index')}" class="col-md-11 form-validate" method="post"  noEnter>
      <input type="hidden" name="groupId" VALUE="{$groupId}" />
    <input type="hidden" name="c[]"  value="{$nodeid}"/>
  
    
     
        <volist name="list" id="vo">
                    <div class="content-box mrg25B">
                  <h3 class="content-box-header ui-state-default font-bold"><span><label><input type="checkbox" class="all c j-icheck" name="c[]" id="list_{$vo.id}"   value="{$vo.id}"  <?php echo in_array($vo['id'], $currentMenu) ? "checked" : "" ?> />&nbsp;{$vo.title}</label></span></h3>
                         
                 <div class="content-box-wrapper">
                    <volist name="vo['sub_node']" id="sub">

                        <label><input type="checkbox"  class="one c j-icheck"  name="c[]" cid="list_{$vo.id}"   value="{$sub.id}" <?php echo in_array($sub['id'], $currentMenu) ? "checked" : "" ?>/>{$sub.title}&nbsp;</label>
                    </volist>
                     </div>
                </div> 
                  </volist>
       
           
         <div class="actionBar text-right">
               
          
            
		   <button type="button" class="btn medium bg-green " id="all">全选</button>
            <button type="button" class="btn medium bg-green  mrg15L" id="none">全不选</button>
            <button type="button" class="btn medium bg-green  mrg15L" id="invert">反选</button>
           <button type="submit" class="btn medium bg-blue mrg15L">保存</button>
           <button type="button" url="{:U('index')}" class="btn-close btn medium bg-red mrg15L">取消</button>
     

             
          
            </div>

    </form>
</block>
<block name="script">
<script language="javascript">

	
$('#invert').on('click', function(){
	
   $('.c').iCheck('toggle');
});
$('#all').on('click', function(){
	
	$(".c").iCheck('check'); 
});
$('#none').on('click', function(){
	
	$(".c").iCheck('uncheck'); 
});
$('.one').each(function(){

	$(this).on('ifChecked', function(){
         $(":checkbox[id='"+$(this).attr('cid')+"']").iCheck('check'); 
	 });
});
$('.all').each(function(){

	
	$(this).on('ifUnchecked', function(){
		$(":checkbox[cid='"+$(this).attr('id')+"']").iCheck('uncheck');
	});
		

	});




</script>

</block>