|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
| portfolio_cron | ( | ) |
main portfolio cronjob currently just cleans up expired transfer records.
Definition at line 947 of file portfoliolib.php.


| portfolio_existing_exports | ( | $ | userid, |
| $ | type = null |
||
| ) |
return a list of current exports for the given user this will not go through and call rewaken_object, because it's heavy it's really just used to figure out what exports are currently happening. this is useful for plugins that don't support multiple exports per session
| int | $userid | the user to check for |
| string | $type | (optional) the portfolio plugin to filter by |
Definition at line 1156 of file portfoliolib.php.

| portfolio_existing_exports_by_plugin | ( | $ | userid | ) |
Return an array of existing exports by type for a given user. This is much more lightweight than {
Definition at line 1172 of file portfoliolib.php.

| portfolio_expected_time_db | ( | $ | recordcount | ) |
try and determine expected_time for purely database based exports or exports that might include large parts of a database
object
| integer | $recordcount | - number of records trying to export |
Definition at line 1050 of file portfoliolib.php.


| portfolio_expected_time_file | ( | $ | totest | ) |
try and determine expected_time for purely file based exports or exports that might include large file attachments.
object
| mixed | $totest | - either an array of stored_file objects or a single stored_file object |
Definition at line 987 of file portfoliolib.php.


| portfolio_export_pagesetup | ( | $ | PAGE, |
| $ | caller | ||
| ) |
| portfolio_export_rethrow_exception | ( | $ | exporter, |
| $ | exception | ||
| ) |
helper function to rethrow a caught portfolio_exception as an export exception
used because when a portfolio_export exception is thrown the export is cancelled
throws portfolio_export_exceptiog
| portfolio_exporter | $exporter | current exporter object |
| exception | $exception | exception to rethrow |
Definition at line 975 of file portfoliolib.php.

| portfolio_export_type_to_id | ( | $ | type, |
| $ | userid | ||
| ) |
Definition at line 1139 of file portfoliolib.php.
the default filesizes and threshold information for file based transfers this shouldn't need to be used outside the admin pages and the portfolio code
Definition at line 1029 of file portfoliolib.php.


| portfolio_format_from_mimetype | ( | $ | mimetype | ) |
Deduce export format from file mimetype
This function returns the revelant portfolio export format which is used to determine which portfolio plugins can be used for exporting this content according to the given mime type this only works when exporting exactly one file, or generating a new one (like a pdf or csv export)
| string | $mimetype | (usually $file->get_mimetype()) |
Definition at line 569 of file portfoliolib.php.


| portfolio_format_is_abstract | ( | $ | format | ) |
tiny helper to figure out whether a portfolio format is abstract
| string | $format | the format to test |
bool
Definition at line 641 of file portfoliolib.php.


| portfolio_format_object | ( | $ | name | ) |
helper function to return a format object from the constant
| string | $name | the constant PORTFOLIO_FORMAT_XXX |
Definition at line 738 of file portfoliolib.php.


Return default common options for format_text() when preparing a content to be exported
It is important not to apply filters and not to clean the HTML in format_text()
Definition at line 1186 of file portfoliolib.php.

| portfolio_handle_event | ( | $ | eventdata | ) |
event handler for the portfolio_send event
Definition at line 929 of file portfoliolib.php.

| portfolio_insane_notify_admins | ( | $ | insane, |
| $ | instances = false |
||
| ) |
object
Definition at line 1070 of file portfoliolib.php.


| portfolio_instance | ( | $ | instanceid, |
| $ | record = null |
||
| ) |
helper function to return an instance of a plugin (with config loaded)
| int | $instance | id of instance |
| array | $record | database row that corresponds to this instance this is passed to avoid unnecessary lookups Optional, and the record will be retrieved if null. |
Definition at line 755 of file portfoliolib.php.

| portfolio_instance_sanity_check | ( | $ | instances = null | ) |
helper function to check all the instances for sanity and set any insane ones to invisible.
| array | $instances | to check (if null, defaults to all) one instance or id will work too |
Definition at line 846 of file portfoliolib.php.


| portfolio_instance_select | ( | $ | instances, |
| $ | callerformats, | ||
| $ | callbackclass, | ||
| $ | mimetype = null, |
||
| $ | selectname = 'instance', |
||
| $ | return = false, |
||
| $ | returnarray = false |
||
| ) |
returns a drop menu with a list of available instances.
| array | $instances | array of portfolio plugin instance objects - the instances to put in the menu |
| array | $callerformats | array of PORTFOLIO_FORMAT_XXX constants - the formats the caller supports (this is used to filter plugins) |
| array | $callbackclass | the callback class name - used for debugging only for when there are no common formats |
| mimetype | $mimetype | if we already know we have exactly one file, or are going to write one, pass it here to do mime filtering. |
| string | $selectname | the name of the select element. Optional, defaults to instance. |
| boolean | $return | whether to print or return the output. Optional, defaults to print. |
| booealn | $returnarray | if returning, whether to return the HTML or the array of options. Optional, defaults to HTML. |
Definition at line 435 of file portfoliolib.php.


| portfolio_instances | ( | $ | visibleonly = true, |
| $ | useronly = true |
||
| ) |
return all portfolio instances
| boolean | visibleonly Don't include hidden instances. Defaults to true and will be overridden to true if the next parameter is true |
| boolean | useronly Check the visibility preferences and permissions of the logged in user. Defaults to true. |
Definition at line 501 of file portfoliolib.php.


| portfolio_most_specific_formats | ( | $ | specificformats, |
| $ | generalformats | ||
| ) |
return the combination of the two arrays of formats with duplicates in terms of specificity removed and also removes conflicting formats use case: a module is exporting a single file, so the general formats would be FILE and MBKP while the specific formats would be the specific subclass of FILE based on mime (say IMAGE) and this function would return IMAGE and MBKP
| array | $specificformats | array of more specific formats (eg based on mime detection) |
| array | $generalformats | array of more general formats (usually more supported) |
Definition at line 671 of file portfoliolib.php.


| portfolio_plugin_sanity_check | ( | $ | plugins = null | ) |
helper function to check all the plugins for sanity and set any insane ones to invisible.
| array | $plugins | to check (if null, defaults to all) one string will work too for a single plugin. |
Definition at line 814 of file portfoliolib.php.


| portfolio_report_insane | ( | $ | insane, |
| $ | instances = false, |
||
| $ | return = false |
||
| ) |
helper function to display a table of plugins (or instances) and reasons for disabling
| array | $insane | array of insane plugins (key = plugin (or instance id), value = reason) |
| array | $instances | if reporting instances rather than whole plugins, pass the array (key = id, value = object) here |
Definition at line 886 of file portfoliolib.php.


| portfolio_rewrite_pluginfile_url_callback | ( | $ | contextid, |
| $ | component, | ||
| $ | filearea, | ||
| $ | itemid, | ||
| $ | format, | ||
| $ | options, | ||
| $ | matches | ||
| ) |
callback function from portfolio_rewrite_pluginfile_urls looks through preg_replace matches and replaces content with whatever the active portfolio export format says
Definition at line 1202 of file portfoliolib.php.

| portfolio_rewrite_pluginfile_urls | ( | $ | text, |
| $ | contextid, | ||
| $ | component, | ||
| $ | filearea, | ||
| $ | itemid, | ||
| $ | format, | ||
| $ | options = null |
||
| ) |
go through all the @PLUGINFILE@ matches in some text, extract the file information and pass it back to the portfolio export format to regenerate the html to output
| string | $text | the text to search through |
| int | $contextid | normal file_area arguments |
| string | $component | |
| string | $filearea | normal file_area arguments |
| int | $itemid | normal file_area arguments |
| portfolio_format | $format | the portfolio export format |
| array | $options | extra options to pass through to the file_output function in the format (optional) |
Definition at line 1256 of file portfoliolib.php.


| portfolio_static_function | ( | $ | plugin, |
| $ | function | ||
| ) |
Helper function to call a static function on a portfolio plugin class
This will figure out the classname and require the right file and call the function. you can send a variable number of arguments to this function after the first two and they will be passed on to the function you wish to call.
| string | $plugin | name of plugin |
| string | $function | function to call |
Definition at line 781 of file portfoliolib.php.

Supported formats currently in use.
Canonical place for a list of all formats that portfolio plugins and callers can use for exporting content
Definition at line 537 of file portfoliolib.php.

| portfolio_supported_formats_intersect | ( | $ | callerformats, |
| $ | pluginformats | ||
| ) |
Intersection of plugin formats and caller formats
Walks both the caller formats and portfolio plugin formats and looks for matches (walking the hierarchy as well) and returns the intersection
| array | $callerformats | formats the caller supports |
| array | $pluginformats | formats the portfolio plugin supports |
Definition at line 605 of file portfoliolib.php.

