function RegistrationForm()
 {
     // Name Set
     $FirstNameField = new TextField('FirstName', "First Name");
     $LastNameField = new TextField('Surname', "Last Name");
     // Email Addresses
     $PrimaryEmailField = new TextField('Email', "Primary Email Address");
     // New Gender Field
     $GenderField = new OptionSetField('Gender', 'I identify my gender as:', array('Male' => 'Male', 'Female' => 'Female', 'Specify' => 'Let me specify', 'Prefer not to say' => 'Prefer not to say'));
     $GenderSpecifyField = new TextField('GenderSpecify', 'Specify your gender');
     $GenderSpecifyField->addExtraClass('hide');
     $StatementOfInterestField = new TextField('StatementOfInterest', 'Statement of Interest');
     $StatementOfInterestField->addExtraClass('autocompleteoff');
     $affiliations = new AffiliationField('Affiliations', 'Affiliations');
     $affiliations->setMode('local');
     $fields = new FieldList($FirstNameField, $LastNameField, new LiteralField('break', '<hr/>'), $PrimaryEmailField, new LiteralField('instructions', '<p>This will also be your login name.</p>'), new LiteralField('break', '<hr/>'), $GenderField, $GenderSpecifyField, new LiteralField('instructions', '<p>It\'s perfectly acceptable if you choose not to tell us: we appreciate you becoming a member of OpenStack Foundation. The information will remain private and only used to monitor our effort to improve gender diversity in our community.</p>'), new LiteralField('break', '<hr/>'), $affiliations, $StatementOfInterestField, new LiteralField('instructions', '<p>Your statement of interest should be a few words describing your objectives or plans for OpenStack.</p>'), new LiteralField('break', '<hr/>'), new TextField('Address', _t('Addressable.ADDRESS', 'Street Address (Line1)')), new TextField('Suburb', _t('Addressable.SUBURB', 'Street Address (Line2)')), new TextField('City', _t('Addressable.CITY', 'City')));
     $label = _t('Addressable.STATE', 'State');
     if (is_array($this->allowedStates)) {
         $fields->push(new DropdownField('State', $label, $this->allowedStates));
     } elseif (!is_string($this->allowedStates)) {
         $fields->push(new TextField('State', $label));
     }
     $AdressField = new TextField('Postcode', _t('Addressable.POSTCODE', 'Postcode'));
     $fields->push($AdressField);
     $label = _t('Addressable.COUNTRY', 'Country');
     if (is_array($this->allowedCountries)) {
         $countryField = new DropdownField('Country', $label, $this->allowedCountries);
         $countryField->addExtraClass('chzn-select');
         $countryField->setEmptyString('-- Select One --');
         $fields->push($countryField);
     } elseif (!is_string($this->allowedCountries)) {
         $countryField = new CountryDropdownField('Country', $label);
         $countryField->setEmptyString('-- Select One --');
         $countryField->addExtraClass('chzn-select');
         $fields->push($countryField);
     }
     $fields->push(new LiteralField('break', '<hr/>'));
     $fields->push(new ConfirmedPasswordField('Password', 'Password'));
     $fields->push(new HiddenField('MembershipType', 'MembershipType', 'foundation'));
     $actions = new FieldList(new FormAction('doRegister', 'Submit My Application'));
     $validator = new Member_Validator('FirstName', 'Surname', 'Email', 'StatementOfInterest', 'Address', 'City', 'Country', 'Password');
     $form = new HoneyPotForm($this, 'RegistrationForm', $fields, $actions, $validator);
     if ($data = Session::get("FormInfo.{$form->FormName()}.data")) {
         if (isset($data['HiddenAffiliations'])) {
             $affiliations->setValue($data['HiddenAffiliations']);
         }
         return $form->loadDataFrom($data);
     }
     return $form;
 }
 function __construct($controller, $name, $use_actions = true)
 {
     $event_manager = new EventManager($this->repository, new EventRegistrationRequestFactory(), null, new SapphireEventPublishingService(), new EventValidatorFactory(), SapphireTransactionManager::getInstance());
     $fields = new FieldList();
     //point of contact
     $fields->push(new TextField('point_of_contact_name', 'Name'));
     $fields->push(new EmailField('point_of_contact_email', 'Email'));
     //main info
     $fields->push(new TextField('title', 'Title'));
     $fields->push(new TextField('url', 'Url'));
     $types = $event_manager->getAllTypes();
     foreach ($types as $type) {
         $options[$type] = $type;
     }
     $categoryField = new DropdownField('category', 'Category', $options);
     $categoryField->setEmptyString('-- select a category --');
     $fields->push($categoryField);
     //location
     $fields->push(new TextField('city', 'City'));
     $fields->push(new TextField('state', 'State'));
     $countryField = new CountryDropdownField('country', 'Country');
     $countryField->setEmptyString('-- select a country --');
     $fields->push($countryField);
     //duration
     $fields->push($start_date = new TextField('start_date', 'Start Date'));
     $fields->push($end_date = new TextField('end_date', 'End Date'));
     $start_date->addExtraClass('date');
     $end_date->addExtraClass('date');
     // Guard against automated spam registrations by optionally adding a field
     // that is supposed to stay blank (and is hidden from most humans).
     // The label and field name are intentionally common ("username"),
     // as most spam bots won't resist filling it out. The actual username field
     // on the forum is called "Nickname".
     $fields->push(new TextField('user_name', 'UserName'));
     // Create action
     $actions = new FieldList();
     if ($use_actions) {
         $actions->push(new FormAction('saveEventRegistrationRequest', 'Save'));
     }
     // Create validators
     $validator = new ConditionalAndValidationRule(array(new HtmlPurifierRequiredValidator('title', 'city'), new RequiredFields('point_of_contact_name', 'point_of_contact_email', 'start_date', 'end_date', 'country')));
     parent::__construct($controller, $name, $fields, $actions, $validator);
 }
 function RegistrationForm()
 {
     // Name Set
     $FirstNameField = new TextField('FirstName', "First Name");
     $LastNameField = new TextField('Surname', "Last Name");
     // Email Addresses
     $PrimaryEmailField = new TextField('Email', "Primary Email Address");
     // New Gender Field
     $GenderField = new OptionSetField('Gender', 'I identify my gender as:', array('Male' => 'Male', 'Female' => 'Female', 'Specify' => 'Let me specify', 'Prefer not to say' => 'Prefer not to say'));
     $GenderSpecifyField = new TextField('GenderSpecify', 'Specify your gender');
     $GenderSpecifyField->addExtraClass('hide');
     $StatementOfInterestField = new TextField('StatementOfInterest', 'Statement of Interest');
     $StatementOfInterestField->addExtraClass('autocompleteoff');
     $affiliations = new FieldGroup(new HeaderField('Affiliations'), new LiteralField("add-affiliation", "<a class='roundedButton' id='add-affiliation' title='Add New Affiliation' href='#'>Add New Affiliation</a>"), new LiteralField("affiliations-container", "<div id='affiliations-container'></div>"));
     $fields = new FieldList($FirstNameField, $LastNameField, new LiteralField('break', '<hr/>'), $PrimaryEmailField, new LiteralField('instructions', '<p>This will also be your login name.</p>'), new LiteralField('break', '<hr/>'), $GenderField, $GenderSpecifyField, new LiteralField('instructions', '<p>It\'s perfectly acceptable if you choose not to tell us: we appreciate you becoming a member of OpenStack Foundation. The information will remain private and only used to monitor our effort to improve gender diversity in our community.</p>'), new LiteralField('break', '<hr/>'), $affiliations, new HiddenField("Affiliations", "Affiliations", ""), new LiteralField('instructions', '<p>For our purposes, an affiliation is defined as any company where you are an officer, director or employee, or any person or company that has paid you more than $60,000 USD as an independent contractor in the last 12 months. Please list all affiliations which meet this criteria. If you\'re not being paid to work on OpenStack please put "Unaffiliated".</p>'), $StatementOfInterestField, new LiteralField('instructions', '<p>Your statement of interest should be a few words describing your objectives or plans for OpenStack.</p>'), new LiteralField('break', '<hr/>'), new TextField('Address', _t('Addressable.ADDRESS', 'Street Address (Line1)')), new TextField('Suburb', _t('Addressable.SUBURB', 'Street Address (Line2)')), new TextField('City', _t('Addressable.CITY', 'City')));
     $label = _t('Addressable.STATE', 'State');
     if (is_array($this->allowedStates)) {
         $fields->push(new DropdownField('State', $label, $this->allowedStates));
     } elseif (!is_string($this->allowedStates)) {
         $fields->push(new TextField('State', $label));
     }
     $AdressField = new TextField('Postcode', _t('Addressable.POSTCODE', 'Postcode'));
     $fields->push($AdressField);
     $label = _t('Addressable.COUNTRY', 'Country');
     if (is_array($this->allowedCountries)) {
         $countryField = new DropdownField('Country', $label, $this->allowedCountries);
         $countryField->addExtraClass('chzn-select');
         $countryField->setEmptyString('-- Select One --');
         $fields->push($countryField);
     } elseif (!is_string($this->allowedCountries)) {
         $countryField = new CountryDropdownField('Country', $label);
         $countryField->setEmptyString('-- Select One --');
         $countryField->addExtraClass('chzn-select');
         $fields->push($countryField);
     }
     $fields->push(new LiteralField('break', '<hr/>'));
     $fields->push(new ConfirmedPasswordField('Password', 'Password'));
     $fields->push(new HiddenField('MembershipType', 'MembershipType', 'foundation'));
     $actions = new FieldList(new FormAction('doRegister', 'Submit My Application'));
     $validator = new Member_Validator('FirstName', 'Surname', 'Email', 'StatementOfInterest', 'Address', 'City', 'Country', 'Password');
     return new HoneyPotForm($this, 'RegistrationForm', $fields, $actions, $validator);
 }
 public function updateCMSFields(FieldList $fields)
 {
     /** @var Page|MapaelCountryPageExtension $page */
     $page = $this->getOwner();
     $labels = $page->fieldLabels();
     $name = MapaelCountryPage::create()->i18n_singular_name();
     $tab = $fields->findOrMakeTab('Root.CountryPageTab', $name);
     $tab->push(new TabSet('CountryPageTabSet', $main = new Tab('CountryPageMain', _t('CMSMain.TabContent', 'Content')), $cities = new Tab('CountryPageCities', $page->fieldLabel('MapaelCities'))));
     $arr = array();
     foreach (MapaelMap::getAreasArray() as $code => $attrs) {
         $arr[$code] = $attrs['tooltip']['content'];
     }
     $main->push($dd = new CountryDropdownField('CountryCode', $page->fieldLabel('CountryCode'), $arr, $page->CountryCode));
     $dd->setEmptyString(_t(__CLASS__ . '.CountryCodeNone', 'None'));
     $main->push($tf = self::getTooltipContentField($page));
     $tf->setDescription(MapaelMap::getCountryName($page->CountryCode));
     $main->push(self::getTargetField($page));
     $main->push(self::getHrefField($page));
     if ($page->CountryHolderPageID) {
         $main->push(new ReadonlyField('CountryHolderPageReadonly', $page->fieldLabel('CountryHolderPage'), $page->CountryHolderPage()->Title));
     }
     $cities->push(GridField::create('MapaelCities', $page->fieldLabel('MapaelCities'), $page->MapaelCities(), GridFieldConfig_RelationEditor::create()));
 }
 /**
  * @param boolean $geoDefaults
  * @return \FieldList
  */
 public function getAddressFields($geoDefaults = true)
 {
     $fields = new CompositeField();
     $localityValue = $this->owner->Locality;
     $countryCode = $this->owner->CountryCode;
     $postalCodeValue = $this->owner->PostalCode;
     if ((!$localityValue || !$countryCode || !$postalCodeValue) && $geoDefaults) {
         $addressFromIp = Geocoder::geocodeIp(null, 'city', true);
         if ($addressFromIp) {
             if (!$localityValue) {
                 $localityValue = (string) $addressFromIp->getLocality();
             }
             if (!$countryCode) {
                 $countryCode = (string) $addressFromIp->getCountryCode();
             }
             if (!$postalCodeValue) {
                 $postalCodeValue = (string) $addressFromIp->getPostalCode();
             }
         }
     }
     $longWidth = 300;
     $shortWidth = 80;
     $streetname = new TextField('StreetName', _t('GeoMemberExtension.STREETNAME', 'Street Name'), $this->owner->StreetName);
     $streetname->setAttribute('placeholder', _t('GeoMemberExtension.STREETNAME', 'Street Name'));
     $streetname->setTitle('');
     $streetname->setAttribute('style', 'width:' . $longWidth . 'px');
     $streetnumber = new TextField('StreetNumber', _t('GeoMemberExtension.STREETNUMBER', 'Street Number'), $this->owner->StreetNumber);
     $streetnumber->setAttribute('placeholder', _t('GeoMemberExtension.STREETNUMBERPLACEHOLDER', 'N°'));
     $streetnumber->setTitle('');
     $streetnumber->setAttribute('style', 'width:' . $shortWidth . 'px');
     $fields->push($street = new FieldGroup($streetname, $streetnumber));
     $street->setTitle(_t('GeoMemberExtension.STREET', 'Street'));
     $street->setFieldHolderTemplate('AddressFieldHolder');
     $postalCodeClass = 'TextField';
     if (class_exists('PostCodeField')) {
         $postalCodeClass = 'PostCodeField';
     }
     $postcode = new $postalCodeClass('PostalCode', _t('GeoMemberExtension.POSTCODE', 'Postal Code'), $postalCodeValue);
     $postcode->setAttribute('placeholder', _t('GeoMemberExtension.POSTCODEPLACEHOLDER', 'Postcode'));
     $postcode->setTitle('');
     $postcode->setAttribute('style', 'width:' . $shortWidth . 'px');
     $locality = new TextField('Locality', _t('GeoMemberExtension.CITY', 'City'), $localityValue);
     $locality->setAttribute('placeholder', _t('GeoMemberExtension.CITY', 'City'));
     $locality->setTitle('');
     $locality->setAttribute('style', 'width:' . $longWidth . 'px');
     $fields->push($localitygroup = new FieldGroup($postcode, $locality));
     $localitygroup->setTitle(_t('GeoMemberExtension.LOCALITY', 'Locality'));
     $localitygroup->setFieldHolderTemplate('AddressFieldHolder');
     // Support some countries administrative areas
     if ($this->owner->CountryCode == 'FR') {
         $fields->push(new FrenchDepartmentField());
     }
     if ($this->owner->CountryCode == 'BE') {
         $fields->push(new BelgianProvinceField());
     }
     $label = _t('GeoMemberExtension.COUNTRY', 'Country');
     $fields->push($countrydd = new CountryDropdownField('CountryCode', _t('GeoMemberExtension.COUNTRY', 'Country'), self::getCountryList(), $countryCode));
     $countrydd->setEmptyString('');
     return $fields;
 }
 function MobileRegistrationForm($membership)
 {
     //Membership
     $membershipField = new HiddenField('MembershipType', null, $membership);
     // Name Set
     $FirstNameField = new TextField('FirstName', "First Name");
     $LastNameField = new TextField('Surname', "Last Name");
     // Country
     $label = _t('Addressable.COUNTRY', 'Country');
     $countryField = new CountryDropdownField('Country', $label);
     $countryField->setEmptyString('-- Select One --');
     $countryField->addExtraClass('chzn-select');
     // Email Addresses
     $PrimaryEmailField = new TextField('Email', "Primary Email Address");
     $fields = new FieldList($membershipField, $FirstNameField, $LastNameField, $countryField, new LiteralField('break', '<hr/>'), $PrimaryEmailField, new LiteralField('login_text', '<div class="login_lit"> You will use this to login. </div>'));
     $fields->push(new ConfirmedPasswordField('Password', 'Password'));
     $actions = new FieldList(new FormAction('doRegisterMobile', 'Complete Registration'));
     $validator = new Member_Validator('FirstName', 'Surname', 'Email', 'Country', 'Password');
     $form = new HoneyPotForm($this, 'MobileRegistrationForm', $fields, $actions, $validator);
     if ($data = Session::get("FormInfo.{$form->FormName()}.data")) {
         return $form->loadDataFrom($data);
     }
     return $form;
 }
Example #7
0
 function __construct($controller, $name)
 {
     // Name Set
     $FirstNameField = new TextField('FirstName', "First Name");
     $LastNameField = new TextField('Surname', "Last Name");
     // Email Addresses
     $PrimaryEmailField = new TextField('Email', "Primary Email Address");
     $SecondEmailField = new TextField('SecondEmail', "Second Email Address");
     $ThirdEmailField = new TextField('ThirdEmail', "Third Email Address");
     // Replace Fields
     $ReplaceBioField = new HiddenField('ReplaceBio', 'ReplaceBio', 0);
     $ReplaceNameField = new HiddenField('ReplaceName', 'ReplaceName', 0);
     $ReplaceSurnameField = new HiddenField('ReplaceSurname', 'ReplaceSurname', 0);
     // Shirt Size Field
     $ShirtSizeField = new DropdownField('ShirtSize', 'Choose A Shirt Size', array('Small' => "Men's Small", 'Medium' => "Men's Medium", 'Large' => "Men's Large", 'XL' => "Men's XL", 'XXL' => "Men's XXL", 'WS' => "Womens Small", 'WM' => "Womens Medium", 'WL' => "Womens Large", 'WXL' => "Womens XL", 'WXXL' => 'Womens XXL'));
     $affiliations = new FieldGroup(new HeaderField('Affiliations'), new LiteralField("add-affiliation", "<a class='roundedButton' id='add-affiliation' title='Add New Affiliation' href='#'>Add New Affiliation</a>"), new LiteralField("affiliations-container", "<div id='affiliations-container'></div>"));
     $StatementOfInterestField = new TextField('StatementOfInterest', 'Statement of Interest');
     $StatementOfInterestField->addExtraClass('autocompleteoff');
     // Photo
     $PhotoField = new CustomUploadField('Photo', 'Photo <em>(Optional)</em>');
     $PhotoField->setCanAttachExisting(false);
     $PhotoField->setAllowedMaxFileNumber(1);
     $PhotoField->setAllowedFileCategories('image');
     $PhotoField->setTemplateFileButtons('CustomUploadField_FrontEndFIleButtons');
     $PhotoField->setFolderName('profile-images');
     $sizeMB = 1;
     // 1 MB
     $size = $sizeMB * 1024 * 1024;
     // 1 MB in bytes
     $PhotoField->getValidator()->setAllowedMaxFileSize($size);
     $PhotoField->setCanPreviewFolder(false);
     // Don't show target filesystem folder on upload field
     // Biography
     $BioField = new TextAreaField('Bio', 'Bio: A Little Bit About You <em>(Optional)</em>', 10, 15);
     // Food Preference
     $FoodPreferenceField = new CheckboxSetField('FoodPreference', 'Do you have any food preferences we can help accomodate?', array('Vegan' => 'Vegan', 'Vegetarian' => 'Vegetarian', 'Gluten' => 'Gluten allergy', 'Peanut' => 'Peanut allergy'));
     // Other Field
     $OtherFoodField = new TextField('OtherFood', 'Other Food Considerations');
     $OtherFoodField->addExtraClass('other-field');
     // IRC and Twitter
     $IRCHandleField = new TextField('IRCHandle', 'IRC Handle <em>(Optional)</em>');
     $TwitterNameField = new TextField('TwitterName', 'Twitter Name <em>(Optional)</em>');
     $LinkedInProfileField = new TextField('LinkedInProfile', 'LinkedIn Profile <em>(Optional)</em>');
     // Associated Projects
     $ProjectsField = new CheckboxSetField('Projects', 'What programs are you involved with? <em>(Optional)</em>', array('Nova' => 'Compute', 'Swift' => 'Object Storage', 'Glance' => 'Image Service', 'Keystone' => 'Identity Service', 'Horizon' => 'Dashboard', 'Quantum' => 'Networking', 'Cinder' => 'Block Storage', 'Ceilometer' => 'Metering/Monitoring', 'Heat' => 'Orchestration', 'Trove' => 'Database Service', 'Ironic' => 'Bare Metal', 'Queue' => 'Queue Service', 'DataProcessing' => 'Data Processing', 'Oslo' => 'Common Libraries', 'Openstack-ci' => 'Infrastructure', 'Openstack-manuals' => 'Documentation', 'QA' => 'Quality Assurance', 'Deployment' => 'Deployment', 'DevStack' => 'DevStack', 'Release' => 'Release Cycle Management'));
     // Other Projects Field
     $OtherProjectField = new TextField('OtherProject', 'Other Project (if one above does not match)');
     $OtherProjectField->addExtraClass('other-field');
     //Newsletter Field
     $subscribedToNewsletterField = new CheckboxField('SubscribedToNewsletter', 'I don\'t mind occasionally receiving the OpenStack community newsletter.');
     $DisplayOnSiteField = new CheckboxField('DisplayOnSite', 'Include this bio on openstack.org.');
     // New Gender Field
     $GenderField = new OptionSetField('Gender', 'I identify my gender as:', array('Male' => 'Male', 'Female' => 'Female', 'Specify' => 'Let me specify', 'Prefer not to say' => 'Prefer not to say'));
     $GenderSpecifyField = new TextField('GenderSpecify', 'Specify your gender');
     $GenderSpecifyField->addExtraClass('hide');
     $fields = new FieldList(new LiteralField('header', '<h3 class="section-divider">Public Information</h3>'), new HeaderField("First & Last Name"), $FirstNameField, $LastNameField, $ReplaceBioField, $ReplaceNameField, $ReplaceSurnameField, new LiteralField('break', '<hr/>'), $affiliations, new HiddenField("Affiliations", "Affiliations", ""), new LiteralField('instructions', '<p>For our purposes, an affiliation is defined as any company where you are an officer, director or employee, or any person or company that has paid you more than $60,000 USD as an independent contractor in the last 12 months. Please list all affiliations which meet this criteria. If you\'re not being paid to work on OpenStack please put "Unaffiliated".</p>'), new LiteralField('break', '<hr/>'), $StatementOfInterestField, new LiteralField('instructions', '<p>Your statement of interest should be a few words describing your objectives or plans for OpenStack.</p>'), new LiteralField('break', '<hr/>'), $IRCHandleField, $TwitterNameField, $LinkedInProfileField, $BioField, $PhotoField, new LiteralField('break', '<hr/>'), $ProjectsField, $OtherProjectField, new LiteralField('header', '<h3 class="section-divider">Private Information</h3>'), new HeaderField("Email Addresses"), new LiteralField('instructions', '<p class="info"><strong>If you\'re an active developer on the OpenStack project, please list any email addresses you use to commit code.</strong> (This will really help us avoid duplicates!) If you contributed code ONLY using gerrit, all email addresses you used will be listed on the <a href="https://review.openstack.org/#/settings/web-identities" target="_blank">web identities page</a>. If you have contributed also <em>before</em> gerrit was put in place, please make an effort to remember other email addresses you may have used. Interested in how to <a href="http://wiki.openstack.org/HowToContribute" target="_blank">become a contributor</a>?</p>'), $PrimaryEmailField, new LiteralField('instructions', '<p class="info">This email address is also the account name you use to login.</p>'), $SecondEmailField, $ThirdEmailField, new LiteralField('break', '<hr/>'), $GenderField, $GenderSpecifyField, new LiteralField('instructions', '<p>It\'s perfectly acceptable if you choose not to tell us: we appreciate you becoming a member of OpenStack Foundation. The information will remain private and only used to monitor our effort to improve gender diversity in our community.</p>'), new LiteralField('break', '<hr/>'), $FoodPreferenceField, $OtherFoodField, new LiteralField('break', '<hr/>'), $ShirtSizeField, $subscribedToNewsletterField, $DisplayOnSiteField, new LiteralField('break', '<hr/>'), new TextField('Address', _t('Addressable.ADDRESS', 'Street Address (Line1)')), new TextField('Suburb', _t('Addressable.SUBURB', 'Street Address (Line2)')), new TextField('City', _t('Addressable.CITY', 'City')));
     // Address Continued
     $label = _t('Addressable.STATE', 'State');
     if (is_array($this->allowedStates)) {
         $fields->push(new DropdownField('State', $label, $this->allowedStates));
     } elseif (!is_string($this->allowedStates)) {
         $fields->push(new TextField('State', $label));
     }
     $fields->push(new TextField('Postcode', _t('Addressable.POSTCODE', 'Postcode')));
     $label = _t('Addressable.COUNTRY', 'Country');
     if (is_array($this->allowedCountries)) {
         $countryField = new DropdownField('Country', $label, $this->allowedCountries);
         $countryField->setEmptyString('-- Select One --');
         $fields->push($countryField);
     } elseif (!is_string($this->allowedCountries)) {
         $countryField = new CountryDropdownField('Country', $label);
         $countryField->setEmptyString('-- Select One --');
         $fields->push($countryField);
     }
     $fields->push(new LiteralField('break', '<hr/>'));
     $fields->push(new LiteralField('changepassword', '<a href="/Security/changepassword">Click here to change your password</a>'));
     // Create action
     $actions = new FieldList(new FormAction('SaveProfile', 'Save'));
     // Create validators
     $validator = new ConditionalAndValidationRule(array(new HtmlPurifierRequiredValidator('FirstName', 'Surname', 'StatementOfInterest', 'Address', 'City'), new RequiredFields('Email', 'Country')));
     parent::__construct($controller, $name, $fields, $actions, $validator);
 }
 public function getCountriesDDL($id = "add-datacenter-location-country")
 {
     $ddl = new CountryDropdownField($id, 'Country');
     $ddl->setEmptyString('-- select a country --');
     $ddl->addExtraClass('add-control');
     $ddl->addExtraClass('countries-ddl');
     return $ddl;
 }
 public function getCountriesDDL()
 {
     $ddl = new CountryDropdownField('country', 'country');
     $ddl->setEmptyString('-- select a country --');
     $ddl->addExtraClass('add-control');
     $ddl->addExtraClass('countries-ddl');
     return $ddl;
 }