public function __construct() { parent::__construct('formEditVenue', 'Edit Venue'); $venue = $this->getVenue(); if (Session::getUser()->getData('organization') != $venue['organizer']) { Session::requirePriv('EDIT_VENUE'); } $this->addElement(Element::factory('hidden', 'id', null, $venue['id'])); $this->addElement(Element::factory('text', 'title', 'Title', $venue['title'])); $this->addElement(Element::factory('text', 'lat', 'Lat', $venue['lat'])); $this->getElement('lat')->setMinMaxLengths(1, 10); $this->addElement(Element::factory('text', 'lng', 'Lng', $venue['lng'])); $this->getElement('lng')->setMinMaxLengths(1, 10); $this->addElement(FormHelpers::getElementCountry($venue['country'])); $this->addElement(FormHelpers::getOrganizerList()); $this->getElement('organizer')->setValue($venue['organizer']); $this->addButtons(Form::BTN_SUBMIT); }
public function __construct() { parent::__construct('newVenue', 'New Venue'); $this->addElement(Element::factory('html', 'desc', null, 'A venue is a physical place where an event will be hosted, this may be a convention centre, a hall or just your house. You can specify detail such as sleeping arangements when the event is created.')); $this->addElement(Element::factory('text', 'title', 'Title', null, 'eg: Budleigh Salterton town hall, Cheltenham Racecourse, etc.')); $this->addElement(FormHelpers::getElementCountry('United Kingdom')); $this->addElement(Element::factory('html', 'locationDesc', null, '<br />The geodetic (WGS84) latitude/longitude of your venue. This can be awkward, but it allows us to put a pin on the map. We cannot use post/zip codes because many countries do not have them! <a href = "http://www.getlatlon.com/">http://getlatlong.com</a> will convert an address to a rough lat/lng. ')); $this->addElement(Element::factory('numeric', 'lat', 'Latitude'))->setAllowNegative(true); $this->addElement(Element::factory('numeric', 'lng', 'Longitude'))->setAllowNegative(true); if (Session::hasPriv('NEW_VENUE')) { $this->addElement(FormHelpers::getOrganizerList()); if (isset($_REQUEST['formNewVenue-organizer'])) { $this->getElement('organizer')->setValue($_REQUEST['formNewVenue-organizer']); } } $this->addButtons(Form::BTN_SUBMIT); $this->requireFields(array('title', 'lat', 'lng', 'country')); }