<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'manager-form',
'enableAjaxValidation'=>false,
));
?>
    <fieldset>
        <legend><?php echo $title;?></legend>

<div class="grid-view">
    <table class="widefat post">
        <thead>
        <tr>
        <th>编号</th><th>角色名称</th><th>角色描述</th><th>用户列表</th><th>操作</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($roles as $name=>$role):?>
        <tr>
            <td>
                <?php echo ++$i; ?>
            </td>
            <td>
                <?php echo CHtml::link($name,array('author/roleassign','name'=>$name));?>
            </td>
            <td>
                <?php echo $role->description; ?>
            </td>
           
            <td width="500px">
                <?php $users = Yii::app()->authManager->getAssignUser($name); ?>
                <?php foreach($users as $user):?>
                <?php echo CHtml::link($user,array('userassign','name'=>$user)); ?>
                <?php endforeach;?>
            </td>
            <td>
                <?php echo CHtml::link('权限维护',array('author/roleassign','name'=>$name));?>
                <?php echo CHtml::link('权限指派',array('authorityassign','name'=>$name)); ?>
            </td>
        </tr>
        <?php endforeach;?>
        </tbody>
    </table>
</div>

    </fieldset>
<?php $this->endWidget(); ?>
</div>
