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]

deprecatedlib.php - Old functions retained only for backward compatibility Old functions retained only for backward compatibility.  New code should not use any of these functions.

Copyright: 1999 onwards Martin Dougiamas {@link http://moodle.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 3825 lines (126 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 classes

format_base:: (24 methods):
  get_all_sections()
  add_mod_to_section()
  get_all_mods()
  get_course_section()
  format_weeks_get_section_dates()
  get_print_section_cm_text()
  print_section_add_menus()
  make_editing_buttons()
  print_section()
  print_overview()
  print_recent_activity()
  delete_course_module()
  update_category_button()
  make_categories_list()
  category_delete_move()
  category_delete_full()
  move_category()
  course_category_hide()
  course_category_show()
  get_course_category()
  create_course_category()
  get_all_subcategories()
  get_child_categories()
  get_categories()

core_course_category:: (14 methods):
  print_course_search()
  print_my_moodle()
  print_remote_course()
  print_remote_host()
  print_whole_category_list()
  print_category_info()
  get_course_category_tree()
  print_courses()
  print_course()
  get_category_courses_array()
  get_category_courses_array_recursively()
  blog_get_context_url()
  get_courses_wmanagers()
  convert_tree_to_html()

tabtree:: (38 methods):
  convert_tabrows_to_tree()
  can_use_rotated_text()
  get_context_instance_by_id()
  get_system_context()
  get_parent_contexts()
  get_parent_contextid()
  get_child_contexts()
  create_contexts()
  cleanup_contexts()
  build_context_path()
  rebuild_contexts()
  preload_course_contexts()
  context_moved()
  fetch_context_capabilities()
  context_instance_preload()
  get_contextlevel_name()
  print_context_name()
  mark_context_dirty()
  delete_context()
  get_context_url()
  get_course_context()
  get_user_courses_bycap()
  get_role_context_caps()
  get_courseid_from_context()
  context_instance_preload_sql()
  get_related_contexts_string()
  get_plugin_list_with_file()
  check_browser_operating_system()
  check_browser_version()
  get_device_type()
  get_device_type_list()
  get_selected_theme_for_device_type()
  get_device_cfg_var_name()
  set_user_device_type()
  get_user_device_type()
  get_browser_version_classes()
  generate_email_supportuser()
  badges_get_issued_badge_info()

tabtree:: (38 methods):
  convert_tabrows_to_tree()
  can_use_rotated_text()
  get_context_instance_by_id()
  get_system_context()
  get_parent_contexts()
  get_parent_contextid()
  get_child_contexts()
  create_contexts()
  cleanup_contexts()
  build_context_path()
  rebuild_contexts()
  preload_course_contexts()
  context_moved()
  fetch_context_capabilities()
  context_instance_preload()
  get_contextlevel_name()
  print_context_name()
  mark_context_dirty()
  delete_context()
  get_context_url()
  get_course_context()
  get_user_courses_bycap()
  get_role_context_caps()
  get_courseid_from_context()
  context_instance_preload_sql()
  get_related_contexts_string()
  get_plugin_list_with_file()
  check_browser_operating_system()
  check_browser_version()
  get_device_type()
  get_device_type_list()
  get_selected_theme_for_device_type()
  get_device_cfg_var_name()
  set_user_device_type()
  get_user_device_type()
  get_browser_version_classes()
  generate_email_supportuser()
  badges_get_issued_badge_info()

and:: (14 methods):
  can_use_html_editor()
  count_login_failures()
  ajaxenabled()
  coursemodule_visible_for_user()
  enrol_cohort_get_cohorts()
  enrol_cohort_can_view_cohort()
  cohort_get_visible_list()
  enrol_cohort_enrol_all_users()
  enrol_cohort_search_cohorts()
  message_current_user_is_involved()
  profile_display_badges()
  useredit_shared_definition_preferences()
  calendar_normalize_tz()
  get_user_timezone_offset()

instead:: (156 methods):
  get_timezone_offset()
  get_list_of_timezones()
  update_timezone_records()
  calculate_user_dst_table()
  dst_changes_for_year()
  get_timezone_record()
  get_referer()
  is_web_crawler()
  completion_cron()
  coursetag_get_tags()
  coursetag_get_all_tags()
  coursetag_get_jscript()
  coursetag_get_jscript_links()
  coursetag_get_records()
  coursetag_store_keywords()
  coursetag_delete_keyword()
  coursetag_get_tagged_courses()
  coursetag_delete_course_tags()
  tag_type_set()
  tag_description_set()
  tag_get_tags()
  tag_get_tags_array()
  tag_get_tags_csv()
  tag_get_tags_ids()
  tag_get_id()
  tag_rename()
  tag_delete_instance()
  tag_find_records()
  tag_add()
  tag_assign()
  tag_record_count()
  tag_record_tagged_with()
  tag_set_flag()
  tag_unset_flag()
  tag_print_cloud()
  tag_autocomplete()
  tag_print_description_box()
  tag_print_management_box()
  tag_print_search_box()
  tag_print_search_results()
  tag_print_tagged_users_table()
  tag_print_user_box()
  tag_print_user_list()
  tag_display_name()
  tag_normalize()
  tag_get_related_tags_csv()
  tag_set()
  tag_set_add()
  tag_set_delete()
  tag_get()
  tag_get_related_tags()
  tag_delete()
  tag_delete_instances()
  tag_cleanup()
  tag_bulk_delete_instances()
  tag_compute_correlations()
  tag_process_computed_correlation()
  tag_cron()
  tag_find_tags()
  tag_get_name()
  tag_get_correlated()
  tag_cloud_sort()
  events_load_def()
  events_queue_handler()
  events_dispatch()
  events_process_queued_handler()
  events_update_definition()
  events_cron()
  events_trigger_legacy()
  events_is_registered()
  events_pending_count()
  clam_message_admins()
  get_clam_error_code()
  course_get_cm_rename_action()
  course_scale_used()
  site_scale_used()
  external_function_info()
  get_records_csv()
  put_records_csv()
  css_is_colour()
  css_is_width()
  css_sort_by_count()
  message_get_course_contexts()
  message_remove_url_params()
  message_count_messages()
  message_count_blocked_users()
  message_contact_link()
  message_get_recent_notifications()
  message_history_link()
  message_search()
  message_shorten_message()
  message_get_fragment()
  message_get_history()
  message_get_contact_add_remove_link()
  message_get_contact_block_link()
  message_mark_messages_read()
  message_page_type_list()
  message_can_post_message()
  message_is_user_non_contact_blocked()
  message_is_user_blocked()
  print_log()
  print_mnet_log()
  print_log_csv()
  print_log_xls()
  print_log_ods()
  build_logs_array()
  get_logs_usercourse()
  get_logs_userday()
  get_logs()
  prevent_form_autofill_password()
  message_get_recent_conversations()
  calendar_preferences_button()
  calendar_wday_name()
  calendar_get_block_upcoming()
  calendar_print_month_selector()
  calendar_cron()
  load_course_context()
  load_role_access_by_context()
  dedupe_user_access()
  get_user_access_sitewide()
  calendar_get_mini()
  calendar_get_upcoming()
  allow_override()
  allow_assign()
  allow_switch()
  question_add_tops()
  question_is_only_toplevel_category_in_context()
  message_move_userfrom_unread2read()
  message_get_blocked_users()
  message_get_contacts()
  message_mark_message_read()
  message_can_delete_message()
  message_delete_message()
  calendar_get_all_allowed_types()
  groups_get_all_groups_for_courses()
  events_get_cached()
  events_uninstall()
  events_cleanup()
  events_dequeue()
  events_get_handlers()
  get_roles_on_exact_context()
  get_roles_with_assignment_on_context()
  message_add_contact()
  message_remove_contact()
  message_unblock_contact()
  message_block_contact()
  message_get_contact()
  get_courses_page()
  report_insights_context_insights()
  get_module_metadata()
  cron_run_single_task()
  cron_execute_plugin_type()
  cron_bc_hack_plugin_functions()
  user_get_participants_sql()
  user_get_total_participants()
  user_get_participants()

instead:: (156 methods):
  get_timezone_offset()
  get_list_of_timezones()
  update_timezone_records()
  calculate_user_dst_table()
  dst_changes_for_year()
  get_timezone_record()
  get_referer()
  is_web_crawler()
  completion_cron()
  coursetag_get_tags()
  coursetag_get_all_tags()
  coursetag_get_jscript()
  coursetag_get_jscript_links()
  coursetag_get_records()
  coursetag_store_keywords()
  coursetag_delete_keyword()
  coursetag_get_tagged_courses()
  coursetag_delete_course_tags()
  tag_type_set()
  tag_description_set()
  tag_get_tags()
  tag_get_tags_array()
  tag_get_tags_csv()
  tag_get_tags_ids()
  tag_get_id()
  tag_rename()
  tag_delete_instance()
  tag_find_records()
  tag_add()
  tag_assign()
  tag_record_count()
  tag_record_tagged_with()
  tag_set_flag()
  tag_unset_flag()
  tag_print_cloud()
  tag_autocomplete()
  tag_print_description_box()
  tag_print_management_box()
  tag_print_search_box()
  tag_print_search_results()
  tag_print_tagged_users_table()
  tag_print_user_box()
  tag_print_user_list()
  tag_display_name()
  tag_normalize()
  tag_get_related_tags_csv()
  tag_set()
  tag_set_add()
  tag_set_delete()
  tag_get()
  tag_get_related_tags()
  tag_delete()
  tag_delete_instances()
  tag_cleanup()
  tag_bulk_delete_instances()
  tag_compute_correlations()
  tag_process_computed_correlation()
  tag_cron()
  tag_find_tags()
  tag_get_name()
  tag_get_correlated()
  tag_cloud_sort()
  events_load_def()
  events_queue_handler()
  events_dispatch()
  events_process_queued_handler()
  events_update_definition()
  events_cron()
  events_trigger_legacy()
  events_is_registered()
  events_pending_count()
  clam_message_admins()
  get_clam_error_code()
  course_get_cm_rename_action()
  course_scale_used()
  site_scale_used()
  external_function_info()
  get_records_csv()
  put_records_csv()
  css_is_colour()
  css_is_width()
  css_sort_by_count()
  message_get_course_contexts()
  message_remove_url_params()
  message_count_messages()
  message_count_blocked_users()
  message_contact_link()
  message_get_recent_notifications()
  message_history_link()
  message_search()
  message_shorten_message()
  message_get_fragment()
  message_get_history()
  message_get_contact_add_remove_link()
  message_get_contact_block_link()
  message_mark_messages_read()
  message_page_type_list()
  message_can_post_message()
  message_is_user_non_contact_blocked()
  message_is_user_blocked()
  print_log()
  print_mnet_log()
  print_log_csv()
  print_log_xls()
  print_log_ods()
  build_logs_array()
  get_logs_usercourse()
  get_logs_userday()
  get_logs()
  prevent_form_autofill_password()
  message_get_recent_conversations()
  calendar_preferences_button()
  calendar_wday_name()
  calendar_get_block_upcoming()
  calendar_print_month_selector()
  calendar_cron()
  load_course_context()
  load_role_access_by_context()
  dedupe_user_access()
  get_user_access_sitewide()
  calendar_get_mini()
  calendar_get_upcoming()
  allow_override()
  allow_assign()
  allow_switch()
  question_add_tops()
  question_is_only_toplevel_category_in_context()
  message_move_userfrom_unread2read()
  message_get_blocked_users()
  message_get_contacts()
  message_mark_message_read()
  message_can_delete_message()
  message_delete_message()
  calendar_get_all_allowed_types()
  groups_get_all_groups_for_courses()
  events_get_cached()
  events_uninstall()
  events_cleanup()
  events_dequeue()
  events_get_handlers()
  get_roles_on_exact_context()
  get_roles_with_assignment_on_context()
  message_add_contact()
  message_remove_contact()
  message_unblock_contact()
  message_block_contact()
  message_get_contact()
  get_courses_page()
  report_insights_context_insights()
  get_module_metadata()
  cron_run_single_task()
  cron_execute_plugin_type()
  cron_bc_hack_plugin_functions()
  user_get_participants_sql()
  user_get_total_participants()
  user_get_participants()

instead:: (156 methods):
  get_timezone_offset()
  get_list_of_timezones()
  update_timezone_records()
  calculate_user_dst_table()
  dst_changes_for_year()
  get_timezone_record()
  get_referer()
  is_web_crawler()
  completion_cron()
  coursetag_get_tags()
  coursetag_get_all_tags()
  coursetag_get_jscript()
  coursetag_get_jscript_links()
  coursetag_get_records()
  coursetag_store_keywords()
  coursetag_delete_keyword()
  coursetag_get_tagged_courses()
  coursetag_delete_course_tags()
  tag_type_set()
  tag_description_set()
  tag_get_tags()
  tag_get_tags_array()
  tag_get_tags_csv()
  tag_get_tags_ids()
  tag_get_id()
  tag_rename()
  tag_delete_instance()
  tag_find_records()
  tag_add()
  tag_assign()
  tag_record_count()
  tag_record_tagged_with()
  tag_set_flag()
  tag_unset_flag()
  tag_print_cloud()
  tag_autocomplete()
  tag_print_description_box()
  tag_print_management_box()
  tag_print_search_box()
  tag_print_search_results()
  tag_print_tagged_users_table()
  tag_print_user_box()
  tag_print_user_list()
  tag_display_name()
  tag_normalize()
  tag_get_related_tags_csv()
  tag_set()
  tag_set_add()
  tag_set_delete()
  tag_get()
  tag_get_related_tags()
  tag_delete()
  tag_delete_instances()
  tag_cleanup()
  tag_bulk_delete_instances()
  tag_compute_correlations()
  tag_process_computed_correlation()
  tag_cron()
  tag_find_tags()
  tag_get_name()
  tag_get_correlated()
  tag_cloud_sort()
  events_load_def()
  events_queue_handler()
  events_dispatch()
  events_process_queued_handler()
  events_update_definition()
  events_cron()
  events_trigger_legacy()
  events_is_registered()
  events_pending_count()
  clam_message_admins()
  get_clam_error_code()
  course_get_cm_rename_action()
  course_scale_used()
  site_scale_used()
  external_function_info()
  get_records_csv()
  put_records_csv()
  css_is_colour()
  css_is_width()
  css_sort_by_count()
  message_get_course_contexts()
  message_remove_url_params()
  message_count_messages()
  message_count_blocked_users()
  message_contact_link()
  message_get_recent_notifications()
  message_history_link()
  message_search()
  message_shorten_message()
  message_get_fragment()
  message_get_history()
  message_get_contact_add_remove_link()
  message_get_contact_block_link()
  message_mark_messages_read()
  message_page_type_list()
  message_can_post_message()
  message_is_user_non_contact_blocked()
  message_is_user_blocked()
  print_log()
  print_mnet_log()
  print_log_csv()
  print_log_xls()
  print_log_ods()
  build_logs_array()
  get_logs_usercourse()
  get_logs_userday()
  get_logs()
  prevent_form_autofill_password()
  message_get_recent_conversations()
  calendar_preferences_button()
  calendar_wday_name()
  calendar_get_block_upcoming()
  calendar_print_month_selector()
  calendar_cron()
  load_course_context()
  load_role_access_by_context()
  dedupe_user_access()
  get_user_access_sitewide()
  calendar_get_mini()
  calendar_get_upcoming()
  allow_override()
  allow_assign()
  allow_switch()
  question_add_tops()
  question_is_only_toplevel_category_in_context()
  message_move_userfrom_unread2read()
  message_get_blocked_users()
  message_get_contacts()
  message_mark_message_read()
  message_can_delete_message()
  message_delete_message()
  calendar_get_all_allowed_types()
  groups_get_all_groups_for_courses()
  events_get_cached()
  events_uninstall()
  events_cleanup()
  events_dequeue()
  events_get_handlers()
  get_roles_on_exact_context()
  get_roles_with_assignment_on_context()
  message_add_contact()
  message_remove_contact()
  message_unblock_contact()
  message_block_contact()
  message_get_contact()
  get_courses_page()
  report_insights_context_insights()
  get_module_metadata()
  cron_run_single_task()
  cron_execute_plugin_type()
  cron_bc_hack_plugin_functions()
  user_get_participants_sql()
  user_get_total_participants()
  user_get_participants()

instead:: (156 methods):
  get_timezone_offset()
  get_list_of_timezones()
  update_timezone_records()
  calculate_user_dst_table()
  dst_changes_for_year()
  get_timezone_record()
  get_referer()
  is_web_crawler()
  completion_cron()
  coursetag_get_tags()
  coursetag_get_all_tags()
  coursetag_get_jscript()
  coursetag_get_jscript_links()
  coursetag_get_records()
  coursetag_store_keywords()
  coursetag_delete_keyword()
  coursetag_get_tagged_courses()
  coursetag_delete_course_tags()
  tag_type_set()
  tag_description_set()
  tag_get_tags()
  tag_get_tags_array()
  tag_get_tags_csv()
  tag_get_tags_ids()
  tag_get_id()
  tag_rename()
  tag_delete_instance()
  tag_find_records()
  tag_add()
  tag_assign()
  tag_record_count()
  tag_record_tagged_with()
  tag_set_flag()
  tag_unset_flag()
  tag_print_cloud()
  tag_autocomplete()
  tag_print_description_box()
  tag_print_management_box()
  tag_print_search_box()
  tag_print_search_results()
  tag_print_tagged_users_table()
  tag_print_user_box()
  tag_print_user_list()
  tag_display_name()
  tag_normalize()
  tag_get_related_tags_csv()
  tag_set()
  tag_set_add()
  tag_set_delete()
  tag_get()
  tag_get_related_tags()
  tag_delete()
  tag_delete_instances()
  tag_cleanup()
  tag_bulk_delete_instances()
  tag_compute_correlations()
  tag_process_computed_correlation()
  tag_cron()
  tag_find_tags()
  tag_get_name()
  tag_get_correlated()
  tag_cloud_sort()
  events_load_def()
  events_queue_handler()
  events_dispatch()
  events_process_queued_handler()
  events_update_definition()
  events_cron()
  events_trigger_legacy()
  events_is_registered()
  events_pending_count()
  clam_message_admins()
  get_clam_error_code()
  course_get_cm_rename_action()
  course_scale_used()
  site_scale_used()
  external_function_info()
  get_records_csv()
  put_records_csv()
  css_is_colour()
  css_is_width()
  css_sort_by_count()
  message_get_course_contexts()
  message_remove_url_params()
  message_count_messages()
  message_count_blocked_users()
  message_contact_link()
  message_get_recent_notifications()
  message_history_link()
  message_search()
  message_shorten_message()
  message_get_fragment()
  message_get_history()
  message_get_contact_add_remove_link()
  message_get_contact_block_link()
  message_mark_messages_read()
  message_page_type_list()
  message_can_post_message()
  message_is_user_non_contact_blocked()
  message_is_user_blocked()
  print_log()
  print_mnet_log()
  print_log_csv()
  print_log_xls()
  print_log_ods()
  build_logs_array()
  get_logs_usercourse()
  get_logs_userday()
  get_logs()
  prevent_form_autofill_password()
  message_get_recent_conversations()
  calendar_preferences_button()
  calendar_wday_name()
  calendar_get_block_upcoming()
  calendar_print_month_selector()
  calendar_cron()
  load_course_context()
  load_role_access_by_context()
  dedupe_user_access()
  get_user_access_sitewide()
  calendar_get_mini()
  calendar_get_upcoming()
  allow_override()
  allow_assign()
  allow_switch()
  question_add_tops()
  question_is_only_toplevel_category_in_context()
  message_move_userfrom_unread2read()
  message_get_blocked_users()
  message_get_contacts()
  message_mark_message_read()
  message_can_delete_message()
  message_delete_message()
  calendar_get_all_allowed_types()
  groups_get_all_groups_for_courses()
  events_get_cached()
  events_uninstall()
  events_cleanup()
  events_dequeue()
  events_get_handlers()
  get_roles_on_exact_context()
  get_roles_with_assignment_on_context()
  message_add_contact()
  message_remove_contact()
  message_unblock_contact()
  message_block_contact()
  message_get_contact()
  get_courses_page()
  report_insights_context_insights()
  get_module_metadata()
  cron_run_single_task()
  cron_execute_plugin_type()
  cron_bc_hack_plugin_functions()
  user_get_participants_sql()
  user_get_total_participants()
  user_get_participants()

instead:: (156 methods):
  get_timezone_offset()
  get_list_of_timezones()
  update_timezone_records()
  calculate_user_dst_table()
  dst_changes_for_year()
  get_timezone_record()
  get_referer()
  is_web_crawler()
  completion_cron()
  coursetag_get_tags()
  coursetag_get_all_tags()
  coursetag_get_jscript()
  coursetag_get_jscript_links()
  coursetag_get_records()
  coursetag_store_keywords()
  coursetag_delete_keyword()
  coursetag_get_tagged_courses()
  coursetag_delete_course_tags()
  tag_type_set()
  tag_description_set()
  tag_get_tags()
  tag_get_tags_array()
  tag_get_tags_csv()
  tag_get_tags_ids()
  tag_get_id()
  tag_rename()
  tag_delete_instance()
  tag_find_records()
  tag_add()
  tag_assign()
  tag_record_count()
  tag_record_tagged_with()
  tag_set_flag()
  tag_unset_flag()
  tag_print_cloud()
  tag_autocomplete()
  tag_print_description_box()
  tag_print_management_box()
  tag_print_search_box()
  tag_print_search_results()
  tag_print_tagged_users_table()
  tag_print_user_box()
  tag_print_user_list()
  tag_display_name()
  tag_normalize()
  tag_get_related_tags_csv()
  tag_set()
  tag_set_add()
  tag_set_delete()
  tag_get()
  tag_get_related_tags()
  tag_delete()
  tag_delete_instances()
  tag_cleanup()
  tag_bulk_delete_instances()
  tag_compute_correlations()
  tag_process_computed_correlation()
  tag_cron()
  tag_find_tags()
  tag_get_name()
  tag_get_correlated()
  tag_cloud_sort()
  events_load_def()
  events_queue_handler()
  events_dispatch()
  events_process_queued_handler()
  events_update_definition()
  events_cron()
  events_trigger_legacy()
  events_is_registered()
  events_pending_count()
  clam_message_admins()
  get_clam_error_code()
  course_get_cm_rename_action()
  course_scale_used()
  site_scale_used()
  external_function_info()
  get_records_csv()
  put_records_csv()
  css_is_colour()
  css_is_width()
  css_sort_by_count()
  message_get_course_contexts()
  message_remove_url_params()
  message_count_messages()
  message_count_blocked_users()
  message_contact_link()
  message_get_recent_notifications()
  message_history_link()
  message_search()
  message_shorten_message()
  message_get_fragment()
  message_get_history()
  message_get_contact_add_remove_link()
  message_get_contact_block_link()
  message_mark_messages_read()
  message_page_type_list()
  message_can_post_message()
  message_is_user_non_contact_blocked()
  message_is_user_blocked()
  print_log()
  print_mnet_log()
  print_log_csv()
  print_log_xls()
  print_log_ods()
  build_logs_array()
  get_logs_usercourse()
  get_logs_userday()
  get_logs()
  prevent_form_autofill_password()
  message_get_recent_conversations()
  calendar_preferences_button()
  calendar_wday_name()
  calendar_get_block_upcoming()
  calendar_print_month_selector()
  calendar_cron()
  load_course_context()
  load_role_access_by_context()
  dedupe_user_access()
  get_user_access_sitewide()
  calendar_get_mini()
  calendar_get_upcoming()
  allow_override()
  allow_assign()
  allow_switch()
  question_add_tops()
  question_is_only_toplevel_category_in_context()
  message_move_userfrom_unread2read()
  message_get_blocked_users()
  message_get_contacts()
  message_mark_message_read()
  message_can_delete_message()
  message_delete_message()
  calendar_get_all_allowed_types()
  groups_get_all_groups_for_courses()
  events_get_cached()
  events_uninstall()
  events_cleanup()
  events_dequeue()
  events_get_handlers()
  get_roles_on_exact_context()
  get_roles_with_assignment_on_context()
  message_add_contact()
  message_remove_contact()
  message_unblock_contact()
  message_block_contact()
  message_get_contact()
  get_courses_page()
  report_insights_context_insights()
  get_module_metadata()
  cron_run_single_task()
  cron_execute_plugin_type()
  cron_bc_hack_plugin_functions()
  user_get_participants_sql()
  user_get_total_participants()
  user_get_participants()

instead:: (156 methods):
  get_timezone_offset()
  get_list_of_timezones()
  update_timezone_records()
  calculate_user_dst_table()
  dst_changes_for_year()
  get_timezone_record()
  get_referer()
  is_web_crawler()
  completion_cron()
  coursetag_get_tags()
  coursetag_get_all_tags()
  coursetag_get_jscript()
  coursetag_get_jscript_links()
  coursetag_get_records()
  coursetag_store_keywords()
  coursetag_delete_keyword()
  coursetag_get_tagged_courses()
  coursetag_delete_course_tags()
  tag_type_set()
  tag_description_set()
  tag_get_tags()
  tag_get_tags_array()
  tag_get_tags_csv()
  tag_get_tags_ids()
  tag_get_id()
  tag_rename()
  tag_delete_instance()
  tag_find_records()
  tag_add()
  tag_assign()
  tag_record_count()
  tag_record_tagged_with()
  tag_set_flag()
  tag_unset_flag()
  tag_print_cloud()
  tag_autocomplete()
  tag_print_description_box()
  tag_print_management_box()
  tag_print_search_box()
  tag_print_search_results()
  tag_print_tagged_users_table()
  tag_print_user_box()
  tag_print_user_list()
  tag_display_name()
  tag_normalize()
  tag_get_related_tags_csv()
  tag_set()
  tag_set_add()
  tag_set_delete()
  tag_get()
  tag_get_related_tags()
  tag_delete()
  tag_delete_instances()
  tag_cleanup()
  tag_bulk_delete_instances()
  tag_compute_correlations()
  tag_process_computed_correlation()
  tag_cron()
  tag_find_tags()
  tag_get_name()
  tag_get_correlated()
  tag_cloud_sort()
  events_load_def()
  events_queue_handler()
  events_dispatch()
  events_process_queued_handler()
  events_update_definition()
  events_cron()
  events_trigger_legacy()
  events_is_registered()
  events_pending_count()
  clam_message_admins()
  get_clam_error_code()
  course_get_cm_rename_action()
  course_scale_used()
  site_scale_used()
  external_function_info()
  get_records_csv()
  put_records_csv()
  css_is_colour()
  css_is_width()
  css_sort_by_count()
  message_get_course_contexts()
  message_remove_url_params()
  message_count_messages()
  message_count_blocked_users()
  message_contact_link()
  message_get_recent_notifications()
  message_history_link()
  message_search()
  message_shorten_message()
  message_get_fragment()
  message_get_history()
  message_get_contact_add_remove_link()
  message_get_contact_block_link()
  message_mark_messages_read()
  message_page_type_list()
  message_can_post_message()
  message_is_user_non_contact_blocked()
  message_is_user_blocked()
  print_log()
  print_mnet_log()
  print_log_csv()
  print_log_xls()
  print_log_ods()
  build_logs_array()
  get_logs_usercourse()
  get_logs_userday()
  get_logs()
  prevent_form_autofill_password()
  message_get_recent_conversations()
  calendar_preferences_button()
  calendar_wday_name()
  calendar_get_block_upcoming()
  calendar_print_month_selector()
  calendar_cron()
  load_course_context()
  load_role_access_by_context()
  dedupe_user_access()
  get_user_access_sitewide()
  calendar_get_mini()
  calendar_get_upcoming()
  allow_override()
  allow_assign()
  allow_switch()
  question_add_tops()
  question_is_only_toplevel_category_in_context()
  message_move_userfrom_unread2read()
  message_get_blocked_users()
  message_get_contacts()
  message_mark_message_read()
  message_can_delete_message()
  message_delete_message()
  calendar_get_all_allowed_types()
  groups_get_all_groups_for_courses()
  events_get_cached()
  events_uninstall()
  events_cleanup()
  events_dequeue()
  events_get_handlers()
  get_roles_on_exact_context()
  get_roles_with_assignment_on_context()
  message_add_contact()
  message_remove_contact()
  message_unblock_contact()
  message_block_contact()
  message_get_contact()
  get_courses_page()
  report_insights_context_insights()
  get_module_metadata()
  cron_run_single_task()
  cron_execute_plugin_type()
  cron_bc_hack_plugin_functions()
  user_get_participants_sql()
  user_get_total_participants()
  user_get_participants()

Defines 156 functions

  add_to_log()
  events_trigger()
  get_core_subsystems()
  get_plugin_types()
  get_plugin_list()
  get_plugin_list_with_class()
  get_plugin_directory()
  normalize_component()
  get_component_directory()
  get_context_instance()
  clam_log_upload()
  clam_log_infected()
  clam_change_log()
  clam_replace_infected_file()
  clam_handle_infected_file()
  clam_scan_moodle_file()
  password_compat_not_supported()
  session_get_instance()
  session_is_legacy()
  session_kill_all()
  session_touch()
  session_kill()
  session_kill_user()
  session_set_user()
  session_is_loggedinas()
  session_get_realuser()
  session_loginas()
  js_minify()
  css_minify_css()
  check_gd_version()
  update_login_count()
  reset_login_count()
  update_log_display_entry()
  filter_text()
  httpsrequired()
  get_file_url()
  get_course_participants()
  is_course_participant()
  get_recent_enrolments()
  detect_munged_arguments()
  unzip_file()
  zip_files()
  mygroupid()
  groupmode()
  set_current_group()
  get_current_group()
  groups_filter_users_by_course_module_visible()
  groups_course_module_visible()
  error()
  current_theme()
  formerr()
  skip_main_destination()
  print_container()
  print_container_start()
  print_container_end()
  notify()
  print_continue()
  print_header()
  print_header_simple()
  print_side_block()
  print_textarea()
  print_arrow()
  choose_from_menu()
  print_scale_menu_helpbutton()
  print_checkbox()
  update_module_button()
  print_navigation()
  build_navigation()
  navmenu()
  add_event()
  update_event()
  delete_event()
  hide_event()
  show_event()
  textlib_get_instance()
  get_generic_section_name()

Class: tabtree  - X-Ref

Class: tabtree  - X-Ref

Class: instead  - X-Ref

get_timezone_offset()   X-Ref


get_list_of_timezones()   X-Ref


update_timezone_records()   X-Ref


calculate_user_dst_table()   X-Ref


dst_changes_for_year()   X-Ref


get_timezone_record()   X-Ref


get_referer()   X-Ref


is_web_crawler()   X-Ref


completion_cron()   X-Ref


coursetag_get_tags()   X-Ref


coursetag_get_all_tags()   X-Ref


coursetag_get_jscript()   X-Ref


coursetag_get_jscript_links()   X-Ref


coursetag_get_records()   X-Ref


coursetag_store_keywords()   X-Ref


coursetag_delete_keyword()   X-Ref


coursetag_get_tagged_courses()   X-Ref


coursetag_delete_course_tags()   X-Ref


tag_type_set()   X-Ref


tag_description_set()   X-Ref


tag_get_tags()   X-Ref


tag_get_tags_array()   X-Ref


tag_get_tags_csv()   X-Ref


tag_get_tags_ids()   X-Ref


tag_get_id()   X-Ref


tag_rename()   X-Ref


tag_delete_instance()   X-Ref


tag_find_records()   X-Ref


tag_add()   X-Ref


tag_assign()   X-Ref


tag_record_count()   X-Ref


tag_record_tagged_with()   X-Ref


tag_set_flag()   X-Ref


tag_unset_flag()   X-Ref


tag_print_cloud()   X-Ref


tag_autocomplete()   X-Ref


tag_print_description_box()   X-Ref


tag_print_management_box()   X-Ref


tag_print_search_box()   X-Ref


tag_print_search_results()   X-Ref


tag_print_tagged_users_table()   X-Ref


tag_print_user_box()   X-Ref


tag_print_user_list()   X-Ref


tag_display_name()   X-Ref


tag_normalize()   X-Ref


tag_get_related_tags_csv()   X-Ref


tag_set()   X-Ref


tag_set_add()   X-Ref


tag_set_delete()   X-Ref


tag_get()   X-Ref


tag_get_related_tags()   X-Ref


tag_delete()   X-Ref


tag_delete_instances()   X-Ref


tag_cleanup()   X-Ref


tag_bulk_delete_instances()   X-Ref


tag_compute_correlations()   X-Ref


tag_process_computed_correlation()   X-Ref


tag_cron()   X-Ref


tag_find_tags()   X-Ref


tag_get_name()   X-Ref


tag_get_correlated()   X-Ref


tag_cloud_sort()   X-Ref


events_load_def()   X-Ref


events_queue_handler()   X-Ref


events_dispatch()   X-Ref


events_process_queued_handler()   X-Ref


events_update_definition()   X-Ref


events_cron()   X-Ref


events_trigger_legacy()   X-Ref


events_is_registered()   X-Ref


events_pending_count()   X-Ref


clam_message_admins()   X-Ref


get_clam_error_code()   X-Ref


course_get_cm_rename_action()   X-Ref


course_scale_used()   X-Ref


site_scale_used()   X-Ref


external_function_info()   X-Ref


get_records_csv()   X-Ref


put_records_csv()   X-Ref


css_is_colour()   X-Ref


css_is_width()   X-Ref


css_sort_by_count()   X-Ref


message_get_course_contexts()   X-Ref


message_remove_url_params()   X-Ref


message_count_messages()   X-Ref


message_count_blocked_users()   X-Ref


message_contact_link()   X-Ref


message_get_recent_notifications()   X-Ref


message_history_link()   X-Ref


message_search()   X-Ref


message_shorten_message()   X-Ref


message_get_fragment()   X-Ref


message_get_history()   X-Ref


message_get_contact_add_remove_link()   X-Ref


message_get_contact_block_link()   X-Ref


message_mark_messages_read()   X-Ref


message_page_type_list()   X-Ref


message_can_post_message()   X-Ref


message_is_user_non_contact_blocked()   X-Ref


message_is_user_blocked()   X-Ref


print_log()   X-Ref


print_mnet_log()   X-Ref


print_log_csv()   X-Ref


print_log_xls()   X-Ref


print_log_ods()   X-Ref


build_logs_array()   X-Ref


get_logs_usercourse()   X-Ref


get_logs_userday()   X-Ref


get_logs()   X-Ref


prevent_form_autofill_password()   X-Ref


message_get_recent_conversations($userorid, $limitfrom = 0, $limitto = 100)   X-Ref


calendar_preferences_button()   X-Ref


calendar_wday_name()   X-Ref


calendar_get_block_upcoming()   X-Ref


calendar_print_month_selector()   X-Ref


calendar_cron()   X-Ref


load_course_context()   X-Ref


load_role_access_by_context()   X-Ref


dedupe_user_access()   X-Ref


get_user_access_sitewide()   X-Ref


calendar_get_mini()   X-Ref


calendar_get_upcoming()   X-Ref


allow_override()   X-Ref


allow_assign()   X-Ref


allow_switch()   X-Ref


question_add_tops()   X-Ref


question_is_only_toplevel_category_in_context()   X-Ref


message_move_userfrom_unread2read()   X-Ref


message_get_blocked_users()   X-Ref


message_get_contacts()   X-Ref


message_mark_message_read()   X-Ref


message_can_delete_message()   X-Ref


message_delete_message()   X-Ref


calendar_get_all_allowed_types()   X-Ref
Get all of the allowed types for all of the courses and groups
the logged in user belongs to.

The returned array will optionally have 5 keys:
'user' : true if the logged in user can create user events
'site' : true if the logged in user can create site events
'category' : array of course categories that the user can create events for
'course' : array of courses that the user can create events for
'group': array of groups that the user can create events for
'groupcourses' : array of courses that the groups belong to (can
be different from the list in 'course'.
return: array The array of allowed types.

groups_get_all_groups_for_courses($courses)   X-Ref
Gets array of all groups in a set of course.

param: array $courses Array of course objects or course ids.
return: array Array of groups indexed by course id.

events_get_cached($component)   X-Ref
Gets the capabilities that have been cached in the database for this
component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
return: array of events

events_uninstall($component)   X-Ref
Remove all event handlers and queued events

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'

events_cleanup($component, $cachedhandlers)   X-Ref
Deletes cached events that are no longer needed by the component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
param: array $cachedhandlers array of the cached events definitions that will be
return: int number of unused handlers that have been removed

events_dequeue($qhandler)   X-Ref
Removes this queued handler from the events_queued_handler table

Removes events_queue record from events_queue if no more references to this event object exists
param: stdClass $qhandler A row from the events_queued_handler table

events_get_handlers($eventname)   X-Ref
Returns handlers for given event. Uses caching for better perf.

param: string $eventname name of event or 'reset'
return: array|false array of handlers or false otherwise

get_roles_on_exact_context(context $context)   X-Ref
This function finds the roles assigned directly to this context only
i.e. no roles in parent contexts

param: context $context
return: array

get_roles_with_assignment_on_context(context $context)   X-Ref
Find out which roles has assignment on this context

param: context $context
return: array

message_add_contact($contactid, $blocked = 0, $userid = 0)   X-Ref
Add the selected user as a contact for the current user

param: int $contactid the ID of the user to add as a contact
param: int $blocked 1 if you wish to block the contact
param: int $userid the user ID of the user we want to add the contact for, defaults to current user if not specified.
return: bool/int false if the $contactid isnt a valid user id. True if no changes made.

message_remove_contact($contactid, $userid = 0)   X-Ref
Remove a contact.

param: int $contactid the user ID of the contact to remove
param: int $userid the user ID of the user we want to remove the contacts for, defaults to current user if not specified.
return: bool returns the result of delete_records()

message_unblock_contact($contactid, $userid = 0)   X-Ref
Unblock a contact.

param: int $contactid the user ID of the contact to unblock
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool returns the result of delete_records()

message_block_contact($contactid, $userid = 0)   X-Ref
Block a user.

param: int $contactid the user ID of the user to block
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool

message_get_contact($contactid)   X-Ref
Load a user's contact record

param: int $contactid the user ID of the user whose contact record you want
return: array message contacts

get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c.*",&$totalcount, $limitfrom="", $limitnum="")   X-Ref
Returns list of courses, for whole site, or category

Similar to get_courses, but allows paging
Important: Using c.* for fields is extremely expensive because
we are using distinct. You almost _NEVER_ need all the fields
in such a large SELECT

param: string|int $categoryid Either a category id or 'all' for everything
param: string $sort A field and direction to sort by
param: string $fields The additional fields to return
param: int $totalcount Reference for the number of courses
param: string $limitfrom The course to start from
param: string $limitnum The number of courses to limit to
return: array Array of courses

report_insights_context_insights(\context $context)   X-Ref
Returns the models that generated insights in the provided context.

param: \context $context
return: int[]

get_module_metadata($course, $modnames, $sectionreturn = null)   X-Ref
Retrieve all metadata for the requested modules

param: object $course The Course
param: array $modnames An array containing the list of modules and their
param: int $sectionreturn The section to return to
return: array A list of stdClass objects containing metadata about each

cron_run_single_task(\core\task\scheduled_task $task)   X-Ref
Runs a single cron task. This function assumes it is displaying output in pseudo-CLI mode.

The function will fail if the task is disabled.

Warning: Because this function closes the browser session, it may not be safe to continue
with other processing (other than displaying the rest of the page) after using this function!

param: \core\task\scheduled_task $task Task to run
return: bool True if cron run successful

cron_execute_plugin_type($plugintype, $description = null)   X-Ref
Executes cron functions for a specific type of plugin.

param: string $plugintype Plugin type (e.g. 'report')
param: string $description If specified, will display 'Starting (whatever)'

cron_bc_hack_plugin_functions($plugintype, $plugins)   X-Ref
Used to add in old-style cron functions within plugins that have not been converted to the
new standard API. (The standard API is frankenstyle_name_cron() in lib.php; some types used
cron.php and some used a different name.)

param: string $plugintype Plugin type e.g. 'report'
param: array $plugins Array from plugin name (e.g. 'report_frog') to function name (e.g.
return: array Revised version of $plugins that adds in any extra plugin functions found by

user_get_participants_sql($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the SQL used by the participants table.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles and -1 no roles
param: int $enrolid The enrolment id, 0 means all enrolment methods will be returned.
param: int $statusid The user enrolment status, -1 means all enrolments regardless of the status will be returned, if allowed.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: array

user_get_total_participants($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the total number of participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: int

user_get_participants($courseid, $groupid = 0, $accesssince, $roleid, $enrolid = 0, $statusid, $search,$additionalwhere = '', $additionalparams = array()   X-Ref
Returns the participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access
param: int $roleid The role id
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string $search The search that was performed
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
param: string $sort The SQL sort
param: int $limitfrom return a subset of records, starting at this point (optional).
param: int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
return: moodle_recordset

Class: instead  - X-Ref

get_timezone_offset()   X-Ref


get_list_of_timezones()   X-Ref


update_timezone_records()   X-Ref


calculate_user_dst_table()   X-Ref


dst_changes_for_year()   X-Ref


get_timezone_record()   X-Ref


get_referer()   X-Ref


is_web_crawler()   X-Ref


completion_cron()   X-Ref


coursetag_get_tags()   X-Ref


coursetag_get_all_tags()   X-Ref


coursetag_get_jscript()   X-Ref


coursetag_get_jscript_links()   X-Ref


coursetag_get_records()   X-Ref


coursetag_store_keywords()   X-Ref


coursetag_delete_keyword()   X-Ref


coursetag_get_tagged_courses()   X-Ref


coursetag_delete_course_tags()   X-Ref


tag_type_set()   X-Ref


tag_description_set()   X-Ref


tag_get_tags()   X-Ref


tag_get_tags_array()   X-Ref


tag_get_tags_csv()   X-Ref


tag_get_tags_ids()   X-Ref


tag_get_id()   X-Ref


tag_rename()   X-Ref


tag_delete_instance()   X-Ref


tag_find_records()   X-Ref


tag_add()   X-Ref


tag_assign()   X-Ref


tag_record_count()   X-Ref


tag_record_tagged_with()   X-Ref


tag_set_flag()   X-Ref


tag_unset_flag()   X-Ref


tag_print_cloud()   X-Ref


tag_autocomplete()   X-Ref


tag_print_description_box()   X-Ref


tag_print_management_box()   X-Ref


tag_print_search_box()   X-Ref


tag_print_search_results()   X-Ref


tag_print_tagged_users_table()   X-Ref


tag_print_user_box()   X-Ref


tag_print_user_list()   X-Ref


tag_display_name()   X-Ref


tag_normalize()   X-Ref


tag_get_related_tags_csv()   X-Ref


tag_set()   X-Ref


tag_set_add()   X-Ref


tag_set_delete()   X-Ref


tag_get()   X-Ref


tag_get_related_tags()   X-Ref


tag_delete()   X-Ref


tag_delete_instances()   X-Ref


tag_cleanup()   X-Ref


tag_bulk_delete_instances()   X-Ref


tag_compute_correlations()   X-Ref


tag_process_computed_correlation()   X-Ref


tag_cron()   X-Ref


tag_find_tags()   X-Ref


tag_get_name()   X-Ref


tag_get_correlated()   X-Ref


tag_cloud_sort()   X-Ref


events_load_def()   X-Ref


events_queue_handler()   X-Ref


events_dispatch()   X-Ref


events_process_queued_handler()   X-Ref


events_update_definition()   X-Ref


events_cron()   X-Ref


events_trigger_legacy()   X-Ref


events_is_registered()   X-Ref


events_pending_count()   X-Ref


clam_message_admins()   X-Ref


get_clam_error_code()   X-Ref


course_get_cm_rename_action()   X-Ref


course_scale_used()   X-Ref


site_scale_used()   X-Ref


external_function_info()   X-Ref


get_records_csv()   X-Ref


put_records_csv()   X-Ref


css_is_colour()   X-Ref


css_is_width()   X-Ref


css_sort_by_count()   X-Ref


message_get_course_contexts()   X-Ref


message_remove_url_params()   X-Ref


message_count_messages()   X-Ref


message_count_blocked_users()   X-Ref


message_contact_link()   X-Ref


message_get_recent_notifications()   X-Ref


message_history_link()   X-Ref


message_search()   X-Ref


message_shorten_message()   X-Ref


message_get_fragment()   X-Ref


message_get_history()   X-Ref


message_get_contact_add_remove_link()   X-Ref


message_get_contact_block_link()   X-Ref


message_mark_messages_read()   X-Ref


message_page_type_list()   X-Ref


message_can_post_message()   X-Ref


message_is_user_non_contact_blocked()   X-Ref


message_is_user_blocked()   X-Ref


print_log()   X-Ref


print_mnet_log()   X-Ref


print_log_csv()   X-Ref


print_log_xls()   X-Ref


print_log_ods()   X-Ref


build_logs_array()   X-Ref


get_logs_usercourse()   X-Ref


get_logs_userday()   X-Ref


get_logs()   X-Ref


prevent_form_autofill_password()   X-Ref


message_get_recent_conversations($userorid, $limitfrom = 0, $limitto = 100)   X-Ref


calendar_preferences_button()   X-Ref


calendar_wday_name()   X-Ref


calendar_get_block_upcoming()   X-Ref


calendar_print_month_selector()   X-Ref


calendar_cron()   X-Ref


load_course_context()   X-Ref


load_role_access_by_context()   X-Ref


dedupe_user_access()   X-Ref


get_user_access_sitewide()   X-Ref


calendar_get_mini()   X-Ref


calendar_get_upcoming()   X-Ref


allow_override()   X-Ref


allow_assign()   X-Ref


allow_switch()   X-Ref


question_add_tops()   X-Ref


question_is_only_toplevel_category_in_context()   X-Ref


message_move_userfrom_unread2read()   X-Ref


message_get_blocked_users()   X-Ref


message_get_contacts()   X-Ref


message_mark_message_read()   X-Ref


message_can_delete_message()   X-Ref


message_delete_message()   X-Ref


calendar_get_all_allowed_types()   X-Ref
Get all of the allowed types for all of the courses and groups
the logged in user belongs to.

The returned array will optionally have 5 keys:
'user' : true if the logged in user can create user events
'site' : true if the logged in user can create site events
'category' : array of course categories that the user can create events for
'course' : array of courses that the user can create events for
'group': array of groups that the user can create events for
'groupcourses' : array of courses that the groups belong to (can
be different from the list in 'course'.
return: array The array of allowed types.

groups_get_all_groups_for_courses($courses)   X-Ref
Gets array of all groups in a set of course.

param: array $courses Array of course objects or course ids.
return: array Array of groups indexed by course id.

events_get_cached($component)   X-Ref
Gets the capabilities that have been cached in the database for this
component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
return: array of events

events_uninstall($component)   X-Ref
Remove all event handlers and queued events

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'

events_cleanup($component, $cachedhandlers)   X-Ref
Deletes cached events that are no longer needed by the component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
param: array $cachedhandlers array of the cached events definitions that will be
return: int number of unused handlers that have been removed

events_dequeue($qhandler)   X-Ref
Removes this queued handler from the events_queued_handler table

Removes events_queue record from events_queue if no more references to this event object exists
param: stdClass $qhandler A row from the events_queued_handler table

events_get_handlers($eventname)   X-Ref
Returns handlers for given event. Uses caching for better perf.

param: string $eventname name of event or 'reset'
return: array|false array of handlers or false otherwise

get_roles_on_exact_context(context $context)   X-Ref
This function finds the roles assigned directly to this context only
i.e. no roles in parent contexts

param: context $context
return: array

get_roles_with_assignment_on_context(context $context)   X-Ref
Find out which roles has assignment on this context

param: context $context
return: array

message_add_contact($contactid, $blocked = 0, $userid = 0)   X-Ref
Add the selected user as a contact for the current user

param: int $contactid the ID of the user to add as a contact
param: int $blocked 1 if you wish to block the contact
param: int $userid the user ID of the user we want to add the contact for, defaults to current user if not specified.
return: bool/int false if the $contactid isnt a valid user id. True if no changes made.

message_remove_contact($contactid, $userid = 0)   X-Ref
Remove a contact.

param: int $contactid the user ID of the contact to remove
param: int $userid the user ID of the user we want to remove the contacts for, defaults to current user if not specified.
return: bool returns the result of delete_records()

message_unblock_contact($contactid, $userid = 0)   X-Ref
Unblock a contact.

param: int $contactid the user ID of the contact to unblock
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool returns the result of delete_records()

message_block_contact($contactid, $userid = 0)   X-Ref
Block a user.

param: int $contactid the user ID of the user to block
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool

message_get_contact($contactid)   X-Ref
Load a user's contact record

param: int $contactid the user ID of the user whose contact record you want
return: array message contacts

get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c.*",&$totalcount, $limitfrom="", $limitnum="")   X-Ref
Returns list of courses, for whole site, or category

Similar to get_courses, but allows paging
Important: Using c.* for fields is extremely expensive because
we are using distinct. You almost _NEVER_ need all the fields
in such a large SELECT

param: string|int $categoryid Either a category id or 'all' for everything
param: string $sort A field and direction to sort by
param: string $fields The additional fields to return
param: int $totalcount Reference for the number of courses
param: string $limitfrom The course to start from
param: string $limitnum The number of courses to limit to
return: array Array of courses

report_insights_context_insights(\context $context)   X-Ref
Returns the models that generated insights in the provided context.

param: \context $context
return: int[]

get_module_metadata($course, $modnames, $sectionreturn = null)   X-Ref
Retrieve all metadata for the requested modules

param: object $course The Course
param: array $modnames An array containing the list of modules and their
param: int $sectionreturn The section to return to
return: array A list of stdClass objects containing metadata about each

cron_run_single_task(\core\task\scheduled_task $task)   X-Ref
Runs a single cron task. This function assumes it is displaying output in pseudo-CLI mode.

The function will fail if the task is disabled.

Warning: Because this function closes the browser session, it may not be safe to continue
with other processing (other than displaying the rest of the page) after using this function!

param: \core\task\scheduled_task $task Task to run
return: bool True if cron run successful

cron_execute_plugin_type($plugintype, $description = null)   X-Ref
Executes cron functions for a specific type of plugin.

param: string $plugintype Plugin type (e.g. 'report')
param: string $description If specified, will display 'Starting (whatever)'

cron_bc_hack_plugin_functions($plugintype, $plugins)   X-Ref
Used to add in old-style cron functions within plugins that have not been converted to the
new standard API. (The standard API is frankenstyle_name_cron() in lib.php; some types used
cron.php and some used a different name.)

param: string $plugintype Plugin type e.g. 'report'
param: array $plugins Array from plugin name (e.g. 'report_frog') to function name (e.g.
return: array Revised version of $plugins that adds in any extra plugin functions found by

user_get_participants_sql($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the SQL used by the participants table.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles and -1 no roles
param: int $enrolid The enrolment id, 0 means all enrolment methods will be returned.
param: int $statusid The user enrolment status, -1 means all enrolments regardless of the status will be returned, if allowed.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: array

user_get_total_participants($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the total number of participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: int

user_get_participants($courseid, $groupid = 0, $accesssince, $roleid, $enrolid = 0, $statusid, $search,$additionalwhere = '', $additionalparams = array()   X-Ref
Returns the participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access
param: int $roleid The role id
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string $search The search that was performed
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
param: string $sort The SQL sort
param: int $limitfrom return a subset of records, starting at this point (optional).
param: int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
return: moodle_recordset

Class: instead  - X-Ref

get_timezone_offset()   X-Ref


get_list_of_timezones()   X-Ref


update_timezone_records()   X-Ref


calculate_user_dst_table()   X-Ref


dst_changes_for_year()   X-Ref


get_timezone_record()   X-Ref


get_referer()   X-Ref


is_web_crawler()   X-Ref


completion_cron()   X-Ref


coursetag_get_tags()   X-Ref


coursetag_get_all_tags()   X-Ref


coursetag_get_jscript()   X-Ref


coursetag_get_jscript_links()   X-Ref


coursetag_get_records()   X-Ref


coursetag_store_keywords()   X-Ref


coursetag_delete_keyword()   X-Ref


coursetag_get_tagged_courses()   X-Ref


coursetag_delete_course_tags()   X-Ref


tag_type_set()   X-Ref


tag_description_set()   X-Ref


tag_get_tags()   X-Ref


tag_get_tags_array()   X-Ref


tag_get_tags_csv()   X-Ref


tag_get_tags_ids()   X-Ref


tag_get_id()   X-Ref


tag_rename()   X-Ref


tag_delete_instance()   X-Ref


tag_find_records()   X-Ref


tag_add()   X-Ref


tag_assign()   X-Ref


tag_record_count()   X-Ref


tag_record_tagged_with()   X-Ref


tag_set_flag()   X-Ref


tag_unset_flag()   X-Ref


tag_print_cloud()   X-Ref


tag_autocomplete()   X-Ref


tag_print_description_box()   X-Ref


tag_print_management_box()   X-Ref


tag_print_search_box()   X-Ref


tag_print_search_results()   X-Ref


tag_print_tagged_users_table()   X-Ref


tag_print_user_box()   X-Ref


tag_print_user_list()   X-Ref


tag_display_name()   X-Ref


tag_normalize()   X-Ref


tag_get_related_tags_csv()   X-Ref


tag_set()   X-Ref


tag_set_add()   X-Ref


tag_set_delete()   X-Ref


tag_get()   X-Ref


tag_get_related_tags()   X-Ref


tag_delete()   X-Ref


tag_delete_instances()   X-Ref


tag_cleanup()   X-Ref


tag_bulk_delete_instances()   X-Ref


tag_compute_correlations()   X-Ref


tag_process_computed_correlation()   X-Ref


tag_cron()   X-Ref


tag_find_tags()   X-Ref


tag_get_name()   X-Ref


tag_get_correlated()   X-Ref


tag_cloud_sort()   X-Ref


events_load_def()   X-Ref


events_queue_handler()   X-Ref


events_dispatch()   X-Ref


events_process_queued_handler()   X-Ref


events_update_definition()   X-Ref


events_cron()   X-Ref


events_trigger_legacy()   X-Ref


events_is_registered()   X-Ref


events_pending_count()   X-Ref


clam_message_admins()   X-Ref


get_clam_error_code()   X-Ref


course_get_cm_rename_action()   X-Ref


course_scale_used()   X-Ref


site_scale_used()   X-Ref


external_function_info()   X-Ref


get_records_csv()   X-Ref


put_records_csv()   X-Ref


css_is_colour()   X-Ref


css_is_width()   X-Ref


css_sort_by_count()   X-Ref


message_get_course_contexts()   X-Ref


message_remove_url_params()   X-Ref


message_count_messages()   X-Ref


message_count_blocked_users()   X-Ref


message_contact_link()   X-Ref


message_get_recent_notifications()   X-Ref


message_history_link()   X-Ref


message_search()   X-Ref


message_shorten_message()   X-Ref


message_get_fragment()   X-Ref


message_get_history()   X-Ref


message_get_contact_add_remove_link()   X-Ref


message_get_contact_block_link()   X-Ref


message_mark_messages_read()   X-Ref


message_page_type_list()   X-Ref


message_can_post_message()   X-Ref


message_is_user_non_contact_blocked()   X-Ref


message_is_user_blocked()   X-Ref


print_log()   X-Ref


print_mnet_log()   X-Ref


print_log_csv()   X-Ref


print_log_xls()   X-Ref


print_log_ods()   X-Ref


build_logs_array()   X-Ref


get_logs_usercourse()   X-Ref


get_logs_userday()   X-Ref


get_logs()   X-Ref


prevent_form_autofill_password()   X-Ref


message_get_recent_conversations($userorid, $limitfrom = 0, $limitto = 100)   X-Ref


calendar_preferences_button()   X-Ref


calendar_wday_name()   X-Ref


calendar_get_block_upcoming()   X-Ref


calendar_print_month_selector()   X-Ref


calendar_cron()   X-Ref


load_course_context()   X-Ref


load_role_access_by_context()   X-Ref


dedupe_user_access()   X-Ref


get_user_access_sitewide()   X-Ref


calendar_get_mini()   X-Ref


calendar_get_upcoming()   X-Ref


allow_override()   X-Ref


allow_assign()   X-Ref


allow_switch()   X-Ref


question_add_tops()   X-Ref


question_is_only_toplevel_category_in_context()   X-Ref


message_move_userfrom_unread2read()   X-Ref


message_get_blocked_users()   X-Ref


message_get_contacts()   X-Ref


message_mark_message_read()   X-Ref


message_can_delete_message()   X-Ref


message_delete_message()   X-Ref


calendar_get_all_allowed_types()   X-Ref
Get all of the allowed types for all of the courses and groups
the logged in user belongs to.

The returned array will optionally have 5 keys:
'user' : true if the logged in user can create user events
'site' : true if the logged in user can create site events
'category' : array of course categories that the user can create events for
'course' : array of courses that the user can create events for
'group': array of groups that the user can create events for
'groupcourses' : array of courses that the groups belong to (can
be different from the list in 'course'.
return: array The array of allowed types.

groups_get_all_groups_for_courses($courses)   X-Ref
Gets array of all groups in a set of course.

param: array $courses Array of course objects or course ids.
return: array Array of groups indexed by course id.

events_get_cached($component)   X-Ref
Gets the capabilities that have been cached in the database for this
component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
return: array of events

events_uninstall($component)   X-Ref
Remove all event handlers and queued events

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'

events_cleanup($component, $cachedhandlers)   X-Ref
Deletes cached events that are no longer needed by the component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
param: array $cachedhandlers array of the cached events definitions that will be
return: int number of unused handlers that have been removed

events_dequeue($qhandler)   X-Ref
Removes this queued handler from the events_queued_handler table

Removes events_queue record from events_queue if no more references to this event object exists
param: stdClass $qhandler A row from the events_queued_handler table

events_get_handlers($eventname)   X-Ref
Returns handlers for given event. Uses caching for better perf.

param: string $eventname name of event or 'reset'
return: array|false array of handlers or false otherwise

get_roles_on_exact_context(context $context)   X-Ref
This function finds the roles assigned directly to this context only
i.e. no roles in parent contexts

param: context $context
return: array

get_roles_with_assignment_on_context(context $context)   X-Ref
Find out which roles has assignment on this context

param: context $context
return: array

message_add_contact($contactid, $blocked = 0, $userid = 0)   X-Ref
Add the selected user as a contact for the current user

param: int $contactid the ID of the user to add as a contact
param: int $blocked 1 if you wish to block the contact
param: int $userid the user ID of the user we want to add the contact for, defaults to current user if not specified.
return: bool/int false if the $contactid isnt a valid user id. True if no changes made.

message_remove_contact($contactid, $userid = 0)   X-Ref
Remove a contact.

param: int $contactid the user ID of the contact to remove
param: int $userid the user ID of the user we want to remove the contacts for, defaults to current user if not specified.
return: bool returns the result of delete_records()

message_unblock_contact($contactid, $userid = 0)   X-Ref
Unblock a contact.

param: int $contactid the user ID of the contact to unblock
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool returns the result of delete_records()

message_block_contact($contactid, $userid = 0)   X-Ref
Block a user.

param: int $contactid the user ID of the user to block
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool

message_get_contact($contactid)   X-Ref
Load a user's contact record

param: int $contactid the user ID of the user whose contact record you want
return: array message contacts

get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c.*",&$totalcount, $limitfrom="", $limitnum="")   X-Ref
Returns list of courses, for whole site, or category

Similar to get_courses, but allows paging
Important: Using c.* for fields is extremely expensive because
we are using distinct. You almost _NEVER_ need all the fields
in such a large SELECT

param: string|int $categoryid Either a category id or 'all' for everything
param: string $sort A field and direction to sort by
param: string $fields The additional fields to return
param: int $totalcount Reference for the number of courses
param: string $limitfrom The course to start from
param: string $limitnum The number of courses to limit to
return: array Array of courses

report_insights_context_insights(\context $context)   X-Ref
Returns the models that generated insights in the provided context.

param: \context $context
return: int[]

get_module_metadata($course, $modnames, $sectionreturn = null)   X-Ref
Retrieve all metadata for the requested modules

param: object $course The Course
param: array $modnames An array containing the list of modules and their
param: int $sectionreturn The section to return to
return: array A list of stdClass objects containing metadata about each

cron_run_single_task(\core\task\scheduled_task $task)   X-Ref
Runs a single cron task. This function assumes it is displaying output in pseudo-CLI mode.

The function will fail if the task is disabled.

Warning: Because this function closes the browser session, it may not be safe to continue
with other processing (other than displaying the rest of the page) after using this function!

param: \core\task\scheduled_task $task Task to run
return: bool True if cron run successful

cron_execute_plugin_type($plugintype, $description = null)   X-Ref
Executes cron functions for a specific type of plugin.

param: string $plugintype Plugin type (e.g. 'report')
param: string $description If specified, will display 'Starting (whatever)'

cron_bc_hack_plugin_functions($plugintype, $plugins)   X-Ref
Used to add in old-style cron functions within plugins that have not been converted to the
new standard API. (The standard API is frankenstyle_name_cron() in lib.php; some types used
cron.php and some used a different name.)

param: string $plugintype Plugin type e.g. 'report'
param: array $plugins Array from plugin name (e.g. 'report_frog') to function name (e.g.
return: array Revised version of $plugins that adds in any extra plugin functions found by

user_get_participants_sql($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the SQL used by the participants table.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles and -1 no roles
param: int $enrolid The enrolment id, 0 means all enrolment methods will be returned.
param: int $statusid The user enrolment status, -1 means all enrolments regardless of the status will be returned, if allowed.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: array

user_get_total_participants($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the total number of participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: int

user_get_participants($courseid, $groupid = 0, $accesssince, $roleid, $enrolid = 0, $statusid, $search,$additionalwhere = '', $additionalparams = array()   X-Ref
Returns the participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access
param: int $roleid The role id
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string $search The search that was performed
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
param: string $sort The SQL sort
param: int $limitfrom return a subset of records, starting at this point (optional).
param: int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
return: moodle_recordset

Class: instead  - X-Ref

get_timezone_offset()   X-Ref


get_list_of_timezones()   X-Ref


update_timezone_records()   X-Ref


calculate_user_dst_table()   X-Ref


dst_changes_for_year()   X-Ref


get_timezone_record()   X-Ref


get_referer()   X-Ref


is_web_crawler()   X-Ref


completion_cron()   X-Ref


coursetag_get_tags()   X-Ref


coursetag_get_all_tags()   X-Ref


coursetag_get_jscript()   X-Ref


coursetag_get_jscript_links()   X-Ref


coursetag_get_records()   X-Ref


coursetag_store_keywords()   X-Ref


coursetag_delete_keyword()   X-Ref


coursetag_get_tagged_courses()   X-Ref


coursetag_delete_course_tags()   X-Ref


tag_type_set()   X-Ref


tag_description_set()   X-Ref


tag_get_tags()   X-Ref


tag_get_tags_array()   X-Ref


tag_get_tags_csv()   X-Ref


tag_get_tags_ids()   X-Ref


tag_get_id()   X-Ref


tag_rename()   X-Ref


tag_delete_instance()   X-Ref


tag_find_records()   X-Ref


tag_add()   X-Ref


tag_assign()   X-Ref


tag_record_count()   X-Ref


tag_record_tagged_with()   X-Ref


tag_set_flag()   X-Ref


tag_unset_flag()   X-Ref


tag_print_cloud()   X-Ref


tag_autocomplete()   X-Ref


tag_print_description_box()   X-Ref


tag_print_management_box()   X-Ref


tag_print_search_box()   X-Ref


tag_print_search_results()   X-Ref


tag_print_tagged_users_table()   X-Ref


tag_print_user_box()   X-Ref


tag_print_user_list()   X-Ref


tag_display_name()   X-Ref


tag_normalize()   X-Ref


tag_get_related_tags_csv()   X-Ref


tag_set()   X-Ref


tag_set_add()   X-Ref


tag_set_delete()   X-Ref


tag_get()   X-Ref


tag_get_related_tags()   X-Ref


tag_delete()   X-Ref


tag_delete_instances()   X-Ref


tag_cleanup()   X-Ref


tag_bulk_delete_instances()   X-Ref


tag_compute_correlations()   X-Ref


tag_process_computed_correlation()   X-Ref


tag_cron()   X-Ref


tag_find_tags()   X-Ref


tag_get_name()   X-Ref


tag_get_correlated()   X-Ref


tag_cloud_sort()   X-Ref


events_load_def()   X-Ref


events_queue_handler()   X-Ref


events_dispatch()   X-Ref


events_process_queued_handler()   X-Ref


events_update_definition()   X-Ref


events_cron()   X-Ref


events_trigger_legacy()   X-Ref


events_is_registered()   X-Ref


events_pending_count()   X-Ref


clam_message_admins()   X-Ref


get_clam_error_code()   X-Ref


course_get_cm_rename_action()   X-Ref


course_scale_used()   X-Ref


site_scale_used()   X-Ref


external_function_info()   X-Ref


get_records_csv()   X-Ref


put_records_csv()   X-Ref


css_is_colour()   X-Ref


css_is_width()   X-Ref


css_sort_by_count()   X-Ref


message_get_course_contexts()   X-Ref


message_remove_url_params()   X-Ref


message_count_messages()   X-Ref


message_count_blocked_users()   X-Ref


message_contact_link()   X-Ref


message_get_recent_notifications()   X-Ref


message_history_link()   X-Ref


message_search()   X-Ref


message_shorten_message()   X-Ref


message_get_fragment()   X-Ref


message_get_history()   X-Ref


message_get_contact_add_remove_link()   X-Ref


message_get_contact_block_link()   X-Ref


message_mark_messages_read()   X-Ref


message_page_type_list()   X-Ref


message_can_post_message()   X-Ref


message_is_user_non_contact_blocked()   X-Ref


message_is_user_blocked()   X-Ref


print_log()   X-Ref


print_mnet_log()   X-Ref


print_log_csv()   X-Ref


print_log_xls()   X-Ref


print_log_ods()   X-Ref


build_logs_array()   X-Ref


get_logs_usercourse()   X-Ref


get_logs_userday()   X-Ref


get_logs()   X-Ref


prevent_form_autofill_password()   X-Ref


message_get_recent_conversations($userorid, $limitfrom = 0, $limitto = 100)   X-Ref


calendar_preferences_button()   X-Ref


calendar_wday_name()   X-Ref


calendar_get_block_upcoming()   X-Ref


calendar_print_month_selector()   X-Ref


calendar_cron()   X-Ref


load_course_context()   X-Ref


load_role_access_by_context()   X-Ref


dedupe_user_access()   X-Ref


get_user_access_sitewide()   X-Ref


calendar_get_mini()   X-Ref


calendar_get_upcoming()   X-Ref


allow_override()   X-Ref


allow_assign()   X-Ref


allow_switch()   X-Ref


question_add_tops()   X-Ref


question_is_only_toplevel_category_in_context()   X-Ref


message_move_userfrom_unread2read()   X-Ref


message_get_blocked_users()   X-Ref


message_get_contacts()   X-Ref


message_mark_message_read()   X-Ref


message_can_delete_message()   X-Ref


message_delete_message()   X-Ref


calendar_get_all_allowed_types()   X-Ref
Get all of the allowed types for all of the courses and groups
the logged in user belongs to.

The returned array will optionally have 5 keys:
'user' : true if the logged in user can create user events
'site' : true if the logged in user can create site events
'category' : array of course categories that the user can create events for
'course' : array of courses that the user can create events for
'group': array of groups that the user can create events for
'groupcourses' : array of courses that the groups belong to (can
be different from the list in 'course'.
return: array The array of allowed types.

groups_get_all_groups_for_courses($courses)   X-Ref
Gets array of all groups in a set of course.

param: array $courses Array of course objects or course ids.
return: array Array of groups indexed by course id.

events_get_cached($component)   X-Ref
Gets the capabilities that have been cached in the database for this
component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
return: array of events

events_uninstall($component)   X-Ref
Remove all event handlers and queued events

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'

events_cleanup($component, $cachedhandlers)   X-Ref
Deletes cached events that are no longer needed by the component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
param: array $cachedhandlers array of the cached events definitions that will be
return: int number of unused handlers that have been removed

events_dequeue($qhandler)   X-Ref
Removes this queued handler from the events_queued_handler table

Removes events_queue record from events_queue if no more references to this event object exists
param: stdClass $qhandler A row from the events_queued_handler table

events_get_handlers($eventname)   X-Ref
Returns handlers for given event. Uses caching for better perf.

param: string $eventname name of event or 'reset'
return: array|false array of handlers or false otherwise

get_roles_on_exact_context(context $context)   X-Ref
This function finds the roles assigned directly to this context only
i.e. no roles in parent contexts

param: context $context
return: array

get_roles_with_assignment_on_context(context $context)   X-Ref
Find out which roles has assignment on this context

param: context $context
return: array

message_add_contact($contactid, $blocked = 0, $userid = 0)   X-Ref
Add the selected user as a contact for the current user

param: int $contactid the ID of the user to add as a contact
param: int $blocked 1 if you wish to block the contact
param: int $userid the user ID of the user we want to add the contact for, defaults to current user if not specified.
return: bool/int false if the $contactid isnt a valid user id. True if no changes made.

message_remove_contact($contactid, $userid = 0)   X-Ref
Remove a contact.

param: int $contactid the user ID of the contact to remove
param: int $userid the user ID of the user we want to remove the contacts for, defaults to current user if not specified.
return: bool returns the result of delete_records()

message_unblock_contact($contactid, $userid = 0)   X-Ref
Unblock a contact.

param: int $contactid the user ID of the contact to unblock
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool returns the result of delete_records()

message_block_contact($contactid, $userid = 0)   X-Ref
Block a user.

param: int $contactid the user ID of the user to block
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool

message_get_contact($contactid)   X-Ref
Load a user's contact record

param: int $contactid the user ID of the user whose contact record you want
return: array message contacts

get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c.*",&$totalcount, $limitfrom="", $limitnum="")   X-Ref
Returns list of courses, for whole site, or category

Similar to get_courses, but allows paging
Important: Using c.* for fields is extremely expensive because
we are using distinct. You almost _NEVER_ need all the fields
in such a large SELECT

param: string|int $categoryid Either a category id or 'all' for everything
param: string $sort A field and direction to sort by
param: string $fields The additional fields to return
param: int $totalcount Reference for the number of courses
param: string $limitfrom The course to start from
param: string $limitnum The number of courses to limit to
return: array Array of courses

report_insights_context_insights(\context $context)   X-Ref
Returns the models that generated insights in the provided context.

param: \context $context
return: int[]

get_module_metadata($course, $modnames, $sectionreturn = null)   X-Ref
Retrieve all metadata for the requested modules

param: object $course The Course
param: array $modnames An array containing the list of modules and their
param: int $sectionreturn The section to return to
return: array A list of stdClass objects containing metadata about each

cron_run_single_task(\core\task\scheduled_task $task)   X-Ref
Runs a single cron task. This function assumes it is displaying output in pseudo-CLI mode.

The function will fail if the task is disabled.

Warning: Because this function closes the browser session, it may not be safe to continue
with other processing (other than displaying the rest of the page) after using this function!

param: \core\task\scheduled_task $task Task to run
return: bool True if cron run successful

cron_execute_plugin_type($plugintype, $description = null)   X-Ref
Executes cron functions for a specific type of plugin.

param: string $plugintype Plugin type (e.g. 'report')
param: string $description If specified, will display 'Starting (whatever)'

cron_bc_hack_plugin_functions($plugintype, $plugins)   X-Ref
Used to add in old-style cron functions within plugins that have not been converted to the
new standard API. (The standard API is frankenstyle_name_cron() in lib.php; some types used
cron.php and some used a different name.)

param: string $plugintype Plugin type e.g. 'report'
param: array $plugins Array from plugin name (e.g. 'report_frog') to function name (e.g.
return: array Revised version of $plugins that adds in any extra plugin functions found by

user_get_participants_sql($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the SQL used by the participants table.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles and -1 no roles
param: int $enrolid The enrolment id, 0 means all enrolment methods will be returned.
param: int $statusid The user enrolment status, -1 means all enrolments regardless of the status will be returned, if allowed.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: array

user_get_total_participants($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the total number of participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: int

user_get_participants($courseid, $groupid = 0, $accesssince, $roleid, $enrolid = 0, $statusid, $search,$additionalwhere = '', $additionalparams = array()   X-Ref
Returns the participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access
param: int $roleid The role id
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string $search The search that was performed
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
param: string $sort The SQL sort
param: int $limitfrom return a subset of records, starting at this point (optional).
param: int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
return: moodle_recordset

Class: instead  - X-Ref

get_timezone_offset()   X-Ref


get_list_of_timezones()   X-Ref


update_timezone_records()   X-Ref


calculate_user_dst_table()   X-Ref


dst_changes_for_year()   X-Ref


get_timezone_record()   X-Ref


get_referer()   X-Ref


is_web_crawler()   X-Ref


completion_cron()   X-Ref


coursetag_get_tags()   X-Ref


coursetag_get_all_tags()   X-Ref


coursetag_get_jscript()   X-Ref


coursetag_get_jscript_links()   X-Ref


coursetag_get_records()   X-Ref


coursetag_store_keywords()   X-Ref


coursetag_delete_keyword()   X-Ref


coursetag_get_tagged_courses()   X-Ref


coursetag_delete_course_tags()   X-Ref


tag_type_set()   X-Ref


tag_description_set()   X-Ref


tag_get_tags()   X-Ref


tag_get_tags_array()   X-Ref


tag_get_tags_csv()   X-Ref


tag_get_tags_ids()   X-Ref


tag_get_id()   X-Ref


tag_rename()   X-Ref


tag_delete_instance()   X-Ref


tag_find_records()   X-Ref


tag_add()   X-Ref


tag_assign()   X-Ref


tag_record_count()   X-Ref


tag_record_tagged_with()   X-Ref


tag_set_flag()   X-Ref


tag_unset_flag()   X-Ref


tag_print_cloud()   X-Ref


tag_autocomplete()   X-Ref


tag_print_description_box()   X-Ref


tag_print_management_box()   X-Ref


tag_print_search_box()   X-Ref


tag_print_search_results()   X-Ref


tag_print_tagged_users_table()   X-Ref


tag_print_user_box()   X-Ref


tag_print_user_list()   X-Ref


tag_display_name()   X-Ref


tag_normalize()   X-Ref


tag_get_related_tags_csv()   X-Ref


tag_set()   X-Ref


tag_set_add()   X-Ref


tag_set_delete()   X-Ref


tag_get()   X-Ref


tag_get_related_tags()   X-Ref


tag_delete()   X-Ref


tag_delete_instances()   X-Ref


tag_cleanup()   X-Ref


tag_bulk_delete_instances()   X-Ref


tag_compute_correlations()   X-Ref


tag_process_computed_correlation()   X-Ref


tag_cron()   X-Ref


tag_find_tags()   X-Ref


tag_get_name()   X-Ref


tag_get_correlated()   X-Ref


tag_cloud_sort()   X-Ref


events_load_def()   X-Ref


events_queue_handler()   X-Ref


events_dispatch()   X-Ref


events_process_queued_handler()   X-Ref


events_update_definition()   X-Ref


events_cron()   X-Ref


events_trigger_legacy()   X-Ref


events_is_registered()   X-Ref


events_pending_count()   X-Ref


clam_message_admins()   X-Ref


get_clam_error_code()   X-Ref


course_get_cm_rename_action()   X-Ref


course_scale_used()   X-Ref


site_scale_used()   X-Ref


external_function_info()   X-Ref


get_records_csv()   X-Ref


put_records_csv()   X-Ref


css_is_colour()   X-Ref


css_is_width()   X-Ref


css_sort_by_count()   X-Ref


message_get_course_contexts()   X-Ref


message_remove_url_params()   X-Ref


message_count_messages()   X-Ref


message_count_blocked_users()   X-Ref


message_contact_link()   X-Ref


message_get_recent_notifications()   X-Ref


message_history_link()   X-Ref


message_search()   X-Ref


message_shorten_message()   X-Ref


message_get_fragment()   X-Ref


message_get_history()   X-Ref


message_get_contact_add_remove_link()   X-Ref


message_get_contact_block_link()   X-Ref


message_mark_messages_read()   X-Ref


message_page_type_list()   X-Ref


message_can_post_message()   X-Ref


message_is_user_non_contact_blocked()   X-Ref


message_is_user_blocked()   X-Ref


print_log()   X-Ref


print_mnet_log()   X-Ref


print_log_csv()   X-Ref


print_log_xls()   X-Ref


print_log_ods()   X-Ref


build_logs_array()   X-Ref


get_logs_usercourse()   X-Ref


get_logs_userday()   X-Ref


get_logs()   X-Ref


prevent_form_autofill_password()   X-Ref


message_get_recent_conversations($userorid, $limitfrom = 0, $limitto = 100)   X-Ref


calendar_preferences_button()   X-Ref


calendar_wday_name()   X-Ref


calendar_get_block_upcoming()   X-Ref


calendar_print_month_selector()   X-Ref


calendar_cron()   X-Ref


load_course_context()   X-Ref


load_role_access_by_context()   X-Ref


dedupe_user_access()   X-Ref


get_user_access_sitewide()   X-Ref


calendar_get_mini()   X-Ref


calendar_get_upcoming()   X-Ref


allow_override()   X-Ref


allow_assign()   X-Ref


allow_switch()   X-Ref


question_add_tops()   X-Ref


question_is_only_toplevel_category_in_context()   X-Ref


message_move_userfrom_unread2read()   X-Ref


message_get_blocked_users()   X-Ref


message_get_contacts()   X-Ref


message_mark_message_read()   X-Ref


message_can_delete_message()   X-Ref


message_delete_message()   X-Ref


calendar_get_all_allowed_types()   X-Ref
Get all of the allowed types for all of the courses and groups
the logged in user belongs to.

The returned array will optionally have 5 keys:
'user' : true if the logged in user can create user events
'site' : true if the logged in user can create site events
'category' : array of course categories that the user can create events for
'course' : array of courses that the user can create events for
'group': array of groups that the user can create events for
'groupcourses' : array of courses that the groups belong to (can
be different from the list in 'course'.
return: array The array of allowed types.

groups_get_all_groups_for_courses($courses)   X-Ref
Gets array of all groups in a set of course.

param: array $courses Array of course objects or course ids.
return: array Array of groups indexed by course id.

events_get_cached($component)   X-Ref
Gets the capabilities that have been cached in the database for this
component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
return: array of events

events_uninstall($component)   X-Ref
Remove all event handlers and queued events

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'

events_cleanup($component, $cachedhandlers)   X-Ref
Deletes cached events that are no longer needed by the component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
param: array $cachedhandlers array of the cached events definitions that will be
return: int number of unused handlers that have been removed

events_dequeue($qhandler)   X-Ref
Removes this queued handler from the events_queued_handler table

Removes events_queue record from events_queue if no more references to this event object exists
param: stdClass $qhandler A row from the events_queued_handler table

events_get_handlers($eventname)   X-Ref
Returns handlers for given event. Uses caching for better perf.

param: string $eventname name of event or 'reset'
return: array|false array of handlers or false otherwise

get_roles_on_exact_context(context $context)   X-Ref
This function finds the roles assigned directly to this context only
i.e. no roles in parent contexts

param: context $context
return: array

get_roles_with_assignment_on_context(context $context)   X-Ref
Find out which roles has assignment on this context

param: context $context
return: array

message_add_contact($contactid, $blocked = 0, $userid = 0)   X-Ref
Add the selected user as a contact for the current user

param: int $contactid the ID of the user to add as a contact
param: int $blocked 1 if you wish to block the contact
param: int $userid the user ID of the user we want to add the contact for, defaults to current user if not specified.
return: bool/int false if the $contactid isnt a valid user id. True if no changes made.

message_remove_contact($contactid, $userid = 0)   X-Ref
Remove a contact.

param: int $contactid the user ID of the contact to remove
param: int $userid the user ID of the user we want to remove the contacts for, defaults to current user if not specified.
return: bool returns the result of delete_records()

message_unblock_contact($contactid, $userid = 0)   X-Ref
Unblock a contact.

param: int $contactid the user ID of the contact to unblock
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool returns the result of delete_records()

message_block_contact($contactid, $userid = 0)   X-Ref
Block a user.

param: int $contactid the user ID of the user to block
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool

message_get_contact($contactid)   X-Ref
Load a user's contact record

param: int $contactid the user ID of the user whose contact record you want
return: array message contacts

get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c.*",&$totalcount, $limitfrom="", $limitnum="")   X-Ref
Returns list of courses, for whole site, or category

Similar to get_courses, but allows paging
Important: Using c.* for fields is extremely expensive because
we are using distinct. You almost _NEVER_ need all the fields
in such a large SELECT

param: string|int $categoryid Either a category id or 'all' for everything
param: string $sort A field and direction to sort by
param: string $fields The additional fields to return
param: int $totalcount Reference for the number of courses
param: string $limitfrom The course to start from
param: string $limitnum The number of courses to limit to
return: array Array of courses

report_insights_context_insights(\context $context)   X-Ref
Returns the models that generated insights in the provided context.

param: \context $context
return: int[]

get_module_metadata($course, $modnames, $sectionreturn = null)   X-Ref
Retrieve all metadata for the requested modules

param: object $course The Course
param: array $modnames An array containing the list of modules and their
param: int $sectionreturn The section to return to
return: array A list of stdClass objects containing metadata about each

cron_run_single_task(\core\task\scheduled_task $task)   X-Ref
Runs a single cron task. This function assumes it is displaying output in pseudo-CLI mode.

The function will fail if the task is disabled.

Warning: Because this function closes the browser session, it may not be safe to continue
with other processing (other than displaying the rest of the page) after using this function!

param: \core\task\scheduled_task $task Task to run
return: bool True if cron run successful

cron_execute_plugin_type($plugintype, $description = null)   X-Ref
Executes cron functions for a specific type of plugin.

param: string $plugintype Plugin type (e.g. 'report')
param: string $description If specified, will display 'Starting (whatever)'

cron_bc_hack_plugin_functions($plugintype, $plugins)   X-Ref
Used to add in old-style cron functions within plugins that have not been converted to the
new standard API. (The standard API is frankenstyle_name_cron() in lib.php; some types used
cron.php and some used a different name.)

param: string $plugintype Plugin type e.g. 'report'
param: array $plugins Array from plugin name (e.g. 'report_frog') to function name (e.g.
return: array Revised version of $plugins that adds in any extra plugin functions found by

user_get_participants_sql($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the SQL used by the participants table.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles and -1 no roles
param: int $enrolid The enrolment id, 0 means all enrolment methods will be returned.
param: int $statusid The user enrolment status, -1 means all enrolments regardless of the status will be returned, if allowed.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: array

user_get_total_participants($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the total number of participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: int

user_get_participants($courseid, $groupid = 0, $accesssince, $roleid, $enrolid = 0, $statusid, $search,$additionalwhere = '', $additionalparams = array()   X-Ref
Returns the participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access
param: int $roleid The role id
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string $search The search that was performed
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
param: string $sort The SQL sort
param: int $limitfrom return a subset of records, starting at this point (optional).
param: int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
return: moodle_recordset

Class: instead  - X-Ref

get_timezone_offset()   X-Ref


get_list_of_timezones()   X-Ref


update_timezone_records()   X-Ref


calculate_user_dst_table()   X-Ref


dst_changes_for_year()   X-Ref


get_timezone_record()   X-Ref


get_referer()   X-Ref


is_web_crawler()   X-Ref


completion_cron()   X-Ref


coursetag_get_tags()   X-Ref


coursetag_get_all_tags()   X-Ref


coursetag_get_jscript()   X-Ref


coursetag_get_jscript_links()   X-Ref


coursetag_get_records()   X-Ref


coursetag_store_keywords()   X-Ref


coursetag_delete_keyword()   X-Ref


coursetag_get_tagged_courses()   X-Ref


coursetag_delete_course_tags()   X-Ref


tag_type_set()   X-Ref


tag_description_set()   X-Ref


tag_get_tags()   X-Ref


tag_get_tags_array()   X-Ref


tag_get_tags_csv()   X-Ref


tag_get_tags_ids()   X-Ref


tag_get_id()   X-Ref


tag_rename()   X-Ref


tag_delete_instance()   X-Ref


tag_find_records()   X-Ref


tag_add()   X-Ref


tag_assign()   X-Ref


tag_record_count()   X-Ref


tag_record_tagged_with()   X-Ref


tag_set_flag()   X-Ref


tag_unset_flag()   X-Ref


tag_print_cloud()   X-Ref


tag_autocomplete()   X-Ref


tag_print_description_box()   X-Ref


tag_print_management_box()   X-Ref


tag_print_search_box()   X-Ref


tag_print_search_results()   X-Ref


tag_print_tagged_users_table()   X-Ref


tag_print_user_box()   X-Ref


tag_print_user_list()   X-Ref


tag_display_name()   X-Ref


tag_normalize()   X-Ref


tag_get_related_tags_csv()   X-Ref


tag_set()   X-Ref


tag_set_add()   X-Ref


tag_set_delete()   X-Ref


tag_get()   X-Ref


tag_get_related_tags()   X-Ref


tag_delete()   X-Ref


tag_delete_instances()   X-Ref


tag_cleanup()   X-Ref


tag_bulk_delete_instances()   X-Ref


tag_compute_correlations()   X-Ref


tag_process_computed_correlation()   X-Ref


tag_cron()   X-Ref


tag_find_tags()   X-Ref


tag_get_name()   X-Ref


tag_get_correlated()   X-Ref


tag_cloud_sort()   X-Ref


events_load_def()   X-Ref


events_queue_handler()   X-Ref


events_dispatch()   X-Ref


events_process_queued_handler()   X-Ref


events_update_definition()   X-Ref


events_cron()   X-Ref


events_trigger_legacy()   X-Ref


events_is_registered()   X-Ref


events_pending_count()   X-Ref


clam_message_admins()   X-Ref


get_clam_error_code()   X-Ref


course_get_cm_rename_action()   X-Ref


course_scale_used()   X-Ref


site_scale_used()   X-Ref


external_function_info()   X-Ref


get_records_csv()   X-Ref


put_records_csv()   X-Ref


css_is_colour()   X-Ref


css_is_width()   X-Ref


css_sort_by_count()   X-Ref


message_get_course_contexts()   X-Ref


message_remove_url_params()   X-Ref


message_count_messages()   X-Ref


message_count_blocked_users()   X-Ref


message_contact_link()   X-Ref


message_get_recent_notifications()   X-Ref


message_history_link()   X-Ref


message_search()   X-Ref


message_shorten_message()   X-Ref


message_get_fragment()   X-Ref


message_get_history()   X-Ref


message_get_contact_add_remove_link()   X-Ref


message_get_contact_block_link()   X-Ref


message_mark_messages_read()   X-Ref


message_page_type_list()   X-Ref


message_can_post_message()   X-Ref


message_is_user_non_contact_blocked()   X-Ref


message_is_user_blocked()   X-Ref


print_log()   X-Ref


print_mnet_log()   X-Ref


print_log_csv()   X-Ref


print_log_xls()   X-Ref


print_log_ods()   X-Ref


build_logs_array()   X-Ref


get_logs_usercourse()   X-Ref


get_logs_userday()   X-Ref


get_logs()   X-Ref


prevent_form_autofill_password()   X-Ref


message_get_recent_conversations($userorid, $limitfrom = 0, $limitto = 100)   X-Ref


calendar_preferences_button()   X-Ref


calendar_wday_name()   X-Ref


calendar_get_block_upcoming()   X-Ref


calendar_print_month_selector()   X-Ref


calendar_cron()   X-Ref


load_course_context()   X-Ref


load_role_access_by_context()   X-Ref


dedupe_user_access()   X-Ref


get_user_access_sitewide()   X-Ref


calendar_get_mini()   X-Ref


calendar_get_upcoming()   X-Ref


allow_override()   X-Ref


allow_assign()   X-Ref


allow_switch()   X-Ref


question_add_tops()   X-Ref


question_is_only_toplevel_category_in_context()   X-Ref


message_move_userfrom_unread2read()   X-Ref


message_get_blocked_users()   X-Ref


message_get_contacts()   X-Ref


message_mark_message_read()   X-Ref


message_can_delete_message()   X-Ref


message_delete_message()   X-Ref


calendar_get_all_allowed_types()   X-Ref
Get all of the allowed types for all of the courses and groups
the logged in user belongs to.

The returned array will optionally have 5 keys:
'user' : true if the logged in user can create user events
'site' : true if the logged in user can create site events
'category' : array of course categories that the user can create events for
'course' : array of courses that the user can create events for
'group': array of groups that the user can create events for
'groupcourses' : array of courses that the groups belong to (can
be different from the list in 'course'.
return: array The array of allowed types.

groups_get_all_groups_for_courses($courses)   X-Ref
Gets array of all groups in a set of course.

param: array $courses Array of course objects or course ids.
return: array Array of groups indexed by course id.

events_get_cached($component)   X-Ref
Gets the capabilities that have been cached in the database for this
component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
return: array of events

events_uninstall($component)   X-Ref
Remove all event handlers and queued events

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'

events_cleanup($component, $cachedhandlers)   X-Ref
Deletes cached events that are no longer needed by the component.

param: string $component examples: 'moodle', 'mod_forum', 'block_quiz_results'
param: array $cachedhandlers array of the cached events definitions that will be
return: int number of unused handlers that have been removed

events_dequeue($qhandler)   X-Ref
Removes this queued handler from the events_queued_handler table

Removes events_queue record from events_queue if no more references to this event object exists
param: stdClass $qhandler A row from the events_queued_handler table

events_get_handlers($eventname)   X-Ref
Returns handlers for given event. Uses caching for better perf.

param: string $eventname name of event or 'reset'
return: array|false array of handlers or false otherwise

get_roles_on_exact_context(context $context)   X-Ref
This function finds the roles assigned directly to this context only
i.e. no roles in parent contexts

param: context $context
return: array

get_roles_with_assignment_on_context(context $context)   X-Ref
Find out which roles has assignment on this context

param: context $context
return: array

message_add_contact($contactid, $blocked = 0, $userid = 0)   X-Ref
Add the selected user as a contact for the current user

param: int $contactid the ID of the user to add as a contact
param: int $blocked 1 if you wish to block the contact
param: int $userid the user ID of the user we want to add the contact for, defaults to current user if not specified.
return: bool/int false if the $contactid isnt a valid user id. True if no changes made.

message_remove_contact($contactid, $userid = 0)   X-Ref
Remove a contact.

param: int $contactid the user ID of the contact to remove
param: int $userid the user ID of the user we want to remove the contacts for, defaults to current user if not specified.
return: bool returns the result of delete_records()

message_unblock_contact($contactid, $userid = 0)   X-Ref
Unblock a contact.

param: int $contactid the user ID of the contact to unblock
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool returns the result of delete_records()

message_block_contact($contactid, $userid = 0)   X-Ref
Block a user.

param: int $contactid the user ID of the user to block
param: int $userid the user ID of the user we want to unblock the contact for, defaults to current user
return: bool

message_get_contact($contactid)   X-Ref
Load a user's contact record

param: int $contactid the user ID of the user whose contact record you want
return: array message contacts

get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c.*",&$totalcount, $limitfrom="", $limitnum="")   X-Ref
Returns list of courses, for whole site, or category

Similar to get_courses, but allows paging
Important: Using c.* for fields is extremely expensive because
we are using distinct. You almost _NEVER_ need all the fields
in such a large SELECT

param: string|int $categoryid Either a category id or 'all' for everything
param: string $sort A field and direction to sort by
param: string $fields The additional fields to return
param: int $totalcount Reference for the number of courses
param: string $limitfrom The course to start from
param: string $limitnum The number of courses to limit to
return: array Array of courses

report_insights_context_insights(\context $context)   X-Ref
Returns the models that generated insights in the provided context.

param: \context $context
return: int[]

get_module_metadata($course, $modnames, $sectionreturn = null)   X-Ref
Retrieve all metadata for the requested modules

param: object $course The Course
param: array $modnames An array containing the list of modules and their
param: int $sectionreturn The section to return to
return: array A list of stdClass objects containing metadata about each

cron_run_single_task(\core\task\scheduled_task $task)   X-Ref
Runs a single cron task. This function assumes it is displaying output in pseudo-CLI mode.

The function will fail if the task is disabled.

Warning: Because this function closes the browser session, it may not be safe to continue
with other processing (other than displaying the rest of the page) after using this function!

param: \core\task\scheduled_task $task Task to run
return: bool True if cron run successful

cron_execute_plugin_type($plugintype, $description = null)   X-Ref
Executes cron functions for a specific type of plugin.

param: string $plugintype Plugin type (e.g. 'report')
param: string $description If specified, will display 'Starting (whatever)'

cron_bc_hack_plugin_functions($plugintype, $plugins)   X-Ref
Used to add in old-style cron functions within plugins that have not been converted to the
new standard API. (The standard API is frankenstyle_name_cron() in lib.php; some types used
cron.php and some used a different name.)

param: string $plugintype Plugin type e.g. 'report'
param: array $plugins Array from plugin name (e.g. 'report_frog') to function name (e.g.
return: array Revised version of $plugins that adds in any extra plugin functions found by

user_get_participants_sql($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the SQL used by the participants table.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles and -1 no roles
param: int $enrolid The enrolment id, 0 means all enrolment methods will be returned.
param: int $statusid The user enrolment status, -1 means all enrolments regardless of the status will be returned, if allowed.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: array

user_get_total_participants($courseid, $groupid = 0, $accesssince = 0, $roleid = 0, $enrolid = 0, $statusid = -1,$search = '', $additionalwhere = '', $additionalparams = array()   X-Ref
Returns the total number of participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access, 0 means any time
param: int $roleid The role id, 0 means all roles
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string|array $search The search that was performed, empty means perform no search
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
return: int

user_get_participants($courseid, $groupid = 0, $accesssince, $roleid, $enrolid = 0, $statusid, $search,$additionalwhere = '', $additionalparams = array()   X-Ref
Returns the participants for a given course.

param: int $courseid The course id
param: int $groupid The groupid, 0 means all groups and USERSWITHOUTGROUP no group
param: int $accesssince The time since last access
param: int $roleid The role id
param: int $enrolid The applied filter for the user enrolment ID.
param: int $status The applied filter for the user's enrolment status.
param: string $search The search that was performed
param: string $additionalwhere Any additional SQL to add to where
param: array $additionalparams The additional params
param: string $sort The SQL sort
param: int $limitfrom return a subset of records, starting at this point (optional).
param: int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
return: moodle_recordset

Functions that are not part of a class:

add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user=0)   X-Ref
Add an entry to the legacy log table.

param: int     $courseid  The course id
param: string  $module  The module name  e.g. forum, journal, resource, course, user etc
param: string  $action  'view', 'update', 'add' or 'delete', possibly followed by another word to clarify.
param: string  $url     The file and parameters used to see the results of the action
param: string  $info    Additional description information
param: int     $cm      The course_module->id if there is one
param: int|stdClass $user If log regards $user other than $USER
return: void

events_trigger()   X-Ref


get_core_subsystems($fullpaths = false)   X-Ref
List all core subsystems and their location

This is a whitelist of components that are part of the core and their
language strings are defined in /lang/en/<<subsystem>>.php. If a given
plugin is not listed here and it does not have proper plugintype prefix,
then it is considered as course activity module.

The location is optionally dirroot relative path. NULL means there is no special
directory for this subsystem. If the location is set, the subsystem's
renderer.php is expected to be there.

param: bool $fullpaths false means relative paths from dirroot, use true for performance reasons
return: array of (string)name => (string|null)location

get_plugin_types($fullpaths = true)   X-Ref
Lists all plugin types.

param: bool $fullpaths false means relative paths from dirroot
return: array Array of strings - name=>location

get_plugin_list($plugintype)   X-Ref
Use when listing real plugins of one type.

param: string $plugintype type of plugin
return: array name=>fulllocation pairs of plugins of given type

get_plugin_list_with_class($plugintype, $class, $file)   X-Ref
Get a list of all the plugins of a given type that define a certain class
in a certain file. The plugin component names and class names are returned.

param: string $plugintype the type of plugin, e.g. 'mod' or 'report'.
param: string $class the part of the name of the class after the
param: string $file the name of file within the plugin that defines the class.
return: array with frankenstyle plugin names as keys (e.g. 'report_courselist', 'mod_forum')

get_plugin_directory($plugintype, $name)   X-Ref
Returns the exact absolute path to plugin directory.

param: string $plugintype type of plugin
param: string $name name of the plugin
return: string full path to plugin directory; NULL if not found

normalize_component($component)   X-Ref
Normalize the component name using the "frankenstyle" names.

param: string $component
return: array two-items list of [(string)type, (string|null)name]

get_component_directory($component)   X-Ref
Return exact absolute path to a plugin directory.

param: string $component name such as 'moodle', 'mod_forum'
return: string full path to component directory; NULL if not found

get_context_instance($contextlevel, $instance = 0, $strictness = IGNORE_MISSING)   X-Ref
Get the context instance as an object. This function will create the
context instance if it does not exist yet.

param: integer $contextlevel The context level, for example CONTEXT_COURSE, or CONTEXT_MODULE.
param: integer $instance The instance id. For $level = CONTEXT_COURSE, this would be $course->id,
param: int $strictness IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found;
return: context The context object.

clam_log_upload()   X-Ref


clam_log_infected()   X-Ref


clam_change_log()   X-Ref


clam_replace_infected_file()   X-Ref


clam_handle_infected_file()   X-Ref


clam_scan_moodle_file()   X-Ref


password_compat_not_supported()   X-Ref


session_get_instance()   X-Ref


session_is_legacy()   X-Ref


session_kill_all()   X-Ref


session_touch()   X-Ref


session_kill()   X-Ref


session_kill_user()   X-Ref


session_set_user()   X-Ref


session_is_loggedinas()   X-Ref


session_get_realuser()   X-Ref


session_loginas()   X-Ref


js_minify()   X-Ref


css_minify_css()   X-Ref


check_gd_version()   X-Ref


update_login_count()   X-Ref


reset_login_count()   X-Ref


update_log_display_entry()   X-Ref


filter_text()   X-Ref


httpsrequired()   X-Ref


get_file_url()   X-Ref


get_course_participants()   X-Ref


is_course_participant()   X-Ref


get_recent_enrolments()   X-Ref


detect_munged_arguments()   X-Ref


unzip_file($zipfile, $destination = '', $showstatus_ignored = true)   X-Ref
Unzip one zip file to a destination dir
Both parameters must be FULL paths
If destination isn't specified, it will be the
SAME directory where the zip file resides.

param: string $zipfile The zip file to unzip
param: string $destination The location to unzip to
param: bool $showstatus_ignored Unused

zip_files($originalfiles, $destination)   X-Ref
Zip an array of files/dirs to a destination zip file
Both parameters must be FULL paths to the files/dirs

param: array $originalfiles Files to zip
param: string $destination The destination path
return: bool Outcome

mygroupid()   X-Ref


groupmode()   X-Ref


set_current_group()   X-Ref


get_current_group()   X-Ref


groups_filter_users_by_course_module_visible()   X-Ref


groups_course_module_visible()   X-Ref


error()   X-Ref


current_theme()   X-Ref


formerr()   X-Ref


skip_main_destination()   X-Ref


print_container()   X-Ref


print_container_start()   X-Ref


print_container_end()   X-Ref


notify()   X-Ref


print_continue()   X-Ref


print_header()   X-Ref


print_header_simple()   X-Ref


print_side_block()   X-Ref


print_textarea($unused, $rows, $cols, $width, $height, $name, $value='', $obsolete=0, $return=false, $id='')   X-Ref
Prints a basic textarea field.

This was 'deprecated' in 2.0, but not properly (there was no alternative) so the
debugging message was commented out.

param: bool $unused No longer used.
param: int $rows Number of rows to display  (minimum of 10 when $height is non-null)
param: int $cols Number of columns to display (minimum of 65 when $width is non-null)
param: null $width (Deprecated) Width of the element; if a value is passed, the minimum value for $cols will be 65. Value is otherwise ignored.
param: null $height (Deprecated) Height of the element; if a value is passe, the minimum value for $rows will be 10. Value is otherwise ignored.
param: string $name Name to use for the textarea element.
param: string $value Initial content to display in the textarea.
param: int $obsolete deprecated
param: bool $return If false, will output string. If true, will return string value.
param: string $id CSS ID to add to the textarea element.
return: string|void depending on the value of $return

print_arrow($direction='up', $strsort=null, $return=false)   X-Ref
Returns an image of an up or down arrow, used for column sorting. To avoid unnecessary DB accesses, please
provide this function with the language strings for sortasc and sortdesc.

param: string $direction 'up' or 'down'
param: string $strsort The language string used for the alt attribute of this image
param: bool $return Whether to print directly or return the html string
return: string|void depending on $return

choose_from_menu()   X-Ref


print_scale_menu_helpbutton()   X-Ref


print_checkbox()   X-Ref


update_module_button()   X-Ref


print_navigation()   X-Ref


build_navigation()   X-Ref


navmenu()   X-Ref


add_event()   X-Ref


update_event()   X-Ref


delete_event()   X-Ref


hide_event()   X-Ref


show_event()   X-Ref


textlib_get_instance()   X-Ref


get_generic_section_name()   X-Ref