Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 311 and 403]

(no description)

File Size: 192 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: private_files  - X-Ref

Manage user private area files form

definition()   X-Ref
Add elements to this form.


validation($data, $files)   X-Ref
Validate incoming data.

param: array $data
param: array $files
return: array

get_emaillink()   X-Ref
Link to email private files

return: string|null

check_access_for_dynamic_submission()   X-Ref
Check if current user has access to this form, otherwise throw exception

Sometimes permission check may depend on the action and/or id of the entity.
If necessary, form data is available in $this->_ajaxformdata or
by calling $this->optional_param()

get_context_for_dynamic_submission()   X-Ref
Returns form context

If context depends on the form data, it is available in $this->_ajaxformdata or
by calling $this->optional_param()

return: \context

get_options()   X-Ref
File upload options

return: array

process_dynamic_submission()   X-Ref
Process the form submission, used if form was submitted via AJAX

This method can return scalar values or arrays that can be json-encoded, they will be passed to the caller JS.

Submission data can be accessed as: $this->get_data()

return: mixed

set_data_for_dynamic_submission()   X-Ref
Load in existing data as form defaults

Can be overridden to retrieve existing values from db by entity id and also
to preprocess editor and filemanager elements

Example:
$this->set_data(get_entity($this->_ajaxformdata['id']));

get_page_url_for_dynamic_submission()   X-Ref
Returns url to set in $PAGE->set_url() when form is being rendered or submitted via AJAX

This is used in the form elements sensitive to the page url, such as Atto autosave in 'editor'

If the form has arguments (such as 'id' of the element being edited), the URL should
also have respective argument.

return: \moodle_url