/** * Load the form */ private function loadForm() { // gender dropdown values $genderValues = array('male' => SpoonFilter::ucfirst(BL::getLabel('Male')), 'female' => SpoonFilter::ucfirst(BL::getLabel('Female'))); // birthdate dropdown values $days = range(1, 31); $months = SpoonLocale::getMonths(BL::getInterfaceLanguage()); $years = range(date('Y'), 1900); // create form $this->frm = new BackendForm('add'); // create elements $this->frm->addText('email'); $this->frm->addPassword('password'); $this->frm->addText('display_name'); $this->frm->addText('first_name'); $this->frm->addText('last_name'); $this->frm->addText('city'); $this->frm->addDropdown('gender', $genderValues); $this->frm->addDropdown('day', array_combine($days, $days)); $this->frm->addDropdown('month', $months); $this->frm->addDropdown('year', array_combine($years, $years)); $this->frm->addDropdown('country', SpoonLocale::getCountries(BL::getInterfaceLanguage())); // set default elements dropdowns $this->frm->getField('gender')->setDefaultElement(''); $this->frm->getField('day')->setDefaultElement(''); $this->frm->getField('month')->setDefaultElement(''); $this->frm->getField('year')->setDefaultElement(''); $this->frm->getField('country')->setDefaultElement(''); }
/** * Load the form */ private function loadForm() { $this->frm = new BackendForm('add'); $this->frm->addText('title', null, null, 'inputText title', 'inputTextError title'); $this->frm->addText('street'); $this->frm->addText('number'); $this->frm->addText('zip'); $this->frm->addText('city'); $this->frm->addDropdown('country', SpoonLocale::getCountries(BL::getInterfaceLanguage()), 'BE'); }
/** * Load the form */ private function loadForm() { $this->frm = new BackendForm('edit'); $this->frm->addText('title', $this->record['title'], null, 'inputText title', 'inputTextError title'); $this->frm->addEditor('text', $this->record['text']); $this->frm->addText('street', $this->record['street']); $this->frm->addText('number', $this->record['number']); $this->frm->addText('zip', $this->record['zip']); $this->frm->addText('city', $this->record['city']); $this->frm->addDropdown('country', SpoonLocale::getCountries(BL::getInterfaceLanguage()), $this->record['country']); }
/** * Load the form. */ private function loadForm() { // gender dropdown values $genderValues = array('male' => SpoonFilter::ucfirst(FL::getLabel('Male')), 'female' => SpoonFilter::ucfirst(FL::getLabel('Female'))); // birthdate dropdown values $days = range(1, 31); $months = SpoonLocale::getMonths(FRONTEND_LANGUAGE); $years = range(date('Y'), 1900); // get settings $birthDate = $this->profile->getSetting('birth_date'); $nameChanges = (int) $this->profile->getSetting('display_name_changes'); // get day, month and year if ($birthDate) { list($birthYear, $birthMonth, $birthDay) = explode('-', $birthDate); } else { $birthDay = ''; $birthMonth = ''; $birthYear = ''; } // create the form $this->frm = new FrontendForm('updateSettings', null, null, 'updateSettingsForm'); // create & add elements $this->frm->addImage('avatar'); $this->frm->addText('display_name', $this->profile->getDisplayName()); $this->frm->addText('first_name', $this->profile->getSetting('first_name')); $this->frm->addText('last_name', $this->profile->getSetting('last_name')); $this->frm->addText('email', $this->profile->getEmail()); $this->frm->addText('city', $this->profile->getSetting('city')); $this->frm->addDropdown('country', SpoonLocale::getCountries(FRONTEND_LANGUAGE), $this->profile->getSetting('country')); $this->frm->addDropdown('gender', $genderValues, $this->profile->getSetting('gender')); $this->frm->addDropdown('day', array_combine($days, $days), $birthDay); $this->frm->addDropdown('month', $months, $birthMonth); $this->frm->addDropdown('year', array_combine($years, $years), (int) $birthYear); // set default elements dropdowns $this->frm->getField('gender')->setDefaultElement(''); $this->frm->getField('day')->setDefaultElement(''); $this->frm->getField('month')->setDefaultElement(''); $this->frm->getField('year')->setDefaultElement(''); $this->frm->getField('country')->setDefaultElement(''); // set email disabled $this->frm->getField('email')->setAttribute('disabled', 'disabled'); // when user exceeded the number of name changes set field disabled if ($nameChanges >= FrontendProfilesModel::MAX_DISPLAY_NAME_CHANGES) { $this->frm->getField('display_name')->setAttribute('disabled', 'disabled'); } }
/** * Load the form */ protected function loadForm() { // create form $this->frm = new BackendForm('edit'); // set array of recurring types $selectTypes = array('0' => ucfirst(BL::lbl('Daily')), '1' => ucfirst(BL::lbl('Weekly')), '2' => ucfirst(BL::lbl('Monthly')), '3' => ucfirst(BL::lbl('Yearly'))); // set array of recurring interval $selectInterval = array(); $i = 1; while ($i < $this->maxInterval) { $selectInterval[$i] = $i; $i++; } // set array of reservation values $radiobuttonSubscriptionsValues[] = array('label' => BL::lbl('Yes'), 'value' => 'Y'); $radiobuttonSubscriptionsValues[] = array('label' => BL::lbl('No'), 'value' => 'N'); // set array of possibilities which an item can end on $radiobuttonEndsOn[] = array('label' => ucfirst(BL::lbl('Never')), 'value' => '0'); $radiobuttonEndsOn[] = array('label' => ucfirst(BL::lbl('After')), 'value' => '1'); $radiobuttonEndsOn[] = array('label' => ucfirst(BL::lbl('On')), 'value' => '2'); // set array of recurring days of item $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Monday')), 'value' => '0'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Tuesday')), 'value' => '1'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Wednesday')), 'value' => '2'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Thursday')), 'value' => '3'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Friday')), 'value' => '4'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Saturday')), 'value' => '5'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Sunday')), 'value' => '6'); // recurring item options $this->frm->addCheckbox('recurring', $this->record['recurring'] === 'Y' ? true : false); $this->frm->addDropdown('type', $selectTypes, $this->recurringOptions['type']); $this->frm->addDropdown('interval', $selectInterval, $this->recurringOptions['interval']); $this->frm->addMultiCheckbox('days', $multiCheckboxDays, $this->recurringOptionsDays); $this->frm->addRadioButton('ends_on', $radiobuttonEndsOn, $this->recurringOptions['ends_on']); $this->frm->addText('frequency', $this->recurringOptions['frequency']); $this->frm->addDate('recurr_end_date_date', $this->recurringOptions['end_date']); $this->frm->addTime('recurr_end_date_time', date('H:i', $this->recurringOptions['end_date'])); $this->frm->addCheckbox('whole_day', $this->record['whole_day'] === 'Y' ? true : false); // location options $this->frm->addText('name', $this->record['location_name']); $this->frm->addText('street', $this->record['street']); $this->frm->addText('number', $this->record['number']); $this->frm->addText('zip', $this->record['zip']); $this->frm->addText('city', $this->record['city']); $this->frm->addDropdown('country', \SpoonLocale::getCountries(BL::getInterfaceLanguage()), $this->record['country']); $this->frm->addCheckbox('google_maps', $this->record['google_maps'] === 'Y' ? true : false); // standard options $this->frm->addText('title', $this->record['title'], null, 'inputText title', 'inputTextError title'); $this->frm->addEditor('text', $this->record['text']); $this->frm->addEditor('introduction', $this->record['introduction']); $this->frm->addDate('begin_date_date', $this->record['begin_date']); $this->frm->addTime('begin_date_time', date('H:i', $this->record['begin_date'])); $this->frm->addDate('end_date_date', $this->record['end_date']); $this->frm->addTime('end_date_time', date('H:i', $this->record['end_date'])); $this->frm->addImage('image'); $this->frm->addText('price', $this->record['price']); $this->frm->addCheckbox('delete_image'); $this->frm->addRadioButton('subscriptions', $radiobuttonSubscriptionsValues, $this->record['allow_subscriptions']); // get categories $categories = BackendAgendaModel::getCategories(); $this->frm->addDropdown('category_id', $categories, $this->record['category_id']); // meta $this->meta = new BackendMeta($this->frm, $this->record['meta_id'], 'title', true); $this->meta->setUrlCallBack('Backend\\Modules\\Agenda\\Engine\\Model', 'getUrl', array($this->record['id'])); $this->media = new BackendMediaHelper($this->frm, (string) $this->getModule(), (int) $this->id, (string) $this->getAction(), 'Agenda'); }
/** * Load the form * * @return void */ private function loadForm() { // gender dropdown values $genderValues = array('male' => ucfirst(BL::getLabel('Male')), 'female' => ucfirst(BL::getLabel('Female'))); // birthdate dropdown values $days = range(1, 31); $months = SpoonLocale::getMonths(BL::getInterfaceLanguage()); $years = range(date('Y'), 1900); // get settings $birthDate = BackendProfilesModel::getSetting($this->id, 'birth_date'); // get day, month and year if ($birthDate) { list($birthYear, $birthMonth, $birthDay) = explode('-', $birthDate); } else { $birthDay = ''; $birthMonth = ''; $birthYear = ''; } // create form $this->frm = new BackendForm('edit'); // create elements $this->frm->addText('email', $this->profile['email']); $this->frm->addPassword('password'); $this->frm->addText('display_name', $this->profile['display_name']); $this->frm->addText('first_name', BackendProfilesModel::getSetting($this->id, 'first_name')); $this->frm->addText('last_name', BackendProfilesModel::getSetting($this->id, 'last_name')); $this->frm->addText('city', BackendProfilesModel::getSetting($this->id, 'city')); $this->frm->addDropdown('gender', $genderValues, BackendProfilesModel::getSetting($this->id, 'gender')); $this->frm->addDropdown('day', array_combine($days, $days), $birthDay); $this->frm->addDropdown('month', $months, $birthMonth); $this->frm->addDropdown('year', array_combine($years, $years), (int) $birthYear); $this->frm->addDropdown('country', SpoonLocale::getCountries(BL::getInterfaceLanguage()), BackendProfilesModel::getSetting($this->id, 'country')); // set default elements dropdowns $this->frm->getField('gender')->setDefaultElement(''); $this->frm->getField('day')->setDefaultElement(''); $this->frm->getField('month')->setDefaultElement(''); $this->frm->getField('year')->setDefaultElement(''); $this->frm->getField('country')->setDefaultElement(''); }
/** * Load the form */ protected function loadForm() { $this->frm = new BackendForm('add'); // set array of recurring types $selectTypes = array('0' => ucfirst(BL::lbl('Daily')), '1' => ucfirst(BL::lbl('Weekly')), '2' => ucfirst(BL::lbl('Monthly')), '3' => ucfirst(BL::lbl('Yearly'))); // set array of recurring interval $selectInterval = array(); $i = 1; while ($i < $this->maxInterval) { $selectInterval[$i] = $i; $i++; } // set array of reservation values $radiobuttonSubscriptionsValues[] = array('label' => BL::lbl('Yes'), 'value' => 'Y'); $radiobuttonSubscriptionsValues[] = array('label' => BL::lbl('No'), 'value' => 'N'); // set array of possibilities which an item can end on $radiobuttonEndsOn[] = array('label' => ucfirst(BL::lbl('Never')), 'value' => '0'); $radiobuttonEndsOn[] = array('label' => ucfirst(BL::lbl('After')), 'value' => '1'); $radiobuttonEndsOn[] = array('label' => ucfirst(BL::lbl('On')), 'value' => '2'); // set array of recurring days of item $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Monday')), 'value' => '0'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Tuesday')), 'value' => '1'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Wednesday')), 'value' => '2'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Thursday')), 'value' => '3'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Friday')), 'value' => '4'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Saturday')), 'value' => '5'); $multiCheckboxDays[] = array('label' => ucfirst(BL::lbl('Sunday')), 'value' => '6'); // recurring item options $this->frm->addCheckbox('recurring'); $this->frm->addDropdown('type', $selectTypes, null); $this->frm->addDropdown('interval', $selectInterval, null); $this->frm->addMultiCheckbox('days', $multiCheckboxDays, 3); $this->frm->addRadioButton('ends_on', $radiobuttonEndsOn, null); $this->frm->addText('frequency'); $this->frm->addDate('recurr_end_date_date'); $this->frm->addTime('recurr_end_date_time'); $this->frm->addCheckbox('whole_day'); $this->frm->addRadioButton('subscriptions', $radiobuttonSubscriptionsValues, 'N'); // location options $this->frm->addText('name'); $this->frm->addText('street'); $this->frm->addText('number'); $this->frm->addText('zip'); $this->frm->addText('city'); $this->frm->addDropdown('country', \SpoonLocale::getCountries(BL::getInterfaceLanguage()), 'BE'); $this->frm->addCheckbox('google_maps'); // standard options $this->frm->addText('title', null, null, 'inputText title', 'inputTextError title'); $this->frm->addEditor('text'); $this->frm->addEditor('introduction'); $this->frm->addDate('begin_date_date'); $this->frm->addTime('begin_date_time'); $this->frm->addDate('end_date_date'); $this->frm->addTime('end_date_time'); $this->frm->addImage('image'); $this->frm->addText('price'); // get categories $categories = BackendAgendaModel::getCategories(); $this->frm->addDropdown('category_id', $categories); // meta $this->meta = new BackendMeta($this->frm, null, 'title', true); }