Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Portfolio caller class for mod_assign. More...
Public Member Functions | |
__construct ($callbackargs) | |
The constructor. More... | |
check_permissions () | |
Checking the permissions. More... | |
expected_time () | |
Calculate the time to transfer either a single file or a list of files based on the data set by load_data. More... | |
expected_time_file () | |
Helper method to calculate expected time for multi or single file exports. More... | |
export_config_form (&$mform, $instance) | |
If this caller wants any additional config items, they should be defined here. More... | |
export_config_validation ($data) | |
Just like the moodle form validation function, this is passed in the data array from the form and if a non empty array is returned, form processing will stop. More... | |
get ($key) | |
Override the parent get function to make sure when we're asked for a course, We retrieve the object from the database as needed. More... | |
get_allowed_export_config () | |
Similar to the other allowed_config functions if you need export config, you must provide a list of what the fields are. More... | |
get_export_config ($key) | |
Returns a particular export config value. More... | |
get_export_summary () | |
After the user submits their config, they're given a confirm screen summarising what they've chosen. More... | |
get_mimetype () | |
Gets mimetype. More... | |
get_navigation () | |
Navigation passed to print_header. More... | |
get_return_url () | |
The url to return to after export or on cancel. More... | |
get_sha1 () | |
Calculate a sha1 has of either a single file or a list of files based on the data set by load_data. More... | |
get_sha1_file () | |
Helper function to calculate the sha1 for multi or single file exports. More... | |
has_export_config () | |
Whether this caller wants any additional config during export (eg options or metadata) More... | |
heading_summary () | |
Return a string to put at the header summarising this export. More... | |
load_data () | |
Load data needed for the portfolio export. More... | |
prepare_package () | |
Prepares the package up before control is passed to the portfolio plugin. More... | |
prepare_package_file () | |
Helper function to copy files into the temp area for single or multi file exports. More... | |
set ($field, &$value) | |
Generic setter for properties belonging to this instance outside the subclass like name, visible, etc. More... | |
set_context ($PAGE) | |
Overridden to return the course module context. More... | |
set_export_config ($config) | |
Stores the config generated at export time. More... | |
set_file_and_format_data ($ids=null) | |
Set up the required files for this export. More... | |
set_formats_from_button ($formats) | |
The button-location always knows best what the formats are... so it should be trusted. More... | |
supported_formats () | |
Array of formats this caller supports. More... | |
Static Public Member Functions | |
static | base_supported_formats () |
Return array of formats supported by this portfolio call back. More... | |
static | display_name () |
Display a module name. More... | |
static | expected_callbackargs () |
Callback arg for a single file export. More... | |
Protected Member Functions | |
add_format ($format) | |
Adds a new format to the list of supported formats. More... | |
get_submission_plugin () | |
Fetch the plugin by its type. More... | |
Protected Attributes | |
string | $area |
callback arg - the area of submission files we export | |
object | $cm |
coursemodule object. More... | |
int | $cmid |
callback arg - the cmid of the assignment we export | |
string | $component |
component of the submission files we export | |
stdclass | $course |
course object | |
string | $editor |
callback arg - the name of the editor field we export | |
array | $exportconfig = array() |
configuration used for export. More... | |
stdClass | $exporter |
a reference to the exporter object | |
int | $fileid |
callback arg - the id of file we export | |
int | $id |
cmid | |
string | $intendedmimetype |
set this for generated-file exports | |
stored_file object | $multifiles |
set this for multi file exports | |
string | $plugin |
callback arg - the plugintype of the editor we export | |
int | $sid |
callback arg - the id of submission we export | |
stored_file | $singlefile |
single file exports configuration | |
array | $supportedformats |
can be optionally overridden by subclass constructors | |
stdclass | $user |
user currently exporting content | |
Portfolio caller class for mod_assign.
assign_portfolio_caller::__construct | ( | $callbackargs | ) |
|
protectedinherited |
Adds a new format to the list of supported formats.
This functions also handles removing conflicting and less specific formats at the same time.
string | $format | one of PORTFOLIO_FORMAT_XX |
void |
|
static |
Return array of formats supported by this portfolio call back.
array |
Reimplemented from portfolio_caller_base.
assign_portfolio_caller::check_permissions | ( | ) |
|
static |
|
static |
Callback arg for a single file export.
Reimplemented from portfolio_caller_base.
assign_portfolio_caller::expected_time | ( | ) |
Calculate the time to transfer either a single file or a list of files based on the data set by load_data.
int |
Reimplemented from portfolio_caller_base.
|
inherited |
Helper method to calculate expected time for multi or single file exports.
string | file time expectation |
|
inherited |
If this caller wants any additional config items, they should be defined here.
moodleform | $mform | passed by reference, add elements to it. |
portfolio_plugin_base | $instance | subclass of portfolio_plugin_base |
Reimplemented in data_portfolio_caller.
|
inherited |
Just like the moodle form validation function, this is passed in the data array from the form and if a non empty array is returned, form processing will stop.
array | $data | data from form. |
|
inherited |
Override the parent get function to make sure when we're asked for a course, We retrieve the object from the database as needed.
string | $key | the name of get function |
stdClass |
Reimplemented from portfolio_caller_base.
|
inherited |
Similar to the other allowed_config functions if you need export config, you must provide a list of what the fields are.
Even if you want to store stuff during export without displaying a form to the user, you can use this.
array | array of allowed keys |
Reimplemented in data_portfolio_caller.
|
finalinherited |
Returns a particular export config value.
Subclasses shouldn't need to override this
string | $key | the config item to fetch |
null|mixed | of export configuration |
|
inherited |
After the user submits their config, they're given a confirm screen summarising what they've chosen.
This function should return a table of nice strings => values of what they've chosen to be displayed in a table.
bool |
|
inherited |
Gets mimetype.
string |
|
inherited |
Navigation passed to print_header.
Override this to do something more specific than the module view page like adding more links to the breadcrumb.
array |
Reimplemented from portfolio_caller_base.
Reimplemented in forum_portfolio_caller, and mod_workshop_portfolio_caller.
|
inherited |
The url to return to after export or on cancel.
Defaults value is set to the module 'view' page. Override this if it's deeper inside the module.
string |
Reimplemented from portfolio_caller_base.
Reimplemented in chat_portfolio_caller, forum_portfolio_caller, and mod_workshop_portfolio_caller.
assign_portfolio_caller::get_sha1 | ( | ) |
Calculate a sha1 has of either a single file or a list of files based on the data set by load_data.
string |
Reimplemented from portfolio_caller_base.
|
inherited |
Helper function to calculate the sha1 for multi or single file exports.
string | sha1 file exports |
|
protected |
Fetch the plugin by its type.
assign_submission_plugin |
|
inherited |
Whether this caller wants any additional config during export (eg options or metadata)
bool |
Reimplemented in data_portfolio_caller.
|
inherited |
Return a string to put at the header summarising this export.
by default, this function just display the name and module instance name. Override this to do something more specific
string |
Reimplemented from portfolio_caller_base.
assign_portfolio_caller::load_data | ( | ) |
Load data needed for the portfolio export.
If the assignment type implements portfolio_load_data(), the processing is delegated to it. Otherwise, the caller must provide either fileid (to export single file) or submissionid and filearea (to export all data attached to the given submission file area) via callback arguments.
portfolio_caller_exception |
Reimplemented from portfolio_caller_base.
assign_portfolio_caller::prepare_package | ( | ) |
Prepares the package up before control is passed to the portfolio plugin.
portfolio_caller_exception |
mixed |
Reimplemented from portfolio_caller_base.
|
inherited |
Helper function to copy files into the temp area for single or multi file exports.
stored_file|bool |
|
finalinherited |
Generic setter for properties belonging to this instance outside the subclass like name, visible, etc.
string | $field | property's name |
mixed | $value | property's value |
bool |
moodle_exception |
|
inherited |
Overridden to return the course module context.
moodle_page | $PAGE | global PAGE |
Reimplemented from portfolio_caller_base.
|
finalinherited |
Stores the config generated at export time.
Subclasses can retrieve values using
array | $config | formdata |
|
inherited |
Set up the required files for this export.
This supports either passing files directly or passing area arguments directly through to the files api using file_storage::get_area_files
mixed | $ids | one of:
|
void |
|
inherited |
|
finalinherited |
Array of formats this caller supports.
array | list of formats |
|
protectedinherited |
coursemodule object.
set this in the constructor like $this->cm = get_coursemodule_from_instance('forum', $this->forum->id);
|
protectedinherited |
configuration used for export.
Use set_export_config and get_export_config to access