[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/user/profile/field/menu/ -> field.class.php (summary)

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: 170 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

profile_field_menu:: (8 methods):
  __construct()
  profile_field_menu()
  edit_field_add()
  edit_field_set_default()
  edit_save_data_preprocess()
  edit_load_user_data()
  edit_field_set_locked()
  convert_external_data()


Class: profile_field_menu  - X-Ref

Class profile_field_menu

__construct($fieldid = 0, $userid = 0)   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

profile_field_menu($fieldid=0, $userid=0)   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


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



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1