Issue Details (XML | Word | Printable)

Key: MDL-6914
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jamie Pratt
Reporter: Petr Skoda
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

formslib.php improvement

Created: 11/Oct/06 03:09 PM   Updated: 02/Jan/07 04:57 AM
Return to search
Component/s: Accessibility
Affects Version/s: 1.8
Fix Version/s: 1.8

File Attachments: 1. File formslibx.php (13 kB)
2. File ft.php (2 kB)
3. File ft2.php (2 kB)

Issue Links:
Dependency
 
Relates

Participants: Jamie Pratt and Petr Skoda
Security Level: None
Resolved date: 02/Jan/07
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE

Sub-Tasks  All   Open   
 Sub-Task Progress: 
No sub-tasks match this view.

 Description  « Hide
patch following...

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 11/Oct/06 03:21 PM
Pending:
  • File uploading and sesskey protection not implemented.
  • Method names could be improved.
  • Some dummy validation callback method could be added.

Changes:

  • the outside API is not dependent on quickforms
  • non-post form type compatible with xxx_param() functions - both return the same data
  • easier to learn how to use - less methods in the wrapper
  • server-side Moodle specific cleaning
  • only form_definition() uses quickform methods, but only those related to form construction

Petr Skoda added a comment - 11/Oct/06 03:25 PM
  • one more change - form name is constructed from the class name

Jamie Pratt added a comment - 11/Oct/06 08:10 PM
Following on from our skype chat I'm going to post a number of ideas here as they come up while examining your code Petr.

We should consider removing the target parameter in :

function moodleform_wrapper($action, $customdata=null, $method='post', $target='', $attributes=null) {

as target is deprecated in xhtml strict.


Jamie Pratt added a comment - 11/Oct/06 08:16 PM
use_values_as_defaults() method is redundant since the user input anyway always overrides qf's defaults.

Jamie Pratt added a comment - 12/Oct/06 01:06 PM
Hi Petr,

I added this code to the end of your updateSubmission method and then use_values_as_defaults() really is redundant :

//need to tell elements that they need to update their value attribute.
foreach (array_keys($this->_elements) as $key) { $this->_elements[$key]->onQuickFormEvent('updateValue', null, $this); }

Jamie


Petr Skoda added a comment - 12/Oct/06 03:37 PM
The new formslib.php in in HEAD, attaching new form test file
I think the API should be stable now, but of course we can still rename the method names if needed.

I am working on course/edit3.php and incline docs+comments. in formslib.php today.


Petr Skoda added a comment - 02/Jan/07 04:57 AM
all should be fixed in cvs, closing now