KeyboardCowboy/perseus — pull request #1 by ShaunLawsNREL (2013-10-25 23:05:56+00:00)
Title: 3.x dev

Hey Chris,

Seems like I've reached a good point to put in this pull request. A few comments about what I've done:

1) This repo includes the site-specific files - page templates (top.inc, bottom.inc), page processing/content (index.php, registrants.php, processing.php), registration form and installer classes (classes/RegistrationForm/RegistrationForm.class.php, classes/RegistrationSystemInstaller/RegistrationSystemInstaller.class.php), settings files (settings/perseus.php, settings/settings.php) and css (registration.css ). I will work on separate these out into their own repo.

2) I added the capability to mark Form fields as required. They are marked with the hard-code * . It would be nice to make this a bit more versatile, so that the way in which the field is marked as required can be configure or overridden, but it's a start.

3) I had to tweak the form element weighting system to make it work. There are @todo/comments in RegistrationForm::createNameInput and Form::render that explain the issue.

4) I added element templates and build functions for hidden, input and text area form elements and for HTML markup. As you noted elsewhere, the HTML markup templates/build functions should be moved out of the Form class to somewhere more generic.

5) I added the port number into mysqli_connect - I use Acquia Dev Desktop locally, which connects via 33066, so needed to explictly use that port. Since I've now moved the code to CD2, I set that back to 3306. I'll work on allowing the port to be set to something other than the default of 3306 in the settings file.

6) I had fatal error with krumo() being redefined - I'm not sure if it's the correct solution, but putting include_once on the krumo class file fixed that.

7) I also had fatals using the System::db() because the db connection wasn't being saved in the db data member. I added some save code to do that when calling System::newService('db').

8) I added some functions to return arrays of US states, Canadian provinces and the ISO country list. For want of a better place to put them, they ended up in includes/util.inc.

Anyway, I hope some of this is useful. Feel free to pull in what you want and refactor (or make suggestions on how I can refactor) the code.