* Brandon Harris bharris@wikimedia.org [Wed, 09 Mar 2011 16:33:59 -0800]:
One of my goals for the year at the Foundation is "Development of a MediaWiki Style Guide." To that end, I have completed the first draft of one section, focused on Forms and Form elements.
This project has multiple goals:
- To create consistency across various interfaces
- To help modernize the MediaWiki interface
- To make the overall user experience more enjoyable
- To make writing user interfaces easier for developers
In a perfect world, MediaWiki would have a standardized User Interface library where a developer can simply say something like
$myInput = UIElements::getTextInput( type => 'text' name => 'elementname', label => 'The Label', helptext => 'Help text string', hint => 'Default value', instructions => 'Instructions string', errorconditions => array(blah blah
blah)
);
And have that do the needful, knowing how to display itself
and
handle errors for itself.
We don't live in a perfect world, but we can start to get
there.
Here is the first draft. Attack at leisure, and feel free to ignore my pathetic mewlings as you cut my soul from my bones.
http://www.mediawiki.org/wiki/StyleGuide/Forms
I'm going to expand this further (with things like "tables"
and
such) but for now this is a start.
You can comment here or on the talk page.
These should use more powerful Xml class, which would not just "linearly" generate inputs but also would allow to build a tree of them and to get / manipulate their nodes and attributes on demand. Arrays are a possible choice, however one might try SPL / SimpleXML / SimpleXMLIterator for that. Gluing output pieces together with concatenations is not nice for large nested output (tags "autoclosing" vs "do not forget to close all your tags manually"). Dmitriy