Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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.
/mod/url/ -> lib.php (source)

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

Mandatory public API of url module

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

Defines 15 functions


Functions that are not part of a class:

url_supports($feature)   X-Ref
List of features supported in URL module

param: string $feature FEATURE_xx constant for requested feature
return: mixed True if module supports feature, false if not, null if doesn't know

url_reset_userdata($data)   X-Ref
This function is used by the reset_course_userdata function in moodlelib.

param: $data the data submitted from the reset course.
return: array status array

url_get_view_actions()   X-Ref
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.

return: array

url_get_post_actions()   X-Ref
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.

return: array

url_add_instance($data, $mform)   X-Ref
Add url instance.

param: object $data
param: object $mform
return: int new url instance id

url_update_instance($data, $mform)   X-Ref
Update url instance.

param: object $data
param: object $mform
return: bool true

url_delete_instance($id)   X-Ref
Delete url instance.

param: int $id
return: bool true

url_get_coursemodule_info($coursemodule)   X-Ref
Given a course_module object, this function returns any
"extra" information that may be needed when printing
this activity in a course listing.

See {@link get_array_of_activities()} in course/lib.php

param: object $coursemodule
return: cached_cm_info info

url_page_type_list($pagetype, $parentcontext, $currentcontext)   X-Ref
Return a list of page types

param: string $pagetype current page type
param: stdClass $parentcontext Block's parent context
param: stdClass $currentcontext Current context of block

url_export_contents($cm, $baseurl)   X-Ref
Export URL resource contents

return: array of file content

url_dndupload_register()   X-Ref
Register the ability to handle drag and drop file uploads

return: array containing details of the files / types the mod can handle

url_dndupload_handle($uploadinfo)   X-Ref
Handle a file that has been uploaded

param: object $uploadinfo details of the file / content that has been uploaded
return: int instance id of the newly created mod

url_view($url, $course, $cm, $context)   X-Ref
Mark the activity completed (if required) and trigger the course_module_viewed event.

param: stdClass $url        url object
param: stdClass $course     course object
param: stdClass $cm         course module object
param: stdClass $context    context object

url_check_updates_since(cm_info $cm, $from, $filter = array()   X-Ref
Check if the module has any update that affects the current user since a given time.

param: cm_info $cm course module data
param: int $from the time to check updates from
param: array $filter  if we need to check only specific updates
return: stdClass an object with the different type of areas indicating if they were updated or not

mod_url_core_calendar_provide_event_action(calendar_event $event,\core_calendar\action_factory $factory, $userid = 0)   X-Ref
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.

param: calendar_event $event
param: \core_calendar\action_factory $factory
param: int $userid ID override for calendar events
return: \core_calendar\local\event\entities\action_interface|null