Moodle  2.2.1
http://www.collinsharper.com
moodleform_mod Class Reference
Inheritance diagram for moodleform_mod:
Collaboration diagram for moodleform_mod:

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

Detailed Description

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.


Member Function Documentation

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.

Parameters:
bool$cancelshow cancel button
string$submitlabelnull means default, false means none, string is label text
string$submit2labelnull means default, false means none, string is label text
Returns:
void

Definition at line 776 of file moodleform_mod.php.

Here is the caller graph for this function:

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.

Returns:
array Array of string IDs of added items, empty array if none

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.

Here is the caller graph for this function:

add_intro_editor ( required = false,
customlabel = null 
)

Definition at line 745 of file moodleform_mod.php.

Here is the caller graph for this function:

Called during validation. Override to indicate, based on the data, whether a custom completion rule is enabled (selected).

Parameters:
array$dataInput data (not yet validated)
Returns:
bool True if one or more rules is enabled, false if none are; default returns false

Definition at line 659 of file moodleform_mod.php.

Here is the caller graph for this function:

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.

Here is the call graph for this function:

init_features ( ) [protected]

Definition at line 74 of file moodleform_mod.php.

Here is the call graph for this function:

Here is the caller graph for this function:

moodleform_mod ( current,
section,
cm,
course 
)

Definition at line 52 of file moodleform_mod.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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).

Parameters:
mixed$default_valuesobject or array of default values

Reimplemented from moodleform.

Reimplemented in mod_scorm_mod_form.

Definition at line 360 of file moodleform_mod.php.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 693 of file moodleform_mod.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 663 of file moodleform_mod.php.

Here is the caller graph for this function:

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.

Parameters:
array$dataarray of ("fieldname"=>value) of submitted data
array$filesarray of uploaded files "element_name"=>tmp_file_path
Returns:
array of "element_name"=>"error_description" if there are errors, or an empty array if everything is OK (true allowed for backwards compatibility too).

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.

Here is the call graph for this function:


Field Documentation

$_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.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations