338 Commits

Author SHA1 Message Date
Jamie Pratt
faaf80fadb MDL-40176 mock_submit method for testing 2013-07-09 15:07:36 +08:00
Sam Hemelryk
615a5aa6f1 Merge branch 'MDL-39280-master-int' of git://github.com/FMCorz/moodle 2013-06-24 14:19:20 +12:00
Sam Hemelryk
80b3780a53 Revert "MDL-38555 forms: Prevent same data submission multiple times."
This reverts commit 761670208a97c0ed7e1ff7c2e6a7ec5494eb93d3.
2013-06-19 13:45:46 +12:00
Ruslan Kabalin
761670208a MDL-38555 forms: Prevent same data submission multiple times.
This disables Submit button when the form has been submitted to
prevent consequent submissions before the page has been loaded.
2013-06-12 15:19:47 +01:00
Frederic Massart
188c04b0a8 MDL-39579 form: Type can be set on repeated elements in a group 2013-05-10 12:05:43 +08:00
Frederic Massart
58f3865fce MDL-39280 form: Multiple select support disabledIf with multiple values 2013-05-10 09:33:46 +08:00
Frederic Massart
d5909fd144 MDL-38885 form: Fix comments and stricter unit test 2013-05-10 08:34:59 +08:00
Frederic Massart
8a9c3f4951 MDL-38885 form: Advanced type checking on special elements 2013-05-10 08:17:40 +08:00
Frederic Massart
3c0ba94e87 MDL-38885 form: Recursively clean parameters based on right type 2013-05-10 08:17:40 +08:00
Frederic Massart
87c1c82286 MDL-38716 accessibility: ARIA attributes and roles defined on form actions 2013-04-15 11:46:05 +08:00
Eloy Lafuente (stronk7)
577173a51f Merge branch 'MDL-38897-master' of git://github.com/danpoltawski/moodle 2013-04-05 03:21:52 +02:00
Dan Poltawski
48056d5459 MDL-38885 - don't test for setType in display() itself
Doing it in _process_submission is enough.
2013-04-04 14:58:14 +08:00
Dan Poltawski
dc4260d918 Merge branch 'MDL-38681-master-int' of git://github.com/FMCorz/moodle 2013-04-03 14:27:08 +08:00
Dan Poltawski
15c2b2c43a Merge branch 'MDL-26956' of git://github.com/timhunt/moodle 2013-04-02 19:49:02 +08:00
sam marshall
d953b18495 MDL-26956 (2) Forms: Function to render form to string
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.
2013-03-28 10:46:33 +00:00
Frederic Massart
a4b076d51b MDL-38681 form: Changed collapse/expand button to a link 2013-03-28 10:18:58 +08:00
Frederic Massart
90a7e556af MDL-38455 form: More consistency in section states
- 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.
2013-03-28 10:03:33 +08:00
Eloy Lafuente (stronk7)
caa30cd625 MDL-38719 forms: detectMissingSetType() handle of repetitions.
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.
2013-03-26 13:28:47 +01:00
Damyon Wiese
8af0dffb50 Merge branch 'MDL-34311-master' of git://github.com/danpoltawski/moodle
Conflicts:
	course/moodleform_mod.php
	lib/upgrade.txt
2013-03-26 13:46:29 +08:00
Dan Poltawski
b45ba7f6fa MDL-34311 formslib: warn when no param type set
Params without a type set will not be getting cleaned, so if developers
really do not want cleaning, they should set it explicitly.
2013-03-25 09:30:51 +08:00
Frederic Massart
f2c0aba81d MDL-38044 form: Added collapse/expand all buttons 2013-03-22 16:25:48 +08:00
Damyon Wiese
976b0ff2d4 Merge branch 'MDL-37959-master' of git://github.com/FMCorz/moodle
Conflicts:
	lib/formslib.php
2013-03-19 14:54:40 +08:00
Damyon Wiese
7c211f565a Merge branch 'MDL-38005-master' of git://github.com/FMCorz/moodle 2013-03-18 13:45:41 +08:00
Frederic Massart
807cf3d0ae MDL-38005 form: Headers have a proper name 2013-03-15 11:06:25 +08:00
Frederic Massart
9ec532bef5 MDL-37959 form: Aria attribute set on collapsible sections 2013-03-13 11:14:20 +08:00
Frederic Massart
41068d989b MDL-38340 form: Last fieldset is collapsed by default 2013-03-12 16:19:17 +08:00
Frederic Massart
f160f97c12 MDL-38435 form: Sections can be expanded by default 2013-03-12 16:18:07 +08:00
Tim Hunt
d23edcf151 MDL-37932 formslib: setAdvanced for repeatelements.
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.
2013-03-01 11:41:59 +00:00
Damyon Wiese
2262c52122 Merge branch 'MDL-37012-master' of git://github.com/mouneyrac/moodle 2013-02-12 14:39:20 +08:00
Damyon Wiese
8dcca4aacb MDL-30637 Formslib - Cleanup for shortforms implementation (mostly comments)
Also added deprecated functions for the functions that were removed from MoodleQuickForm.
2013-02-11 10:37:13 +08:00
Ruslan Kabalin
ac5e6ca4d1 MDL-30637 Refactor Advanced fileds functionality
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
2013-02-07 14:38:37 +00:00
Ruslan Kabalin
a4067bfc48 MDL-30637 Simplify moodle forms
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');
2013-02-07 14:13:36 +00:00
Jerome Mouneyrac
46b229f9a8 MDL-37012-master redesign the community finder search form 2013-02-04 11:17:02 +08:00
Sam Hemelryk
1b4e47e43a Merge branch 'MDL-36433-master' of git://github.com/itamart/moodle 2012-12-10 12:13:32 +13:00
Tim Hunt
5f137dcbe2 MDL-36760 formslib: fix frozen elements with [] in name.
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.
2012-11-23 10:53:14 +00:00
Frederic Massart
510ccc5521 MDL-36564 usability: Repositioned help/info icon 2012-11-19 10:03:50 +08:00
Itamar Tzadok
ed608e7ad4 MDL-36433 Forms lib - Added dash escaping to validation script getter. 2012-11-14 01:03:14 -05:00
Frederic Massart
15396bba9b MDL-35171 Forms: Date selector always gets UTF-8 strings 2012-10-15 09:46:02 +08:00
Tim Hunt
6b65e50bcb MDL-35395 formslib: a method to disable formchangechecker for a form. 2012-10-05 17:44:21 +01:00
Frederic Massart
28c7749fc7 MDL-30909 Forms: Custom ID can be set on a form 2012-09-17 09:46:31 +08:00
Eloy Lafuente (stronk7)
c0d716d7b9 Merge branch 'MDL-35171' of git://github.com/merrill-oakland/moodle 2012-09-11 02:44:30 +02:00
Adrian Greeve
8e73fbf5aa MDL-32785 - lib - Ignorning hard frozen fields when submitting data. 2012-09-10 11:12:10 +08:00
Eric Merrill
1bae1fe522 MDL-35171 formslib Updating date config array to fix problems with month jumping.
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).
2012-09-01 10:11:24 -04:00
Aparup Banerjee
f597dcc008 MDL-34708 Forms library : Fixed incorrect calendar day displayed across timezones. Credit to Matthew Davidson and team at rose-hulman.edu. 2012-08-05 23:27:31 +08:00
Adrian Greeve
b0c6dc1cac MDL-34465 - lib - Replacing get_context_instance with context_XXXX::instance (group 8) 2012-07-27 10:10:46 +08:00
Aparup Banerjee
821fbfe4f5 Merge branch 'wip-mdl-31294' of git://github.com/rajeshtaneja/moodle 2012-07-24 16:57:58 +08:00
Rajesh Taneja
c277b502ab MDL-31294 Forms Library: Removed deprecated functions from forms library 2012-07-24 15:09:39 +08:00
Dan Poltawski
b7db7803bc Merge branch 'w30_MDL-34299_m24_html5' of git://github.com/skodak/moodle
Conflicts:
	lib/db/upgrade.php
	version.php
2012-07-24 14:07:26 +08:00
Sam Hemelryk
87608b34f4 Merge branch 'MDL-33927_enforce_max_attachments' of git://github.com/davosmith/moodle 2012-07-23 12:00:30 +12:00
Petr Škoda
13725b3797 MDL-34299 remove xmlstrictheaders setting and switch to html5 doctype by default
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.
2012-07-21 19:23:44 +02:00