function OnPreRender() { require_once 'xhtml/forms/form-part.class.php'; require_once 'xhtml/forms/textbox.class.php'; # add lines $o_saon_box = new TextBox('saon', $this->o_data_object->GetSaon()); $o_saon_box->AddAttribute('maxlength', 250); $o_saon = new FormPart('Address within building', $o_saon_box); $this->AddControl($o_saon); $o_line1_box = new TextBox('paon', $this->o_data_object->GetPaon()); $o_line1_box->AddAttribute('maxlength', 250); $o_line1 = new FormPart('Building name or number', $o_line1_box); $this->AddControl($o_line1); $o_line2_box = new TextBox('streetDescriptor', $this->o_data_object->GetStreetDescriptor()); $o_line2_box->AddAttribute('maxlength', 250); $o_line2 = new FormPart('Street name', $o_line2_box); $this->AddControl($o_line2); $o_line3_box = new TextBox('locality', $this->o_data_object->GetLocality()); $o_line3_box->AddAttribute('maxlength', 250); $o_line3 = new FormPart('Village or part of town', $o_line3_box); $this->AddControl($o_line3); # add town $o_town_box = new TextBox('town', $this->o_data_object->GetTown()); $o_town_box->AddAttribute('maxlength', 100); $o_town = new FormPart('Town', $o_town_box); $this->AddControl($o_town); # add county $o_county_box = new TextBox('county', $this->o_data_object->GetAdministrativeArea()); $o_county_box->AddAttribute('maxlength', 100); $o_county = new FormPart('County', $o_county_box); $this->AddControl($o_county); # add postcode $o_postcode_box = new TextBox('postcode', $this->o_data_object->GetPostcode()); $o_postcode_box->AddAttribute('maxlength', 8); $o_postcode = new FormPart('Postcode', $o_postcode_box); $this->AddControl($o_postcode); # add geolocation $o_lat_box = new TextBox('lat', $this->o_data_object->GetLatitude()); $o_lat_box->SetMaxLength(20); $o_lat = new FormPart('Latitude', $o_lat_box); $this->AddControl($o_lat); $o_long_box = new TextBox('long', $this->o_data_object->GetLongitude()); $o_long_box->SetMaxLength(20); $o_long = new FormPart('Longitude', $o_long_box); $this->AddControl($o_long); $o_precision = new XhtmlSelect('geoprecision'); $o_precision->AddControl(new XhtmlOption("Don't know", '')); $o_precision->AddControl(new XhtmlOption('Exact', GeoPrecision::Exact())); $o_precision->AddControl(new XhtmlOption('Postcode', GeoPrecision::Postcode())); $o_precision->AddControl(new XhtmlOption('Street', GeoPrecision::StreetDescriptor())); $o_precision->AddControl(new XhtmlOption('Town', GeoPrecision::Town())); $o_precision->SelectOption($this->o_data_object->GetGeoPrecision()); $o_precision_part = new FormPart('How accurate is lat/long?', $o_precision); $this->AddControl($o_precision_part); $o_map = new XhtmlElement('div'); $o_map->SetXhtmlId('map'); $o_map->SetCssClass('formControl'); $o_map_container = new XhtmlElement('div', $o_map); $o_map_container->SetCssClass('formPart'); $this->AddControl($o_map_container); }