Differences Between: [Versions 311 and 402] [Versions 311 and 403]
Menu profile field.
Copyright: | 2007 onwards Shane Elliot {@link http://pukunui.com} |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 173 lines (6 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
profile_field_menu:: (8 methods):
__construct()
edit_field_add()
edit_field_set_default()
edit_save_data_preprocess()
edit_load_user_data()
edit_field_set_locked()
convert_external_data()
get_field_properties()
Class: profile_field_menu - X-Ref
Class profile_field_menu__construct($fieldid = 0, $userid = 0, $fielddata = null) X-Ref |
Constructor method. Pulls out the options for the menu from the database and sets the the corresponding key for the data if it exists. param: int $fieldid param: int $userid param: object $fielddata |
edit_field_add($mform) X-Ref |
Create the code snippet for this field instance Overwrites the base class method param: moodleform $mform Moodle form instance |
edit_field_set_default($mform) X-Ref |
Set the default value for this field instance Overwrites the base class method. param: moodleform $mform Moodle form instance |
edit_save_data_preprocess($data, $datarecord) X-Ref |
The data from the form returns the key. This should be converted to the respective option string to be saved in database Overwrites base class accessor method. param: mixed $data The key returned from the select input in the form param: stdClass $datarecord The object that will be used to save the record return: mixed Data or null |
edit_load_user_data($user) X-Ref |
When passing the user object to the form class for the edit profile page we should load the key for the saved data Overwrites the base class method. param: stdClass $user User object. |
edit_field_set_locked($mform) X-Ref |
HardFreeze the field if locked. param: moodleform $mform instance of the moodleform class |
convert_external_data($value) X-Ref |
Convert external data (csv file) from value to key for processing later by edit_save_data_preprocess param: string $value one of the values in menu options. return: int options key for the menu |
get_field_properties() X-Ref |
Return the field type and null properties. This will be used for validating the data submitted by a user. return: array the param type and null property |