Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

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: 543 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