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

Public Member Functions

 profile_field_base ($fieldid=0, $userid=0)
 edit_field_add (&$mform)
 display_data ()
 edit_field (&$mform)
 edit_after_data (&$mform)
 edit_save_data ($usernew)
 edit_validate_field ($usernew)
 edit_field_set_default (&$mform)
 edit_field_set_required (&$mform)
 edit_field_set_locked (&$mform)
 edit_save_data_preprocess ($data, &$datarecord)
 edit_load_user_data (&$user)
 is_user_object_data ()
 set_userid ($userid)
 set_fieldid ($fieldid)
 load_data ()
 is_visible ()
 is_empty ()
 is_required ()
 is_locked ()
 is_unique ()
 is_signup_field ()

Data Fields

 $fieldid
 $userid
 $field
 $inputname
 $data
 $dataformat

Detailed Description

Base class for the customisable profile fields.

Definition at line 14 of file lib.php.


Member Function Documentation

Display the data for this field

Reimplemented in profile_field_datetime, profile_field_checkbox, profile_field_textarea, and profile_field_text.

Definition at line 56 of file lib.php.

Here is the call graph for this function:

edit_after_data ( &$  mform)

Tweaks the edit form

Parameters:
objectinstance of the moodleform class $return boolean

Definition at line 85 of file lib.php.

Here is the call graph for this function:

edit_field ( &$  mform)

Print out the form field in the edit profile page

Parameters:
objectinstance of the moodleform class $return boolean

Definition at line 67 of file lib.php.

Here is the call graph for this function:

edit_field_add ( &$  mform)

Abstract method: Adds the profile field to the moodle form class

Parameters:
forminstance of the moodleform class

Reimplemented in profile_field_menu, profile_field_text, profile_field_checkbox, and profile_field_textarea.

Definition at line 46 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

edit_field_set_default ( &$  mform)

Sets the default data for the field in the form object

Parameters:
objectinstance of the moodleform class

Reimplemented in profile_field_menu.

Definition at line 161 of file lib.php.

Here is the caller graph for this function:

edit_field_set_locked ( &$  mform)

HardFreeze the field if locked.

Parameters:
objectinstance of the moodleform class

Reimplemented in profile_field_menu.

Definition at line 181 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

edit_field_set_required ( &$  mform)

Sets the required flag for the field in the form object

Parameters:
objectinstance of the moodleform class

Definition at line 171 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

edit_load_user_data ( &$  user)

Loads a user object with data for this field ready for the edit profile form

Parameters:
objecta user object

Reimplemented in profile_field_menu, and profile_field_textarea.

Definition at line 206 of file lib.php.

edit_save_data ( usernew)

Saves the data coming from form

Parameters:
mixeddata coming from the form
Returns:
mixed returns data id if success of db insert/update, false on fail, 0 if not permitted

Definition at line 100 of file lib.php.

edit_save_data_preprocess ( data,
&$  datarecord 
)

Hook for child classess to process the data before it gets saved in database

Parameters:
mixed
stdClassThe object that will be used to save the record
Returns:
mixed

Reimplemented in profile_field_textarea.

Definition at line 197 of file lib.php.

edit_validate_field ( usernew)

Validate the form field from profile page

Returns:
string contains error message otherwise NULL

Check for uniqueness of data if required

Definition at line 128 of file lib.php.

is_empty ( )

Check if the field data is considered empty return boolean

Definition at line 297 of file lib.php.

is_locked ( )

Check if the field is locked on the edit profile page

Returns:
boolean

Definition at line 313 of file lib.php.

Check if the field is required on the edit profile page

Returns:
boolean

Definition at line 305 of file lib.php.

Here is the caller graph for this function:

Check if the field should appear on the signup page

Returns:
boolean

Definition at line 329 of file lib.php.

is_unique ( )

Check if the field data should be unique

Returns:
boolean

Definition at line 321 of file lib.php.

Check if the field data should be loaded into the user object By default it is, but for field types where the data may be potentially large, the child class should override this and return false

Returns:
boolean

Reimplemented in profile_field_textarea.

Definition at line 218 of file lib.php.

Check if the field data is visible to the current user

Returns:
boolean

Definition at line 274 of file lib.php.

Here is the call graph for this function:

load_data ( )

Accessor method: Load the field record and user data associated with the object's fieldid and userid

Load the field object

Definition at line 245 of file lib.php.

Here is the caller graph for this function:

profile_field_base ( fieldid = 0,
userid = 0 
)

Constructor method.

Parameters:
integerid of the profile from the user_info_field table
integerid of the user for whom we are displaying data

Definition at line 31 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_fieldid ( fieldid)

Accessor method: set the fieldid for this instance

Parameters:
integerid from the user_info_field table

Definition at line 237 of file lib.php.

Here is the caller graph for this function:

set_userid ( userid)

Accessor method: set the userid for this instance

Parameters:
integerid from the user table

Definition at line 229 of file lib.php.

Here is the caller graph for this function:


Field Documentation

$data

Definition at line 23 of file lib.php.

$dataformat

Definition at line 24 of file lib.php.

$field

Definition at line 21 of file lib.php.

$fieldid

These 2 variables are really what we're interested in. Everything else can be extracted from them

Definition at line 18 of file lib.php.

$inputname

Definition at line 22 of file lib.php.

Definition at line 19 of file lib.php.


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