public function actionGroupSelectDialog()
 {
     $this->setData("items", CStaffManager::getAllUserGroups());
     $this->renderView("_acl_manager/dialog/groupSelect.tpl");
 }
 public function actionSave()
 {
     $form = new CUserForm();
     $form->setAttributes(CRequest::getArray($form::getClassName()));
     /**
      * Здесь у нас слегка раздутая модель,
      */
     if ($form->validate()) {
         $form->save();
         if ($this->continueEdit()) {
             $this->redirect("?action=edit&id=" . $form->user->getId());
         } else {
             $this->redirect("?action=index");
         }
         return true;
     }
     /**
      * Получаем список групп
      */
     $groups = array();
     foreach (CStaffManager::getAllUserGroups()->getItems() as $group) {
         $groups[$group->getId()] = $group->comment;
     }
     $user = $form->user;
     /**
      * Получаем список ролей, полученных от участия
      * в группах
      */
     $fromGroups = array();
     foreach ($user->getGroups()->getItems() as $group) {
         foreach ($group->getRoles()->getItems() as $role) {
             $fromGroups[$role->getId()] = $group->comment;
         }
     }
     /**
      * Все передаем в представление
      */
     $this->setData("fromGroups", json_encode($fromGroups));
     $this->setData("groups", $groups);
     $this->setData("form", $form);
     $this->renderView("_users/users/edit.tpl");
 }