getGroupsForDropDown() public static method

Get profile groups for dropdown not yet linked to a profile
public static getGroupsForDropDown ( integer $profileId, integer $includeId = null ) : array
$profileId integer Profile id.
$includeId integer Group id to always include.
return array
Example #1
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     // get group values for dropdown
     $ddmValues = BackendProfilesModel::getGroupsForDropDown($this->id);
     // create form and elements
     $this->frm = new BackendForm('import');
     $this->frm->addDropdown('group', $ddmValues);
     $this->frm->addFile('file');
     $this->frm->addCheckbox('overwrite_existing');
 }
Example #2
0
 /**
  * Load the form.
  */
 private function loadForm()
 {
     // get group values for dropdown
     $ddmValues = BackendProfilesModel::getGroupsForDropDown($this->id);
     // create form
     $this->frm = new BackendForm('addProfileGroup');
     // create elements
     $this->frm->addDropdown('group', $ddmValues);
     $this->frm->addDate('expiration_date');
     $this->frm->addTime('expiration_time', '');
     // set default element
     $this->frm->getField('group')->setDefaultElement('');
 }
Example #3
0
 /**
  * Load the form.
  */
 private function loadForm()
 {
     // get group values for dropdown
     $ddmValues = BackendProfilesModel::getGroupsForDropDown($this->profileId, $this->id);
     // create form
     $this->frm = new BackendForm('editProfileGroup');
     // create elements
     $this->frm->addDropdown('group', $ddmValues, $this->profileGroup['group_id']);
     $this->frm->addDate('expiration_date', $this->profileGroup['expires_on']);
     $this->frm->addTime('expiration_time', $this->profileGroup['expires_on'] !== null ? date('H:i', $this->profileGroup['expires_on']) : '');
     // set default element
     $this->frm->getField('group')->setDefaultElement('');
 }