<label><input type='checkbox' onclick='check(this,"roles")'/> 角色权限</label>
<table class="widefat post" id="roles">
<tr>
<?php foreach ($roles as $rolekey => $role):?>
<td width="200px">

<label>
<input type="checkbox" name="assign[]" <?php if (is_array($hasoperations) && in_array($rolekey, $hasoperations)):?>checked="checked"<?php endif;?> value="<?php echo $rolekey;?>">
<?php $label = Label::getItemByName($rolekey);?>
<?php if (!empty($label)):?>
    <?php echo $label.'|'.$rolekey;?>
<?php else:?>
    <?php echo CHtml::link($rolekey, '#', array('onclick'=>'openDialog("'.$rolekey.'")'));?>
<?php endif;?>
</label>

 </td>
<?php if((++$i)%4==0):?>
 </tr>
  <tr>
 <?php endif;?>
 <?php endforeach;?>
  </tr>
</table>


