|
Moodle
2.2.1
http://www.collinsharper.com
|

Public Member Functions | |
| __construct ($callbackargs) | |
| export_config_form (&$mform, $instance) | |
| has_export_config () | |
| export_config_validation ($data) | |
| expected_time () | |
| expected_time_file () | |
| get_navigation () | |
| get_sha1 () | |
| get_sha1_file () | |
| get ($field) | |
| set ($field, &$value) | |
| set_export_config ($config) | |
| get_export_config ($key) | |
| get_allowed_export_config () | |
| get_export_summary () | |
| prepare_package () | |
| prepare_package_file () | |
| supported_formats () | |
| get_return_url () | |
| check_permissions () | |
| heading_summary () | |
| load_data () | |
| set_file_and_format_data ($ids=null) | |
| set_formats_from_button ($formats) | |
| get_mimetype () | |
| set_context ($PAGE) | |
Static Public Member Functions | |
| static | base_supported_formats () |
| static | display_name () |
| static | expected_callbackargs () |
Protected Member Functions | |
| add_format ($format) | |
Protected Attributes | |
| $course | |
| $exportconfig = array() | |
| $user | |
| $exporter | |
| $supportedformats | |
| $singlefile | |
| $multifiles | |
| $intendedmimetype | |
base class for callers
See http://docs.moodle.org/dev/Adding_a_Portfolio_Button_to_a_page {
Definition at line 39 of file caller.php.
| __construct | ( | $ | callbackargs | ) |
Reimplemented in portfolio_caller_test, data_portfolio_caller, and forum_portfolio_caller.
Definition at line 84 of file caller.php.
| add_format | ( | $ | format | ) | [protected] |
adds a new format to the list of supported formats. handles removing conflicting and less specific formats at the same time.
| string | $format | one of PORTFOLIO_FORMAT_XX |
Definition at line 456 of file caller.php.


| static base_supported_formats | ( | ) | [static] |
Reimplemented in forum_portfolio_caller, data_portfolio_caller, glossary_entry_portfolio_caller, glossary_full_portfolio_caller, assignment_portfolio_caller, portfolio_caller_test, and chat_portfolio_caller.
Definition at line 337 of file caller.php.

| check_permissions | ( | ) | [abstract] |
callback to do whatever capability checks required in the caller (called during the export process
Reimplemented in forum_portfolio_caller, glossary_entry_portfolio_caller, data_portfolio_caller, glossary_full_portfolio_caller, assignment_portfolio_caller, chat_portfolio_caller, and portfolio_caller_test.
| static display_name | ( | ) | [static] |
nice name to display to the user about this caller location
Reimplemented in forum_portfolio_caller, glossary_entry_portfolio_caller, data_portfolio_caller, glossary_full_portfolio_caller, assignment_portfolio_caller, chat_portfolio_caller, and portfolio_caller_test.
Definition at line 357 of file caller.php.

| static expected_callbackargs | ( | ) | [static] |
array of arguments the caller expects to be passed through to it this must be keyed on the argument name, and the array value is a boolean, whether it is required, or just optional eg array( id => true, somethingelse => false, )
Reimplemented in glossary_entry_portfolio_caller, portfolio_caller_test, data_portfolio_caller, assignment_portfolio_caller, forum_portfolio_caller, glossary_full_portfolio_caller, and chat_portfolio_caller.
Definition at line 482 of file caller.php.
| expected_time | ( | ) | [abstract] |
how long does this reasonably expect to take.. should we offer the user the option to wait.. this is deliberately nonstatic so it can take filesize into account the portfolio plugin can override this. (so for example even if a huge file is being sent, the download portfolio plugin doesn't care )
Reimplemented in forum_portfolio_caller, glossary_entry_portfolio_caller, assignment_portfolio_caller, data_portfolio_caller, glossary_full_portfolio_caller, chat_portfolio_caller, and portfolio_caller_test.
helper method to calculate expected time for multi or single file exports
Definition at line 144 of file caller.php.


| export_config_form | ( | &$ | mform, |
| $ | instance | ||
| ) |
if this caller wants any additional config items they should be defined here.
| array | $mform | moodleform object (passed by reference) to add elements to |
| object | $instance | subclass of portfolio_plugin_base |
| integer | $userid | id of user exporting content |
Reimplemented in data_portfolio_caller.
Definition at line 106 of file caller.php.
| 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.
| array | $data | data from form. |
Definition at line 127 of file caller.php.
| get | ( | $ | field | ) |
Reimplemented in portfolio_module_caller_base.
Definition at line 194 of file caller.php.

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.
Reimplemented in data_portfolio_caller.
Definition at line 271 of file caller.php.

| get_export_config | ( | $ | key | ) | [final] |
returns a particular export config value. subclasses shouldn't need to override this
| string | key the config item to fetch |
Definition at line 245 of file caller.php.


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.
Definition at line 286 of file caller.php.
| get_mimetype | ( | ) |
| get_navigation | ( | ) | [abstract] |
used for displaying the navigation during the export screens.
this function must be implemented, but can really return anything. an Exporting.. string will be added on the end.
to pass to build_navigation
Reimplemented in portfolio_module_caller_base, forum_portfolio_caller, and portfolio_caller_test.
| get_return_url | ( | ) | [abstract] |
this is the "return to where you were" url
Reimplemented in portfolio_module_caller_base, chat_portfolio_caller, forum_portfolio_caller, and portfolio_caller_test.

| get_sha1 | ( | ) | [abstract] |
| get_sha1_file | ( | ) |
helper function to calculate the sha1 for multi or single file exports
Definition at line 174 of file caller.php.


whether this caller wants any additional config during export (eg options or metadata)
Reimplemented in data_portfolio_caller.
Definition at line 115 of file caller.php.
| heading_summary | ( | ) |
return a string to put at the header summarising this export by default, just the display name (usually just 'assignment' or something unhelpful
Reimplemented in portfolio_module_caller_base.
Definition at line 367 of file caller.php.

| load_data | ( | ) | [abstract] |
| prepare_package | ( | ) | [abstract] |
called before the portfolio plugin gets control this function should copy all the files it wants to the temporary directory, using {
Reimplemented in glossary_entry_portfolio_caller, data_portfolio_caller, forum_portfolio_caller, chat_portfolio_caller, glossary_full_portfolio_caller, assignment_portfolio_caller, and portfolio_caller_test.
helper function to copy files into the temp area for single or multi file exports.
Definition at line 302 of file caller.php.


| set | ( | $ | field, |
| &$ | value | ||
| ) | [final] |
generic setter for properties belonging to this instance outside the subclass like name, visible, etc.
Definition at line 208 of file caller.php.

| set_context | ( | $ | PAGE | ) | [abstract] |
return the context for this export. used for $PAGE->set_context
Reimplemented in portfolio_module_caller_base, and portfolio_caller_test.
| set_export_config | ( | $ | config | ) | [final] |
stores the config generated at export time. subclasses can retrieve values using get_export_config
| array | $config | formdata |
Definition at line 225 of file caller.php.

| set_file_and_format_data | ( | $ | ids = null | ) |
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:
|
| int | $contextid | (optional), passed to file_storage::get_area_files |
| string | $component | (optional), passed to file_storage::get_area_files |
| string | $filearea | (optional), passed to file_storage::get_area_files |
| int | $itemid | (optional), passed to file_storage::get_area_files |
| string | $sort | (optional), passed to file_storage::get_area_files |
| bool | $includedirs | (optional), passed to file_storage::get_area_files |
Definition at line 391 of file caller.php.


| set_formats_from_button | ( | $ | formats | ) |
the button-location always knows best what the formats are... so it should be trusted.
| array | $formats | array of PORTFOLIO_FORMAT_XX |
Definition at line 434 of file caller.php.

| supported_formats | ( | ) | [final] |
array of formats this caller supports the intersection of what this function returns and what the selected portfolio plugin supports will be used use the constants PORTFOLIO_FORMAT_*
Definition at line 324 of file caller.php.

$course [protected] |
stdclass object course that was active during the caller
Reimplemented in portfolio_module_caller_base.
Definition at line 45 of file caller.php.
$exportconfig = array() [protected] |
named array of export config useset_export_config and get_export_config to access
Definition at line 51 of file caller.php.
$exporter [protected] |
a reference to the exporter object
Definition at line 62 of file caller.php.
$intendedmimetype [protected] |
set this for generated-file exports
Definition at line 82 of file caller.php.
$multifiles [protected] |
set this for multi file exports
Definition at line 77 of file caller.php.
$singlefile [protected] |
set this for single file exports
Definition at line 72 of file caller.php.
$supportedformats [protected] |
this can be overridden in subclasses constructors if they want
Definition at line 67 of file caller.php.
$user [protected] |
stdclass object user currently exporting content
Definition at line 57 of file caller.php.