|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| moodleform_mod ($current, $section, $cm, $course) | |
| data_preprocessing (&$default_values) | |
| definition_after_data () | |
| validation ($data, $files) | |
| set_data ($default_values) | |
| standard_coursemodule_elements () | |
| add_completion_rules () | |
| completion_rule_enabled (&$data) | |
| standard_hidden_coursemodule_elements () | |
| standard_grading_coursemodule_elements () | |
| add_intro_editor ($required=false, $customlabel=null) | |
| add_action_buttons ($cancel=true, $submitlabel=null, $submit2label=null) | |
Protected Member Functions | |
| init_features () | |
Protected Attributes | |
| $current | |
| $_instance | |
| $_section | |
| $_cm | |
| $_features | |
| $_customcompletionelements | |
| $_modname | |
| $context | |
| $_outcomesused | |
This class adds extra methods to form wrapper specific to be used for module add / update forms mod/{modname}/mod_form.php replaced deprecated mod/{modname}/mod.html
Definition at line 9 of file moodleform_mod.php.
| add_action_buttons | ( | $ | cancel = true, |
| $ | submitlabel = null, |
||
| $ | submit2label = null |
||
| ) |
Overriding formslib's add_action_buttons() method, to add an extra submit "save changes and return" button.
| bool | $cancel | show cancel button |
| string | $submitlabel | null means default, false means none, string is label text |
| string | $submit2label | null means default, false means none, string is label text |
Definition at line 776 of file moodleform_mod.php.

Can be overridden to add custom completion rules if the module wishes them. If overriding this, you should also override completion_rule_enabled.
Just add elements to the form as needed and return the list of IDs. The system will call disabledIf and handle other behaviour for each returned ID.
Reimplemented in mod_feedback_mod_form, mod_forum_mod_form, mod_glossary_mod_form, and mod_choice_mod_form.
Definition at line 647 of file moodleform_mod.php.

| add_intro_editor | ( | $ | required = false, |
| $ | customlabel = null |
||
| ) |
| completion_rule_enabled | ( | &$ | data | ) |
Called during validation. Override to indicate, based on the data, whether a custom completion rule is enabled (selected).
| array | $data | Input data (not yet validated) |
Definition at line 659 of file moodleform_mod.php.

| data_preprocessing | ( | &$ | default_values | ) |
Only available on moodleform_mod.
| array | $default_values | passed by reference |
Reimplemented in mod_quiz_mod_form, mod_lesson_mod_form, mod_scorm_mod_form, mod_lti_mod_form, mod_workshop_mod_form, mod_forum_mod_form, mod_feedback_mod_form, mod_resource_mod_form, mod_glossary_mod_form, mod_url_mod_form, mod_page_mod_form, mod_assignment_mod_form, mod_choice_mod_form, mod_data_mod_form, and mod_folder_mod_form.
Definition at line 98 of file moodleform_mod.php.

Each module which defines definition_after_data() must call this method using parent::definition_after_data();
Reimplemented from moodleform.
Reimplemented in mod_workshop_mod_form, mod_lti_mod_form, mod_resource_mod_form, mod_forum_mod_form, and mod_glossary_mod_form.
Definition at line 114 of file moodleform_mod.php.

| init_features | ( | ) | [protected] |
Definition at line 74 of file moodleform_mod.php.


| moodleform_mod | ( | $ | current, |
| $ | section, | ||
| $ | cm, | ||
| $ | course | ||
| ) |
Definition at line 52 of file moodleform_mod.php.


| set_data | ( | $ | default_values | ) |
Load in existing data as form defaults. Usually new entry defaults are stored directly in form definition (new entry form); this function is used to load in data where values already exist and data is being edited (edit entry form).
| mixed | $default_values | object or array of default values |
Reimplemented from moodleform.
Reimplemented in mod_scorm_mod_form.
Definition at line 360 of file moodleform_mod.php.

Adds all the standard elements to a form to edit the settings for an activity module.
Definition at line 372 of file moodleform_mod.php.


Definition at line 693 of file moodleform_mod.php.


| validation | ( | $ | data, |
| $ | files | ||
| ) |
Dummy stub method - override if you needed to perform some extra validation. If there are errors return array of errors ("fieldname"=>"error message"), otherwise true if ok.
Server side rules do not work for uploaded files, implement serverside rules here if needed.
| array | $data | array of ("fieldname"=>value) of submitted data |
| array | $files | array of uploaded files "element_name"=>tmp_file_path |
Reimplemented from moodleform.
Reimplemented in mod_quiz_mod_form, mod_lesson_mod_form, mod_scorm_mod_form, mod_feedback_mod_form, mod_resource_mod_form, mod_url_mod_form, mod_choice_mod_form, mod_assignment_mod_form, and mod_imscp_mod_form.
Definition at line 275 of file moodleform_mod.php.

$_cm [protected] |
Definition at line 33 of file moodleform_mod.php.
$_customcompletionelements [protected] |
Definition at line 41 of file moodleform_mod.php.
$_features [protected] |
List of modform features
Definition at line 37 of file moodleform_mod.php.
$_instance [protected] |
Definition at line 19 of file moodleform_mod.php.
$_modname [protected] |
Definition at line 45 of file moodleform_mod.php.
$_outcomesused [protected] |
a flag indicating whether outcomes are being used
Definition at line 50 of file moodleform_mod.php.
$_section [protected] |
Definition at line 26 of file moodleform_mod.php.
$context [protected] |
current context, course or module depends if already exists
Definition at line 47 of file moodleform_mod.php.
$current [protected] |
Current data
Definition at line 11 of file moodleform_mod.php.