Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

lib/formslib.php

From MoodleDocs
Revision as of 04:57, 9 October 2006 by Jamie Pratt (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Work Done on Formslib

  • Created stylesheet for forms.
  • Created initial xhtml structure (maybe changed later).
  • Created demo of formslib converting an exisiting form to use the new formslib course/edit.php which has been included in Moodle 1.7 as course/edit2.php
  • Added facility to add help buttons to forms, worked on ways to process form data securely as is currently done with required_param, optional_param

To Do

  • Conversion of forms to use the new forms API. See list of initial forms to be done below.
  • Security audit.
  • Further debugging.



Initial Forms to Be Worked On

We will leave the form data being processed as it was. The quick form libraries will be used just to print the forms. The values for each form element will be passed to the quickform code from the existing code after the existing code has filled in default values and processed any submitted values. This will save significant time since the logic for processing submitted values and setting defaults is often interwoven in Moodle and to unweave that and do it the quickforms way will take some time. So better to let the old code handle the processing and defaults of values and just concentrate on rendering accessible forms using xhtml and css.

Later we can work on having quickforms process the form values on these old forms if required. I do hope to work on having course/mod.php use the form descriptions to process submitted values from the activity module update forms.

Forms that have been initially selected as good candidates for conversion are ones that are ones not too complex :


blocks\loancalc\block_loancalc.php (158) blog\preferences.html (1) calendar\event_edit.html (5) calendar\event_new.html (5) calendar\preferences.php (207) course\edit.html (55) course\editsection.html (2) course\groups-edit.html (86) course\groups-edit.html (154) course\lib.php (141) course\request.html (22) course\scales.php (180) login\signup_form.html (28) message\settings.php (95) mod\assignment\config.php (881) mod\assignment\mod.html (38) mod\chat\config.html (1) mod\chat\mod.html (21) mod\choice\mod.html (61) mod\data\config.php (1) mod\data\mod.html (76) mod\exercise\mod.html (44) mod\forum\config.html (1) mod\forum\mod.html (54) mod\forum\post.html (20) mod\forum\search.php (271) mod\forum\subscriber.html (2) mod\glossary\comment.html (9) mod\glossary\config.html (5) mod\glossary\edit.html (9) mod\glossary\formats.php (70) mod\glossary\import.html (1) mod\glossary\mod.html (72) mod\hotpot\config.html (1) mod\hotpot\mod.html (25) mod\hotpot\report.php (414) mod\label\mod.html (7) mod\lams\config.html (36) mod\lams\mod.html (36) mod\lesson\action\addpage.php (49) mod\lesson\mod.html (137) mod\quiz\config.html (88) mod\quiz\mod.html (144) mod\resource\config.html (1) mod\resource\type\common.html (1) mod\scorm\config.html (10) mod\scorm\mod.html (407) mod\survey\details.php (28) mod\survey\mod.html (14) mod\wiki\mod.html (62) mod\wiki\revertpages.html (11) mod\workshop\assessments.php (464) mod\workshop\assessment_grading_form.html (6) mod\workshop\mod.html (86) question\format\coursetestmanager\format.php (60) question\import.php (221) search\query.php (141) user\edit.html (23)