Previously it was only possible to display the form immediately as
HTML output. You had to wrap in an output buffer in order to put
it in a renderer. This new function does the output buffer for you.
- A short form of 2 sections has collapsible sections;
- The second section is expanded by default if the form has 2 sections;
- The collapsed state by setExpanded can override the state in which
the section was when it was submitted by the user;
- A header containing a required field or one that has an error
will never be collapsed.
It seems that formslib, for repetition, relies in the type
especified by the main (non existent at the end) element, instead
of assingning a type to each repetition.
Surely a result of storing types apart from elements. :-(
With the patch, detectMissingSetType() will detect
repeated elements (name containing '[') and will
perform the verification against that main element type.
I think this commit also fixes some other problems with repeatelements
and shortforms. The shortforms code was trying to use hidden elements
with names like in conjunction with ...[0] with optional_param which
will not work. Hidden form fields that relate to other parts of the form
must use the other elements's id, no name, to make the hidden field
name.
The displaying of advanced items has been refactored. The changes are:
* The Advanced button is replaced by the Show Less/More link
* The Show less/more link controls advanced elements only within the section
it is located at
* The Show less/more state of sections is preserved between form submissions
* When javascript is off, all advanced elements will be displayed by default,
no show/hide controls will exists on the page
Make the forms easier to use and navigate by adding functionality to
collapse and extend form sections (headers). The logic is as follows:
If form contains 2 and less sections (headers):
* Display the form as non-collapsible at all.
* The point above can be overridden if developer marks the section as expanded
in form definition (e.g. $mform->setExpanded('foo'));
If form contains 3 and more sections (headers):
* always expanding the first section and closing all others by default;
* always expanding a section containing at least one "required" element;
* expanding any section which contains validation errors after submission;
* expanding any section which was previously open on previous submit (e.g. when
adding new choices);
* expanding the section which is marked as expanded in form definition (e.g.
$mform->setExpanded('foo');
This was a regression caused by MDL-30845 or, to be precise, the related
issue MDL-32785.
Form elements with names like multipier[0] require special handling,
such as is present in HTML_QuickForm_element::_prepareValue. I have
added equivalent handling to MoodleQuickForm::exportValues. I am afraid
that I could not think of a way to do this reliably without duplicating
code.
Based on https://bugs.php.net/bug.php?id=49115, if you request a month, but do not
specify a date, it will use your current date, which may be beyon a date in the month
requested, causing the return of the next month. This patch specifies the date (1st).
This fixes WCAG 2.0 compliance because we were already using HTML5 markup.
The strict XML headers setting never worked for production servers, developers
used browser validators for compliance testing. XHTML 5 option is relatively
similar to this obsolete option, but still it can not be used on production servers.
XHTML Strict 1.x was a standardised dead end, HTML5 is the new de-facto-standard
supported by all major browsers including latest versions of IE.
Please note nothing changes in our coding style because HTML5 is a superset of
several previous standards, it is recommended to use only features that are
already implemented in all our supported browsers.