Example #1
0
            <?php 
echo $form->textFieldControlGroup($model, 'email', array('span' => 5));
?>

            <?php 
echo $form->textFieldControlGroup($model, 'username', array('span' => 5));
?>

            <?php 
echo $form->textFieldControlGroup($model, 'password', array('span' => 5));
?>
          

            <?php 
// if (Yii::app()->user->isSuperuser) {
$all_roles = new RAuthItemDataProvider('roles', array('type' => 2));
$data = $all_roles->fetchData();
?>
                <div>
                    <label for="type_id">Role</label>
                    <?php 
echo CHtml::dropDownList("Type", '', CHtml::listData($data, 'name', 'name'));
?>
 
                </div>
            <?php 
//}
?>
    
        <div class="form-actions">
        <?php 
 /**
  * Fetches the data from the persistent data storage.
  * @return array list of data items
  */
 public function fetchData()
 {
     $this->items = Rights::getAuthorizer()->getAuthItemChildren($this->parent->name, $this->type);
     return parent::fetchData();
 }
 /**
  * Fetches the data from the persistent data storage.
  * @return array list of data items
  */
 public function fetchData()
 {
     $this->items = Rights::getAuthorizer()->getAuthItemParents($this->parent->name, $this->type, null, true);
     return parent::fetchData();
 }
 /**
  * This method use to get all user role
  * @author Phihx
  * @date 14/02/2014
  */
 public function getAllRoleUser()
 {
     Yii::import('application.modules.rights.components.dataproviders.*');
     $all_roles = new RAuthItemDataProvider('roles', array('type' => 2));
     return $all_roles->fetchData();
 }