|
Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
|
Functions | |
| mod_wiki_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, int $userid=0) | |
| This function receives a calendar event and returns the action associated with it, or null if there is none. | |
| mod_wiki_get_fontawesome_icon_map () | |
| Get icon mapping for font-awesome. | |
| wiki_add_instance ($wiki) | |
| Given an object containing all the necessary data, (defined by the form in mod.html) this function will create a new instance and return the id number of the new instance. | |
| wiki_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. | |
| wiki_cm_info_dynamic (cm_info $cm) | |
| Sets dynamic information about a course module. | |
| wiki_comment_permissions ($comment_param) | |
| Running addtional permission check on plugin, for example, plugins may have switch to turn on/off comments option, this callback will affect UI display, not like pluginname_comment_validate only throw exceptions. | |
| wiki_comment_validate ($comment_param) | |
| Validate comment parameter before perform other comments actions. | |
| wiki_delete_instance ($id) | |
| Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it. | |
| wiki_extend_navigation (navigation_node $navref, stdClass $course, stdClass $instance, cm_info $cm) | |
| Extends the global navigation tree by adding wiki nodes if there is a relevant content. | |
| wiki_get_extra_capabilities () | |
| Returns all other caps used in wiki module. | |
| wiki_grades ($wikiid) | |
| Must return an array of grades for a given instance of this module, indexed by user. | |
| wiki_page_type_list ($pagetype, $parentcontext, $currentcontext) | |
| Return a list of page types. | |
| wiki_page_view ($wiki, $page, $course, $cm, $context, $uid=null, $other=null, $subwiki=null) | |
| Mark the activity completed (if required) and trigger the page_viewed event. | |
| wiki_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) | |
| file serving callback | |
| $CFG | wiki_print_recent_activity ($course, $viewfullnames, $timestart) |
| Given a course and a time, this module should find recent activity that has occurred in wiki activities and print it out. | |
| wiki_reset_course_form_definition (&$mform) | |
| wiki_reset_userdata ($data) | |
| Implements callback to reset course. | |
| wiki_scale_used () | |
| wiki_scale_used_anywhere ($scaleid) | |
| Checks if scale is being used by any instance of wiki. | |
| wiki_search_form ($cm, $search='', $subwiki=null) | |
| Search for wiki. | |
| wiki_supports ($feature) | |
| Indicates API features that the wiki supports. | |
| wiki_update_instance ($wiki) | |
| Given an object containing all the necessary data, (defined by the form in mod.html) this function will update an existing instance with new data. | |
| wiki_view ($wiki, $course, $cm, $context) | |
| Mark the activity completed (if required) and trigger the course_module_viewed event. | |
| mod_wiki_core_calendar_provide_event_action | ( | calendar_event | $event, |
| core_calendar\action_factory | $factory, | ||
| int | $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 | |
| int | $userid | User id to use for all capability checks, etc. Set to 0 for current user (default). |
| core_calendar\local\event\entities\action_interface|null |
| wiki_add_instance | ( | $wiki | ) |
Given an object containing all the necessary data, (defined by the form in mod.html) this function will create a new instance and return the id number of the new instance.
| object | $instance | An object from the form in mod.html |
| int | The id of the newly inserted wiki record |
| wiki_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 |
| wiki_cm_info_dynamic | ( | cm_info | $cm | ) |
Sets dynamic information about a course module.
This callback is called from cm_info when checking module availability (incl. $cm->uservisible)
Main viewing capability in mod_wiki is 'mod/wiki:viewpage' instead of the expected standardised 'mod/wiki:view'. The method cm_info\is_user_access_restricted_by_capability() does not work for wiki, we need to implement this callback.
| cm_info | $cm |
| wiki_comment_permissions | ( | $comment_param | ) |
Running addtional permission check on plugin, for example, plugins may have switch to turn on/off comments option, this callback will affect UI display, not like pluginname_comment_validate only throw exceptions.
Capability check has been done in comment->check_permissions(), we don't need to do it again here.
| stdClass | $comment_param | { context => context the context object courseid => int course id cm => stdClass course module object commentarea => string comment area itemid => int itemid } |
| array |
| wiki_comment_validate | ( | $comment_param | ) |
Validate comment parameter before perform other comments actions.
| stdClass | $comment_param | { context => context the context object courseid => int course id cm => stdClass course module object commentarea => string comment area itemid => int itemid } |
| boolean |
| wiki_delete_instance | ( | $id | ) |
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.
| int | $id | Id of the module instance |
| boolean | Success/Failure |
| wiki_extend_navigation | ( | navigation_node | $navref, |
| stdClass | $course, | ||
| stdClass | $instance, | ||
| cm_info | $cm ) |
Extends the global navigation tree by adding wiki nodes if there is a relevant content.
This can be called by an AJAX request so do not rely on $PAGE as it might not be set up properly.
| navigation_node | $navref | An object representing the navigation tree node of the workshop module instance |
| stdClass | $course | the course object |
| stdClass | $instance | the activity record object |
| cm_info | $cm | the course module object |
| wiki_get_extra_capabilities | ( | ) |
Returns all other caps used in wiki module.
| array |
| wiki_grades | ( | $wikiid | ) |
Must return an array of grades for a given instance of this module, indexed by user.
It also returns a maximum allowed grade.
Example: $return->grades = array of grades; $return->maxgrade = maximum allowed grade;
return $return;
| int | $wikiid | ID of an instance of this module |
| mixed | Null or object with an array of grades and with the maximum grade |
| wiki_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 |
| wiki_page_view | ( | $wiki, | |
| $page, | |||
| $course, | |||
| $cm, | |||
| $context, | |||
| $uid = null, | |||
| $other = null, | |||
| $subwiki = null ) |
Mark the activity completed (if required) and trigger the page_viewed event.
| stdClass | $wiki | Wiki object. |
| stdClass | $page | Page object. |
| stdClass | $course | Course object. |
| stdClass | $cm | Course module object. |
| stdClass | $context | Context object. |
| int | $uid | Optional User ID. |
| array | $other | Optional Other params: title, wiki ID, group ID, groupanduser, prettyview. |
| stdClass | $subwiki | Optional Subwiki. |
| wiki_pluginfile | ( | $course, | |
| $cm, | |||
| $context, | |||
| $filearea, | |||
| $args, | |||
| $forcedownload, | |||
| array | $options = array() ) |
file serving callback
| 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 the file was not found, just send the file otherwise and do not return anything |
| $CFG wiki_print_recent_activity | ( | $course, | |
| $viewfullnames, | |||
| $timestart ) |
Given a course and a time, this module should find recent activity that has occurred in wiki activities and print it out.
Return true if there was output, or false is there was none.
@global $DB @uses CONTEXT_MODULE @uses VISIBLEGROUPS
| object | $course | |
| bool | $viewfullnames | capability |
| int | $timestart |
| boolean |
| wiki_reset_userdata | ( | $data | ) |
Implements callback to reset course.
| stdClass | $data |
| boolean|array |
| wiki_scale_used | ( | ) |
| wiki_scale_used_anywhere | ( | $scaleid | ) |
Checks if scale is being used by any instance of wiki.
This function was added in 1.9
This is used to find out if scale used anywhere
| $scaleid | int |
| boolean | True if the scale is used by any wiki |
| wiki_search_form | ( | $cm, | |
| $search = '', | |||
| $subwiki = null ) |
Search for wiki.
| stdClass | $cm | course module object |
| string | $search | searchword. |
| stdClass | $subwiki | Optional Subwiki. |
| Search | wiki input form |
| wiki_supports | ( | $feature | ) |
Indicates API features that the wiki supports.
@uses FEATURE_GROUPS @uses FEATURE_GROUPINGS @uses FEATURE_MOD_INTRO @uses FEATURE_COMPLETION_TRACKS_VIEWS @uses FEATURE_COMPLETION_HAS_RULES @uses FEATURE_GRADE_HAS_GRADE @uses FEATURE_GRADE_OUTCOMES
| string | $feature |
| mixed | True if module supports feature, false if not, null if doesn't know or string for the module purpose. |
| wiki_update_instance | ( | $wiki | ) |
Given an object containing all the necessary data, (defined by the form in mod.html) this function will update an existing instance with new data.
| object | $instance | An object from the form in mod.html |
| boolean | Success/Fail |
| wiki_view | ( | $wiki, | |
| $course, | |||
| $cm, | |||
| $context ) |
Mark the activity completed (if required) and trigger the course_module_viewed event.
| stdClass | $wiki | Wiki object. |
| stdClass | $course | Course object. |
| stdClass | $cm | Course module object. |
| stdClass | $context | Context object. |