Hi everyone,
Version 1.2 of Semantic Forms has been released. This is a fairly big version: by far the most important change is that form-based file uploading is now possible. All you have to do is add the new parameter "uploadable" to a field declaration within a form definition, and in the form, a link named "Upload file" (in the user's language) will appear next to the entry. This link will pop up a "lightbox"-style window that lets the user upload a file, and then, when they're done, automatically inserts the name of that file into the text entry. You can see a demo here, in my nonsense testing form:
http://discoursedb.org/wiki/Special:AddData/Fields_test/Some_new_pageClick on "Upload file" near the "Image" field (feel free to upload an image, if you want to). This feature uses the fantastic open-source Floatbox Javascript library, written by Byron McGregor, which handles all of the popup functionality. I also have to give a big thanks to the development team at Chickipedia, who came up with both the concept and implementation for how file upload could work in SF; I'm essentially just using their PHP code. While I'm giving thanks, I should note both of the predecessors to the Floatbox library: Lightbox, created by Lokesh Dhakar, and Lytebox, created by Markus F. Hay; my understanding is that Floatbox couldn't have been created without the important contributions of these two previous libraries.
And, actually, the thanks wouldn't be complete if I didn't thank all of you on this list who have been whining about this feature for nearly a year now. If it hadn't been for the frequent questions and complaints, I don't think I ever would have been motivated enough to look into file uploading through forms; I didn't even really think it was possible in the first place. And now that it's here, I have to admit that I really like the feature - it's brought Semantic Forms a big step closer to being the sought-after complete solution. So, keep up the good work. :)
Other changes and additions in this version:
- There's a new parser function: 'arraymaptemplate'. This is
very similar to the existing 'arraymap' function, which does a mapping
onto a delimited string; except that, instead of the mapping being
defined right in the function call, this function takes in a template,
and applies that template onto each value in the string. It's intended
for mappings that are more complex or involved than can be done in
'arraymap'. See the documentation for how exactly it's called. Thanks to Sergey Chernyshev for this new parser function.
- There were also some minor improvements made to handling of the 'arraymap' function; thanks again to Sergey for that.
- A fix was made in the handling of timestamps, so that trying to save a page that was modified by someone else after the user started editing with a form now leads to a warning message.
- Another new parameter for fields has been added: "autocomplete on property=". This lets you set autocompletion to use a different semantic property than the one the field is attached to (or set a new one, if the field doesn't correspond to a semantic property).
- Also, the parameter "autocomplete on=" has been renamed to "autocomplete on category=", for consistency with "autocomplete on namespace=" and the new "autocomplete on property=". "autocomplete on=" will still work, for backwards compatibility.
- Similarly, disabling autocompletion for a field, which before was done by adding "autocomplete on=" with a blank value, is now done through another new parameter, "no autocomplete". Again, the old version will still work, for backwards compatibility.
- The parameter "maxlength=" has also been added for fields; it sets the "maxlength" HTML property for text inputs.
- Finally, language support was added for Ripuarian.
-Yaron