Example #1
0
 /**
  * Load the form
  */
 protected function loadForm()
 {
     // create form
     $this->frm = new BackendForm('settings');
     // get categories
     $groups = BackendMailengineModel::getAllGroupsForDropdown();
     $groups = array("0" => "") + $groups;
     // multiple categories?
     $default_group = BackendModel::getModuleSetting($this->URL->getModule(), 'default_group');
     $default_group = $default_group > 0 ? $default_group : 0;
     // create element
     $this->frm->addDropdown('default_group', $groups, BackendModel::getModuleSetting($this->URL->getModule(), 'default_group'));
 }
Example #2
0
 /**
  * Load the form
  */
 protected function loadForm()
 {
     //--Create form
     $this->frm = new BackendForm("send_preview");
     //--Get the groups
     $groups = BackendMailengineModel::getAllGroupsForDropdown(true);
     if (empty($groups)) {
         \SpoonHTTP::redirect(BackendModel::createURLForAction('index', $this->module) . "&id=" . $this->id . "&error=GroupsNeededToSendMailing");
     }
     //--Loop all the users
     foreach ($groups as $key => $value) {
         $groupCheckboxes[] = array("label" => $value, "value" => $key);
     }
     //--Add multicheckboxes to form
     $this->frm->addMultiCheckbox("groups", $groupCheckboxes, null);
     $this->frm->addDate('start_date');
     $this->frm->addTime('start_time', null, 'inputText time');
     if (BackendModel::isModuleInstalled('profiles')) {
         $profiles = BackendMailengineModel::getAllProfiles();
         $profileGroups = BackendMailengineModel::getAllProfileGroupsForDropdown(true);
         $profileGroupCheckboxes = array();
         $this->tpl->assign("profilesCount", count($profiles));
         //--Loop all the users
         foreach ($profileGroups as $key => $value) {
             $profileGroupCheckboxes[] = array("label" => $value, "value" => $key);
         }
         if (!empty($profileGroups)) {
             $this->frm->addMultiCheckbox("profile_groups", $profileGroupCheckboxes, null);
         }
         $this->frm->addCheckbox("profiles_all");
     }
     //--Create review form
     $this->frm_review = new BackendForm("send_review");
     //--Add hidden field as dummy
     $this->frm_review->addHidden("profiles_all");
     $this->frm_review->addHidden("profile_groups");
     $this->frm_review->addHidden("groups");
     $this->frm_review->addDate("start_date");
     $this->frm_review->addTime("start_time");
 }
Example #3
0
 /**
  * Load the form.
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('filter', BackendModel::createURLForAction(), 'get');
     // add fields
     $this->frm->addText('email', $this->filter['email']);
     $this->frm->addText('name', $this->filter['name']);
     // get categories
     $groups = BackendMailengineModel::getAllGroupsForDropdown();
     $groups = array("0" => "") + $groups;
     // multiple categories?
     if (count($groups) > 1) {
         // create element
         $this->frm->addDropdown('group', $groups, $this->filter["group"]);
         $this->frm->getField('group')->setDefaultElement('');
     }
     // manually parse fields
     $this->frm->parse($this->tpl);
 }