Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402] [Versions 402 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: 3842 lines (125 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 classes

core_courseformat:: (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:: (181 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_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()
  plagiarism_save_form_elements()
  plagiarism_get_form_elements_module()
  make_categories_options()
  message_count_unread_messages()
  serialise_tool_proxy()
  get_extra_user_fields()
  get_extra_user_fields_sql()
  get_user_field_name()
  get_all_user_name_fields()
  calendar_process_subscription_row()
  calendar_import_icalendar_events()
  grade_print_tabs()
  print_grade_plugin_selector()
  course_purge_section_cache()
  course_purge_module_cache()
  get_array_of_activities()
  print_error()
  cron_run()
  cron_run_scheduled_tasks()
  cron_run_adhoc_tasks()
  cron_run_inner_scheduled_task()
  cron_run_inner_adhoc_task()
  cron_set_process_title()
  cron_trace_time_and_memory()
  cron_prepare_core_renderer()
  cron_setup_user()

instead:: (181 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_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()
  plagiarism_save_form_elements()
  plagiarism_get_form_elements_module()
  make_categories_options()
  message_count_unread_messages()
  serialise_tool_proxy()
  get_extra_user_fields()
  get_extra_user_fields_sql()
  get_user_field_name()
  get_all_user_name_fields()
  calendar_process_subscription_row()
  calendar_import_icalendar_events()
  grade_print_tabs()
  print_grade_plugin_selector()
  course_purge_section_cache()
  course_purge_module_cache()
  get_array_of_activities()
  print_error()
  cron_run()
  cron_run_scheduled_tasks()
  cron_run_adhoc_tasks()
  cron_run_inner_scheduled_task()
  cron_run_inner_adhoc_task()
  cron_set_process_title()
  cron_trace_time_and_memory()
  cron_prepare_core_renderer()
  cron_setup_user()

instead:: (181 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_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()
  plagiarism_save_form_elements()
  plagiarism_get_form_elements_module()
  make_categories_options()
  message_count_unread_messages()
  serialise_tool_proxy()
  get_extra_user_fields()
  get_extra_user_fields_sql()
  get_user_field_name()
  get_all_user_name_fields()
  calendar_process_subscription_row()
  calendar_import_icalendar_events()
  grade_print_tabs()
  print_grade_plugin_selector()
  course_purge_section_cache()
  course_purge_module_cache()
  get_array_of_activities()
  print_error()
  cron_run()
  cron_run_scheduled_tasks()
  cron_run_adhoc_tasks()
  cron_run_inner_scheduled_task()
  cron_run_inner_adhoc_task()
  cron_set_process_title()
  cron_trace_time_and_memory()
  cron_prepare_core_renderer()
  cron_setup_user()

instead:: (181 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_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()
  plagiarism_save_form_elements()
  plagiarism_get_form_elements_module()
  make_categories_options()
  message_count_unread_messages()
  serialise_tool_proxy()
  get_extra_user_fields()
  get_extra_user_fields_sql()
  get_user_field_name()
  get_all_user_name_fields()
  calendar_process_subscription_row()
  calendar_import_icalendar_events()
  grade_print_tabs()
  print_grade_plugin_selector()
  course_purge_section_cache()
  course_purge_module_cache()
  get_array_of_activities()
  print_error()
  cron_run()
  cron_run_scheduled_tasks()
  cron_run_adhoc_tasks()
  cron_run_inner_scheduled_task()
  cron_run_inner_adhoc_task()
  cron_set_process_title()
  cron_trace_time_and_memory()
  cron_prepare_core_renderer()
  cron_setup_user()

instead:: (181 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_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()
  plagiarism_save_form_elements()
  plagiarism_get_form_elements_module()
  make_categories_options()
  message_count_unread_messages()
  serialise_tool_proxy()
  get_extra_user_fields()
  get_extra_user_fields_sql()
  get_user_field_name()
  get_all_user_name_fields()
  calendar_process_subscription_row()
  calendar_import_icalendar_events()
  grade_print_tabs()
  print_grade_plugin_selector()
  course_purge_section_cache()
  course_purge_module_cache()
  get_array_of_activities()
  print_error()
  cron_run()
  cron_run_scheduled_tasks()
  cron_run_adhoc_tasks()
  cron_run_inner_scheduled_task()
  cron_run_inner_adhoc_task()
  cron_set_process_title()
  cron_trace_time_and_memory()
  cron_prepare_core_renderer()
  cron_setup_user()

instead:: (181 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_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()
  plagiarism_save_form_elements()
  plagiarism_get_form_elements_module()
  make_categories_options()
  message_count_unread_messages()
  serialise_tool_proxy()
  get_extra_user_fields()
  get_extra_user_fields_sql()
  get_user_field_name()
  get_all_user_name_fields()
  calendar_process_subscription_row()
  calendar_import_icalendar_events()
  grade_print_tabs()
  print_grade_plugin_selector()
  course_purge_section_cache()
  course_purge_module_cache()
  get_array_of_activities()
  print_error()
  cron_run()
  cron_run_scheduled_tasks()
  cron_run_adhoc_tasks()
  cron_run_inner_scheduled_task()
  cron_run_inner_adhoc_task()
  cron_set_process_title()
  cron_trace_time_and_memory()
  cron_prepare_core_renderer()
  cron_setup_user()

Defines 181 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_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


groups_get_all_groups_for_courses()   X-Ref


events_get_cached()   X-Ref


events_uninstall()   X-Ref


events_cleanup()   X-Ref


events_dequeue()   X-Ref


events_get_handlers()   X-Ref


get_roles_on_exact_context()   X-Ref


get_roles_with_assignment_on_context()   X-Ref


message_add_contact()   X-Ref


message_remove_contact()   X-Ref


message_unblock_contact()   X-Ref


message_block_contact()   X-Ref


message_get_contact()   X-Ref


get_courses_page()   X-Ref


report_insights_context_insights(\context $context)   X-Ref


get_module_metadata()   X-Ref


cron_run_single_task()   X-Ref


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, $accesssince, $roleid, $enrolid, $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

plagiarism_save_form_elements()   X-Ref


plagiarism_get_form_elements_module()   X-Ref


make_categories_options()   X-Ref


message_count_unread_messages()   X-Ref


serialise_tool_proxy()   X-Ref


get_extra_user_fields($context, $already = array()   X-Ref
Checks if current user is shown any extra fields when listing users.

Does not include any custom profile fields.

param: object $context Context
param: array $already Array of fields that we're going to show anyway
return: array Array of field names from user table, not including anything

get_extra_user_fields_sql($context, $alias='', $prefix='', $already = array()   X-Ref
If the current user is to be shown extra user fields when listing or
selecting users, returns a string suitable for including in an SQL select
clause to retrieve those fields.

Does not include any custom profile fields.

param: context $context Context
param: string $alias Alias of user table, e.g. 'u' (default none)
param: string $prefix Prefix for field names using AS, e.g. 'u_' (default none)
param: array $already Array of fields that we're going to include anyway so don't list them (default none)
return: string Partial SQL select clause, beginning with comma, for example ',u.idnumber,u.department' unless it is blank

get_user_field_name($field)   X-Ref
Returns the display name of a field in the user table. Works for most fields that are commonly displayed to users.

Also works for custom fields.

param: string $field Field name, e.g. 'phone1'
return: string Text description taken from language file, e.g. 'Phone number'

get_all_user_name_fields($returnsql = false, $tableprefix = null, $prefix = null, $fieldprefix = null, $order = false)   X-Ref
A centralised location for the all name fields. Returns an array / sql string snippet.

param: bool $returnsql True for an sql select field snippet.
param: string $tableprefix table query prefix to use in front of each field.
param: string $prefix prefix added to the name fields e.g. authorfirstname.
param: string $fieldprefix sql field prefix e.g. id AS userid.
param: bool $order moves firstname and lastname to the top of the array / start of the string.
return: array|string All name fields.

calendar_process_subscription_row($subscriptionid, $pollinterval, $action)   X-Ref
Update a subscription from the form data in one of the rows in the existing subscriptions table.

param: int $subscriptionid The ID of the subscription we are acting upon.
param: int $pollinterval The poll interval to use.
param: int $action The action to be performed. One of update or remove.
return: string A log of the import progress, including errors

calendar_import_icalendar_events($ical, $unused = null, $subscriptionid = null)   X-Ref
Import events from an iCalendar object into a course calendar.

param: iCalendar $ical The iCalendar object.
param: int $unused Deprecated
param: int $subscriptionid The subscription ID.
return: string A log of the import progress, including errors.

grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=false)   X-Ref
Print grading plugin selection tab-based navigation.

param: string  $active_type type of plugin on current page - import, export, report or edit
param: string  $active_plugin active plugin type - grader, user, cvs, ...
param: array   $plugin_info Array of plugins
param: boolean $return return as string
return: nothing or string if $return true

print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return=false)   X-Ref
Print grading plugin selection popup form.

param: array   $plugin_info An array of plugins containing information for the selector
param: boolean $return return as string
return: nothing or string if $return true

course_purge_section_cache(object $sectioninfo)   X-Ref
Purge the cache of a course section.

$sectioninfo must have following attributes:
- course: course id
- section: section number

param: object $sectioninfo section info
return: void

course_purge_module_cache($cm)   X-Ref
Purge the cache of a course module.

$cm must have following attributes:
- id: cmid
- course: course id

param: cm_info|stdClass $cm course module
return: void

get_array_of_activities(int $courseid, bool $usecache = false)   X-Ref
For a given course, returns an array of course activity objects
Each item in the array contains he following properties:

param: int $courseid course id
param: bool $usecache get activities from cache if modinfo exists when $usecache is true
return: array list of activities

print_error($errorcode, $module = 'error', $link = '', $a = null, $debuginfo = null)   X-Ref
Abort execution by throwing of a general exception,
default exception handler displays the error message in most cases.

param: string $errorcode The name of the language string containing the error message.
param: string $module The language file to get the error message from.
param: string $link The url where the user will be prompted to continue.
param: object $a Extra words and phrases that might be required in the error string
param: string $debuginfo optional debugging information
return: void, always throws exception!

cron_run(?int $keepalive = null)   X-Ref
Execute cron tasks

param: int|null $keepalive The keepalive time for this cron run.

cron_run_scheduled_tasks(int $timenow)   X-Ref
Execute all queued scheduled tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.

cron_run_adhoc_tasks(int $timenow, $keepalive = 0, $checklimits = true)   X-Ref
Execute all queued adhoc tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.
param: int     $keepalive Keep this function alive for N seconds and poll for new adhoc tasks.
param: bool    $checklimits Should we check limits?

cron_run_inner_scheduled_task(\core\task\task_base $task)   X-Ref
Shared code that handles running of a single scheduled task within the cron.

Not intended for calling directly outside of this library!

param: \core\task\task_base $task

cron_run_inner_adhoc_task(\core\task\adhoc_task $task)   X-Ref
Shared code that handles running of a single adhoc task within the cron.

param: \core\task\adhoc_task $task

cron_set_process_title(string $title)   X-Ref
Sets the process title

This makes it very easy for a sysadmin to immediately see what task
a cron process is running at any given moment.

param: string $title process status title

cron_trace_time_and_memory()   X-Ref
Output some standard information during cron runs. Specifically current time
and memory usage. This method also does gc_collect_cycles() (before displaying
memory usage) to try to help PHP manage memory better.


cron_prepare_core_renderer($restore = false)   X-Ref
Prepare the output renderer for the cron run.

This involves creating a new $PAGE, and $OUTPUT fresh for each task and prevents any one task from influencing
any other.

param: bool    $restore Whether to restore the original PAGE and OUTPUT

cron_setup_user($user = null, $course = null, $leavepagealone = false)   X-Ref
Sets up current user and course environment (lang, etc.) in cron.
Do not use outside of cron script!

param: stdClass $user full user object, null means default cron user (admin),
param: stdClass $course full course record, null means $SITE
param: bool $leavepagealone If specified, stops it messing with global page object
return: void

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_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


groups_get_all_groups_for_courses()   X-Ref


events_get_cached()   X-Ref


events_uninstall()   X-Ref


events_cleanup()   X-Ref


events_dequeue()   X-Ref


events_get_handlers()   X-Ref


get_roles_on_exact_context()   X-Ref


get_roles_with_assignment_on_context()   X-Ref


message_add_contact()   X-Ref


message_remove_contact()   X-Ref


message_unblock_contact()   X-Ref


message_block_contact()   X-Ref


message_get_contact()   X-Ref


get_courses_page()   X-Ref


report_insights_context_insights(\context $context)   X-Ref


get_module_metadata()   X-Ref


cron_run_single_task()   X-Ref


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, $accesssince, $roleid, $enrolid, $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

plagiarism_save_form_elements()   X-Ref


plagiarism_get_form_elements_module()   X-Ref


make_categories_options()   X-Ref


message_count_unread_messages()   X-Ref


serialise_tool_proxy()   X-Ref


get_extra_user_fields($context, $already = array()   X-Ref
Checks if current user is shown any extra fields when listing users.

Does not include any custom profile fields.

param: object $context Context
param: array $already Array of fields that we're going to show anyway
return: array Array of field names from user table, not including anything

get_extra_user_fields_sql($context, $alias='', $prefix='', $already = array()   X-Ref
If the current user is to be shown extra user fields when listing or
selecting users, returns a string suitable for including in an SQL select
clause to retrieve those fields.

Does not include any custom profile fields.

param: context $context Context
param: string $alias Alias of user table, e.g. 'u' (default none)
param: string $prefix Prefix for field names using AS, e.g. 'u_' (default none)
param: array $already Array of fields that we're going to include anyway so don't list them (default none)
return: string Partial SQL select clause, beginning with comma, for example ',u.idnumber,u.department' unless it is blank

get_user_field_name($field)   X-Ref
Returns the display name of a field in the user table. Works for most fields that are commonly displayed to users.

Also works for custom fields.

param: string $field Field name, e.g. 'phone1'
return: string Text description taken from language file, e.g. 'Phone number'

get_all_user_name_fields($returnsql = false, $tableprefix = null, $prefix = null, $fieldprefix = null, $order = false)   X-Ref
A centralised location for the all name fields. Returns an array / sql string snippet.

param: bool $returnsql True for an sql select field snippet.
param: string $tableprefix table query prefix to use in front of each field.
param: string $prefix prefix added to the name fields e.g. authorfirstname.
param: string $fieldprefix sql field prefix e.g. id AS userid.
param: bool $order moves firstname and lastname to the top of the array / start of the string.
return: array|string All name fields.

calendar_process_subscription_row($subscriptionid, $pollinterval, $action)   X-Ref
Update a subscription from the form data in one of the rows in the existing subscriptions table.

param: int $subscriptionid The ID of the subscription we are acting upon.
param: int $pollinterval The poll interval to use.
param: int $action The action to be performed. One of update or remove.
return: string A log of the import progress, including errors

calendar_import_icalendar_events($ical, $unused = null, $subscriptionid = null)   X-Ref
Import events from an iCalendar object into a course calendar.

param: iCalendar $ical The iCalendar object.
param: int $unused Deprecated
param: int $subscriptionid The subscription ID.
return: string A log of the import progress, including errors.

grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=false)   X-Ref
Print grading plugin selection tab-based navigation.

param: string  $active_type type of plugin on current page - import, export, report or edit
param: string  $active_plugin active plugin type - grader, user, cvs, ...
param: array   $plugin_info Array of plugins
param: boolean $return return as string
return: nothing or string if $return true

print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return=false)   X-Ref
Print grading plugin selection popup form.

param: array   $plugin_info An array of plugins containing information for the selector
param: boolean $return return as string
return: nothing or string if $return true

course_purge_section_cache(object $sectioninfo)   X-Ref
Purge the cache of a course section.

$sectioninfo must have following attributes:
- course: course id
- section: section number

param: object $sectioninfo section info
return: void

course_purge_module_cache($cm)   X-Ref
Purge the cache of a course module.

$cm must have following attributes:
- id: cmid
- course: course id

param: cm_info|stdClass $cm course module
return: void

get_array_of_activities(int $courseid, bool $usecache = false)   X-Ref
For a given course, returns an array of course activity objects
Each item in the array contains he following properties:

param: int $courseid course id
param: bool $usecache get activities from cache if modinfo exists when $usecache is true
return: array list of activities

print_error($errorcode, $module = 'error', $link = '', $a = null, $debuginfo = null)   X-Ref
Abort execution by throwing of a general exception,
default exception handler displays the error message in most cases.

param: string $errorcode The name of the language string containing the error message.
param: string $module The language file to get the error message from.
param: string $link The url where the user will be prompted to continue.
param: object $a Extra words and phrases that might be required in the error string
param: string $debuginfo optional debugging information
return: void, always throws exception!

cron_run(?int $keepalive = null)   X-Ref
Execute cron tasks

param: int|null $keepalive The keepalive time for this cron run.

cron_run_scheduled_tasks(int $timenow)   X-Ref
Execute all queued scheduled tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.

cron_run_adhoc_tasks(int $timenow, $keepalive = 0, $checklimits = true)   X-Ref
Execute all queued adhoc tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.
param: int     $keepalive Keep this function alive for N seconds and poll for new adhoc tasks.
param: bool    $checklimits Should we check limits?

cron_run_inner_scheduled_task(\core\task\task_base $task)   X-Ref
Shared code that handles running of a single scheduled task within the cron.

Not intended for calling directly outside of this library!

param: \core\task\task_base $task

cron_run_inner_adhoc_task(\core\task\adhoc_task $task)   X-Ref
Shared code that handles running of a single adhoc task within the cron.

param: \core\task\adhoc_task $task

cron_set_process_title(string $title)   X-Ref
Sets the process title

This makes it very easy for a sysadmin to immediately see what task
a cron process is running at any given moment.

param: string $title process status title

cron_trace_time_and_memory()   X-Ref
Output some standard information during cron runs. Specifically current time
and memory usage. This method also does gc_collect_cycles() (before displaying
memory usage) to try to help PHP manage memory better.


cron_prepare_core_renderer($restore = false)   X-Ref
Prepare the output renderer for the cron run.

This involves creating a new $PAGE, and $OUTPUT fresh for each task and prevents any one task from influencing
any other.

param: bool    $restore Whether to restore the original PAGE and OUTPUT

cron_setup_user($user = null, $course = null, $leavepagealone = false)   X-Ref
Sets up current user and course environment (lang, etc.) in cron.
Do not use outside of cron script!

param: stdClass $user full user object, null means default cron user (admin),
param: stdClass $course full course record, null means $SITE
param: bool $leavepagealone If specified, stops it messing with global page object
return: void

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_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


groups_get_all_groups_for_courses()   X-Ref


events_get_cached()   X-Ref


events_uninstall()   X-Ref


events_cleanup()   X-Ref


events_dequeue()   X-Ref


events_get_handlers()   X-Ref


get_roles_on_exact_context()   X-Ref


get_roles_with_assignment_on_context()   X-Ref


message_add_contact()   X-Ref


message_remove_contact()   X-Ref


message_unblock_contact()   X-Ref


message_block_contact()   X-Ref


message_get_contact()   X-Ref


get_courses_page()   X-Ref


report_insights_context_insights(\context $context)   X-Ref


get_module_metadata()   X-Ref


cron_run_single_task()   X-Ref


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, $accesssince, $roleid, $enrolid, $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

plagiarism_save_form_elements()   X-Ref


plagiarism_get_form_elements_module()   X-Ref


make_categories_options()   X-Ref


message_count_unread_messages()   X-Ref


serialise_tool_proxy()   X-Ref


get_extra_user_fields($context, $already = array()   X-Ref
Checks if current user is shown any extra fields when listing users.

Does not include any custom profile fields.

param: object $context Context
param: array $already Array of fields that we're going to show anyway
return: array Array of field names from user table, not including anything

get_extra_user_fields_sql($context, $alias='', $prefix='', $already = array()   X-Ref
If the current user is to be shown extra user fields when listing or
selecting users, returns a string suitable for including in an SQL select
clause to retrieve those fields.

Does not include any custom profile fields.

param: context $context Context
param: string $alias Alias of user table, e.g. 'u' (default none)
param: string $prefix Prefix for field names using AS, e.g. 'u_' (default none)
param: array $already Array of fields that we're going to include anyway so don't list them (default none)
return: string Partial SQL select clause, beginning with comma, for example ',u.idnumber,u.department' unless it is blank

get_user_field_name($field)   X-Ref
Returns the display name of a field in the user table. Works for most fields that are commonly displayed to users.

Also works for custom fields.

param: string $field Field name, e.g. 'phone1'
return: string Text description taken from language file, e.g. 'Phone number'

get_all_user_name_fields($returnsql = false, $tableprefix = null, $prefix = null, $fieldprefix = null, $order = false)   X-Ref
A centralised location for the all name fields. Returns an array / sql string snippet.

param: bool $returnsql True for an sql select field snippet.
param: string $tableprefix table query prefix to use in front of each field.
param: string $prefix prefix added to the name fields e.g. authorfirstname.
param: string $fieldprefix sql field prefix e.g. id AS userid.
param: bool $order moves firstname and lastname to the top of the array / start of the string.
return: array|string All name fields.

calendar_process_subscription_row($subscriptionid, $pollinterval, $action)   X-Ref
Update a subscription from the form data in one of the rows in the existing subscriptions table.

param: int $subscriptionid The ID of the subscription we are acting upon.
param: int $pollinterval The poll interval to use.
param: int $action The action to be performed. One of update or remove.
return: string A log of the import progress, including errors

calendar_import_icalendar_events($ical, $unused = null, $subscriptionid = null)   X-Ref
Import events from an iCalendar object into a course calendar.

param: iCalendar $ical The iCalendar object.
param: int $unused Deprecated
param: int $subscriptionid The subscription ID.
return: string A log of the import progress, including errors.

grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=false)   X-Ref
Print grading plugin selection tab-based navigation.

param: string  $active_type type of plugin on current page - import, export, report or edit
param: string  $active_plugin active plugin type - grader, user, cvs, ...
param: array   $plugin_info Array of plugins
param: boolean $return return as string
return: nothing or string if $return true

print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return=false)   X-Ref
Print grading plugin selection popup form.

param: array   $plugin_info An array of plugins containing information for the selector
param: boolean $return return as string
return: nothing or string if $return true

course_purge_section_cache(object $sectioninfo)   X-Ref
Purge the cache of a course section.

$sectioninfo must have following attributes:
- course: course id
- section: section number

param: object $sectioninfo section info
return: void

course_purge_module_cache($cm)   X-Ref
Purge the cache of a course module.

$cm must have following attributes:
- id: cmid
- course: course id

param: cm_info|stdClass $cm course module
return: void

get_array_of_activities(int $courseid, bool $usecache = false)   X-Ref
For a given course, returns an array of course activity objects
Each item in the array contains he following properties:

param: int $courseid course id
param: bool $usecache get activities from cache if modinfo exists when $usecache is true
return: array list of activities

print_error($errorcode, $module = 'error', $link = '', $a = null, $debuginfo = null)   X-Ref
Abort execution by throwing of a general exception,
default exception handler displays the error message in most cases.

param: string $errorcode The name of the language string containing the error message.
param: string $module The language file to get the error message from.
param: string $link The url where the user will be prompted to continue.
param: object $a Extra words and phrases that might be required in the error string
param: string $debuginfo optional debugging information
return: void, always throws exception!

cron_run(?int $keepalive = null)   X-Ref
Execute cron tasks

param: int|null $keepalive The keepalive time for this cron run.

cron_run_scheduled_tasks(int $timenow)   X-Ref
Execute all queued scheduled tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.

cron_run_adhoc_tasks(int $timenow, $keepalive = 0, $checklimits = true)   X-Ref
Execute all queued adhoc tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.
param: int     $keepalive Keep this function alive for N seconds and poll for new adhoc tasks.
param: bool    $checklimits Should we check limits?

cron_run_inner_scheduled_task(\core\task\task_base $task)   X-Ref
Shared code that handles running of a single scheduled task within the cron.

Not intended for calling directly outside of this library!

param: \core\task\task_base $task

cron_run_inner_adhoc_task(\core\task\adhoc_task $task)   X-Ref
Shared code that handles running of a single adhoc task within the cron.

param: \core\task\adhoc_task $task

cron_set_process_title(string $title)   X-Ref
Sets the process title

This makes it very easy for a sysadmin to immediately see what task
a cron process is running at any given moment.

param: string $title process status title

cron_trace_time_and_memory()   X-Ref
Output some standard information during cron runs. Specifically current time
and memory usage. This method also does gc_collect_cycles() (before displaying
memory usage) to try to help PHP manage memory better.


cron_prepare_core_renderer($restore = false)   X-Ref
Prepare the output renderer for the cron run.

This involves creating a new $PAGE, and $OUTPUT fresh for each task and prevents any one task from influencing
any other.

param: bool    $restore Whether to restore the original PAGE and OUTPUT

cron_setup_user($user = null, $course = null, $leavepagealone = false)   X-Ref
Sets up current user and course environment (lang, etc.) in cron.
Do not use outside of cron script!

param: stdClass $user full user object, null means default cron user (admin),
param: stdClass $course full course record, null means $SITE
param: bool $leavepagealone If specified, stops it messing with global page object
return: void

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_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


groups_get_all_groups_for_courses()   X-Ref


events_get_cached()   X-Ref


events_uninstall()   X-Ref


events_cleanup()   X-Ref


events_dequeue()   X-Ref


events_get_handlers()   X-Ref


get_roles_on_exact_context()   X-Ref


get_roles_with_assignment_on_context()   X-Ref


message_add_contact()   X-Ref


message_remove_contact()   X-Ref


message_unblock_contact()   X-Ref


message_block_contact()   X-Ref


message_get_contact()   X-Ref


get_courses_page()   X-Ref


report_insights_context_insights(\context $context)   X-Ref


get_module_metadata()   X-Ref


cron_run_single_task()   X-Ref


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, $accesssince, $roleid, $enrolid, $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

plagiarism_save_form_elements()   X-Ref


plagiarism_get_form_elements_module()   X-Ref


make_categories_options()   X-Ref


message_count_unread_messages()   X-Ref


serialise_tool_proxy()   X-Ref


get_extra_user_fields($context, $already = array()   X-Ref
Checks if current user is shown any extra fields when listing users.

Does not include any custom profile fields.

param: object $context Context
param: array $already Array of fields that we're going to show anyway
return: array Array of field names from user table, not including anything

get_extra_user_fields_sql($context, $alias='', $prefix='', $already = array()   X-Ref
If the current user is to be shown extra user fields when listing or
selecting users, returns a string suitable for including in an SQL select
clause to retrieve those fields.

Does not include any custom profile fields.

param: context $context Context
param: string $alias Alias of user table, e.g. 'u' (default none)
param: string $prefix Prefix for field names using AS, e.g. 'u_' (default none)
param: array $already Array of fields that we're going to include anyway so don't list them (default none)
return: string Partial SQL select clause, beginning with comma, for example ',u.idnumber,u.department' unless it is blank

get_user_field_name($field)   X-Ref
Returns the display name of a field in the user table. Works for most fields that are commonly displayed to users.

Also works for custom fields.

param: string $field Field name, e.g. 'phone1'
return: string Text description taken from language file, e.g. 'Phone number'

get_all_user_name_fields($returnsql = false, $tableprefix = null, $prefix = null, $fieldprefix = null, $order = false)   X-Ref
A centralised location for the all name fields. Returns an array / sql string snippet.

param: bool $returnsql True for an sql select field snippet.
param: string $tableprefix table query prefix to use in front of each field.
param: string $prefix prefix added to the name fields e.g. authorfirstname.
param: string $fieldprefix sql field prefix e.g. id AS userid.
param: bool $order moves firstname and lastname to the top of the array / start of the string.
return: array|string All name fields.

calendar_process_subscription_row($subscriptionid, $pollinterval, $action)   X-Ref
Update a subscription from the form data in one of the rows in the existing subscriptions table.

param: int $subscriptionid The ID of the subscription we are acting upon.
param: int $pollinterval The poll interval to use.
param: int $action The action to be performed. One of update or remove.
return: string A log of the import progress, including errors

calendar_import_icalendar_events($ical, $unused = null, $subscriptionid = null)   X-Ref
Import events from an iCalendar object into a course calendar.

param: iCalendar $ical The iCalendar object.
param: int $unused Deprecated
param: int $subscriptionid The subscription ID.
return: string A log of the import progress, including errors.

grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=false)   X-Ref
Print grading plugin selection tab-based navigation.

param: string  $active_type type of plugin on current page - import, export, report or edit
param: string  $active_plugin active plugin type - grader, user, cvs, ...
param: array   $plugin_info Array of plugins
param: boolean $return return as string
return: nothing or string if $return true

print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return=false)   X-Ref
Print grading plugin selection popup form.

param: array   $plugin_info An array of plugins containing information for the selector
param: boolean $return return as string
return: nothing or string if $return true

course_purge_section_cache(object $sectioninfo)   X-Ref
Purge the cache of a course section.

$sectioninfo must have following attributes:
- course: course id
- section: section number

param: object $sectioninfo section info
return: void

course_purge_module_cache($cm)   X-Ref
Purge the cache of a course module.

$cm must have following attributes:
- id: cmid
- course: course id

param: cm_info|stdClass $cm course module
return: void

get_array_of_activities(int $courseid, bool $usecache = false)   X-Ref
For a given course, returns an array of course activity objects
Each item in the array contains he following properties:

param: int $courseid course id
param: bool $usecache get activities from cache if modinfo exists when $usecache is true
return: array list of activities

print_error($errorcode, $module = 'error', $link = '', $a = null, $debuginfo = null)   X-Ref
Abort execution by throwing of a general exception,
default exception handler displays the error message in most cases.

param: string $errorcode The name of the language string containing the error message.
param: string $module The language file to get the error message from.
param: string $link The url where the user will be prompted to continue.
param: object $a Extra words and phrases that might be required in the error string
param: string $debuginfo optional debugging information
return: void, always throws exception!

cron_run(?int $keepalive = null)   X-Ref
Execute cron tasks

param: int|null $keepalive The keepalive time for this cron run.

cron_run_scheduled_tasks(int $timenow)   X-Ref
Execute all queued scheduled tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.

cron_run_adhoc_tasks(int $timenow, $keepalive = 0, $checklimits = true)   X-Ref
Execute all queued adhoc tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.
param: int     $keepalive Keep this function alive for N seconds and poll for new adhoc tasks.
param: bool    $checklimits Should we check limits?

cron_run_inner_scheduled_task(\core\task\task_base $task)   X-Ref
Shared code that handles running of a single scheduled task within the cron.

Not intended for calling directly outside of this library!

param: \core\task\task_base $task

cron_run_inner_adhoc_task(\core\task\adhoc_task $task)   X-Ref
Shared code that handles running of a single adhoc task within the cron.

param: \core\task\adhoc_task $task

cron_set_process_title(string $title)   X-Ref
Sets the process title

This makes it very easy for a sysadmin to immediately see what task
a cron process is running at any given moment.

param: string $title process status title

cron_trace_time_and_memory()   X-Ref
Output some standard information during cron runs. Specifically current time
and memory usage. This method also does gc_collect_cycles() (before displaying
memory usage) to try to help PHP manage memory better.


cron_prepare_core_renderer($restore = false)   X-Ref
Prepare the output renderer for the cron run.

This involves creating a new $PAGE, and $OUTPUT fresh for each task and prevents any one task from influencing
any other.

param: bool    $restore Whether to restore the original PAGE and OUTPUT

cron_setup_user($user = null, $course = null, $leavepagealone = false)   X-Ref
Sets up current user and course environment (lang, etc.) in cron.
Do not use outside of cron script!

param: stdClass $user full user object, null means default cron user (admin),
param: stdClass $course full course record, null means $SITE
param: bool $leavepagealone If specified, stops it messing with global page object
return: void

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_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


groups_get_all_groups_for_courses()   X-Ref


events_get_cached()   X-Ref


events_uninstall()   X-Ref


events_cleanup()   X-Ref


events_dequeue()   X-Ref


events_get_handlers()   X-Ref


get_roles_on_exact_context()   X-Ref


get_roles_with_assignment_on_context()   X-Ref


message_add_contact()   X-Ref


message_remove_contact()   X-Ref


message_unblock_contact()   X-Ref


message_block_contact()   X-Ref


message_get_contact()   X-Ref


get_courses_page()   X-Ref


report_insights_context_insights(\context $context)   X-Ref


get_module_metadata()   X-Ref


cron_run_single_task()   X-Ref


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, $accesssince, $roleid, $enrolid, $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

plagiarism_save_form_elements()   X-Ref


plagiarism_get_form_elements_module()   X-Ref


make_categories_options()   X-Ref


message_count_unread_messages()   X-Ref


serialise_tool_proxy()   X-Ref


get_extra_user_fields($context, $already = array()   X-Ref
Checks if current user is shown any extra fields when listing users.

Does not include any custom profile fields.

param: object $context Context
param: array $already Array of fields that we're going to show anyway
return: array Array of field names from user table, not including anything

get_extra_user_fields_sql($context, $alias='', $prefix='', $already = array()   X-Ref
If the current user is to be shown extra user fields when listing or
selecting users, returns a string suitable for including in an SQL select
clause to retrieve those fields.

Does not include any custom profile fields.

param: context $context Context
param: string $alias Alias of user table, e.g. 'u' (default none)
param: string $prefix Prefix for field names using AS, e.g. 'u_' (default none)
param: array $already Array of fields that we're going to include anyway so don't list them (default none)
return: string Partial SQL select clause, beginning with comma, for example ',u.idnumber,u.department' unless it is blank

get_user_field_name($field)   X-Ref
Returns the display name of a field in the user table. Works for most fields that are commonly displayed to users.

Also works for custom fields.

param: string $field Field name, e.g. 'phone1'
return: string Text description taken from language file, e.g. 'Phone number'

get_all_user_name_fields($returnsql = false, $tableprefix = null, $prefix = null, $fieldprefix = null, $order = false)   X-Ref
A centralised location for the all name fields. Returns an array / sql string snippet.

param: bool $returnsql True for an sql select field snippet.
param: string $tableprefix table query prefix to use in front of each field.
param: string $prefix prefix added to the name fields e.g. authorfirstname.
param: string $fieldprefix sql field prefix e.g. id AS userid.
param: bool $order moves firstname and lastname to the top of the array / start of the string.
return: array|string All name fields.

calendar_process_subscription_row($subscriptionid, $pollinterval, $action)   X-Ref
Update a subscription from the form data in one of the rows in the existing subscriptions table.

param: int $subscriptionid The ID of the subscription we are acting upon.
param: int $pollinterval The poll interval to use.
param: int $action The action to be performed. One of update or remove.
return: string A log of the import progress, including errors

calendar_import_icalendar_events($ical, $unused = null, $subscriptionid = null)   X-Ref
Import events from an iCalendar object into a course calendar.

param: iCalendar $ical The iCalendar object.
param: int $unused Deprecated
param: int $subscriptionid The subscription ID.
return: string A log of the import progress, including errors.

grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=false)   X-Ref
Print grading plugin selection tab-based navigation.

param: string  $active_type type of plugin on current page - import, export, report or edit
param: string  $active_plugin active plugin type - grader, user, cvs, ...
param: array   $plugin_info Array of plugins
param: boolean $return return as string
return: nothing or string if $return true

print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return=false)   X-Ref
Print grading plugin selection popup form.

param: array   $plugin_info An array of plugins containing information for the selector
param: boolean $return return as string
return: nothing or string if $return true

course_purge_section_cache(object $sectioninfo)   X-Ref
Purge the cache of a course section.

$sectioninfo must have following attributes:
- course: course id
- section: section number

param: object $sectioninfo section info
return: void

course_purge_module_cache($cm)   X-Ref
Purge the cache of a course module.

$cm must have following attributes:
- id: cmid
- course: course id

param: cm_info|stdClass $cm course module
return: void

get_array_of_activities(int $courseid, bool $usecache = false)   X-Ref
For a given course, returns an array of course activity objects
Each item in the array contains he following properties:

param: int $courseid course id
param: bool $usecache get activities from cache if modinfo exists when $usecache is true
return: array list of activities

print_error($errorcode, $module = 'error', $link = '', $a = null, $debuginfo = null)   X-Ref
Abort execution by throwing of a general exception,
default exception handler displays the error message in most cases.

param: string $errorcode The name of the language string containing the error message.
param: string $module The language file to get the error message from.
param: string $link The url where the user will be prompted to continue.
param: object $a Extra words and phrases that might be required in the error string
param: string $debuginfo optional debugging information
return: void, always throws exception!

cron_run(?int $keepalive = null)   X-Ref
Execute cron tasks

param: int|null $keepalive The keepalive time for this cron run.

cron_run_scheduled_tasks(int $timenow)   X-Ref
Execute all queued scheduled tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.

cron_run_adhoc_tasks(int $timenow, $keepalive = 0, $checklimits = true)   X-Ref
Execute all queued adhoc tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.
param: int     $keepalive Keep this function alive for N seconds and poll for new adhoc tasks.
param: bool    $checklimits Should we check limits?

cron_run_inner_scheduled_task(\core\task\task_base $task)   X-Ref
Shared code that handles running of a single scheduled task within the cron.

Not intended for calling directly outside of this library!

param: \core\task\task_base $task

cron_run_inner_adhoc_task(\core\task\adhoc_task $task)   X-Ref
Shared code that handles running of a single adhoc task within the cron.

param: \core\task\adhoc_task $task

cron_set_process_title(string $title)   X-Ref
Sets the process title

This makes it very easy for a sysadmin to immediately see what task
a cron process is running at any given moment.

param: string $title process status title

cron_trace_time_and_memory()   X-Ref
Output some standard information during cron runs. Specifically current time
and memory usage. This method also does gc_collect_cycles() (before displaying
memory usage) to try to help PHP manage memory better.


cron_prepare_core_renderer($restore = false)   X-Ref
Prepare the output renderer for the cron run.

This involves creating a new $PAGE, and $OUTPUT fresh for each task and prevents any one task from influencing
any other.

param: bool    $restore Whether to restore the original PAGE and OUTPUT

cron_setup_user($user = null, $course = null, $leavepagealone = false)   X-Ref
Sets up current user and course environment (lang, etc.) in cron.
Do not use outside of cron script!

param: stdClass $user full user object, null means default cron user (admin),
param: stdClass $course full course record, null means $SITE
param: bool $leavepagealone If specified, stops it messing with global page object
return: void

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_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


groups_get_all_groups_for_courses()   X-Ref


events_get_cached()   X-Ref


events_uninstall()   X-Ref


events_cleanup()   X-Ref


events_dequeue()   X-Ref


events_get_handlers()   X-Ref


get_roles_on_exact_context()   X-Ref


get_roles_with_assignment_on_context()   X-Ref


message_add_contact()   X-Ref


message_remove_contact()   X-Ref


message_unblock_contact()   X-Ref


message_block_contact()   X-Ref


message_get_contact()   X-Ref


get_courses_page()   X-Ref


report_insights_context_insights(\context $context)   X-Ref


get_module_metadata()   X-Ref


cron_run_single_task()   X-Ref


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, $accesssince, $roleid, $enrolid, $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

plagiarism_save_form_elements()   X-Ref


plagiarism_get_form_elements_module()   X-Ref


make_categories_options()   X-Ref


message_count_unread_messages()   X-Ref


serialise_tool_proxy()   X-Ref


get_extra_user_fields($context, $already = array()   X-Ref
Checks if current user is shown any extra fields when listing users.

Does not include any custom profile fields.

param: object $context Context
param: array $already Array of fields that we're going to show anyway
return: array Array of field names from user table, not including anything

get_extra_user_fields_sql($context, $alias='', $prefix='', $already = array()   X-Ref
If the current user is to be shown extra user fields when listing or
selecting users, returns a string suitable for including in an SQL select
clause to retrieve those fields.

Does not include any custom profile fields.

param: context $context Context
param: string $alias Alias of user table, e.g. 'u' (default none)
param: string $prefix Prefix for field names using AS, e.g. 'u_' (default none)
param: array $already Array of fields that we're going to include anyway so don't list them (default none)
return: string Partial SQL select clause, beginning with comma, for example ',u.idnumber,u.department' unless it is blank

get_user_field_name($field)   X-Ref
Returns the display name of a field in the user table. Works for most fields that are commonly displayed to users.

Also works for custom fields.

param: string $field Field name, e.g. 'phone1'
return: string Text description taken from language file, e.g. 'Phone number'

get_all_user_name_fields($returnsql = false, $tableprefix = null, $prefix = null, $fieldprefix = null, $order = false)   X-Ref
A centralised location for the all name fields. Returns an array / sql string snippet.

param: bool $returnsql True for an sql select field snippet.
param: string $tableprefix table query prefix to use in front of each field.
param: string $prefix prefix added to the name fields e.g. authorfirstname.
param: string $fieldprefix sql field prefix e.g. id AS userid.
param: bool $order moves firstname and lastname to the top of the array / start of the string.
return: array|string All name fields.

calendar_process_subscription_row($subscriptionid, $pollinterval, $action)   X-Ref
Update a subscription from the form data in one of the rows in the existing subscriptions table.

param: int $subscriptionid The ID of the subscription we are acting upon.
param: int $pollinterval The poll interval to use.
param: int $action The action to be performed. One of update or remove.
return: string A log of the import progress, including errors

calendar_import_icalendar_events($ical, $unused = null, $subscriptionid = null)   X-Ref
Import events from an iCalendar object into a course calendar.

param: iCalendar $ical The iCalendar object.
param: int $unused Deprecated
param: int $subscriptionid The subscription ID.
return: string A log of the import progress, including errors.

grade_print_tabs($active_type, $active_plugin, $plugin_info, $return=false)   X-Ref
Print grading plugin selection tab-based navigation.

param: string  $active_type type of plugin on current page - import, export, report or edit
param: string  $active_plugin active plugin type - grader, user, cvs, ...
param: array   $plugin_info Array of plugins
param: boolean $return return as string
return: nothing or string if $return true

print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return=false)   X-Ref
Print grading plugin selection popup form.

param: array   $plugin_info An array of plugins containing information for the selector
param: boolean $return return as string
return: nothing or string if $return true

course_purge_section_cache(object $sectioninfo)   X-Ref
Purge the cache of a course section.

$sectioninfo must have following attributes:
- course: course id
- section: section number

param: object $sectioninfo section info
return: void

course_purge_module_cache($cm)   X-Ref
Purge the cache of a course module.

$cm must have following attributes:
- id: cmid
- course: course id

param: cm_info|stdClass $cm course module
return: void

get_array_of_activities(int $courseid, bool $usecache = false)   X-Ref
For a given course, returns an array of course activity objects
Each item in the array contains he following properties:

param: int $courseid course id
param: bool $usecache get activities from cache if modinfo exists when $usecache is true
return: array list of activities

print_error($errorcode, $module = 'error', $link = '', $a = null, $debuginfo = null)   X-Ref
Abort execution by throwing of a general exception,
default exception handler displays the error message in most cases.

param: string $errorcode The name of the language string containing the error message.
param: string $module The language file to get the error message from.
param: string $link The url where the user will be prompted to continue.
param: object $a Extra words and phrases that might be required in the error string
param: string $debuginfo optional debugging information
return: void, always throws exception!

cron_run(?int $keepalive = null)   X-Ref
Execute cron tasks

param: int|null $keepalive The keepalive time for this cron run.

cron_run_scheduled_tasks(int $timenow)   X-Ref
Execute all queued scheduled tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.

cron_run_adhoc_tasks(int $timenow, $keepalive = 0, $checklimits = true)   X-Ref
Execute all queued adhoc tasks, applying necessary concurrency limits and time limits.

param: int     $timenow The time this process started.
param: int     $keepalive Keep this function alive for N seconds and poll for new adhoc tasks.
param: bool    $checklimits Should we check limits?

cron_run_inner_scheduled_task(\core\task\task_base $task)   X-Ref
Shared code that handles running of a single scheduled task within the cron.

Not intended for calling directly outside of this library!

param: \core\task\task_base $task

cron_run_inner_adhoc_task(\core\task\adhoc_task $task)   X-Ref
Shared code that handles running of a single adhoc task within the cron.

param: \core\task\adhoc_task $task

cron_set_process_title(string $title)   X-Ref
Sets the process title

This makes it very easy for a sysadmin to immediately see what task
a cron process is running at any given moment.

param: string $title process status title

cron_trace_time_and_memory()   X-Ref
Output some standard information during cron runs. Specifically current time
and memory usage. This method also does gc_collect_cycles() (before displaying
memory usage) to try to help PHP manage memory better.


cron_prepare_core_renderer($restore = false)   X-Ref
Prepare the output renderer for the cron run.

This involves creating a new $PAGE, and $OUTPUT fresh for each task and prevents any one task from influencing
any other.

param: bool    $restore Whether to restore the original PAGE and OUTPUT

cron_setup_user($user = null, $course = null, $leavepagealone = false)   X-Ref
Sets up current user and course environment (lang, etc.) in cron.
Do not use outside of cron script!

param: stdClass $user full user object, null means default cron user (admin),
param: stdClass $course full course record, null means $SITE
param: bool $leavepagealone If specified, stops it messing with global page object
return: void

Functions that are not part of a class:

add_to_log()   X-Ref


events_trigger()   X-Ref


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

This is a list 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()   X-Ref


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