850 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
8c9eecdea7 Merge branch 'MDL-60682' of git://github.com/timhunt/moodle 2017-11-28 20:37:59 +01:00
Tim Hunt
223419d92c MDL-60682 forms: date/times should use step 1 minute by default 2017-11-21 14:50:28 +00:00
Damyon Wiese
fda2fa2680 MDL-60526 forms: Prevent duplicate type attributes
The exporter for mform elements does not skip "type" (which is included as a separate value).
2017-11-15 11:53:56 +08:00
Simey Lameze
3c2b703e00 MDL-59686 form: fix autosave support for editor field 2017-10-26 09:03:31 +08:00
Eloy Lafuente (stronk7)
b3f41c084d MDL-60485 modgrade: Change string expectation in related test 2017-10-20 18:57:31 +02:00
Adrian Greeve
749af21bd4 MDL-60485 modgrade: Update to mod settings form.
The message for changing the max grade in the module form
was inaccurate for modules that can not rescale.
2017-10-19 10:42:02 +08:00
Jun Pataleta
d63c2d35ec Merge branch 'MDL-60205_group_hiding_clean' of git://github.com/davosmith/moodle 2017-10-10 11:08:06 +08:00
Andrew Nicols
9f2bb19a47 Merge branch 'MDL-60012_form_neq_regression' of git://github.com/davosmith/moodle 2017-10-09 10:13:30 +08:00
Davo Smith
c377d07f26 MDL-60205 form: fix hiding of elements within groups with theme_clean 2017-10-03 09:10:56 +01:00
Davo Smith
b67f3bc693 MDL-60012 form: improve clarity of elementsByName code 2017-10-03 09:09:09 +01:00
Jake Dallimore
b8c31dfe6d MDL-59507 forms: unit tests confirming that .xxx is an invalid extension
Modified:
- test_data_for_browser()
- test_unknow_file_types()
2017-09-18 09:03:00 +08:00
Jake Dallimore
405cbc09ba MDL-59507 forms: accepted file types won't allow the .xxx extension
- Modified get_filetypes_browser_data() to exclude this extension.
- Server side form validation blocks this extension too.
2017-09-18 09:03:00 +08:00
Davo Smith
8cab0a2571 MDL-60012 form: fix 'neq' disabledif regression 2017-09-14 16:28:53 +01:00
Marina Glancy
032674eebc MDL-59775 forms: add femptylabel class to els without labels
This class was present in clean/more but was forgotted in boost
2017-09-11 10:33:48 +08:00
Eloy Lafuente (stronk7)
a4cdbff86c MDL-59713 forms: prevent php warning when 'optional' option is missing 2017-08-29 20:12:41 +02:00
Damyon Wiese
26c4d2bf79 MDL-59628 forms: Get a valid zindex for datepicker
We have a way to determine a valid zindex when adding things to a page. Find all the moodle-has-zindex things and
choose a value bigger all of them. This needs doing in javascript whenever a thing is opened. It's not possible to
fix generically in CSS (remember the historic z-index wars).
2017-08-29 12:09:59 +08:00
Andrew Nicols
8cb6a55147 Merge branch 'MDL-53848_form_hideif' of git://github.com/davosmith/moodle 2017-08-23 09:56:00 +08:00
Jake Dallimore
81ed702156 MDL-36985 atto: show file removal text on managefiles plugin
Shows a text warning in the manage files plugin window when an editor
has set the 'removeorphaneddrafts' option to true. The text tells the
user that unused files will be automatically deleted on save.
2017-08-22 13:19:52 +08:00
Davo Smith
527459a4c7 MDL-53848 mod_assign, formslib: add hideIf to real form and adapt behat tests to use this 2017-08-17 14:52:11 +01:00
Davo Smith
8dff6c78bd MDL-53848 formslib: peer review fixes 2017-08-17 14:52:11 +01:00
Davo Smith
68d206b274 MDL-53848 form: fix disabledIf functionality 2017-08-17 14:52:11 +01:00
Davo Smith
766d6f9a61 MDL-53848 form: hide entire group if hideIf test is applied to the group 2017-08-17 14:52:10 +01:00
Ankit Agarwal
988879655b MDL-53848 formslib: make conditional hidden elements properly accessible 2017-08-17 14:52:10 +01:00
Marina Glancy
f3da329da4 MDL-53848 forms: additions to the behat test 2017-08-17 14:52:10 +01:00
Davo Smith
d20498625c MDL-53848 form: add hideIf functionality 2017-08-17 14:52:10 +01:00
Eloy Lafuente (stronk7)
245227fdcd Merge branch 'MDL-59667-master-2' of git://github.com/ryanwyllie/moodle 2017-08-15 13:12:45 +02:00
Ryan Wyllie
ecc88f3379 MDL-59667 form: stop datepicker from rendering outside viewport
Stop the date picker panel from being rendered outside of the
viewport, for example when being displayed in a modal.
2017-08-15 01:24:52 +00:00
Jun Pataleta
28368da794 Merge branch 'MDL-59740_master' of git://github.com/markn86/moodle 2017-08-14 13:48:01 +08:00
Andrew Nicols
c036256d86 Merge branch 'MDL-59749-master' of git://github.com/ryanwyllie/moodle 2017-08-08 14:33:43 +08:00
Ryan Wyllie
0a501e1b2e MDL-59749 form: revert setting id on inline form elements
Revert the change I made in MDL-59382 to correctly set the id for inline
form elements because it's breaking a bunch of different places that had
already worked around the problem.
2017-08-08 03:28:36 +00:00
Mark Nelson
a91a4dd77b MDL-59740 core_form: add ability to specify if a button is primary 2017-08-07 17:37:14 +08:00
Andrew Nicols
a41ef5ece5 Merge branch 'MDL-59698-master' of git://github.com/damyon/moodle 2017-08-07 12:43:42 +08:00
Damyon Wiese
63f4aa20b2 MDL-59698 behat: Remove bad tests
These tests are an abuse and should not have been accepted. Behat tests should use real pages.
Adding testing only entry points to Moodle is a bad security practice and is not the purpose of behat.
2017-08-03 10:26:05 +08:00
Andrew Nicols
c6de3bd68f Merge branch 'MDL-59382-master-4' of git://github.com/ryanwyllie/moodle 2017-08-03 09:31:44 +08:00
Ryan Wyllie
6973baa31e MDL-59382 form: fix name in template context 2017-08-02 04:47:42 +00:00
John Okely
1318aec36e MDL-59299 filepicker: Display what filetypes are accepted 2017-07-31 09:58:22 +08:00
John Okely
320889c02b MDL-59299 filemanager: Display what filetypes are accepted 2017-07-31 09:58:21 +08:00
David Monllao
a2b326c232 Merge branch 'MDL-59544-master-filemanagervalidation' of git://github.com/mudrd8mz/moodle 2017-07-25 11:17:07 +02:00
Vladimir Zhirov
0398bbe675 MDL-59407 folder resource: remember view mode using preference API 2017-07-15 00:46:36 +04:00
David Mudrák
1661204a6c MDL-59544 forms: Implicit validation of the filemanager and filepicker
The patch adds an extra validation step against accepted file types.
Even if the repository checks are bypassed (as illustrated in the
Behat), the invalid file is still caught by the element's validation
rules.

It turns out there is no way to test the filepicker element easily via
Behat. Additionally, it provides the renaming features only with
disabled javascript. So the Behat tests are provided for the filemanager
only.

AMOS BEGIN
 CPY [err_wrongfileextension,mod_workshop],[err_wrongfileextension,core_form]
AMOS END
2017-07-14 20:38:54 +02:00
Damyon Wiese
a60e8ba51e MDL-59365 enrol_manual: Rewrite the yui enrolment popup in amd
The add/roles thing was only converted to bootstrap 2/4 markup and the yui left in place.

The modal for adding users to a course was unsavable so I rewrote it with an mform in a popup, still calling
the same (barely) modified ajax script.

The webservice for searching cohorts was taken from admin/tool/lp and moved into /cohort. I added a generic "cohort"
mform element at the same time.

The webservice for searching for users was taken from the original ajax script.
2017-07-11 13:47:26 +01:00
David Mudrák
ee7e8fdf8e MDL-59443 forms: Add behat tests for the field validation 2017-07-06 09:29:04 +02:00
David Mudrák
a100469875 MDL-59443 forms: Consider '*' as a known file type
While working on the filetypes element validation, I realized we did not
cover the case of selecting 'Any file type'. So the value '*' was
falsely reported as unknown file type.
2017-07-06 09:29:04 +02:00
David Mudrák
572d6fdef3 MDL-59443 forms: Allow implicit validation of filetypes element values
The validation obeys the element options 'allowall', 'allowunknown' and
'onlytypes' passed when creating the element.
2017-07-06 09:29:04 +02:00
David Mudrák
6b59e4aafb MDL-59452 forms: Add Behat test for the filetypes form element
This is a very basic test for now to illustrate that it is possible now
to specify filetypes fields by the label.
2017-07-06 09:22:14 +02:00
David Mudrák
9aabf267ee MDL-59452 forms: Provide a label for the filetypes input field
This is a pragmatic (read: hacky) solution of the problem that
Behat/Mink is unable to locate the input field within the filetypes
group. I've spent a while trying to figure out how to make it work. On
the road, I've discovered that our situation with labels of mform group
elements is a bit messy. And generally there seems to be no easy way how
to use the group's label to identify one particular input field in the
group.

In this case, we use mform group but in fact there is a single input
field within the group. Mink does not locate the group itself as an
input field and throws ElementNotFoundException. So reusing the group's
label as a hidden label for the input makes sense from certain
perspective.

The potential drawback (unconfirmed) is that screen readers might read
the same label text twice. But only one of them is associated with the
actual input field so chances are they would ignore the group's one,
like Mink does.
2017-07-05 17:38:04 +02:00
David Mudrák
710a2414d8 MDL-53240 filetypes: Use multibyte safe variant of strtolower
Credit goes to failed unit tests.
2017-06-05 20:50:28 +02:00
David Mudrák
8cf36e9c81 MDL-53240 filetypes: Introduce admin_setting_filetypes class
This new type of admin settings makes use of the filetypes browser but
for the admin settings.
2017-06-01 09:48:45 +02:00
David Mudrák
8b493eb09d MDL-53240 filetypes: Enhance the filetypes element with a types browser 2017-06-01 09:20:07 +02:00
John Okely
86bb4f5bf2 MDL-53240 filetypes: Add functions to be used for input validation 2017-06-01 09:18:38 +02:00