|
| | define_default_field () |
| | This field just sets up a default field object.
|
| |
| | define_field ($data) |
| | Set up the field object according to data in an object.
|
| |
| object | delete_content ($recordid=0) |
| | Delete all content associated with the field.
|
| |
| object | delete_field () |
| | Delete a field completely.
|
| |
| | display_add_field ($recordid=0, $formdata=null) |
| | Print the relevant form element in the ADD template for this field.
|
| |
| | display_browse_field ($recordid, $template) |
| | Display the content of the field in browse mode.
|
| |
| object | display_edit_field () |
| | Print the relevant form element to define the attributes for this field viewable by teachers only.
|
| |
|
| display_search_field ($value='') |
| |
| | export_text_value ($record) |
| | Per default, return the record's text value only from the "content" field.
|
| |
| | file_ok ($relativepath) |
| |
|
| generate_sql ($tablealias, $value) |
| |
| | get_config_for_external () |
| | Return the plugin configs for external functions.
|
| |
| | get_sort_field () |
| | Returns the sortable field for the content.
|
| |
| | get_sort_sql ($fieldname) |
| | Returns the SQL needed to refer to the column.
|
| |
| object | image () |
| | Prints the respective type icon.
|
| |
| object | insert_field () |
| | Insert a new field in the database We assume the field object is already defined as $this->field.
|
| |
| | name () |
| | Returns the name/type of the field.
|
| |
| | notemptyfield ($value, $name) |
| | Check if a field from an add form is empty.
|
| |
|
| parse_search_field ($defaults=null) |
| |
| | print_after_form () |
| | Just in case a field needs to print something after the whole form.
|
| |
|
| print_before_form () |
| | Just in case a field needs to print something before the whole form.
|
| |
| | text_export_supported () |
| | Per default, it is assumed that fields support text exporting.
|
| |
| | update_content ($recordid, $value, $name='') |
| | Update the content of one data field in the data_content table.
|
| |
|
| update_content_import ($recordid, $value, $name='') |
| |
| object | update_field () |
| | Update a field in the database.
|
| |
| | validate (stdClass $fieldinput) |
| | Validates params of fieldinput data.
|
| |
|
|
object | $cm |
| | course module or cmifno
|
| |
|
object | $context |
| | activity context
|
| |
|
object | $data = NULL |
| | The database object that this field belongs to.
|
| |
|
object | $field = NULL |
| | The field object itself, if we know it.
|
| |
|
int | $iconheight = 16 |
| | Width of the icon for this fieldtype.
|
| |
|
int | $iconwidth = 16 |
| | Width of the icon for this fieldtype.
|
| |
|
| $type = 'url' |
| |
|
const | HIGH_PRIORITY = 3 |
| | priority value for high priority
|
| |
|
const | LOW_PRIORITY = 2 |
| | priority value for low priority
|
| |
|
const | MAX_PRIORITY = 4 |
| | priority value for maximum priority
|
| |
|
const | MIN_PRIORITY = 1 |
| | priority value for minimum priority
|
| |
|
const | NO_PRIORITY = 0 |
| | priority value for invalid fields regarding indexing
|
| |
| data_field_base::validate |
( |
stdClass |
$fieldinput | ) |
|
|
inherited |
Validates params of fieldinput data.
Overwrite to validate fieldtype specific data.
You are expected to return an array like ['paramname' => 'Error message for paramname param'] if there is an error, return an empty array if everything is fine.
- Parameters
-
| stdClass | $fieldinput | The field input data to check |
- Return values
-
| array::$errors | if empty validation was fine, otherwise contains one or more error messages |
Reimplemented in data_field_picture.