Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Private resource module utility functions

Copyright: 2009 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 555 lines (20 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

resource_content_file_info:: (3 methods):
  get_parent()
  get_visible_name()
  resource_set_mainfile()

Defines 3 functions


Class: resource_content_file_info  - X-Ref

File browsing support class

get_parent()   X-Ref
No description

get_visible_name()   X-Ref
No description

resource_set_mainfile($data)   X-Ref
No description

Functions that are not part of a class:

resource_redirect_if_migrated($oldid, $cmid)   X-Ref
Redirected to migrated resource if needed,
return if incorrect parameters specified

param: int $oldid
param: int $cmid
return: void

resource_display_embed($resource, $cm, $course, $file)   X-Ref
Display embedded resource file.

param: object $resource
param: object $cm
param: object $course
param: stored_file $file main file
return: does not return

resource_display_frame($resource, $cm, $course, $file)   X-Ref
Display resource frames.

param: object $resource
param: object $cm
param: object $course
param: stored_file $file main file
return: does not return

resource_get_clicktoopen($file, $revision, $extra='')   X-Ref
Internal function - create click to open text with link.


resource_get_clicktodownload($file, $revision)   X-Ref
Internal function - create click to open text with link.


resource_print_workaround($resource, $cm, $course, $file)   X-Ref
Print resource info and workaround link when JS not available.

param: object $resource
param: object $cm
param: object $course
param: stored_file $file main file
return: does not return

resource_print_header($resource, $cm, $course)   X-Ref
Print resource header.

param: object $resource
param: object $cm
param: object $course
return: void

resource_print_heading($resource, $cm, $course, $notused = false)   X-Ref
Print resource heading.

param: object $resource
param: object $cm
param: object $course
param: bool $notused This variable is no longer used
return: void

resource_get_file_details($resource, $cm)   X-Ref
Gets details of the file to cache in course cache to be displayed using {@link resource_get_optional_details()}

param: object $resource Resource table row (only property 'displayoptions' is used here)
param: object $cm Course-module table row
return: string Size and type or empty string if show options are not enabled

resource_get_optional_details($resource, $cm)   X-Ref
Gets optional details for a resource, depending on resource settings.

Result may include the file size and type if those settings are chosen,
or blank if none.

param: object $resource Resource table row (only property 'displayoptions' is used here)
param: object $cm Course-module table row
return: string Size and type or empty string if show options are not enabled

resource_print_intro($resource, $cm, $course, $ignoresettings=false)   X-Ref
Print resource introduction.

param: object $resource
param: object $cm
param: object $course
param: bool $ignoresettings print even if not specified in modedit
return: void

resource_print_tobemigrated($resource, $cm, $course)   X-Ref
Print warning that instance not migrated yet.

param: object $resource
param: object $cm
param: object $course
return: void, does not return

resource_print_filenotfound($resource, $cm, $course)   X-Ref
Print warning that file can not be found.

param: object $resource
param: object $cm
param: object $course
return: void, does not return

resource_get_final_display_type($resource)   X-Ref
Decide the best display format.

param: object $resource
return: int display type constant