Example #1
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     $this->frm = new BackendForm('add');
     $this->frm->addText('email');
     // fetch groups
     $groups = BackendMailmotorModel::getGroupsForCheckboxes();
     // if no groups are found, redirect to overview
     if (empty($groups)) {
         $this->redirect(BackendModel::createURLForAction('Addresses') . '&error=no_groups');
     }
     // add checkboxes for groups
     $this->frm->addMultiCheckbox('groups', $groups, $this->groupId);
 }
Example #2
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('edit');
     // create elements
     $this->frm->addText('email', $this->email);
     $this->frm->getField('email')->setAttribute('disabled', 'disabled');
     // fetch groups for checkbox format
     $checkboxGroups = BackendMailmotorModel::getGroupsForCheckboxes();
     // if no groups are found, redirect to overview
     if (empty($checkboxGroups)) {
         $this->redirect(BackendModel::createURLForAction('Addresses') . '&error=no-groups');
     }
     // add checkboxes for groups
     $this->frm->addMultiCheckbox('groups', $checkboxGroups, $this->record['groups']);
     // add dropdown for subscriptions
     if (!empty($this->subscriptions)) {
         $this->frm->addDropdown('subscriptions', $this->subscriptions, $this->id);
     }
 }
Example #3
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('import');
     // create elements
     $this->frm->addFile('csv');
     // dropdown for languages
     $this->frm->addDropdown('languages', BL::getWorkingLanguages(), BL::getWorkingLanguage());
     // fetch groups
     $groups = BackendMailmotorModel::getGroupsForCheckboxes();
     // if no groups are found, redirect to overview
     if (empty($groups)) {
         $this->redirect(BackendModel::createURLForAction('Addresses') . '&error=no-groups');
     }
     // add radiobuttons for groups
     $this->frm->addRadiobutton('groups', $groups, empty($this->groupId) ? null : $this->groupId);
     // show the form
     $this->tpl->assign('import', true);
 }