Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
resourcelib.php File Reference

Functions

 resourcelib_embed_general ($fullurl, $title, $clicktoopen, $mimetype)
 Returns general link or file embedding html.
 
 resourcelib_embed_image ($fullurl, $title)
 Returns image embedding html.
 
 resourcelib_embed_pdf ($fullurl, $title, $clicktoopen)
 Returns general link or pdf embedding html.
 
 resourcelib_get_displayoptions (array $enabled, $current=null)
 Returns list of available display options.
 
 resourcelib_get_extension ($fullurl)
 Looks for the extension.
 
 resourcelib_guess_url_mimetype ($fullurl)
 Tries to guess correct mimetype for arbitrary URL.
 
 resourcelib_try_file_migration ($filepath, $cmid, $courseid, $component, $filearea, $itemid)
 Try on demand migration of file from old course files.
 

Variables

const RESOURCELIB_DISPLAY_AUTO 0
 Try the best way.
 
const RESOURCELIB_DISPLAY_DOWNLOAD 4
 Force download of file instead of display.
 
const RESOURCELIB_DISPLAY_EMBED 1
 Display using object tag.
 
const RESOURCELIB_DISPLAY_FRAME 2
 Display inside frame.
 
const RESOURCELIB_DISPLAY_NEW 3
 Display normal link in new window.
 
const RESOURCELIB_DISPLAY_OPEN 5
 Open directly.
 
const RESOURCELIB_DISPLAY_POPUP 6
 Open in "emulated" pop-up without navigation.
 
const RESOURCELIB_LEGACYFILES_ACTIVE 2
 Legacy files conversion in progress.
 
const RESOURCELIB_LEGACYFILES_DONE 1
 Legacy files conversion marked as completed.
 
const RESOURCELIB_LEGACYFILES_NO 0
 Legacy files not needed or new resource.