Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Classes | Functions
portfoliolib.php File Reference

This file contains all global functions to do with manipulating portfolios. More...

Classes

class  portfolio_add_button
 

Functions

 portfolio_existing_exports ($userid, $type=null)
 Return a list of current exports for the given user. More...
 
 portfolio_existing_exports_by_plugin ($userid)
 Return an array of existing exports by type for a given user. More...
 
 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. More...
 
 portfolio_expected_time_file ($totest)
 Try and determine expected_time for purely file based exports or exports that might include large file attachments. More...
 
 portfolio_export_pagesetup ($PAGE, $caller)
 Setup page export. More...
 
 portfolio_export_rethrow_exception ($exporter, $exception)
 Helper function to rethrow a caught portfolio_exception as an export exception. More...
 
 portfolio_export_type_to_id ($type, $userid)
 Get export type id. More...
 
 portfolio_filesize_info ()
 The default filesizes and threshold information for file based transfers. More...
 
 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) More...
 
 portfolio_format_is_abstract ($format)
 Tiny helper to figure out whether a portfolio format is abstract. More...
 
 portfolio_format_object ($name)
 Helper function to return a format object from the constant. More...
 
 portfolio_format_text_options ()
 Return default common options for format_text() when preparing a content to be exported. More...
 
 portfolio_has_visible_instances ()
 Return whether there are visible instances in portfolio. More...
 
 portfolio_include_callback_file ($component, $class=null)
 Function to require any potential callback files, throwing exceptions if an issue occurs. More...
 
 portfolio_insane_notify_admins ($insane, $instances=false)
 Function to send portfolio report to admins. More...
 
 portfolio_instance ($instanceid, $record=null)
 Helper function to return an instance of a plugin (with config loaded) More...
 
 portfolio_instance_sanity_check ($instances=null)
 Helper function to check all the instances for sanity and set any insane ones to invisible. More...
 
 portfolio_instance_select ($instances, $callerformats, $callbackclass, $mimetype=null, $selectname='instance', $return=false, $returnarray=false)
 Returns a drop menu with a list of available instances. More...
 
 portfolio_instances ($visibleonly=true, $useronly=true)
 Return all portfolio instances. More...
 
 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. More...
 
 portfolio_plugin_sanity_check ($plugins=null)
 Helper function to check all the plugins for sanity and set any insane ones to invisible. More...
 
 portfolio_report_insane ($insane, $instances=false, $return=false)
 Helper function to display a table of plugins (or instances) and reasons for disabling. More...
 
 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 More...
 
 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. More...
 
 portfolio_static_function ($plugin, $function)
 Helper function to call a static function on a portfolio plugin class. More...
 
 portfolio_supported_formats ()
 Supported formats currently in use. More...
 
 portfolio_supported_formats_intersect ($callerformats, $pluginformats)
 Intersection of plugin formats and caller formats. More...
 

Detailed Description

This file contains all global functions to do with manipulating portfolios.

Everything else that is logically namespaced by class is in its own file in lib/portfolio/ directory.

Major Contributors