Пример #1
0
 public function addRoleCheckboxes($userID = null)
 {
     ///////////////////// create role checkboxes /////////////////////
     // get role array
     $roleModel = new Admin_Model_Role();
     $roleArray = $roleModel->getRoleArray();
     // create subform
     $subForm = new Zend_Form_SubForm(array('class' => 'roleGroup'));
     $subForm->setDecorators($this->_displayGroupDecorators);
     $subForm->setOptions(array('class' => 'fieldsetForm span-7'));
     // this case is for updating user
     if ($userID) {
         $checkboxes = $this->_createCheckboxesForUpdatingUser($userID);
     } else {
         $checkboxes = $this->_createCheckboxesForCreatingUser();
     }
     $subForm->addElements($checkboxes);
     $this->addSubForm($subForm, 'roles');
 }