24 Commits

Author SHA1 Message Date
Marina Glancy
b4eb5f0212 MDL-34859 forms: new element defaultcustom 2017-03-20 14:59:45 +08:00
Damyon Wiese
e584e6ae46 MDL-55071 theme/output: PHPCS fixes for new theme branch
Part of MDL-55071
2016-09-23 10:57:36 +01:00
Frederic Massart
fc7f69e7e8 MDL-51948 formslib: Support forcing LTR on form elements
Part of MDL-55071
2016-09-23 10:54:49 +01:00
Damyon Wiese
344321e1ef MDL-55417 forms: Clean up form element template patch
Use a trait and a base mustache template for all form elements to reduce code
duplication and increase standardisation.

Part of MDL-55071
2016-09-23 10:53:30 +01:00
Damyon Wiese
91bda4cd45 MDL-55417 forms: Render form elements with a template
This change allows form elements to be overridden with a mustache template.
The template can even listen for form validation errors and supply the JS to
change the look of the form element when there is/isn't a validation error.

Initial support is for all core form elements including:

text, select, selectyesno and checkboxes, groups, dateselector, datetimeselector,
autocomplete, modvisible, advcheckbox, button, duration, filemanager, filepicker, editor, static, grading,
warning, textarea, password, url, submit, questioncategory, recaptcha.

Part of MDL-55071
2016-09-23 10:53:30 +01:00
Rajesh Taneja
1ebda3eb8c MDL-50484 lib_formslib: Persistant input should have different id
Persistant input is appended for frozen elements
and should have different id then the actual element
2016-02-19 14:00:04 +08:00
Marina Glancy
1a0df5535e MDL-52081 forms: Use __construct() for constructors 2015-12-10 13:38:01 +08:00
Tim Hunt
5bcfd504df MDL-45618 Fix @since PHPdoc tags. 2014-05-19 17:03:04 +01:00
Ankit Agarwal
83e9b8f9de MDL-30845 formslib: Freeze should always be with persistantfreeze set to false since Frozen text fields are now rendered as input fields 2012-10-15 14:01:46 +08:00
Ankit Agarwal
3ec55b9e0a MDL-30845 accessibility: changing the way input fields are rendered when they are not-editable 2012-10-15 14:01:46 +08:00
Rajesh Taneja
c277b502ab MDL-31294 Forms Library: Removed deprecated functions from forms library 2012-07-24 15:09:39 +08:00
Rajesh Taneja
6c1fd30484 MDL-30974 form: Checked and updated docblock for form library 2012-02-15 12:55:06 +08:00
Tim Hunt
820b41e34f MDL-30168 formslib: untangle automatic id generation.
Previously, we had overridden the _generateId method in almost all
subclasses; and then we mostly, but not always; ignored the value that
was generated there, and instead generated new (nicer) values in
MoodleQuickForm_Renderer::renderElement. Of course, that is not really a
logical place to (re)generate ids.

I have fixed the code so that the _generateId method now uses the 'nice
id' algorithm from renderElement. This should make the whole code flow
more logical.

This make all our overriding of _generateId unnecessary.

We do need a special _generateId for radio buttons, because you often
have different radio buttons with the same name but different values.

This change should only change the ids on radio, checkbox and
advcheckbox elements. Previously, those were essentially random, so I
don't think anyone could have been relying on the particular values.

This commit also has new unit tests, first to test the basic _generateId
algorithm, and then to create and render an example form (including some
tricky things like repeat_elements) and chech the acutal ids in the
generated HTML.
2011-12-23 11:51:45 +00:00
Petr Skoda
4bcc51185c MDL-21217, MDL-21198 simplified/improved outputlib help icon related apis + several fixed regresions 2009-12-30 15:19:55 +00:00
Petr Skoda
6f5e085205 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-01 16:48:45 +00:00
nicolasconnault
f8065dd287 MDL-19756 Migrated the following functions from weblib to outputlib:
1. button_to_popup_window
2. link_to_popup_window
3. print_single_button
4. print_spacer
5. print_file_picture (deprecated)
6. print_user_picture
7. print_png (deprecated)
8. helpbutton
9. doclink
10. print_paging_bar
11. notice_yesno
2009-07-27 10:33:00 +00:00
skodak
3e8b394e08 MDL-19416 fixed PHP 5.3 compatiblity issue - fixes weird use of constructors in quickforms 2009-06-07 09:43:27 +00:00
jamiesensei
0709d4d5f5 some xhtml validity fixes for the case that select and text elements are 'frozen' 2007-01-11 04:57:57 +00:00
jamiesensei
5ce73257ab some bug fixes in setHelpButton internals.
added new editorhelpbutton function that can be used to refer to several help topics.
2007-01-04 10:23:06 +00:00
jamiesensei
19194f825a added setAdvanced MoodleQuickForm method. And added closeHeaderAfter method 2006-12-14 12:44:10 +00:00
jamiesensei
44875d7898 added code to include hidden labels in groups in forms 2006-12-09 14:06:15 +00:00
jamiesensei
d4fe14d3e4 some changes to setHelpButton methods on elements and MoodleQuickForm to allow non standard help buttons such as the grades pop up window. 2006-11-13 07:43:22 +00:00
skodak
7f40a229a4 New version of formslib.php (see MDL-6914 for more details), course/edit2.php is disabled for now - working on edit3.php ;-)
More inline comments/docs today.
2006-10-12 07:33:57 +00:00
jamiesensei
da6f876395 This is a first cut of a new formslib.php a library of classes for creating and securely processing forms in Moodle, based on PEAR QuickForms. Only uses XHTML and CSS and no table tags.
This is NOT YET PART OF THE MOODLE API it is here for experimental purposes.
2006-09-24 17:04:51 +00:00