Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Namespaces | |
namespace | mod_resource\analytics\indicator |
| |
namespace | mod_resource\completion |
| |
namespace | mod_resource\content |
| |
namespace | mod_resource\event |
| |
namespace | mod_resource\privacy |
| |
namespace | mod_resource\search |
| |
Classes | |
class | backup_resource_activity_structure_step |
Define the complete resource structure for backup, with file and id annotations. More... | |
class | backup_resource_activity_task |
Provides the steps to perform one complete backup of the Resource instance. More... | |
class | mod_resource\analytics\indicator\activity_base |
Activity base class. More... | |
class | mod_resource\analytics\indicator\cognitive_depth |
Cognitive depth indicator - resource. More... | |
class | mod_resource\analytics\indicator\social_breadth |
Social breadth indicator - resource. More... | |
class | mod_resource\completion\custom_completion |
class | mod_resource\content\exporter |
A class which assists a component to export content. More... | |
class | mod_resource\event\course_module_instance_list_viewed |
The mod_resource instance list viewed event class. More... | |
class | mod_resource\event\course_module_viewed |
The mod_resource course module viewed event class. More... | |
class | mod_resource\privacy\provider |
The mod_resource module does not store any data. More... | |
class | mod_resource\search\activity |
Search area for mod_resource activities. More... | |
class | mod_resource_external |
class | mod_resource_generator |
Resource module data generator class. More... | |
class | mod_resource_mod_form |
class | moodle1_mod_resource_handler |
Resource conversion handler. More... | |
class | resource_content_file_info |
File browsing support class. More... | |
class | restore_resource_activity_structure_step |
Define all the restore steps that will be used by the restore_resource_activity_task. More... | |
class | restore_resource_activity_task |
resource restore task that provides all the settings and steps to perform one complete restore of the activity More... | |
Functions | |
mod_resource_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, $userid=0) | |
This function receives a calendar event and returns the action associated with it, or null if there is none. | |
mod_resource_get_path_from_pluginfile (string $filearea, array $args) | |
Given an array with a file path, it returns the itemid and the filepath for the defined filearea. | |
resource_add_instance ($data, $mform) | |
Add resource instance. | |
resource_check_updates_since (cm_info $cm, $from, $filter=array()) | |
Check if the module has any update that affects the current user since a given time. | |
resource_cm_info_view (cm_info $cm) | |
Called when viewing course page. | |
resource_delete_instance ($id) | |
Delete resource instance. | |
resource_display_embed ($resource, $cm, $course, $file) | |
Display embedded resource file. | |
resource_display_frame ($resource, $cm, $course, $file) | |
Display resource frames. | |
resource_dndupload_handle ($uploadinfo) | |
Handle a file that has been uploaded. | |
resource_dndupload_register () | |
Register the ability to handle drag and drop file uploads. | |
resource_export_contents ($cm, $baseurl) | |
Export file resource contents. | |
resource_get_clicktodownload ($file, $revision) | |
Internal function - create click to open text with link. | |
resource_get_clicktoopen ($file, $revision, $extra='') | |
Internal function - create click to open text with link. | |
resource_get_coursemodule_info ($coursemodule) | |
Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing. | |
resource_get_file_areas ($course, $cm, $context) | |
Lists all browsable file areas. | |
resource_get_file_details ($resource, $cm) | |
Gets details of the file to cache in course cache to be displayed using resource_get_optional_details(). | |
resource_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) | |
File browsing support for resource module content area. | |
resource_get_final_display_type ($resource) | |
Decide the best display format. | |
resource_get_intro (object $resource, object $cm, bool $ignoresettings=false) | |
Get resource introduction. | |
resource_get_optional_details ($resource, $cm) | |
Gets optional details for a resource, depending on resource settings. | |
resource_get_post_actions () | |
List the actions that correspond to a post of this module. | |
resource_get_view_actions () | |
List the actions that correspond to a view of this module. | |
resource_page_type_list ($pagetype, $parentcontext, $currentcontext) | |
Return a list of page types. | |
resource_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) | |
Serves the resource files. | |
resource_print_filenotfound ($resource, $cm, $course) | |
Print warning that file can not be found. | |
resource_print_header ($resource, $cm, $course) | |
Print resource header. | |
resource_print_heading ($resource, $cm, $course, $notused=false) | |
Print resource heading. | |
resource_print_intro ($resource, $cm, $course, $ignoresettings=false) | |
Print resource introduction. | |
resource_print_tobemigrated ($resource, $cm, $course) | |
Print warning that instance not migrated yet. | |
resource_print_workaround ($resource, $cm, $course, $file) | |
Print resource info and workaround link when JS not available. | |
resource_redirect_if_migrated ($oldid, $cmid) | |
Redirected to migrated resource if needed, return if incorrect parameters specified. | |
resource_reset_userdata ($data) | |
This function is used by the reset_course_userdata function in moodlelib. | |
resource_set_display_options ($data) | |
Updates display options based on form input. | |
resource_set_mainfile ($data) | |
resource_supports ($feature) | |
List of features supported in Resource module. | |
resource_update_instance ($data, $mform) | |
Update resource instance. | |
resource_view ($resource, $course, $cm, $context) | |
Mark the activity completed (if required) and trigger the course_module_viewed event. | |
xmldb_resource_upgrade ($oldversion) | |
Variables | |
$capabilities | |
$functions | |
$logs | |
$plugin = 2023041800 | |
$plugin | component = 'mod_resource' |
$plugin | cron = 0 |
$plugin | version = 2023042400 |
mod_resource_core_calendar_provide_event_action | ( | calendar_event | $event, |
core_calendar\action_factory | $factory, | ||
$userid = 0 ) |
This function receives a calendar event and returns the action associated with it, or null if there is none.
This is used by block_myoverview in order to display the event appropriately. If null is returned then the event is not displayed on the block.
calendar_event | $event | |
core_calendar\action_factory | $factory |
core_calendar\local\event\entities\action_interface|null |
mod_resource_get_path_from_pluginfile | ( | string | $filearea, |
array | $args ) |
Given an array with a file path, it returns the itemid and the filepath for the defined filearea.
string | $filearea | The filearea. |
array | $args | The path (the part after the filearea and before the filename). |
array | The itemid and the filepath inside the $args path, for the defined filearea. |
resource_add_instance | ( | $data, | |
$mform ) |
Add resource instance.
object | $data | |
object | $mform |
int | new resource instance id |
resource_check_updates_since | ( | cm_info | $cm, |
$from, | |||
$filter = array() ) |
Check if the module has any update that affects the current user since a given time.
cm_info | $cm | course module data |
int | $from | the time to check updates from |
array | $filter | if we need to check only specific updates |
stdClass | an object with the different type of areas indicating if they were updated or not |
resource_cm_info_view | ( | cm_info | $cm | ) |
Called when viewing course page.
Shows extra details after the link if enabled.
cm_info | $cm | Course module information |
resource_delete_instance | ( | $id | ) |
Delete resource instance.
int | $id |
bool | true |
resource_display_embed | ( | $resource, | |
$cm, | |||
$course, | |||
$file ) |
Display embedded resource file.
object | $resource | |
object | $cm | |
object | $course | |
stored_file | $file | main file |
does | not return |
resource_display_frame | ( | $resource, | |
$cm, | |||
$course, | |||
$file ) |
Display resource frames.
object | $resource | |
object | $cm | |
object | $course | |
stored_file | $file | main file |
does | not return |
resource_dndupload_handle | ( | $uploadinfo | ) |
Handle a file that has been uploaded.
object | $uploadinfo | details of the file / content that has been uploaded |
int | instance id of the newly created mod |
resource_dndupload_register | ( | ) |
Register the ability to handle drag and drop file uploads.
array | containing details of the files / types the mod can handle |
resource_export_contents | ( | $cm, | |
$baseurl ) |
Export file resource contents.
array | of file content |
resource_get_coursemodule_info | ( | $coursemodule | ) |
Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing.
See course_modinfo::get_array_of_activities()
stdClass | $coursemodule |
cached_cm_info | info |
resource_get_file_areas | ( | $course, | |
$cm, | |||
$context ) |
Lists all browsable file areas.
stdClass | $course | course object |
stdClass | $cm | course module object |
stdClass | $context | context object |
array |
resource_get_file_details | ( | $resource, | |
$cm ) |
Gets details of the file to cache in course cache to be displayed using resource_get_optional_details().
object | $resource | Resource table row (only property 'displayoptions' is used here) |
object | $cm | Course-module table row |
string | Size and type or empty string if show options are not enabled |
resource_get_file_info | ( | $browser, | |
$areas, | |||
$course, | |||
$cm, | |||
$context, | |||
$filearea, | |||
$itemid, | |||
$filepath, | |||
$filename ) |
File browsing support for resource module content area.
file_browser | $browser | file browser instance |
stdClass | $areas | file areas |
stdClass | $course | course object |
stdClass | $cm | course module object |
stdClass | $context | context object |
string | $filearea | file area |
int | $itemid | item ID |
string | $filepath | file path |
string | $filename | file name |
file_info | instance or null if not found |
resource_get_final_display_type | ( | $resource | ) |
Decide the best display format.
object | $resource |
int | display type constant |
resource_get_intro | ( | object | $resource, |
object | $cm, | ||
bool | $ignoresettings = false ) |
Get resource introduction.
object | $resource | |
object | $cm | |
bool | $ignoresettings | print even if not specified in modedit |
string |
resource_get_optional_details | ( | $resource, | |
$cm ) |
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.
object | $resource | Resource table row (only property 'displayoptions' is used here) |
object | $cm | Course-module table row |
string | Size and type or empty string if show options are not enabled |
resource_get_post_actions | ( | ) |
List the actions that correspond to a post of this module.
This is used by the participation report.
Note: This is not used by new logging system. Event with crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING will be considered as post action.
array |
resource_get_view_actions | ( | ) |
List the actions that correspond to a view of this module.
This is used by the participation report.
Note: This is not used by new logging system. Event with crud = 'r' and edulevel = LEVEL_PARTICIPATING will be considered as view action.
array |
resource_page_type_list | ( | $pagetype, | |
$parentcontext, | |||
$currentcontext ) |
Return a list of page types.
string | $pagetype | current page type |
stdClass | $parentcontext | Block's parent context |
stdClass | $currentcontext | Current context of block |
resource_pluginfile | ( | $course, | |
$cm, | |||
$context, | |||
$filearea, | |||
$args, | |||
$forcedownload, | |||
array | $options = array() ) |
Serves the resource files.
stdClass | $course | course object |
stdClass | $cm | course module object |
stdClass | $context | context object |
string | $filearea | file area |
array | $args | extra arguments |
bool | $forcedownload | whether or not force download |
array | $options | additional options affecting the file serving |
bool | false if file not found, does not return if found - just send the file |
resource_print_filenotfound | ( | $resource, | |
$cm, | |||
$course ) |
Print warning that file can not be found.
object | $resource | |
object | $cm | |
object | $course |
void,does | not return |
resource_print_header | ( | $resource, | |
$cm, | |||
$course ) |
Print resource header.
object | $resource | |
object | $cm | |
object | $course |
void |
resource_print_heading | ( | $resource, | |
$cm, | |||
$course, | |||
$notused = false ) |
Print resource heading.
object | $resource | |
object | $cm | |
object | $course | |
bool | $notused | This variable is no longer used |
void |
resource_print_intro | ( | $resource, | |
$cm, | |||
$course, | |||
$ignoresettings = false ) |
Print resource introduction.
object | $resource | |
object | $cm | |
object | $course | |
bool | $ignoresettings | print even if not specified in modedit |
void |
resource_print_tobemigrated | ( | $resource, | |
$cm, | |||
$course ) |
Print warning that instance not migrated yet.
object | $resource | |
object | $cm | |
object | $course |
void,does | not return |
resource_print_workaround | ( | $resource, | |
$cm, | |||
$course, | |||
$file ) |
Print resource info and workaround link when JS not available.
object | $resource | |
object | $cm | |
object | $course | |
stored_file | $file | main file |
does | not return |
resource_redirect_if_migrated | ( | $oldid, | |
$cmid ) |
Redirected to migrated resource if needed, return if incorrect parameters specified.
int | $oldid | |
int | $cmid |
void |
resource_reset_userdata | ( | $data | ) |
This function is used by the reset_course_userdata function in moodlelib.
$data | the data submitted from the reset course. |
array | status array |
resource_set_display_options | ( | $data | ) |
Updates display options based on form input.
Shared code used by resource_add_instance and resource_update_instance.
object | $data | Data object |
resource_supports | ( | $feature | ) |
List of features supported in Resource module.
string | $feature | FEATURE_xx constant for requested feature |
mixed | True if module supports feature, false if not, null if doesn't know or string for the module purpose. |
resource_update_instance | ( | $data, | |
$mform ) |
Update resource instance.
object | $data | |
object | $mform |
bool | true |
resource_view | ( | $resource, | |
$course, | |||
$cm, | |||
$context ) |
Mark the activity completed (if required) and trigger the course_module_viewed event.
stdClass | $resource | resource object |
stdClass | $course | course object |
stdClass | $cm | course module object |
stdClass | $context | context object |
$capabilities |
$functions |
$logs |