Entries Tagged 'Quests/FormProcessor' ↓
May 10th, 2005 — Quests/FormProcessor
OK, I’ve put up “a tarball of the FormProcessor code”:http://peter.mapledesign.co.uk/quests/formprocessor/FormProcessor.tar.gz as it stands on my hard drive.
First some disclaimers: there is no documentation to speak of, and I haven’t the foggiest idea what status this code is. I’ve released it again because people keep on emailing me for it
Use at your own risk etc.
When the SVN hosting disappeared I lost the changelog, so what stat this code is in I don’t know. If it doesn’t work let me know, or if you find bugs.
Development’s currently halted due to other interestes and a lack of time. I have plenty of ideas for it and know where I want the code to go, and plan to continue with it at some point. I think a similar idea would also be a great addition to “Rails”:http://www.rubyonrails.com! I envisage changing the rendering pipeline of the script to make it smoother… watch this space (for documents on proposed changes, if not code).
If anyone has SVN hosting they can donate that would be fantastic.
August 2nd, 2004 — Quests/FormProcessor
I’ve been working further on FormProcessor’s “Frontend”:http://svn.mapledesign.co.uk/svn/FormProcessor/Frontend/ recently and got a nice working demo going (but it’s broken again now :)). The majority of the code has been done by hacking one of “PPK’s”:http://www.quirksmode.org/ demonstrations.
Thing is, I can’t fix the latest bug (@this.parentNode.parentNode.getElementById(fields[i]).style.display = ‘block’@ doesn’t want to work - see function @showValueFields@ in “the source code”:http://svn.mapledesign.co.uk/svn/FormProcessor/Frontend/templates/create_rules.php). I also can’t figure out how to prepopulate rulesets - if I have a PHP array, how the heck do I get the data from it into the form to start with?
I’m starting to wish I’d written the whole thing in PHP and reloaded the page whenever a rule was added/removed, although this seems a really inefficient way.
Is there anyone in the community who would help me? I imagine for someone who understands Javascript it would not be difficult.
July 24th, 2004 — Quests/FormProcessor
The latest version of FormProcessor is now available through my new Subversion repository:
“http://svn.mapledesign.co.uk/svn/FormProcessor/”:http://svn.mapledesign.co.uk/svn/FormProcessor/
This repository allows anonymous checkouts, to get the code you’ll need a “Subversion client”:http://subversion.tigris.org/project_links.html - I use “TortoiseSVN”:http://www.tortoisesvn.org/ on Windows.
May 15th, 2004 — Quests/FormProcessor
As my RSS manager gets towards the stage of needing an interface, I’ve been looking again at the FormProcessor code. I’m writing forms for adding/editing feeds, filters etc[1] and seeing that the form is the same for each task, I don’t want to duplicate it.
So how do I handle having one button saying “Add X”, while after editing it says “Save Changes” and needs the item’s database ID embedded in the form in a hidden input?
On the “previous site”:http://www.daystarvillas.com I built using FormProcessor I was using the “Smarty”:http://smarty.php.net template engine, and so I used this to swap in/out the buttons on the form. But should this need a template engine, or shoud it be built into FormProcessor?
More importantly, is there a smarter way to do this?
I have thought about having language strings defined somewhere and just switching this, but sometimes I find during sign-up I need to have Next/Prev buttons instead of just Submit, so this doesn’t cut it.
fn1. Yeah, maybe for this task the forms should be generated by PHP from the database structure. But that doesn’t give me total flexibility over the layout 
December 29th, 2003 — Quests/FormProcessor
I’ve uploaded the “latest code”:http://peter.mapledesign.co.uk/quests/formprocessor/FormProcessor.tar.bz2 for any of you who are using FormProcessor. This release supports array named fields and multiple selects. Plus there’s a new example and a very small amount of documentation.
No unit tests yet though…
Oh, and you won’t be bale to just unzip this release with Winzip as it’s bzipped to reduce bandwidth usage.
November 26th, 2003 — Quests/FormProcessor
Having spent the past 8 weeks not doing any programming (and 6 of those weeks without an Internet connection) I’ve reached the stage where I *want* to do some again. I also want/need to get FormProcessor finished.
The first thing that needs doing for FormProcessor is unit tests. I have done most of the work to convert Formprocessor to handling fields with @[]@ or @[foobar]@ in their names, but I think its broken and buggy in one or two places.
“SimpleTest”:http://www.lastcraft.com/simple_test.php seems to be the library everyone talks about in PHP.
Is there anyone with experience of writing unit tests who is willing to help? I have no idea how to approach them for a script such as FormProcessor with so much HTML being generated, yet I know that they (or some other automated testing mechanism) is absolutely necessary.
September 21st, 2003 — Quests/FormProcessor
Well, after many more hours of work than I care to remember, FormProcessor has basic handling of arrays (i.e. form fields with names like @field[]@). Only the ability to fill in fields is currently present; validation won’t work. Also, I’ve not tested this with any type of form extensively, so something may well be broken.
Having issued the warnings, you can get the code and my basic test suite @ “http://peter.mapledesign.co.uk/quests/formprocessor/code/array_capable/”:http://peter.mapledesign.co.uk/quests/formprocessor/code/array_capable/
I’m hoping it’s not _too_ much slower than the original - there’s certainly a lot more code present, and many more method calls (wherever it used to look in @$this->data@ for a value it now calls @$this->_get_data()@ instead) so I do expect a slow-down. It’ll be interesting to benchmark it (or see some benchmarks if someone else does them )
I started hacking the code to do this as someone was going to pay me to improve “sendcard”:http://www.sendcard.org/ using it. Now they’ve decided they can’t afford to, so I’m left with a half-finished piece of code. Which I’m sure will be useful once it’s finished 
September 19th, 2003 — Quests/FormProcessor
As I haven’t heard anything from Daniel about CVS, I’ve uploaded the FormProcessor code to my hosting The latest version is 0.4, you can find the code at “http://peter.mapledesign.co.uk/quests/formprocessor/code/”:http://peter.mapledesign.co.uk/quests/formprocessor/code/.
I’ve uploaded a basic example, from the current project I’m working on. It might not work, but should give you an idea as to how to write a script using FormProcessor.
What’s the next job? To make FormProcessor work with field names such at @foo[]@ without drastically slowing down the script.
September 9th, 2003 — Quests/FormProcessor
I thought it overdue that an update should be posted, enlightening you, dear reader, as to the progress of this library.
*The good news:* FormProcessor now resides in CVS!
*The bad news:* Anonymous access isn’t working, and I’ve not been able to get “Horde”:http://www.horde.org and “Chora”:http://www.horde.org/chora installed or configured properly. So I can use the CVS, and no-one else can at the moment.
I’m using FormProcessor in production, and it’s performing remarkably well. I’ve added a method or two and made a few changes since I last posted.
I’ll keep you posted as soon as anything positive happens. Currently I’m really busy, so don’t have the time to configure Chora, or post the Formprocessor code on this site.
Back to work again 
August 26th, 2003 — Quests/FormProcessor
One change I’ve made today, which is a hack (but I can’t think how to do it better) is to change the first line of @function validate@ from:
@if (!$_POST) {@
to
@if (!$_POST || $GLOBALS['FORMPROCESSOR_NO_PROCESS'] == 1) {@
I had to do this because I was writing a login interface which doesn’t work by redirection, and after POSTing to the login form and being authorised, the next form that was shown was being validated straight off, due to the POST of the login data (make sense?).
I’ve no doubt this will cause problems somewhere down the line. If anyone’s thought out how to cure this better then please let me know 