Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Files | |
file | access_token.php |
Loads/stores oauth2 access tokens in DB for system accounts in order to use a single token across multiple sessions. | |
file | activities_due.php |
Activities due indicator. | |
file | adhoc_task.php |
Adhoc task abstract class. | |
file | adminlib.php |
Functions and classes used during installation, upgrades and for admin settings. | |
file | advanced_testcase.php |
Advanced test case. | |
file | ajaxlib.php |
Library functions to facilitate the use of ajax JavaScript in Moodle. | |
file | alignment_form.php |
Form alignment for editing. | |
file | analytics.php |
Defines the built-in prediction models provided by the Moodle core. | |
file | analytics_cleanup_task.php |
A scheduled task. | |
file | any_access_after_end.php |
Any access after the official end of the course. | |
file | any_access_before_start.php |
Any access before the official start of the course. | |
file | any_course_access.php |
Any access indicator. | |
file | any_write_action.php |
Write actions indicator. | |
file | any_write_action_in_course.php |
Write actions in a course indicator. | |
file | api.php |
The class core\update\api is defined here. | |
file | api.php |
Class for loading/storing oauth2 endpoints from the DB. | |
file | api.php |
Class communication. | |
file | arraydataset.php |
Array based data iterator. | |
file | assertion.php |
Badge assertion library. | |
file | assessable_submitted.php |
Abstract assessable submitted event. | |
file | assessable_uploaded.php |
Abstract assessable uploaded event. | |
file | async_helper.class.php |
Helper functions for asynchronous backups and restores. | |
file | asynchronous_backup_task.php |
Adhoc task that performs asynchronous backups. | |
file | asynchronous_restore_task.php |
Adhoc task that performs asynchronous restores. | |
file | auth.php |
Defines classes used for plugin info. | |
file | authlib.php |
Multiple plugin authentication Support library. | |
file | autoloader.php |
PHPUnit autoloader for Moodle. | |
file | automated_backup_task.php |
A scheduled task. | |
file | availability.php |
Class for availability plugins. | |
file | award_criteria.php |
Badge award criteria. | |
file | award_criteria_activity.php |
This file contains the activity badge award criteria type class. | |
file | award_criteria_badge.php |
This file contains the badge earned badge award criteria type class. | |
file | award_criteria_cohort.php |
This file contains the cohort membership badge award criteria type class. | |
file | award_criteria_competency.php |
This file contains the badge earned badge award criteria type class. | |
file | award_criteria_course.php |
This file contains the course completion badge award criteria type class. | |
file | award_criteria_courseset.php |
This file contains the courseset completion badge award criteria type class. | |
file | award_criteria_manual.php |
This file contains the manual badge award criteria type class. | |
file | award_criteria_overall.php |
This file contains the overall badge award criteria type. | |
file | award_criteria_profile.php |
This file contains the profile completion badge award criteria type class. | |
file | awardlib.php |
Classes to manage manual badge award. | |
file | backpack.php |
Form class for mybackpack.php. | |
file | backup_cleanup_task.php |
A scheduled task. | |
file | backup_cron_helper.class.php |
Utility helper for automated backups run through cron. | |
file | backuplib.php |
Provides imscc11_export_converter class. | |
file | badge.php |
Form classes for editing badges. | |
file | badge.php |
Badge assertion library. | |
file | badge_alignments.php |
Issued badge renderable. | |
file | badge_archived.php |
Badge archived event. | |
file | badge_awarded.php |
Badge awarded event. | |
file | badge_collection.php |
Issued badge renderable. | |
file | badge_created.php |
Badge created event. | |
file | badge_criteria_created.php |
Badge criteria created event. | |
file | badge_criteria_deleted.php |
Badge criteria deleted event. | |
file | badge_criteria_updated.php |
Badge criteria updated event. | |
file | badge_deleted.php |
Badge deleted event. | |
file | badge_disabled.php |
Badge disabled event. | |
file | badge_duplicated.php |
Badge duplicated event. | |
file | badge_enabled.php |
Badge enabled event. | |
file | badge_listing_viewed.php |
Badge listing viewed event. | |
file | badge_management.php |
Issued badge renderable. | |
file | badge_recipients.php |
Issued badge renderable. | |
file | badge_related.php |
Collection of all related badges. | |
file | badge_revoked.php |
Badge revoked event. | |
file | badge_updated.php |
Badge updated event. | |
file | badge_user_collection.php |
Collection of use badges. | |
file | badge_viewed.php |
Badge viewed event. | |
file | badges.php |
This file defines settingpages and externalpages under the "badges" section. | |
file | badges_cron_task.php |
A scheduled task. | |
file | badgeslib.php |
Contains classes, functions and constants used in badges. | |
file | bakerlib.php |
Baking badges library. | |
file | base.php |
Defines classes used for plugin info. | |
file | base.php |
Base event class. | |
file | base.php |
Base class for dataformat. | |
file | base_testcase.php |
Base test case class. | |
file | basic_testcase.php |
Basic test case. | |
file | behat_action_menu.php |
Steps definitions to open and close action menus. | |
file | behat_app.php |
Mobile/desktop app steps definitions. | |
file | behat_base.php |
Base class of all steps definitions. | |
file | behat_command.php |
Behat command utils. | |
file | behat_config_manager.php |
Utils to set Behat config. | |
file | behat_config_util.php |
Utils to set Behat config. | |
file | behat_context_helper.php |
Helper to get behat contexts from other contexts. | |
file | behat_core_generator.php |
Data generators for acceptance testing. | |
file | behat_data_generators.php |
Data generators for acceptance testing. | |
file | behat_deprecated.php |
Steps definitions that will be deprecated in the next releases. | |
file | behat_field_manager.php |
Form fields helper. | |
file | behat_filters.php |
Steps definitions related to filters. | |
file | behat_forms.php |
Steps definitions related with forms. | |
file | behat_general.php |
General use steps definitions. | |
file | behat_generator_base.php |
Base class for data generators component support for acceptance testing. | |
file | behat_init_context.php |
Contexts initializer class. | |
file | behat_login.php |
Behat login related steps definitions. | |
file | behat_navigation.php |
Navigation steps definitions. | |
file | behat_permissions.php |
Steps definitions related with permissions. | |
file | behat_selectors.php |
Moodle-specific selectors. | |
file | behat_transformations.php |
Behat arguments transformations. | |
file | behaviourtypebase.php |
Defines the question behaviour type base class. | |
file | block.php |
Defines classes used for plugin info. | |
file | block_generator.php |
Block generator base class. | |
file | blocklib.php |
Block Class and Functions. | |
file | blog_association_created.php |
Event for when a new blog entry is associated with a context. | |
file | blog_association_deleted.php |
Event for when a new blog entry is associated with a context. | |
file | blog_comment_created.php |
The blog comment created event. | |
file | blog_comment_deleted.php |
The blog comment deleted event. | |
file | blog_cron_task.php |
A scheduled task. | |
file | blog_entries_viewed.php |
Event for when blog entries are viewed. | |
file | blog_entry_created.php |
Event for when a new blog entry is added. | |
file | blog_entry_deleted.php |
Event for when a new blog entry is deleted. | |
file | blog_entry_updated.php |
Event to be triggered when a blog entry is updated. | |
file | blog_external_added.php |
Event for when a new blog entry is associated with a context. | |
file | blog_external_removed.php |
Event for when a new blog entry is associated with a context. | |
file | blog_external_updated.php |
Event for when a new blog entry is associated with a context. | |
file | blog_external_viewed.php |
Event for when a new blog entry is associated with a context. | |
file | bootstraplib.php |
PHPUnit bootstrap function. | |
file | boxlib.php |
Box.net client. | |
file | brokenfile.php |
This is an empty file which is used in order to prevent error logs in the serverlog. | |
file | build_installed_themes_task.php |
Adhoc task that builds and caches all of the site's installed themes. | |
file | cache_cleanup_task.php |
A scheduled task. | |
file | cache_cron_task.php |
A scheduled task. | |
file | cachelock.php |
Defines classes used for plugin info. | |
file | caches.php |
Core cache definitions. | |
file | cachestore.php |
Defines classes used for plugin info. | |
file | calculated.php |
Question statistics calculations class. | |
file | calculator.php |
Question statistics calculator class. | |
file | calendar_cron_task.php |
A scheduled task. | |
file | calendar_event_created.php |
Calendar event created event. | |
file | calendar_event_deleted.php |
Calendar event deleted event. | |
file | calendar_event_updated.php |
Calendar event updated event. | |
file | calendar_subscription_created.php |
calendar subscription added event. | |
file | calendar_subscription_deleted.php |
calendar subscription deleted event. | |
file | calendar_subscription_updated.php |
calendar subscription updated event. | |
file | calendartype.php |
Defines classes used for plugin info. | |
file | capability_assigned.php |
Capability assigned event. | |
file | capability_unassigned.php |
Capability unassigned event. | |
file | category.php |
Contains class core_course_category responsible for course category operations. | |
file | change_password_form.php |
Change password form definition. | |
file | chart_axis.php |
Chart axis. | |
file | chart_bar.php |
Chart bar. | |
file | chart_base.php |
Chart base. | |
file | chart_line.php |
Chart line. | |
file | chart_pie.php |
Chart pie. | |
file | chart_series.php |
Chart series. | |
file | check_for_updates_task.php |
A scheduled task. | |
file | checkbox_toggleall.php |
The renderable for core/checkbox-toggleall. | |
file | checker.php |
Defines classes used for updates. | |
file | checker_exception.php |
Defines classes used for updates. | |
file | chooser.php |
The chooser renderable. | |
file | chooser_item.php |
The chooser_item renderable. | |
file | chooser_section.php |
The chooser_section renderable. | |
file | clean_up_deleted_search_area_task.php |
Adhoc task that clean up data related ro deleted search area. | |
file | client.php |
Configurable oauth2 client class. | |
file | clilib.php |
Command line utility functions and classes. | |
file | cohort_created.php |
Cohort updated event. | |
file | cohort_deleted.php |
Cohort deleted event. | |
file | cohort_member_added.php |
User added to a cohort event. | |
file | cohort_member_removed.php |
User removed from a cohort event. | |
file | cohort_updated.php |
Cohort updated event. | |
file | collator.php |
Defines string apis. | |
file | collections.php |
Form class for mybackpack.php. | |
file | comment_created.php |
Abstract comment created event. | |
file | comment_deleted.php |
Abstract comment deleted event. | |
file | comments_viewed.php |
Abstract comments viewed event. | |
file | completion_daily_task.php |
A scheduled task. | |
file | completion_defaults_updated.php |
Default completion for activity in a course updated event. | |
file | completion_regular_task.php |
A scheduled task. | |
file | component.php |
Components (core subsystems + plugins) related code. | |
file | component_generator_base.php |
Component generator base class. | |
file | component_named_replacement.php |
A class for recording the definition of Mink replacements. | |
file | component_named_selector.php |
Class representing a named selector that can be used in Behat tests. | |
file | componentlib.class.php |
This library includes all the necessary stuff to use the one-click download and install feature of Moodle, used to keep updated some items like languages, pear, enviroment... | |
file | config.php |
Cache configuration reader. | |
file | config_log_created.php |
Config log created. | |
file | configonlylib.php |
Minimalistic library, usable even when no other moodle libs are loaded. | |
file | constraint_object_is_equal_with_exceptions.php |
Constraint that checks a simple object with an isEqual constrain, allowing for exceptions to be made for some fields. | |
file | content_viewed.php |
Abstract event for content viewing. | |
file | context_cleanup_task.php |
A scheduled task. | |
file | convert_factory.class.php |
@subpackage backup-convert | |
file | convert_helper.class.php |
Provides } and convert_helper_exception classes. | |
file | convert_includes.php |
Makes sure that all general code needed by backup-convert code is included. | |
file | convertlib.php |
Provides base converter classes. | |
file | core_behat_file_helper.php |
Files interactions with behat. | |
file | core_media_player_native.php |
Test for core_media_player_native. | |
file | course_backup_created.php |
Course backup created event. | |
file | course_category_created.php |
Course category created event. | |
file | course_category_deleted.php |
Category deleted event. | |
file | course_category_updated.php |
Course category updated event. | |
file | course_category_viewed.php |
Course category viewed event. | |
file | course_completed.php |
Course completed event. | |
file | course_completion_updated.php |
Course module completion updated event. | |
file | course_content_deleted.php |
Course content deleted event. | |
file | course_created.php |
Course created event. | |
file | course_deleted.php |
Course deleted event. | |
file | course_information_viewed.php |
Course information viewed event. | |
file | course_module_completion_updated.php |
Course module completion event. | |
file | course_module_created.php |
Event to be triggered when a new course module is created. | |
file | course_module_deleted.php |
Event to be triggered when a new course module is deleted. | |
file | course_module_instance_list_viewed.php |
Course module instance list viewed event. | |
file | course_module_instances_list_viewed.php |
Course module instances list_viewed event. | |
file | course_module_updated.php |
Event to be triggered when a new course module is updated. | |
file | course_module_viewed.php |
Course module viewed event. | |
file | course_reset_ended.php |
The course reset ended event. | |
file | course_reset_started.php |
core course reset started event. | |
file | course_resources_list_viewed.php |
Event for viewing the list of course resources. | |
file | course_restored.php |
Course restored event. | |
file | course_section_created.php |
Course section created event. | |
file | course_section_deleted.php |
Course section deleted event. | |
file | course_section_updated.php |
Course section updated event. | |
file | course_updated.php |
Course updated event. | |
file | course_user_report_viewed.php |
Course user report viewed event. | |
file | course_viewed.php |
Course viewed event. | |
file | coursecat_summary_exporter.php |
Class for exporting summary information for a course category. | |
file | coursecatlib.php |
Deprecated file, classes moved to autoloaded locations. | |
file | coursereport.php |
Defines classes used for plugin info. | |
file | courses.php |
Courses analyser working at course level (insights for the course teachers). | |
file | courses.php |
This file defines settingpages and externalpages under the "courses" category. | |
file | courses_searched.php |
Courses searched event. | |
file | coverage.php |
Coverage information for the core subsystem. | |
file | coverage.php |
Coverage information for the tool_dataprivacy plugin. | |
file | coverage_info.php |
Coverage information for PHPUnit. | |
file | create_contexts_task.php |
Scheduled task class. | |
file | criteria_form.php |
Form classes for editing badges criteria. | |
file | cronlib.php |
Cron functions. | |
file | css.php |
This script prints basic CSS for the installer. | |
file | csslib.php |
This file contains CSS file serving functions. | |
file | cssparser.php |
Moodle implementation of CSS parsing. | |
file | csvlib.class.php |
This is a one-line short description of the file. | |
file | curl_security_helper.php |
Contains a class providing functions used to check the host/port black/whitelists for curl. | |
file | curl_security_helper_base.php |
Contains an abstract base class definition for curl security helpers. | |
file | customcheckslib.php |
This is a place to put custom environment checks, if there is not a better place. | |
file | customfield.php |
Defines classes used for plugin info. | |
file | dashboard_reset.php |
Dashboard reset event. | |
file | dashboard_viewed.php |
Dashboard viewed event. | |
file | dashboards_reset.php |
Dashboards reset event. | |
file | data_generator.php |
Data generator. | |
file | database.php |
Database based session handler. | |
file | database_driver_testcase.php |
Database driver test case. | |
file | database_logger.php |
Database logger for task logging. | |
file | database_text_field_content_replaced.php |
The database text field content replaced event. | |
file | dataformat.php |
Defines classes used for plugin info. | |
file | dataformatlib.php |
dataformatlib.php - Contains core dataformat related functions. | |
file | datalib.php |
Library of functions for database manipulation. | |
file | date.php |
Core date and time related code. | |
file | db_record_lock_factory.php |
This is a db record locking factory. | |
file | db_updater.php |
Progress handler that updates a database table with the progress. | |
file | ddllib.php |
This library includes all the required functions used to handle the DB structure (DDL) independently of the underlying RDBMS in use. | |
file | deciles.php |
10 parts time splitting method. | |
file | deciles_accum.php |
Range processor splitting the course in ten parts and accumulating data. | |
file | definition.php |
Cache definition class. | |
file | delete_incomplete_users_task.php |
A scheduled task. | |
file | delete_unconfirmed_users_task.php |
Scheduled task abstract class. | |
file | deprecatedlib.php |
deprecatedlib.php - Old functions retained only for backward compatibility | |
file | disabledlib.php |
This file contains classes that are used by the Cache API only when it is disabled. | |
file | dmllib.php |
This library contains all the Data Manipulation Language (DML) functions used to interact with the DB. | |
file | dnduploadlib.php |
Library to handle drag and drop course uploads. | |
file | dtllib.php |
DTL == Database Transfer Library. | |
file | dummy_manager.php |
Dummy storage manager, returns nothing. | |
file | dummystore.php |
Cache dummy store. | |
file | editor.php |
Defines classes used for plugin info. | |
file | editorlib.php |
Utility classes and functions for text editor integration. | |
file | email_failed.php |
Email failed event. | |
file | endorsement_form.php |
Form endorsement for editing. | |
file | endpoint.php |
Class for loading/storing oauth2 endpoints from the DB. | |
file | enrol.php |
Defines classes used for plugin info. | |
file | enrol_instance_created.php |
Enrol instance created event. | |
file | enrol_instance_deleted.php |
Enrol instance deleted event. | |
file | enrol_instance_updated.php |
Enrol instance updated event. | |
file | enrollib.php |
This library includes the basic parts of enrol api. | |
file | environmentlib.php |
This library includes all the necessary stuff to execute some standard tests of required versions and libraries to run Moodle. | |
file | event_course_module_instance_list_viewed.php |
Tests for base course module instance list viewed event. | |
file | event_course_module_viewed.php |
Tests for base course module viewed event. | |
file | event_mock.php |
Event mock. | |
file | event_sink.php |
Event sink. | |
file | events.php |
Definition of core event observers. | |
file | exact_named_selector.php |
Moodle-specific named exact selectors. | |
file | excellib.class.php |
Excel writer abstraction layer. | |
file | exception.php |
Session exception. | |
file | exporter.php |
Generic exporter to take a stdClass and prepare it for return by webservice. | |
file | external.php |
This class contains a list of webservice functions related to session. | |
file | external.php |
Mustache helper to load strings from string_manager. | |
file | external_badge.php |
External badge renderable. | |
file | factory.php |
This file contains the cache factory class. | |
file | file.php |
File based session handler. | |
file | file_lock_factory.php |
Flock based file locking factory. | |
file | file_temp_cleanup_task.php |
A scheduled task. | |
file | file_trash_cleanup_task.php |
A scheduled task. | |
file | fileconverter.php |
Defines classes used for plugin info. | |
file | filetypes.php |
Class to manage the custom filetypes list that is stored in a config variable. | |
file | filter.php |
Defines classes used for plugin info. | |
file | filterlib.php |
Library functions for managing text filter plugins. | |
file | flickrclient.php |
Provides flickr_client class. | |
file | forgot_password_form.php |
Forgot password page. | |
file | format.php |
Defines classes used for plugin info. | |
file | forms.php |
Forms used for the administration and managemement of the cache setup. | |
file | gdlib.php |
gdlib.php - Collection of routines in Moodle related to processing images using GD | |
file | general.php |
Defines classes used for plugin info. | |
file | geopattern.php |
Geopatterns for images. | |
file | get_user_capability_course_helper.php |
Helper functions to implement the complex get_user_capability_course function. | |
file | googleapi.php |
Simple implementation of some Google API functions for Moodle. | |
file | grade_cron_task.php |
A scheduled task. | |
file | grade_deleted.php |
Grade deleted event. | |
file | grade_exported.php |
Grade report viewed event. | |
file | grade_history_cleanup_task.php |
A scheduled task. | |
file | grade_item_created.php |
Grade item created event. | |
file | grade_item_updated.php |
Grade item updated event. | |
file | grade_letter_created.php |
Grade letter created event. | |
file | grade_letter_deleted.php |
Grade letter deleted event. | |
file | grade_letter_updated.php |
Grade letter updated event. | |
file | grade_report_viewed.php |
Grade report viewed event. | |
file | gradeexport.php |
Defines classes used for plugin info. | |
file | gradeimport.php |
Defines classes used for plugin info. | |
file | gradereport.php |
Defines classes used for plugin info. | |
file | gradingform.php |
Defines classes used for plugin info. | |
file | group_created.php |
Group created event. | |
file | group_deleted.php |
Group deleted event. | |
file | group_member_added.php |
Group member added event. | |
file | group_member_removed.php |
Group member removed event. | |
file | grouping_deleted.php |
Grouping deleted event. | |
file | grouping_group_assigned.php |
Group assigned to grouping event. | |
file | grouping_group_unassigned.php |
Group unassigned from grouping event. | |
file | grouping_updated.php |
Grouping updated event. | |
file | h5p_deleted.php |
H5P deleted event class. | |
file | h5p_get_content_types_task.php |
Task to get the latest content types from the official H5P repository. | |
file | h5p_viewed.php |
H5P viewed event class. | |
file | handler.php |
Session handler base. | |
file | helper.php |
Cache helper class. | |
file | hint_resultprinter.php |
Helper test listener. | |
file | icon_system.php |
Contains class core\output\icon_system. | |
file | icon_system_font.php |
Contains class core\output\icon_system. | |
file | icon_system_fontawesome.php |
Contains class core\output\icon_system. | |
file | icon_system_standard.php |
Contains class core\output\icon_system_standard. | |
file | info.php |
Defines classes used for updates. | |
file | inplace_editable.php |
Contains class core\output\inplace_editable. | |
file | installation_lock_factory.php |
Lock factory for use during installation. | |
file | installlib.php |
Functions to support installation process. | |
file | interfaces.php |
Cache API interfaces. | |
file | invalid_persistent_exception.php |
Invalid persistent exception. | |
file | ip_utils.php |
Contains a simple class providing some useful internet protocol-related functions. | |
file | issued_badge.php |
Issued badge renderable. | |
file | issuer.php |
Class for loading/storing issuers from the DB. | |
file | legacy_logged.php |
Legacy log emulation event class. | |
file | legacy_plugin_cron_task.php |
Scheduled task class. | |
file | lib.php |
mod_chat data generator. | |
file | lib.php |
Login library file of login/password related Moodle functions. | |
file | lib.php |
Testing general functions. | |
file | lib.php |
Adds data generator support. | |
file | lib.php |
Moodle PHPUnit integration. | |
file | lib.php |
Behat basic functions. | |
file | lib.php |
IP Lookup utility functions. | |
file | lib.php |
Functions and classes for commenting. | |
file | licenselib.php |
A namespace contains license specific functions. | |
file | list_element.php |
Contains class core_course_list_element. | |
file | listlib.php |
Classes for displaying and editing a nested list of items. | |
file | load_fontawesome_map.php |
A web service to load the mapping of moodle pix names to fontawesome icon names. | |
file | loaders.php |
Cache loaders. | |
file | local.php |
Defines classes used for plugin info. | |
file | local_settings_form.php |
A Moodle form base class for editing local filter settings. | |
file | locallib.php |
Functions and classes for comments management. | |
file | locallib.php |
The supplementary cache API. | |
file | location.php |
Define administration settings on the Location settings page. | |
file | lock.php |
Class representing a lock. | |
file | lock_config.php |
Lock configuration class, used to get an instance of the currently configured lock factory. | |
file | lock_factory.php |
Defines abstract factory class for generating locks. | |
file | log.php |
Definition of log events associated with the current component. | |
file | logging_trait.php |
This file defines a trait to assist with logging in tasks. | |
file | logmanager.php |
Task log manager. | |
file | manager.php |
Scheduled and adhoc task management. | |
file | manager.php |
Session manager class. | |
file | manager.php |
Log storage manager interface. | |
file | manager.php |
New event manager class. | |
file | mathslib.php |
@subpackage lib | |
file | media.php |
Defines classes used for plugin info. | |
file | memcached.php |
Memcached based session handler. | |
file | messaging_cleanup_task.php |
A scheduled task. | |
file | minify.php |
JS and CSS compression. | |
file | mlbackend.php |
Defines classes used for plugin info. | |
file | mnet_access_control_created.php |
Mnet access control created event. | |
file | mnet_access_control_updated.php |
Mnet access control updated event. | |
file | mnetservice.php |
Defines classes used for plugin info. | |
file | mod.php |
Defines classes used for plugin info. | |
file | modinfolib.php |
modinfolib.php - Functions/classes relating to cached information about module instances on a course. | |
file | module_generator.php |
Module generator base class. | |
file | moodlelib.php |
moodlelib.php - Moodle main library | |
file | moodleservices.php |
This file gives information about Moodle Services. | |
file | mustache_filesystem_loader.php |
Perform some custom name mapping for template file names (strip leading component/). | |
file | mustache_javascript_helper.php |
Mustache helper that will add JS to the end of the page. | |
file | mustache_pix_helper.php |
Mustache helper render pix icons. | |
file | mustache_quote_helper.php |
Wrap content in quotes, and escape all quotes used. | |
file | mustache_shorten_text_helper.php |
Mustache helper shorten text. | |
file | mustache_string_helper.php |
Mustache helper to load strings from string_manager. | |
file | mustache_template_finder.php |
List the valid locations to search for a template with a given name. | |
file | mustache_template_source_loader.php |
Load template source strings. | |
file | mustache_uniqid_helper.php |
Mustache helper that will add JS to the end of the page. | |
file | mustache_user_date_helper.php |
Mustache helper that will convert a timestamp to a date string. | |
file | myprofilelib.php |
Defines core nodes for my profile navigation tree. | |
file | named_selector.php |
Moodle-specific common functions for named selectors. | |
file | nasty_strings.php |
Nasty strings to use in tests. | |
file | navigationlib.php |
This file contains classes used to manage the navigation structures within Moodle. | |
file | no_splitting.php |
No time splitting method. | |
file | none.php |
Progress handler that ignores progress entirely. | |
file | note_created.php |
Event for when a new note entry is added. | |
file | note_deleted.php |
Event for when a new note entry deleted. | |
file | note_updated.php |
Event for when a new note entry is updated. | |
file | notes_viewed.php |
Event for when a new note entry viewed. | |
file | notification.php |
Notification renderable component. | |
file | notification.php |
User Alert notifications. | |
file | notification_sent.php |
Notification sent event. | |
file | notification_viewed.php |
Notification viewed event. | |
file | odslib.class.php |
ODS file writer. | |
file | orphaned.php |
Defines class used for orphaned subplugins. | |
file | outputactions.php |
Classes representing JS event handlers, used by output components. | |
file | outputcomponents.php |
Classes representing HTML elements, used by $OUTPUT methods. | |
file | outputfactories.php |
Interface and classes for creating appropriate renderers for various parts of Moodle. | |
file | outputfragmentrequirementslib.php |
Library functions to facilitate the use of JavaScript in Moodle. | |
file | outputlib.php |
Functions for generating the HTML that Moodle should output. | |
file | outputrenderers.php |
Classes for rendering HTML output for Moodle. | |
file | outputrequirementslib.php |
Library functions to facilitate the use of JavaScript in Moodle. | |
file | paged_content_exporter.php |
Paged Content exporter. | |
file | pagelib.php |
This file contains the moodle_page class. | |
file | partial_named_selector.php |
Moodle-specific selectors. | |
file | password_reset_cleanup_task.php |
A scheduled task. | |
file | peer_forms.php |
This file contains two forms for adding/editing mnet hosts, used by peers.php. | |
file | persistent.php |
Abstract class for objects saved to the DB. | |
file | persistent.php |
Persistent form abstract. | |
file | persistent_exporter.php |
Exporter based on persistent. | |
file | php_time_limit.php |
PHP time limit management. | |
file | phpmailer_sink.php |
phpmailer message sink. | |
file | phpminimumversionlib.php |
A set of PHP-compatible convenience functions to check Moodle minimum PHP version in a unified place. | |
file | plagiarism.php |
Defines classes used for plugin info. | |
file | plagiarism_cron_task.php |
A scheduled task. | |
file | plugin_manager.php |
Defines classes used for plugins management. | |
file | plugins.php |
Load all plugins into the admin tree. | |
file | portfolio.php |
Defines classes used for plugin info. | |
file | portfolio_cron_task.php |
A scheduled task. | |
file | postgres_lock_factory.php |
Postgres advisory locking factory. | |
file | preferences_form.php |
Form class for editing badges preferences. | |
file | profilefield.php |
Defines classes used for plugin info. | |
file | profilefields_form.php |
Allows the admin to configure a list of profile fields that are sent/recieved. | |
file | provider.php |
Privacy class for requesting user data. | |
file | purge_caches.php |
Form for selective purging of caches. | |
file | qbehaviour.php |
Defines classes used for plugin info. | |
file | qformat.php |
Defines classes used for plugin info. | |
file | qtype.php |
Defines classes used for plugin info. | |
file | quarters.php |
Quarters time splitting method. | |
file | quarters_accum.php |
Range processor splitting the course in quarters and accumulating data. | |
file | question_base.php |
Base class for question events. | |
file | question_category_base.php |
Base class for question category events. | |
file | question_category_created.php |
Question category created event. | |
file | question_category_deleted.php |
Question category deleted event. | |
file | question_category_moved.php |
Question category moved event. | |
file | question_category_updated.php |
Question category updated event. | |
file | question_category_viewed.php |
Question category viewed event. | |
file | question_created.php |
Question created event. | |
file | question_deleted.php |
Question deleted event. | |
file | question_manually_graded.php |
The mod_quiz question manually graded event. | |
file | question_moved.php |
Question moved event. | |
file | question_preview_cleanup_task.php |
Task to cleanup old question previews. | |
file | question_stats_cleanup_task.php |
Task to cleanup old question statistics cache. | |
file | question_updated.php |
Question updated event. | |
file | question_viewed.php |
Question previewed event. | |
file | questions_exported.php |
Questions exported event. | |
file | questions_imported.php |
Questions imported event. | |
file | read_actions.php |
Read actions indicator. | |
file | reader.php |
Log storage reader interface. | |
file | recaptchalib_v2.php |
This is a PHP library that handles calling reCAPTCHA v2. | |
file | recent_activity_viewed.php |
Event for recent activity page. | |
file | recordset_walk.php |
Applies the same callback to all recorset records. | |
file | redis.php |
Redis based session handler. | |
file | refresh_mod_calendar_events_task.php |
Adhoc task that updates all of the existing calendar events for modules that implement the *_refresh_events() hook. | |
file | refresh_system_tokens_task.php |
A scheduled task. | |
file | registration.php |
Class registration. | |
file | registration_cron_task.php |
A scheduled task. | |
file | related_form.php |
Form related badges. | |
file | renamedclasses.php |
This file contains mappings for classes that have been renamed so that they meet the requirements of the autoloader. | |
file | renderer.php |
Base renderer for outputting course formats. | |
file | renderer.php |
The Cache renderer. | |
file | renderer.php |
Renderer for use with the badges output. | |
file | renderer.php |
Renderer for core_admin subsystem. | |
file | report.php |
Defines classes used for plugin info. | |
file | repository.php |
Defines classes used for plugin info. | |
file | requirejs.php |
RequireJS helper functions. | |
file | reset_form.php |
Provides the course_reset_form class. | |
file | resourcelib.php |
Recourse module like helper functions. | |
file | rest.php |
Rest API base class mapping rest api methods to endpoints with http methods, args and post body. | |
file | rest_exception.php |
Rest Exception class containing error code and message. | |
file | restore_date_testcase.php |
Restore dates test case. | |
file | restored_password_form.php |
Magic that deals restored users without passwords. | |
file | role_allow_assign_updated.php |
Role assignments updated event. | |
file | role_allow_override_updated.php |
Role allow override updated event. | |
file | role_allow_switch_updated.php |
Role allow switch updated event. | |
file | role_allow_view_updated.php |
Role allow view updated event. | |
file | role_assigned.php |
Role assigned event. | |
file | role_capabilities_updated.php |
Role updated event. | |
file | role_deleted.php |
Role assigned event. | |
file | role_unassigned.php |
Role unassigned event. | |
file | role_updated.php |
Role updated event. | |
file | rtlcss.php |
Moodle implementation of RTLCSS. | |
file | scale_created.php |
Scale created event. | |
file | scale_deleted.php |
Scale deleted event. | |
file | scale_updated.php |
Scale updated event. | |
file | scheduled_task.php |
Scheduled task abstract class. | |
file | scss.php |
Moodle implementation of SCSS. | |
file | search.php |
Defines classes used for plugin info. | |
file | search_index_task.php |
A scheduled task for global search. | |
file | search_indexed.php |
Data indexed event. | |
file | search_optimize_task.php |
A scheduled task for global search. | |
file | search_results_viewed.php |
Search results viewed. | |
file | searchlib.php |
@subpackage search | |
file | send_failed_login_notifications_task.php |
Scheduled task class. | |
file | send_new_user_passwords_task.php |
Scheduled task class. | |
file | service-nologin.php |
This file is used to call any registered externallib function in Moodle. | |
file | services_form.php |
The form for configuring which services are subscribed and published on a host. | |
file | session_cleanup_task.php |
Scheduled task abstract class. | |
file | sessionlib.php |
@subpackage session | |
file | set_password_form.php |
Set password form definition. | |
file | setuplib.php |
These functions are required very early in the Moodle setup process, before any of the main libraries are loaded. | |
file | shutdown_manager.php |
Shutdown management class. | |
file | signup_form.php |
User sign-up form. | |
file | single_range.php |
Single time splitting method. | |
file | site_courses.php |
Site courses analyser working at system level (insights for the site admin). | |
file | site_registration_form.php |
Class site_registration_form. | |
file | soaplib.php |
Web services wrapper library script. | |
file | spout_base.php |
Common Spout class for dataformat. | |
file | sql_internal_table_reader.php |
Log storage sql internal table reader interface. | |
file | sql_join.php |
An object that contains sql join fragments. | |
file | sql_reader.php |
Log iterator reader interface. | |
file | stats_cron_task.php |
A scheduled task. | |
file | statslib.php |
@subpackage stats | |
file | store.php |
Cache store - base class. | |
file | string_manager.php |
String manager interface. | |
file | string_manager_install.php |
Installation time string manager. | |
file | string_manager_standard.php |
Standard string manager. | |
file | student_enrolments.php |
Student enrolments analyser. | |
file | system_account.php |
When using OAuth sometimes it makes sense to authenticate as a system user, and not the current user. | |
file | table.php |
Helpers and methods relating to DML tables. | |
file | tablelib.php |
@subpackage lib | |
file | tabs.php |
Tabs to be included on the pages for configuring a single host $mnet_peer object must be set and bootstrapped $currenttab string must be set. | |
file | tag.php |
Tag area definitions. | |
file | tag_added.php |
The tag added event. | |
file | tag_collection_created.php |
Tag collection created event. | |
file | tag_collection_deleted.php |
Tag collection deleted event. | |
file | tag_collection_updated.php |
Tag collection updated event. | |
file | tag_created.php |
Tag created event. | |
file | tag_cron_task.php |
A scheduled task. | |
file | tag_deleted.php |
Tag deleted event. | |
file | tag_flagged.php |
Tag flagged event. | |
file | tag_removed.php |
The tag removed event. | |
file | tag_unflagged.php |
Tag unflagged event. | |
file | tag_updated.php |
Tag updated event. | |
file | task_base.php |
Abstract class for common properties of scheduled_task and adhoc_task. | |
file | task_log_cleanup_task.php |
Task to cleanup task logs. | |
file | task_logger.php |
Interface for task logging. | |
file | tasks.php |
Definition of core scheduled tasks. | |
file | tasks.php |
Definition of core scheduled tasks. | |
file | test_lock.php |
Tests lock. | |
file | testoutgoingmailconf_form.php |
Testing outgoing mail configuration form. | |
file | tests_finder.php |
Tests finder. | |
file | text.php |
Defines string apis. | |
file | theme.php |
Defines classes used for plugin info. | |
file | tool.php |
Defines classes used for plugin info. | |
file | unknown_logged.php |
Unknown event. | |
file | upcoming_activities_due.php |
Upcoming activities due target. | |
file | uploadlib.php |
uploadlib.php - This class handles all aspects of fileuploading | |
file | url_rewriter.php |
URL rewriter base. | |
file | user.php |
User class. | |
file | user_bulk_cohortadd_form.php |
form for bulk user multi cohort add | |
file | user_created.php |
User created event. | |
file | user_deleted.php |
User deleted event. | |
file | user_enrolment_created.php |
User enrolment created event. | |
file | user_enrolment_deleted.php |
User enrolment deleted event. | |
file | user_enrolment_updated.php |
User enrolment updated event. | |
file | user_field_mapping.php |
Class for loading/storing oauth2 endpoints from the DB. | |
file | user_graded.php |
Grade edited event. | |
file | user_info_category_created.php |
User profile field created event. | |
file | user_info_category_deleted.php |
User profile field deleted event. | |
file | user_info_category_updated.php |
User profile field updated event. | |
file | user_info_field_created.php |
User profile field created event. | |
file | user_info_field_deleted.php |
User profile info field deleted event. | |
file | user_info_field_updated.php |
User profile info field updated event. | |
file | user_list_viewed.php |
Defines the user list viewed event. | |
file | user_loggedin.php |
User login event. | |
file | user_loggedinas.php |
User loggedinas event. | |
file | user_loggedout.php |
User logout event. | |
file | user_login_failed.php |
User login failed event. | |
file | user_password_updated.php |
User password updated event. | |
file | user_profile_viewed.php |
The user profile viewed event. | |
file | user_updated.php |
User updated event. | |
file | useragent.php |
Environment class to aid with the detection and establishment of the working environment. | |
file | users.php |
Users analyser (insights for users). | |
file | util.php |
Testing util classes. | |
file | util.php |
Utility class. | |
file | util.php |
PayPal enrolment plugin utility class. | |
file | util.php |
Utils for behat-related stuff. | |
file | uuid.php |
V4 UUID generator. | |
file | weblib.php |
Library of functions for web output. | |
file | webservice.php |
Defines classes used for plugin info. | |
file | webservice_function_called.php |
Web service function called event. | |
file | webservice_login_failed.php |
Web service login failed event. | |
file | webservice_service_created.php |
Web service service created event. | |
file | webservice_service_deleted.php |
Web service service deleted event. | |
file | webservice_service_updated.php |
Web service service updated event. | |
file | webservice_service_user_added.php |
Web service service user added event. | |
file | webservice_service_user_removed.php |
Web service service user removed event. | |
file | webservice_token_created.php |
Web service token created event. | |
file | webservice_token_sent.php |
Webservice token_sent event. | |
file | wiki_to_markdown.php |
Utility function to convert wiki-like to Markdown format. | |
file | xmlize.php |
Code for parsing xml files. | |
Classes | |
class | action_link |
class | action_menu |
class | action_menu_filler |
class | action_menu_link |
class | action_menu_link_primary |
class | action_menu_link_secondary |
class | admin_category |
The object used to represent folders (a.k.a. More... | |
class | admin_externalpage |
Links external PHP pages into the admin tree. More... | |
class | admin_page_defaultmessageoutputs |
Default message outputs configuration. More... | |
class | admin_page_manageblocks |
Blocks manage page. More... | |
class | admin_page_managefilters |
Special class for filter administration. More... | |
class | admin_page_managemessageoutputs |
Message outputs configuration. More... | |
class | admin_page_managemods |
Module manage page. More... | |
class | admin_page_manageportfolios |
class | admin_page_manageqbehaviours |
Manage question behaviours page. More... | |
class | admin_page_manageqtypes |
Question type manage page. More... | |
class | admin_page_managerepositories |
class | admin_page_pluginsoverview |
General plugins manager. More... | |
class | admin_root |
Root of admin settings tree, does not have any parent. More... | |
class | admin_setting |
Admin settings class. More... | |
class | admin_setting_agedigitalconsentmap |
Used to validate the content and format of the age of digital consent map and ensuring it is parsable. More... | |
class | admin_setting_bloglevel |
Select for blog's bloglevel setting: if set to 0, will set blog_menu block to hidden. More... | |
class | admin_setting_configcheckbox |
Checkbox. More... | |
class | admin_setting_configcheckbox_with_advanced |
Checkbox with an advanced checkbox that controls an additional $name. More... | |
class | admin_setting_configcheckbox_with_lock |
Checkbox with an advanced checkbox that controls an additional $name. More... | |
class | admin_setting_configcolourpicker |
Colour picker. More... | |
class | admin_setting_configdirectory |
Path to directory. More... | |
class | admin_setting_configduration |
Seconds duration setting. More... | |
class | admin_setting_configduration_with_advanced |
Seconds duration setting with an advanced checkbox, that controls a additional $name. More... | |
class | admin_setting_configempty |
Empty setting used to allow flags (advanced) on settings that can have no sensible default. More... | |
class | admin_setting_configexecutable |
Path to executable file. More... | |
class | admin_setting_configfile |
Path to directory. More... | |
class | admin_setting_confightmleditor |
General text area with html editor. More... | |
class | admin_setting_configiplist |
Used to validate a textarea used for ip addresses. More... | |
class | admin_setting_configmixedhostiplist |
Used to validate a textarea used for domain names, wildcard domain names and IP addresses/ranges (both IPv4 and IPv6 format). More... | |
class | admin_setting_configmulticheckbox |
Multiple checkboxes, each represents different value, stored in csv format. More... | |
class | admin_setting_configmulticheckbox2 |
Multiple checkboxes 2, value stored as string 00101011. More... | |
class | admin_setting_configmultiselect |
Select multiple items from list. More... | |
class | admin_setting_configmultiselect_modules |
Multiselect for current modules. More... | |
class | admin_setting_configpasswordunmask |
Password field, allows unmasking of password. More... | |
class | admin_setting_configpasswordunmask_with_advanced |
Password field, allows unmasking of password, with an advanced checkbox that controls an additional $name. More... | |
class | admin_setting_configportlist |
Used to validate a textarea used for port numbers. More... | |
class | admin_setting_configselect |
Select one value from list. More... | |
class | admin_setting_configselect_with_advanced |
Dropdown menu with an advanced checkbox, that controls a additional $name. More... | |
class | admin_setting_configselect_with_lock |
Select with an advanced checkbox that controls an additional $name. More... | |
class | admin_setting_configstoredfile |
Class used for uploading of one file into file storage, the file name is stored in config table. More... | |
class | admin_setting_configtext |
The most flexible setting, the user enters text. More... | |
class | admin_setting_configtext_with_advanced |
Text field with an advanced checkbox, that controls a additional $name. More... | |
class | admin_setting_configtext_with_maxlength |
Text input with a maximum length constraint. More... | |
class | admin_setting_configtextarea |
General text area without html editor. More... | |
class | admin_setting_configtime |
Time selector. More... | |
class | admin_setting_countrycodes |
class | admin_setting_courselist_frontpage |
Special select - lists on the frontpage - hacky. More... | |
class | admin_setting_description |
No setting - just name and description in same row. More... | |
class | admin_setting_devicedetectregex |
Administration interface for user specified regular expressions for device detection. More... | |
class | admin_setting_emoticons |
Administration interface for emoticon_manager settings. More... | |
class | admin_setting_enablemobileservice |
Special checkbox for enable mobile web service If enable then we store the service id of the mobile service into config table If disable then we unstore the service id from the config table. More... | |
class | admin_setting_filetypes |
Administration setting to define a list of file types. More... | |
class | admin_setting_flag |
An additional option that can be applied to an admin setting. More... | |
class | admin_setting_forcetimezone |
Forced user timezone setting. More... | |
class | admin_setting_grade_profilereport |
Selection of grade report in user profiles. More... | |
class | admin_setting_gradecat_combo |
Grade category settings. More... | |
class | admin_setting_heading |
No setting - just heading and text. More... | |
class | admin_setting_langlist |
Special setting for limiting of the list of available languages. More... | |
class | admin_setting_manage_fileconverter_plugins |
Generic class for managing plugins in a table that allows re-ordering and enable/disable of each plugin. More... | |
class | admin_setting_manage_plugins |
Generic class for managing plugins in a table that allows re-ordering and enable/disable of each plugin. More... | |
class | admin_setting_manageantiviruses |
Special class for antiviruses administration. More... | |
class | admin_setting_manageauths |
Special class for authentication administration. More... | |
class | admin_setting_managecustomfields |
Custom fields manager. More... | |
class | admin_setting_managedataformats |
Data formats manager. More... | |
class | admin_setting_manageeditors |
Special class for authentication administration. More... | |
class | admin_setting_manageenrols |
Special class for enrol plugins management. More... | |
class | admin_setting_manageexternalservices |
Special class for management of external services. More... | |
class | admin_setting_manageformats |
Course formats manager. More... | |
class | admin_setting_managelicenses |
Special class for license administration. More... | |
class | admin_setting_managemediaplayers |
Special class for media player plugins management. More... | |
class | admin_setting_managerepository |
Manage repository settings. More... | |
class | admin_setting_managewebserviceprotocols |
Special class for web service protocol administration. More... | |
class | admin_setting_managewebservicetokens |
Special class for web service token administration. More... | |
class | admin_setting_my_grades_report |
Provides a selection of grade reports to be used for "grades". More... | |
class | admin_setting_php_extension_enabled |
Admin setting to show if a php extension is enabled or not. More... | |
class | admin_setting_pickfilters |
Admin setting that is a list of installed filter plugins. More... | |
class | admin_setting_pickroles |
Admin setting that allows a user to pick appropriate roles for something. More... | |
class | admin_setting_question_behaviour |
Admin setting that allows a user to pick a behaviour. More... | |
class | admin_setting_regradingcheckbox |
class | admin_setting_scsscode |
Used to validate the contents of SCSS code and ensuring they are parsable. More... | |
class | admin_setting_searchsetupinfo |
Search setup steps info. More... | |
class | admin_setting_servertimezone |
Server timezone setting. More... | |
class | admin_setting_sitesetcheckbox |
Special checkbox for frontpage - stores data in course table. More... | |
class | admin_setting_sitesetselect |
Special select for frontpage - stores data in course table. More... | |
class | admin_setting_sitesettext |
Special text for frontpage - stores data in course table. More... | |
class | admin_setting_special_adminseesall |
Special checkbox for calendar - resets SESSION vars. More... | |
class | admin_setting_special_backup_auto_destination |
Special setting for backup auto destination. More... | |
class | admin_setting_special_backupdays |
Special control for selecting days to backup. More... | |
class | admin_setting_special_calendar_weekend |
Special admin control. More... | |
class | admin_setting_special_coursecontact |
Which roles to show on course description page. More... | |
class | admin_setting_special_debug |
Special debug setting. More... | |
class | admin_setting_special_frontpagedesc |
Special text editor for site description. More... | |
class | admin_setting_special_gradebookroles |
Graded roles in gradebook. More... | |
class | admin_setting_special_gradeexport |
Primary grade export plugin - has state tracking. More... | |
class | admin_setting_special_gradelimiting |
class | admin_setting_special_grademinmaxtouse |
Special setting for $CFG->grade_minmaxtouse. More... | |
class | admin_setting_special_gradepointdefault |
A setting for setting the default grade point value. More... | |
class | admin_setting_special_gradepointmax |
A setting for setting the maximum grade value. More... | |
class | admin_setting_special_registerauth |
Special class for register auth selection. More... | |
class | admin_setting_special_selectsetup |
Special select for settings that are altered in setup.php and can not be altered on the fly. More... | |
class | admin_setting_users_with_capability |
An admin setting for selecting one or more users who have a capability in the system context. More... | |
class | admin_setting_webservicesoverview |
Special class for overview of external services. More... | |
class | admin_settingdependency |
Used to store details of the dependency between two settings elements. More... | |
class | admin_settingpage |
Used to group a number of admin_setting objects into a page and add them to the admin tree. More... | |
class | admin_settings_country_select |
Selection of one of the recognised countries using the list returned by get_list_of_countries(). More... | |
class | admin_settings_coursecat_select |
Course category selection. More... | |
class | admin_settings_num_course_sections |
admin_setting_configselect for the default number of sections in a course, simply so we can lazy-load the choices. More... | |
class | admin_settings_sitepolicy_handler_select |
Selection of plugins that can work as site policy handlers. More... | |
class | advanced_testcase |
class | alignment_form |
Form to edit alignment. More... | |
class | async_helper |
Helper functions for asynchronous backups and restores. More... | |
class | auth_plugin_base |
Abstract authentication plugin. More... | |
class | award_criteria |
Award criteria abstract definition. More... | |
class | award_criteria_activity |
Badge award criteria – award on activity completion. More... | |
class | award_criteria_badge |
Badge award criteria – award on badge completion. More... | |
class | award_criteria_cohort |
Badge award criteria – award on cohort membership. More... | |
class | award_criteria_competency |
Badge award criteria – award on competency completion. More... | |
class | award_criteria_course |
Badge award criteria – award on course completion. More... | |
class | award_criteria_courseset |
Badge award criteria – award on courseset completion. More... | |
class | award_criteria_manual |
Manual badge award criteria. More... | |
class | award_criteria_overall |
Overall badge award criteria. More... | |
class | award_criteria_profile |
Profile completion badge award criteria. More... | |
class | backup_cron_automated_helper |
This class is an abstract class with methods that can be called to aid the running of automated backups over cron. More... | |
class | badge_award_selector_base |
class | badge_existing_users_selector |
A user selector control for existing users to award badge. More... | |
class | badge_potential_users_selector |
A user selector control for potential users to award badge. More... | |
class | badges_preferences_form |
class | base_converter |
Base converter class. More... | |
class | base_testcase |
class | basic_testcase |
class | behat_action_menu |
class | behat_app |
class | behat_base |
class | behat_command |
class | behat_component_named_replacement |
class | behat_component_named_selector |
class | behat_config_manager |
class | behat_config_util |
Behat configuration manager. More... | |
class | behat_context_helper |
class | behat_core_generator |
class | behat_data_generators |
class | behat_deprecated |
class | behat_exact_named_selector |
Moodle selectors manager. More... | |
class | behat_field_manager |
class | behat_filters |
class | behat_forms |
class | behat_general |
class | behat_generator_base |
class | behat_init_context |
class | behat_login |
class | behat_navigation |
class | behat_partial_named_selector |
class | behat_permissions |
class | behat_selectors |
class | behat_transformations |
class | behat_util |
class | block_contents |
class | block_manager |
This class keeps track of the block that should appear on a moodle_page. More... | |
class | block_move_target |
class | block_not_on_page_exception |
Exception thrown when someone tried to do something with a block that does not exist on a page. More... | |
class | bootstrap_renderer |
This class solves the problem of how to initialise $OUTPUT. More... | |
class | boxclient |
class | boxnet_client |
Box.net client class. More... | |
class | breadcrumb_navigation_node |
class | cache |
class | cache_application |
An application cache. More... | |
class | cache_config |
class | cache_config_disabled |
The cache config class used when the Cache has been disabled. More... | |
interface | cache_data_source |
class | cache_definition |
class | cache_definition_mappings_form |
class | cache_definition_sharing_form |
class | cache_disabled |
Required as it is needed for cache_config_disabled which extends cache_config_writer. More... | |
class | cache_factory |
The cache factory class. More... | |
class | cache_factory_disabled |
The cache factory class used when the Cache has been disabled. More... | |
class | cache_helper |
interface | cache_is_configurable |
Cache store feature: configurable. More... | |
interface | cache_is_key_aware |
Cache store feature: key awareness. More... | |
interface | cache_is_lockable |
Cache store feature: locking. More... | |
interface | cache_is_searchable |
Cache store feature: keys are searchable. More... | |
interface | cache_loader |
Cache Loader. More... | |
interface | cache_loader_with_locking |
Cache Loader supporting locking. More... | |
class | cache_lock_form |
interface | cache_lock_interface |
Cache lock interface. More... | |
class | cache_mode_mappings_form |
class | cache_request |
An request cache. More... | |
class | cache_session |
A session cache. More... | |
class | cache_store |
interface | cache_store_interface |
interface | cacheable_object |
Cacheable object. More... | |
class | cached_cm_info |
Class that is the return value for the _get_coursemodule_info module API function. More... | |
class | cachestore_addinstance_form |
class | cachestore_dummy |
The cache dummy store. More... | |
class | calc_formula |
This class abstracts evaluation of spreadsheet formulas. More... | |
class | cm_info |
class | coding_exception |
Exception indicating programming error, must be fixed by a programer. More... | |
class | combined_progress_trace |
Special type of trace that can be used for redirecting to multiple other traces. More... | |
class | comment |
class | comment_exception |
Comment exception class. More... | |
class | comment_manager |
comment_manager is helper class to manage moodle comments in admin page (Reports->Comments) More... | |
class | component_action |
class | component_generator_base |
Component generator base class. More... | |
class | component_installer |
This class is used to check, download and install items from download.moodle.org to the moodledata directory. More... | |
class | confirm_action |
class | context_header |
class | convert_exception |
General convert-related exception. More... | |
class | convert_factory |
Factory class to create new instances of backup converters. More... | |
class | convert_helper |
Provides various functionality via its static methods. More... | |
class | convert_helper_exception |
General convert_helper related exception. More... | |
class | core\access\get_user_capability_course_helper |
Helper functions to implement the complex get_user_capability_course function. More... | |
class | core\analytics\analyser\courses |
Courses analyser working at course level (insights for the course teachers). More... | |
class | core\analytics\analyser\site_courses |
Site courses analyser working at system level (insights for the site admin). More... | |
class | core\analytics\analyser\student_enrolments |
Student enrolments analyser. More... | |
class | core\analytics\analyser\users |
Users analyser (insights for users). More... | |
class | core\analytics\indicator\any_access_after_end |
Any access after the official end of the course. More... | |
class | core\analytics\indicator\any_access_before_start |
Any access before the official start of the course. More... | |
class | core\analytics\indicator\any_course_access |
Any access indicator. More... | |
class | core\analytics\indicator\any_write_action |
Write actions indicator. More... | |
class | core\analytics\indicator\any_write_action_in_course |
Write actions in a course indicator. More... | |
class | core\analytics\indicator\read_actions |
Read actions indicator. More... | |
class | core\analytics\time_splitting\deciles |
10 parts time splitting method. More... | |
class | core\analytics\time_splitting\deciles_accum |
Range processor splitting the course in ten parts and accumulating data. More... | |
class | core\analytics\time_splitting\no_splitting |
No time splitting method. More... | |
class | core\analytics\time_splitting\quarters |
Quarters time splitting method. More... | |
class | core\analytics\time_splitting\quarters_accum |
Range processor splitting the course in quarters and accumulating data. More... | |
class | core\analytics\time_splitting\single_range |
Single time splitting method. More... | |
class | core\antivirus\scanner |
Base abstract antivirus scanner class. More... | |
class | core\antivirus\scanner_exception |
An antivirus scanner exception class. More... | |
class | core\chart_axis |
Chart axis class. More... | |
class | core\chart_bar |
Chart bar class. More... | |
class | core\chart_base |
Chart base class. More... | |
class | core\chart_line |
Chart line class. More... | |
class | core\chart_pie |
Chart pie class. More... | |
class | core\chart_series |
Chart series class. More... | |
class | core\dataformat\base |
Base class for dataformat. More... | |
class | core\dataformat\spout_base |
Common Spout class for dataformat. More... | |
class | core\dml\recordset_walk |
class | core\dml\sql_join |
class | core\dml\table |
Helpers and methods relating to DML tables. More... | |
class | core\event\assessable_submitted |
Abstract assessable submitted event class. More... | |
class | core\event\assessable_uploaded |
class | core\event\badge_archived |
Event triggered after a badge is archived. More... | |
class | core\event\badge_awarded |
Event triggered after a badge is awarded to a user. More... | |
class | core\event\badge_created |
Event triggered after a badge is created. More... | |
class | core\event\badge_criteria_created |
class | core\event\badge_criteria_deleted |
class | core\event\badge_criteria_updated |
class | core\event\badge_deleted |
Event triggered after a badge is deleted. More... | |
class | core\event\badge_disabled |
Event triggered after a badge is disabled. More... | |
class | core\event\badge_duplicated |
Event triggered after a badge is duplicated. More... | |
class | core\event\badge_enabled |
Event triggered after a badge is enabled. More... | |
class | core\event\badge_listing_viewed |
class | core\event\badge_revoked |
Event triggered after a badge is revoked from a user. More... | |
class | core\event\badge_updated |
Event triggered after a badge is updated. More... | |
class | core\event\badge_viewed |
class | core\event\base |
class | core\event\blog_association_created |
class | core\event\blog_association_deleted |
class | core\event\blog_comment_created |
The blog comment created event class. More... | |
class | core\event\blog_comment_deleted |
The blog comment deleted event class. More... | |
class | core\event\blog_entries_viewed |
class | core\event\blog_entry_created |
Class blog_entry_created. More... | |
class | core\event\blog_entry_deleted |
Class blog_entry_deleted. More... | |
class | core\event\blog_entry_updated |
Class blog_entry_updated. More... | |
class | core\event\blog_external_added |
class | core\event\blog_external_removed |
Class for event to be triggered when an external blog is removed from moodle. More... | |
class | core\event\blog_external_updated |
class | core\event\blog_external_viewed |
class | core\event\calendar_event_created |
class | core\event\calendar_event_deleted |
class | core\event\calendar_event_updated |
class | core\event\calendar_subscription_created |
class | core\event\calendar_subscription_deleted |
class | core\event\calendar_subscription_updated |
class | core\event\capability_assigned |
Capability assigned event class. More... | |
class | core\event\capability_unassigned |
Capability unassigned event class. More... | |
class | core\event\cohort_created |
Cohort created event class. More... | |
class | core\event\cohort_deleted |
Cohort deleted event class. More... | |
class | core\event\cohort_member_added |
User added to a cohort event class. More... | |
class | core\event\cohort_member_removed |
User removed from a cohort event class. More... | |
class | core\event\cohort_updated |
Cohort updated event class. More... | |
class | core\event\comment_created |
class | core\event\comment_deleted |
class | core\event\comments_viewed |
Abstract comments viewed event class. More... | |
class | core\event\completion_defaults_updated |
Default completion for activity in a course updated event. More... | |
class | core\event\config_log_created |
class | core\event\content_viewed |
class | core\event\course_backup_created |
class | core\event\course_category_created |
Course category created event class. More... | |
class | core\event\course_category_deleted |
class | core\event\course_category_updated |
Course category updated event class. More... | |
class | core\event\course_category_viewed |
Course category viewed event class. More... | |
class | core\event\course_completed |
class | core\event\course_completion_updated |
Course module completion updated event class. More... | |
class | core\event\course_content_deleted |
class | core\event\course_created |
class | core\event\course_deleted |
class | core\event\course_information_viewed |
Course information viewed event class. More... | |
class | core\event\course_module_completion_updated |
class | core\event\course_module_created |
class | core\event\course_module_deleted |
class | core\event\course_module_instance_list_viewed |
Course module instance list viewed event class. More... | |
class | core\event\course_module_instances_list_viewed |
This class has been deprecated, please use core\event\course_module_instance_list_viewed. More... | |
class | core\event\course_module_updated |
class | core\event\course_module_viewed |
Abstract Course module viewed event class. More... | |
class | core\event\course_reset_ended |
class | core\event\course_reset_started |
class | core\event\course_resources_list_viewed |
Event for viewing the list of course resources. More... | |
class | core\event\course_restored |
class | core\event\course_section_created |
class | core\event\course_section_deleted |
class | core\event\course_section_updated |
class | core\event\course_updated |
class | core\event\course_user_report_viewed |
class | core\event\course_viewed |
class | core\event\courses_searched |
class | core\event\dashboard_reset |
class | core\event\dashboard_viewed |
Dashboard viewed event class. More... | |
class | core\event\dashboards_reset |
class | core\event\database_text_field_content_replaced |
class | core\event\email_failed |
class | core\event\enrol_instance_created |
class | core\event\enrol_instance_deleted |
class | core\event\enrol_instance_updated |
class | core\event\grade_deleted |
class | core\event\grade_exported |
Grade report viewed event class. More... | |
class | core\event\grade_item_created |
Grade item created event class. More... | |
class | core\event\grade_item_updated |
Grade item updated event class. More... | |
class | core\event\grade_letter_created |
Grade letter created event class. More... | |
class | core\event\grade_letter_deleted |
Grade letter deleted event class. More... | |
class | core\event\grade_letter_updated |
Grade letter updated event class. More... | |
class | core\event\grade_report_viewed |
Grade report viewed event class. More... | |
class | core\event\group_created |
Group created event class. More... | |
class | core\event\group_deleted |
Group deleted event class. More... | |
class | core\event\group_member_added |
class | core\event\group_member_removed |
Group member removed event class. More... | |
class | core\event\group_message_sent |
class | core\event\group_updated |
Group updated event class. More... | |
class | core\event\grouping_created |
Grouping created event class. More... | |
class | core\event\grouping_deleted |
Grouping deleted event class. More... | |
class | core\event\grouping_group_assigned |
Group assigned to grouping event class. More... | |
class | core\event\grouping_group_unassigned |
Group unassigned from grouping event class. More... | |
class | core\event\grouping_updated |
Grouping updated event class. More... | |
class | core\event\manager |
Class used for event dispatching. More... | |
class | core\event\message_contact_added |
Message contact added event class. More... | |
class | core\event\message_contact_blocked |
Message contact blocked event class. More... | |
class | core\event\message_contact_removed |
Message contact removed event class. More... | |
class | core\event\message_contact_unblocked |
Message contact unblocked event class. More... | |
class | core\event\message_deleted |
class | core\event\message_sent |
class | core\event\message_user_blocked |
Message user blocked event class. More... | |
class | core\event\message_user_unblocked |
Message users unblocked event class. More... | |
class | core\event\message_viewed |
class | core\event\mnet_access_control_created |
class | core\event\mnet_access_control_updated |
class | core\event\note_created |
class | core\event\note_deleted |
class | core\event\note_updated |
class | core\event\notes_viewed |
Class note_viewed. More... | |
class | core\event\notification_sent |
class | core\event\notification_viewed |
Notification viewed event class. More... | |
class | core\event\question_base |
Base class for question events. More... | |
class | core\event\question_category_base |
Base class for question category events. More... | |
class | core\event\question_category_created |
Question category created event class. More... | |
class | core\event\question_category_deleted |
Question category deleted event class. More... | |
class | core\event\question_category_moved |
Question category moved event class. More... | |
class | core\event\question_category_updated |
Question category updated event class. More... | |
class | core\event\question_category_viewed |
Question category viewed event class. More... | |
class | core\event\question_created |
class | core\event\question_deleted |
class | core\event\question_moved |
class | core\event\question_updated |
class | core\event\question_viewed |
class | core\event\questions_exported |
class | core\event\questions_imported |
class | core\event\recent_activity_viewed |
Event for recent activity page. More... | |
class | core\event\role_allow_assign_updated |
Role assignments updated event class. More... | |
class | core\event\role_allow_override_updated |
Role allow override updated event class. More... | |
class | core\event\role_allow_switch_updated |
Role allow switch updated event class. More... | |
class | core\event\role_allow_view_updated |
Role allow view updated event class. More... | |
class | core\event\role_assigned |
class | core\event\role_capabilities_updated |
Role updated event class. More... | |
class | core\event\role_deleted |
class | core\event\role_unassigned |
class | core\event\role_updated |
Role updated event class. More... | |
class | core\event\scale_created |
Scale created event class. More... | |
class | core\event\scale_deleted |
Scale deleted event class. More... | |
class | core\event\scale_updated |
Scale updated event class. More... | |
class | core\event\search_indexed |
Event when new data has been indexed. More... | |
class | core\event\search_results_viewed |
class | core\event\tag_added |
class | core\event\tag_collection_created |
Tag collection created event class. More... | |
class | core\event\tag_collection_deleted |
Tag collection deleted event class. More... | |
class | core\event\tag_collection_updated |
Tag collection updated event class. More... | |
class | core\event\tag_created |
class | core\event\tag_deleted |
class | core\event\tag_flagged |
class | core\event\tag_removed |
class | core\event\tag_unflagged |
class | core\event\tag_updated |
class | core\event\unknown_logged |
Unknown event class. More... | |
class | core\event\user_created |
Event when new user profile is created. More... | |
class | core\event\user_deleted |
class | core\event\user_enrolment_created |
class | core\event\user_enrolment_deleted |
class | core\event\user_enrolment_updated |
class | core\event\user_graded |
class | core\event\user_info_category_created |
class | core\event\user_info_category_deleted |
class | core\event\user_info_category_updated |
class | core\event\user_info_field_created |
class | core\event\user_info_field_deleted |
class | core\event\user_info_field_updated |
class | core\event\user_list_viewed |
class | core\event\user_loggedin |
class | core\event\user_loggedinas |
class | core\event\user_loggedout |
class | core\event\user_login_failed |
class | core\event\user_password_updated |
class | core\event\user_profile_viewed |
class | core\event\user_updated |
Event when user profile is updated. More... | |
class | core\event\webservice_function_called |
class | core\event\webservice_login_failed |
class | core\event\webservice_service_created |
class | core\event\webservice_service_deleted |
Web service service deleted event class. More... | |
class | core\event\webservice_service_updated |
Web service service updated event class. More... | |
class | core\event\webservice_service_user_added |
Web service service user added event class. More... | |
class | core\event\webservice_service_user_removed |
Web service service user removed event class. More... | |
class | core\event\webservice_token_created |
class | core\event\webservice_token_sent |
Webservice token sent event class. More... | |
class | core\external\coursecat_summary_exporter |
Class for exporting a course summary from an stdClass. More... | |
class | core\external\exporter |
Generic exporter to take a stdClass and prepare it for return by webservice, or as the context for a template. More... | |
class | core\external\output\icon_system\load_fontawesome_map |
class | core\external\paged_content_exporter |
Paged Content exporter. More... | |
class | core\external\persistent_exporter |
Abstract exporter based on the persistent model. More... | |
class | core\files\curl_security_helper |
Host and port checking for curl. More... | |
class | core\files\curl_security_helper_base |
Security helper for the curl class. More... | |
class | core\form\persistent |
Persistent form abstract class. More... | |
class | core\hub\api |
Provides methods to communicate with the hub (sites directory) web services. More... | |
class | core\hub\registration |
Methods to use when registering the site at the moodle sites directory. More... | |
class | core\hub\site_registration_form |
The site registration form. More... | |
class | core\invalid_persistent_exception |
Invalid persistent exception class. More... | |
class | core\ip_utils |
Static helper class providing some useful internet-protocol-related functions. More... | |
class | core\lock\db_record_lock_factory |
class | core\lock\file_lock_factory |
class | core\lock\installation_lock_factory |
class | core\lock\lock |
class | core\lock\lock_config |
interface | core\lock\lock_factory |
class | core\lock\postgres_lock_factory |
class | core\log\dummy_manager |
interface | core\log\manager |
Interface describing log readers. More... | |
interface | core\log\reader |
interface | core\log\sql_internal_table_reader |
Sql internal table reader. More... | |
interface | core\log\sql_reader |
Log iterator reader interface. More... | |
class | core\message\inbound\private_files_handler |
A Handler to store attachments sent in e-mails as private files. More... | |
class | core\notification |
class | core\oauth2\access_token |
Loads/stores oauth2 access tokens in DB for system accounts in order to use a single token across multiple sessions. More... | |
class | core\oauth2\api |
Static list of api methods for system oauth2 configuration. More... | |
class | core\oauth2\client |
Configurable oauth2 client class. More... | |
class | core\oauth2\endpoint |
Class for loading/storing oauth2 endpoints from the DB. More... | |
class | core\oauth2\issuer |
Class for loading/storing issuer from the DB. More... | |
class | core\oauth2\refresh_system_tokens_task |
Task to refresh system tokens regularly. More... | |
class | core\oauth2\rest |
Rest API base class mapping rest api methods to endpoints with http methods, args and post body. More... | |
class | core\oauth2\rest_exception |
Rest Exception class containing error code and message. More... | |
class | core\oauth2\system_account |
Class for loading/storing oauth2 refresh tokens from the DB. More... | |
class | core\oauth2\user_field_mapping |
Class for loading/storing oauth2 user field mappings from the DB. More... | |
class | core\output\checkbox_toggleall |
The checkbox-toggleall renderable class. More... | |
class | core\output\chooser |
The chooser renderable class. More... | |
class | core\output\chooser_item |
The chooser_item renderable class. More... | |
class | core\output\chooser_section |
The chooser_section renderable class. More... | |
class | core\output\external |
This class contains a list of webservice functions related to output. More... | |
class | core\output\icon_system |
class | core\output\icon_system_font |
class | core\output\icon_system_fontawesome |
class | core\output\icon_system_standard |
class | core\output\inplace_editable |
class | core\output\mustache_filesystem_loader |
Perform some custom name mapping for template file names. More... | |
class | core\output\mustache_javascript_helper |
Store a list of JS calls to insert at the end of the page. More... | |
class | core\output\mustache_pix_helper |
This class will call pix_icon with the section content. More... | |
class | core\output\mustache_quote_helper |
Wrap content in quotes, and escape all quotes used. More... | |
class | core\output\mustache_shorten_text_helper |
This class will call shorten_text with the section content. More... | |
class | core\output\mustache_string_helper |
This class will load language strings in a template. More... | |
class | core\output\mustache_template_finder |
Get information about valid locations for mustache templates. More... | |
class | core\output\mustache_template_source_loader |
Load template source strings. More... | |
class | core\output\mustache_uniqid_helper |
Lazy create a uniqid per instance of the class. More... | |
class | core\output\mustache_user_date_helper |
Mustache helper that will convert a timestamp to a date string. More... | |
class | core\output\notification |
interface | core\output\url_rewriter |
URL rewriter interface. More... | |
class | core\persistent |
Abstract class for core objects saved to the DB. More... | |
class | core\plugininfo\auth |
Class for authentication plugins. More... | |
class | core\plugininfo\availability |
Class for availability plugins. More... | |
class | core\plugininfo\base |
class | core\plugininfo\block |
Class for page side blocks. More... | |
class | core\plugininfo\cachelock |
Class for admin tool plugins. More... | |
class | core\plugininfo\cachestore |
Class for cache store plugins. More... | |
class | core\plugininfo\calendartype |
Class for calendar type plugins. More... | |
class | core\plugininfo\coursereport |
Class for admin tool plugins. More... | |
class | core\plugininfo\customfield |
Class for admin tool plugins. More... | |
class | core\plugininfo\dataformat |
Class for dataformats. More... | |
class | core\plugininfo\editor |
Class for HTML editors. More... | |
class | core\plugininfo\enrol |
Class for enrolment plugins. More... | |
class | core\plugininfo\fileconverter |
Class for document converter plugins. More... | |
class | core\plugininfo\filter |
Class for text filters. More... | |
class | core\plugininfo\format |
Class for course formats. More... | |
class | core\plugininfo\general |
General class for all plugin types that do not have their own class. More... | |
class | core\plugininfo\gradeexport |
Class for admin tool plugins. More... | |
class | core\plugininfo\gradeimport |
Class for admin tool plugins. More... | |
class | core\plugininfo\gradereport |
Class for admin tool plugins. More... | |
class | core\plugininfo\gradingform |
Class for admin tool plugins. More... | |
class | core\plugininfo\local |
Class for local plugins. More... | |
class | core\plugininfo\media |
Class for media plugins. More... | |
class | core\plugininfo\message |
Class for messaging processors. More... | |
class | core\plugininfo\mlbackend |
Class for analytics machine learning backend plugins. More... | |
class | core\plugininfo\mnetservice |
Class representing an MNet service. More... | |
class | core\plugininfo\mod |
Class for activity modules. More... | |
class | core\plugininfo\orphaned |
Orphaned subplugins class. More... | |
class | core\plugininfo\plagiarism |
Class for plagiarism plugins. More... | |
class | core\plugininfo\portfolio |
Class for portfolios. More... | |
class | core\plugininfo\profilefield |
Class for admin tool plugins. More... | |
class | core\plugininfo\qbehaviour |
Class for question behaviours. More... | |
class | core\plugininfo\qformat |
Class for question types. More... | |
class | core\plugininfo\qtype |
Class for question types. More... | |
class | core\plugininfo\report |
Class for admin tool plugins. More... | |
class | core\plugininfo\repository |
Class for repositories. More... | |
class | core\plugininfo\search |
Class for search plugins. More... | |
class | core\plugininfo\theme |
Class for themes. More... | |
class | core\plugininfo\tool |
Class for admin tool plugins. More... | |
class | core\plugininfo\webservice |
Class for webservice protocols. More... | |
class | core\privacy\provider |
Privacy class for requesting user data. More... | |
class | core\progress\db_updater |
Progress handler that updates a database table with the progress. More... | |
class | core\progress\none |
Progress handler that ignores progress entirely. More... | |
class | core\session\database |
Database based session handler. More... | |
class | core\session\exception |
Session related exception class. More... | |
class | core\session\external |
This class contains a list of webservice functions related to session. More... | |
class | core\session\file |
File based session handler. More... | |
class | core\session\handler |
Session handler base. More... | |
class | core\session\manager |
Session manager, this is the public Moodle API for sessions. More... | |
class | core\session\memcached |
Memcached based session handler. More... | |
class | core\session\redis |
Redis based session handler. More... | |
class | core\task\adhoc_task |
Abstract class defining an adhoc task. More... | |
class | core\task\analytics_cleanup_task |
Delete stale records from analytics tables. More... | |
class | core\task\asynchronous_backup_task |
Adhoc task that performs asynchronous backups. More... | |
class | core\task\asynchronous_restore_task |
Adhoc task that performs asynchronous restores. More... | |
class | core\task\automated_backup_task |
Simple task to run the backup cron. More... | |
class | core\task\backup_cleanup_task |
Simple task to delete old backup records. More... | |
class | core\task\badges_cron_task |
Simple task to run the badges cron. More... | |
class | core\task\badges_message_task |
Simple task to run the badges cron. More... | |
class | core\task\blog_cron_task |
Simple task to run the blog cron. More... | |
class | core\task\build_installed_themes_task |
Class that builds and caches all of the site's installed themes. More... | |
class | core\task\cache_cleanup_task |
Simple task to delete old cache records. More... | |
class | core\task\cache_cron_task |
Simple task to run the cache cron. More... | |
class | core\task\calendar_cron_task |
Simple task to run the calendar cron. More... | |
class | core\task\check_for_updates_task |
Simple task to run the registration cron. More... | |
class | core\task\clean_up_deleted_search_area_task |
Class that cleans up data related to deleted search area. More... | |
class | core\task\completion_daily_task |
Simple task to run the daily completion cron. More... | |
class | core\task\completion_regular_task |
Simple task to run the regular completion cron. More... | |
class | core\task\context_cleanup_task |
Simple task to delete old context records. More... | |
class | core\task\create_contexts_task |
Simple task to create missing contexts at all levels. More... | |
class | core\task\database_logger |
Database logger for task logging. More... | |
class | core\task\delete_incomplete_users_task |
Simple task to delete user accounts for users who have not completed their profile in time. More... | |
class | core\task\delete_unconfirmed_users_task |
Simple task to delete user accounts for users who have not confirmed in time. More... | |
class | core\task\file_temp_cleanup_task |
Simple task to delete temp files older than 1 week. More... | |
class | core\task\file_trash_cleanup_task |
Simple task to run the file trash cleanup cron. More... | |
class | core\task\grade_cron_task |
Simple task to run the grade cron. More... | |
class | core\task\grade_history_cleanup_task |
Simple task to clean grade history tables. More... | |
class | core\task\h5p_get_content_types_task |
A task to get the latest content types from the official H5P repository. More... | |
class | core\task\legacy_plugin_cron_task |
Simple task to run cron for all plugins. More... | |
class | core\task\logmanager |
Task log manager. More... | |
class | core\task\manager |
Collection of task related methods. More... | |
class | core\task\messaging_cleanup_task |
Simple task to delete old messaging records. More... | |
class | core\task\password_reset_cleanup_task |
Simple task to delete old password reset records. More... | |
class | core\task\plagiarism_cron_task |
Simple task to run the plagiarism cron. More... | |
class | core\task\portfolio_cron_task |
Simple task to run the portfolio cron. More... | |
class | core\task\question_preview_cleanup_task |
A task to cleanup old question previews. More... | |
class | core\task\question_stats_cleanup_task |
A task to cleanup old question statistics cache. More... | |
class | core\task\refresh_mod_calendar_events_task |
Class that updates all of the existing calendar events for modules that implement the *_refresh_events() hook. More... | |
class | core\task\registration_cron_task |
Simple task to run the registration cron. More... | |
class | core\task\scheduled_task |
Abstract class defining a scheduled task. More... | |
class | core\task\search_index_task |
Runs global search indexing. More... | |
class | core\task\search_optimize_task |
Runs search index optimization. More... | |
class | core\task\send_failed_login_notifications_task |
Simple task to send notifications about failed login attempts. More... | |
class | core\task\send_new_user_passwords_task |
Simple task to create accounts and send password emails for new users. More... | |
class | core\task\session_cleanup_task |
Simple task to cleanup user sessions from a scheduled task. More... | |
class | core\task\stats_cron_task |
Simple task to run the stats cron. More... | |
class | core\task\tag_cron_task |
Simple task to run the tag cron. More... | |
class | core\task\task_base |
Abstract class for common properties of scheduled_task and adhoc_task. More... | |
class | core\task\task_log_cleanup_task |
A task to cleanup log entries for tasks. More... | |
interface | core\task\task_logger |
Interface for task logging. More... | |
class | core\update\api |
General purpose client for https://download.moodle.org/api/. More... | |
class | core\update\checker |
Singleton class that handles checking for available updates. More... | |
class | core\update\checker_exception |
General exception thrown by the core\update\checker class. More... | |
class | core\update\info |
Defines the structure of objects returned by (). More... | |
class | core\upgrade\util |
Core upgrade utility class. More... | |
class | core\uuid |
V4 UUID generator class. More... | |
class | core_admin\form\purge_caches |
Form for selecting which caches to purge on admin/purgecaches.php. More... | |
class | core_admin\form\testoutgoingmailconf_form |
Test mail form. More... | |
class | core_admin_renderer |
Standard HTML output renderer for core_admin subsystem. More... | |
class | core_badges\badge |
Class that represents badge. More... | |
class | core_badges\form\backpack |
Form to edit backpack initial details. More... | |
class | core_badges\form\badge |
Form to edit badge details. More... | |
class | core_badges\form\collections |
Form to select backpack collections. More... | |
class | core_badges\form\message |
Form to edit badge message. More... | |
class | core_badges\output\badge_alignments |
Link to external resources this badge is aligned with. More... | |
class | core_badges\output\badge_collection |
Collection of all badges for view.php page. More... | |
class | core_badges\output\badge_management |
Collection of badges used at the index.php page. More... | |
class | core_badges\output\badge_recipients |
Badge recipients rendering class. More... | |
class | core_badges\output\badge_related |
Collection of all related badges. More... | |
class | core_badges\output\badge_user_collection |
Collection of user badges used at the mybadges.php page. More... | |
class | core_badges\output\external_badge |
An external badges for external.php page. More... | |
class | core_badges\output\issued_badge |
An issued badges for badge.php page. More... | |
class | core_badges_assertion |
Open Badges Assertions specification 1.0 https://github.com/mozilla/openbadges/wiki/Assertions More... | |
class | core_badges_renderer |
Standard HTML output renderer for badges. More... | |
class | core_cache_renderer |
class | core_collator |
A collator class with static methods that can be used for sorting. More... | |
class | core_component |
Collection of components related methods. More... | |
class | core_course\analytics\indicator\activities_due |
Activities due indicator. More... | |
class | core_course_category |
class | core_course_list_element |
class | core_cssparser |
Moodle CSS parser. More... | |
class | core_date |
Core date and time related code. More... | |
class | core_event_course_module_instance_list_viewed_testcase |
Class core_event_course_module_instance_list_viewed_testcase. More... | |
class | core_event_course_module_viewed_testcase |
Class core_event_course_module_viewed_testcase. More... | |
class | core_files_renderer |
File browser render. More... | |
class | core_filetypes |
Class to manage the custom filetypes list that is stored in a config variable. More... | |
class | core_geopattern |
class | core_h5p\event\h5p_deleted |
H5P viewed event class. More... | |
class | core_h5p\event\h5p_viewed |
H5P viewed event class. More... | |
class | core_media_player_native_testcase |
class | core_minify |
Collection of JS and CSS compression methods. More... | |
class | core_php_time_limit |
Utility class to manage PHP time limit. More... | |
class | core_plugin_manager |
Singleton class providing general plugins management functionality. More... | |
class | core_question\statistics\questions\calculated |
This class is used to return the stats as calculated by core_question\statistics\questions\calculator. More... | |
class | core_question\statistics\questions\calculator |
This class has methods to compute the question statistics from the raw data. More... | |
class | core_renderer |
class | core_renderer_ajax |
class | core_renderer_cli |
class | core_renderer_maintenance |
class | core_requirejs |
Collection of requirejs related methods. More... | |
class | core_rtlcss |
Moodle RTLCSS class. More... | |
class | core_scss |
Moodle SCSS compiler class. More... | |
class | core_shutdown_manager |
Shutdown management class. More... | |
interface | core_string_manager |
Interface for string manager. More... | |
class | core_string_manager_install |
Fetches minimum strings for installation. More... | |
class | core_string_manager_standard |
Standard string_manager implementation. More... | |
class | core_tag_manage_table |
Class core_tag_manage_table. More... | |
class | core_text |
class | core_user |
User class to access user details. More... | |
class | core_user\analytics\target\upcoming_activities_due |
Upcoming activities due target. More... | |
class | core_useragent |
The user agent class. More... | |
class | core_xml_parser |
Class for parsing xml files. More... | |
class | course_enrolment_table |
Main course enrolment table. More... | |
class | course_modinfo |
class | course_reset_form |
Defines the course reset settings form. More... | |
class | coursecat_helper |
Class storing display options and functions to help display course category and/or courses lists. More... | |
class | coursecat_sortable_records |
An array of records that is sortable by many fields. More... | |
class | csv_export_writer |
class | csv_import_reader |
Utitily class for importing of CSV files. More... | |
class | custom_menu |
class | custom_menu_item |
class | database_driver_testcase |
class | dbtransfer_exception |
Exception class for db transfer. More... | |
class | ddl_change_structure_exception |
Error during changing db structure. More... | |
class | ddl_dependency_exception |
Error changing db structure, caused by some dependency found like trying to modify one field having related indexes. More... | |
class | ddl_exception |
DDL exception class, use instead of print_error() and "return false;" in ddl code. More... | |
class | ddl_field_missing_exception |
Table does not exist problem exception. More... | |
class | ddl_table_missing_exception |
Table does not exist problem exception. More... | |
class | dml_connection_exception |
class | dml_exception |
class | dml_missing_record_exception |
class | dml_multiple_records_exception |
class | dml_read_exception |
class | dml_sessionwait_exception |
class | dml_transaction_exception |
class | dml_write_exception |
class | dndupload_ajax_processor |
Processes the upload, creating the course module and returning the result. More... | |
class | dndupload_handler |
Stores all the information about the available dndupload handlers. More... | |
class | edit_criteria_form |
Form to edit badge criteria. More... | |
class | edit_relatedbadge_form |
Form to edit badge details. More... | |
class | emoticon_manager |
Provides core support for plugins that have to deal with emoticons (like HTML editor or emoticon filter). More... | |
class | endorsement_form |
Form to edit endorsement. More... | |
class | enrol_plugin |
Enrolment plugins abstract class. More... | |
class | environment_results |
Helper Class to return results to caller. More... | |
class | error_log_progress_trace |
This subclass of progress_trace outputs to error log. More... | |
class | file_picker |
class | file_serving_exception |
An exception that indicates that file can not be served. More... | |
class | files_tree_viewer |
Data structure representing a general moodle file tree viewer. More... | |
class | filter_local_settings_form |
class | filter_manager |
Class to manage the filtering of strings. More... | |
class | filterobject |
This is just a little object to define a phrase and some instructions for how to process it. More... | |
class | flat_navigation |
Class used to generate a collection of navigation nodes most closely related to the current page. More... | |
class | flat_navigation_node |
class | flexible_table |
#- More... | |
class | flickr_client |
Simple Flickr API client implementing the features needed by Moodle. More... | |
class | format_section_renderer_base |
This is a convenience renderer which can be used by section based formats to reduce code duplication. More... | |
class | fragment_requirements_manager |
class | global_navigation |
class | global_navigation_for_ajax |
class | google_docs |
Class for manipulating google documents through the google data api. More... | |
class | google_oauth |
OAuth 2.0 client for Google Services. More... | |
class | google_picasa |
Class for manipulating picasa through the google data api. More... | |
class | Hacky_TextUI_Command_reader |
class | help_icon |
class | Hint_ResultPrinter |
class | html_list_progress_trace |
HTML List Progress Tree. More... | |
class | html_progress_trace |
This subclass of progress_trace outputs as HTML. More... | |
class | html_table |
class | html_table_cell |
class | html_table_row |
class | html_writer |
class | image_icon |
Data structure representing an activity icon. More... | |
class | imscc11_backup_convert |
class | imscc11_convert_exception |
Exception thrown by this converter. More... | |
class | imscc11_converter |
class | imscc11_export_converter |
class | imscc11_store_backup_file |
class | imscc11_zip_contents |
class | imscc1_convert_exception |
Exception thrown by this converter. More... | |
class | imscc1_converter |
class | initials_bar |
class | invalid_dataroot_permissions |
An exception that indicates incorrect permissions in $CFG->dataroot. More... | |
class | invalid_parameter_exception |
Exception indicating malformed parameter problem. More... | |
class | invalid_response_exception |
Exception indicating malformed response problem. More... | |
class | invalid_state_exception |
An exception that indicates something really weird happened. More... | |
class | js_writer |
class | lang_installer |
End of component_installer class. More... | |
class | lang_installer_exception |
Exception thrown by lang_installer. More... | |
class | lang_string |
class | license_manager |
class | list_item |
class | login_change_password_form |
class | login_forgot_password_form |
Reset forgotten password form definition. More... | |
class | login_set_password_form |
Set forgotten password form definition. More... | |
class | login_signup_form |
class | logstore_legacy\event\legacy_logged |
class | mnet_profile_form |
small form to allow the administrator to configure (override) which profile fields are sent/imported over mnet More... | |
class | mnet_review_host_form |
The second step of the form - reviewing the host details This is also the same form that is used for editing an existing host. More... | |
class | mnet_services_form |
class | mnet_simple_host_form |
The very basic first step add new host form - just wwwroot & application The second form is loaded up with the information from this one. More... | |
class | mod_chat_generator |
class | mod_quiz\event\question_manually_graded |
class | moodle_exception |
Base Moodle Exception class. More... | |
class | moodle_list |
Clues to reading this code: More... | |
class | moodle_page |
class | moodle_text_filter |
Base class for text filters. More... | |
class | moodle_url |
Class for creating and manipulating urls. More... | |
class | MoodleExcelFormat |
Define and operate over one Format. More... | |
class | MoodleExcelWorkbook |
Define and operate over one Moodle Workbook. More... | |
class | MoodleExcelWorksheet |
Define and operate over one Worksheet. More... | |
class | MoodleODSCell |
ODS Cell abstraction. More... | |
class | MoodleODSFormat |
ODS cell format abstraction. More... | |
class | MoodleODSWorkbook |
ODS workbook abstraction. More... | |
class | MoodleODSWorksheet |
ODS Worksheet abstraction. More... | |
class | MoodleODSWriter |
ODS file writer. More... | |
class | mysqli_native_moodle_recordset |
Mysqli specific moodle recordset class. More... | |
class | nasty_strings |
class | navbar |
class | navigation_cache |
class | navigation_json |
class | navigation_node |
class | navigation_node_collection |
class | null_filter_manager |
Filter manager subclass that does nothing. More... | |
class | null_progress_trace |
This subclass of progress_trace does not ouput anything. More... | |
class | oauth2_client |
OAuth 2.0 Client for using web access tokens. More... | |
class | page_requirements_manager |
class | paging_bar |
interface | parentable_part_of_admin_tree |
Interface implemented by any part_of_admin_tree that has children. More... | |
interface | part_of_admin_tree |
CLASS DEFINITIONS /////////////////////////////////////////////////////////. More... | |
class | performance_measuring_filter_manager |
Filter manager subclass that tracks how much work it does. More... | |
class | phpunit_ArrayDataSet |
class | phpunit_autoloader |
class | phpunit_constraint_object_is_equal_with_exceptions |
class | phpunit_coverage_info |
Coverage information for the tool_dataprivacy plugin. More... | |
class | phpunit_event_mock |
class | phpunit_event_sink |
class | phpunit_message_sink |
class | phpunit_phpmailer_sink |
class | phpunit_util |
class | pix_emoticon |
class | pix_icon |
class | pix_icon_font |
class | pix_icon_fontawesome |
class | plugin_renderer_base |
class | PNG_MetaDataHandler |
Information on PNG file chunks can be found at http://www.w3.org/TR/PNG/#11Chunks Some other info on PNG that I used http://garethrees.org/2007/11/14/pngcrush/. More... | |
class | popup_action |
class | preferences_group |
class | preferences_groups |
class | progress_bar |
class | progress_trace |
Progress trace class. More... | |
class | progress_trace_buffer |
Special type of trace that can be used for catching of output of other traces. More... | |
class | question_behaviour_type |
This class represents the type of behaviour, rather than the instance of the behaviour which control a particular question attempt. More... | |
class | question_behaviour_type_fallback |
This class exists to allow behaviours that worked in Moodle 2.3 to continue to work. More... | |
interface | renderable |
class | renderer_base |
interface | renderer_factory |
class | renderer_factory_base |
class | require_login_exception |
Course/activity access exception. More... | |
class | require_login_session_timeout_exception |
Session timeout exception. More... | |
class | required_capability_exception |
Exceptions indicating user does not have permissions to do something and the execution can not continue. More... | |
class | restore_date_testcase |
class | search_lexer |
This class does the heavy lifting of lexing the search string into tokens. More... | |
class | search_parser |
This class takes care of sticking the proper token type/value pairs into the parsed token array. More... | |
class | search_token |
Class to hold token/value pairs after they're parsed. More... | |
class | section_info |
class | settings_navigation |
class | settings_navigation_ajax |
class | single_button |
class | single_select |
class | standard_renderer_factory |
class | table_dataformat_export_format |
Dataformat exporter. More... | |
class | table_default_export_format_parent |
class | table_sql |
class | tabobject |
Stores one tab. More... | |
class | tabtree |
interface | templatable |
class | test_lock |
class | testing_block_generator |
class | testing_data_generator |
class | testing_module_generator |
class | testing_util |
class | tests_finder |
class | text_progress_trace |
This subclass of progress_trace outputs to plain text. More... | |
class | texteditor |
Base abstract text editor class. More... | |
class | theme_config |
class | theme_overridden_renderer_factory |
class | upload_manager |
This class handles all aspects of fileuploading. More... | |
class | url_select |
class | user_bulk_cohortadd_form |
class | user_picture |
class | uu_progress_tracker |
Tracking of processed users. More... | |
class | webservice_parameter_exception |
Web service parameter exception class. More... | |
class | WikiToMarkdown |
#- More... | |
class | xhtml_container_stack |
class | xml_format_exception |
class | YUI_config |
Functions | |
moodle_text_filter::__construct ($context, array $localconfig) | |
Set any context-specific configuration for this filter. More... | |
filterobject::__construct ($phrase, $hreftagbegin='< span class="highlight">', $hreftagend='</span >', $casesensitive=false, $fullmatch=false, $replacementphrase=null, $replacementcallback=null, array $replacementcallbackdata=null) | |
Constructor. More... | |
filter_manager::__construct () | |
Constructor. More... | |
object | _fix_course_cats ($children, &$sortorder, $parent, $depth, $path, &$fixcontexts) |
Internal recursive category verification function, do not use directly! More... | |
abort_all_db_transactions () | |
Unconditionally abort all database transactions, this function should be called from exception handlers only. More... | |
add_event () | |
CALENDAR MANAGEMENT ////////////////////////////////////////////////////////////////. More... | |
add_mod_to_section () | |
moodle_database | add_to_config_log ($name, $oldvalue, $value, $plugin) |
add_to_log ($courseid, $module, $action, $url='', $info='', $cm=0, $user=0) | |
Add an entry to the legacy log table. More... | |
address_in_subnet ($addr, $subnetstr) | |
Function to check the passed address is within the passed subnet. More... | |
addslashes_js ($var) | |
Does proper javascript quoting. More... | |
admin_apply_default_settings ($node=null, $unconditional=true, $admindefaultsettings=array(), $settingsoutput=array()) | |
settings utility functions More... | |
admin_critical_warnings_present () | |
Test if and critical warnings are present. More... | |
moodle_page | admin_externalpage_setup ($section, $extrabutton='', array $extraurlparams=null, $actualurl='', array $options=array()) |
Initialise admin page - this function does require login and permission checks specified in page definition. More... | |
admin_find_write_settings ($node, $data) | |
Internal recursive function - finds all settings from submitted form. More... | |
admin_get_root ($reload=false, $requirefulltree=true) | |
Returns the reference to admin tree root. More... | |
admin_output_new_settings_by_page ($node) | |
Internal function - returns arrays of html pages with uninitialised settings. More... | |
admin_search_settings_html ($query) | |
Internal function - prints the search results. More... | |
admin_write_settings ($formdata) | |
Store changed settings, this function updates the errors variable in $ADMIN. More... | |
ajax_capture_output () | |
Starts capturing output whilst processing an AJAX request. More... | |
ajax_check_captured_output () | |
Check captured output for content. More... | |
ajaxenabled () | |
allow_assign () | |
allow_override () | |
allow_switch () | |
any_new_admin_settings ($node) | |
Based on find_new_settings() in upgradesettings.php Looks to find any admin settings that have not been initialized. More... | |
filter_manager::apply_filter_chain ($text, $filterchain, array $options=array(), array $skipfilters=null) | |
Apply a list of filters to some content. More... | |
array_is_nested ($array) | |
Check if there is a nested array within the passed array. More... | |
authenticate_user_login ($username, $password, $ignorelockout=false, &$failurereason=null, $logintoken=false) | |
Authenticates a user against the chosen authentication mechanism. More... | |
badge_assemble_notification (stdClass $badge) | |
Creates single message for all notification and sends it out. More... | |
badge_award_criteria_competency_has_records_for_competencies ($competencyids) | |
Check if any badge has records for competencies. More... | |
badge_message_from_template ($message, $params) | |
Replaces variables in a message template and returns text ready to be emailed to a user. More... | |
badges_add_course_navigation (navigation_node $coursenode, stdClass $course) | |
Extends the course administration navigation with the Badges page. More... | |
badges_award_handle_manual_criteria_review (stdClass $data) | |
Triggered when badge is manually awarded. More... | |
badges_bake ($hash, $badgeid, $userid=0, $pathhash=false) | |
Bake issued badge. More... | |
badges_calculate_message_schedule ($schedule) | |
Caclulates date for the next message digest to badge creators. More... | |
badges_check_backpack_accessibility () | |
Checks if badges can be pushed to external backpack. More... | |
badges_create_site_backpack ($data) | |
Create the backpack with this data. More... | |
badges_disconnect_user_backpack ($userid) | |
Disconnect from the user backpack by deleting the user preferences. More... | |
badges_download ($userid) | |
Download all user badges in zip archive. More... | |
badges_external_create_mapping ($sitebackpackid, $type, $internalid, $externalid) | |
Save the info about which objects we connected with a backpack before. More... | |
badges_external_delete_mapping ($sitebackpackid, $type, $internalid) | |
Delete a specific external mapping information for a backpack. More... | |
badges_external_delete_mappings ($sitebackpackid) | |
Delete all external mapping information for a backpack. More... | |
badges_external_get_mapping ($sitebackpackid, $type, $internalid) | |
Used to remember which objects we connected with a backpack before. More... | |
badges_get_badge_api_versions () | |
List the supported badges api versions. More... | |
badges_get_badges ($type, $courseid=0, $sort='', $dir='', $page=0, $perpage=BADGE_PERPAGE, $user=0) | |
Get all badges. More... | |
badges_get_default_issuer () | |
Get the default issuer for a badge from this site. More... | |
badges_get_issued_badge_info () | |
badges_get_site_backpack ($id) | |
Get a site backpacks by id or url. More... | |
badges_get_site_backpacks () | |
List the backpacks at site level. More... | |
badges_get_user_badges ($userid, $courseid=0, $page=0, $perpage=0, $search='', $onlypublic=false) | |
Get badges for a specific user. More... | |
badges_handle_course_deletion ($courseid) | |
Handles what happens to the course badges when a course is deleted. More... | |
badges_list_criteria ($enabled=true) | |
Return all the enabled criteria types for this site. More... | |
badges_local_backpack_js ($checksite=false) | |
No js files are required for backpack support. More... | |
badges_notify_badge_award (badge $badge, $userid, $issued, $filepathhash) | |
Sends notifications to users about awarded badges. More... | |
badges_open_badges_backpack_api () | |
Is any backpack enabled that supports open badges V1? More... | |
badges_process_badge_image (badge $badge, $iconfile) | |
Process badge image from form data. More... | |
badges_send_verification_email ($email, $backpackid, $backpackpassword) | |
Create and send a verification email to the email address supplied. More... | |
badges_setup_backpack_js () | |
Loads JS files required for backpack support. More... | |
badges_update_site_backpack ($id, $data) | |
Update the backpack with this id. More... | |
badges_user_has_backpack ($userid) | |
Checks if user has external backpack connected. More... | |
badges_verify_backpack (int $backpackid) | |
Attempt to authenticate with a backpack credentials and return an error if the authentication fails. More... | |
badges_verify_site_backpack () | |
Attempt to authenticate with the site backpack credentials and return an error if the authentication fails. More... | |
behat_check_config_vars () | |
Checks that the behat config vars are properly set. More... | |
behat_clean_init_config () | |
Restrict the config.php settings allowed. More... | |
behat_error ($errorcode, $text='') | |
Exits with an error code. More... | |
behat_error_handler ($errno, $errstr, $errfile, $errline, $errcontext) | |
PHP errors handler to use when running behat tests. More... | |
behat_get_error_string ($errtype) | |
Return logical error string. More... | |
behat_get_run_process () | |
Get behat run process from either $_SERVER or command config. More... | |
behat_get_shutdown_process_errors () | |
Return php errors save which were save during shutdown. More... | |
behat_is_requested_url ($url) | |
Checks if the URL requested by the user matches the provided argument. More... | |
behat_is_test_site () | |
Should we switch to the test site data? More... | |
behat_shutdown_function () | |
Before shutdown save last error entries, so we can fail the test. | |
behat_update_vars_for_process () | |
Fix variables for parallel behat testing. More... | |
block_add_block_ui ($page, $output) | |
Functions update the blocks if required by the request parameters ==========. More... | |
block_instance ($blockname, $instance=NULL, $page=NULL) | |
Creates a new instance of the specified block class. More... | |
block_instance_by_id ($blockinstanceid) | |
Returns a new instance of the specified block instance id. More... | |
block_load_class ($blockname) | |
Load the block class for a particular type of block. More... | |
block_method_result ($blockname, $method, $param=NULL) | |
Helper functions for working with block classes ============================. More... | |
blocks_add_default_course_blocks ($course) | |
Add the default blocks to a course. More... | |
blocks_add_default_system_blocks () | |
Add the default system-context blocks. More... | |
blocks_delete_all_for_context ($contextid) | |
Delete all the blocks that belong to a particular context. More... | |
blocks_delete_instance ($instance, $nolongerused=false, $skipblockstables=false) | |
Delete a block, and associated data. More... | |
blocks_delete_instances ($instanceids) | |
Delete multiple blocks at once. More... | |
blocks_find_block ($blockid, $blocksarray) | |
Find a given block by its blockid within a provide array. More... | |
blocks_get_default_site_course_blocks () | |
blocks_get_record ($blockid=NULL, $notusedanymore=false) | |
Get the block record for a particular blockid - that is, a particular type os block. More... | |
blocks_name_allowed_in_format ($name, $pageformat) | |
Check that a given name is in a permittable format. More... | |
blocks_parse_default_blocks_list ($blocksstr) | |
Parse a list of default blocks. More... | |
blocks_remove_inappropriate ($course) | |
Actually delete from the database any blocks that are currently on this page, but which should not be there according to blocks_name_allowed_in_format. More... | |
blocks_set_visibility ($instance, $page, $newvisibility) | |
Set a block to be visible or hidden on a particular page. More... | |
blog_get_context_url () | |
bounded_number ($min, $value, $max) | |
Used to make sure that $min <= $value <= $max. More... | |
break_up_long_words ($string, $maxsize=20, $cutchar=' ') | |
Given some normal text this function will break up any long words to a given size by inserting the given character. More... | |
build_context_path () | |
build_logs_array () | |
build_navigation () | |
calculate_user_dst_table () | |
calendar_cron () | |
calendar_get_all_allowed_types () | |
Get all of the allowed types for all of the courses and groups the logged in user belongs to. More... | |
calendar_get_block_upcoming () | |
calendar_get_mini () | |
calendar_get_upcoming () | |
calendar_normalize_tz () | |
calendar_preferences_button () | |
calendar_print_month_selector () | |
calendar_wday_name () | |
can_send_from_real_email_address ($from, $user, $unused=null) | |
Check to see if a user's real email address should be used for the "From" field. More... | |
can_use_html_editor () | |
can_use_rotated_text () | |
category_delete_full () | |
category_delete_move () | |
check_browser_operating_system () | |
check_browser_version () | |
check_consecutive_identical_characters ($password, $maxchars) | |
Check whether the given password has no more than the specified number of consecutive identical characters. More... | |
check_dir_exists ($dir, $create=true, $recursive=true) | |
Function to check if a directory exists and by default create it if not exists. More... | |
check_gd_version () | |
check_moodle_environment ($version, $env_select=ENV_SELECT_NEWER) | |
This function checks all the requirements defined in environment.xml. More... | |
check_password_policy ($password, &$errmsg, $user=null) | |
Validate a password against the configured password policy. More... | |
check_php_version ($version='5.2.4') | |
Returns true if the current version of PHP is greater that the specified one. More... | |
check_user_preferences_loaded (stdClass $user, $cachelifetime=120) | |
choose_from_menu () | |
clam_change_log () | |
clam_handle_infected_file () | |
clam_log_infected () | |
clam_log_upload () | |
clam_message_admins () | |
clam_replace_infected_file () | |
clam_scan_moodle_file () | |
clean_filename ($string) | |
Cleans a given filename by removing suspicious or troublesome characters. More... | |
clean_param ($param, $type) | |
Used by } and required_param() to clean the variables and/or cast to specific types, based on an options field. More... | |
clean_param_array (array $param=null, $type, $recursive=false) | |
Makes sure array contains only the allowed types, this function does not validate array key names! More... | |
clean_text ($text, $format=FORMAT_HTML, $options=array()) | |
Cleans raw text removing nasties. More... | |
cleanremoteaddr ($addr, $compress=false) | |
Cleans an ip address. More... | |
cleanup_contexts () | |
cleardoubleslashes ($path) | |
Replace 1 or more slashes or backslashes to 1 slash. More... | |
cli_error ($text, $errorcode=1) | |
Write to standard error output and exit with the given code. More... | |
cli_execute_parallel ($cmds, $cwd=null, $delay=0) | |
Execute commands in parallel. More... | |
cli_get_params (array $longoptions, array $shortmapping=null) | |
Returns cli script parameters. More... | |
cli_heading ($string, $return=false) | |
Print or return section heading string. More... | |
cli_input ($prompt, $default='', array $options=null, $casesensitiveoptions=false) | |
Get input from user. More... | |
cli_logo ($padding=2, $return=false) | |
Print an ASCII version of the Moodle logo. More... | |
cli_problem ($text) | |
Write error notification. More... | |
cli_separator ($return=false) | |
Print or return section separator string. More... | |
cli_write ($text, $stream=STDOUT) | |
Write a text to the given stream. More... | |
cli_writeln ($text, $stream=STDOUT) | |
Write a text followed by an end of line symbol to the given stream. More... | |
close_window ($delay=0, $reloadopener=false) | |
Try and close the current window using JavaScript, either immediately, or after a delay. More... | |
cohort_get_visible_list () | |
complete_user_login ($user) | |
Call to complete the user login process after authenticate_user_login() has succeeded. More... | |
completion_cron () | |
complex_random_string ($length=null) | |
Generate a complex random string (useful for md5 salts) More... | |
component_callback ($component, $function, array $params=array(), $default=null) | |
Invoke component's callback functions. More... | |
component_callback_exists ($component, $function) | |
Determine if a component callback exists and return the function name to call. More... | |
component_class_callback ($classname, $methodname, array $params, $default=null) | |
Call the specified callback method on the provided class. More... | |
confirm_sesskey ($sesskey=NULL) | |
Check the sesskey and return true of false for whether it is valid. More... | |
content_to_text ($content, $contentformat) | |
Converts texts or strings to plain text. More... | |
context_instance_preload () | |
context_instance_preload_sql () | |
context_moved () | |
convert_tabrows_to_tree () | |
convert_to_array ($var) | |
Converts an object into an associative array. More... | |
convert_tree_to_html () | |
core_login_extend_change_password_form ($mform, $user) | |
Plugins can extend forms. More... | |
core_login_extend_forgot_password_form ($mform) | |
Inject form elements into forgot_password_form. More... | |
core_login_extend_set_password_form ($mform, $user) | |
Inject form elements into set_password_form. More... | |
core_login_extend_signup_form ($mform) | |
Inject form elements into signup_form. More... | |
core_login_generate_password_reset ($user) | |
Create a new record in the database to track a new password set request for user. More... | |
core_login_get_return_url () | |
Determine where a user should be redirected after they have been logged in. More... | |
core_login_post_change_password_requests ($data) | |
Plugins can perform post submission actions. More... | |
core_login_post_forgot_password_requests ($data) | |
Post forgot_password_form submission actions. More... | |
core_login_post_set_password_requests ($data, $user) | |
Post set_password_form submission actions. More... | |
core_login_post_signup_requests ($data) | |
Post signup_form submission actions. More... | |
core_login_pre_signup_requests () | |
Plugins can create pre sign up requests. | |
core_login_process_password_reset ($username, $email) | |
Process the password reset for the given user (via username or email). More... | |
core_login_process_password_reset_request () | |
Processes a user's request to set a new password in the event they forgot the old one. More... | |
core_login_process_password_set ($token) | |
This function processes a user's submitted token to validate the request to set a new password. More... | |
core_login_validate_extend_change_password_form ($data, $user) | |
Plugins can add additional validation to forms. More... | |
core_login_validate_extend_forgot_password_form ($data) | |
Inject validation into forgot_password_form. More... | |
core_login_validate_extend_set_password_form ($data, $user) | |
Inject validation into set_password_form. More... | |
core_login_validate_extend_signup_form ($data) | |
Inject validation into signup_form. More... | |
core_login_validate_forgot_password_data ($data) | |
Validates the forgot password form data. More... | |
core_myprofile_navigation (core_user\output\myprofile\tree $tree, $user, $iscurrentuser, $course) | |
Defines core nodes for my profile navigation tree. More... | |
count_enrolled_users (context $context, $withcapability='', $groupid=0, $onlyactive=false) | |
Counts list of users enrolled into course (as per above function) More... | |
count_letters ($string) | |
count_login_failures () | |
count_words ($string) | |
course_category_hide () | |
course_category_show () | |
course_get_cm_rename_action () | |
course_scale_used () | |
coursemodule_visible_for_user () | |
coursetag_delete_course_tags () | |
coursetag_delete_keyword () | |
coursetag_get_all_tags () | |
coursetag_get_jscript () | |
coursetag_get_jscript_links () | |
coursetag_get_records () | |
coursetag_get_tagged_courses () | |
coursetag_get_tags () | |
coursetag_store_keywords () | |
create_contexts () | |
create_course_category () | |
create_user_key ($script, $userid, $instance=null, $iprestriction=null, $validuntil=null) | |
Creates a new private user access key. More... | |
create_user_record ($username, $password, $auth='manual') | |
Creates a bare-bones user record. More... | |
cron_bc_hack_plugin_functions ($plugintype, $plugins) | |
Used to add in old-style cron functions within plugins that have not been converted to the new standard API. More... | |
cron_execute_plugin_type ($plugintype, $description=null) | |
Executes cron functions for a specific type of plugin. More... | |
cron_prepare_core_renderer ($restore=false) | |
Prepare the output renderer for the cron run. More... | |
cron_run () | |
Execute cron tasks. | |
cron_run_adhoc_tasks (int $timenow) | |
Execute all queued adhoc tasks, applying necessary concurrency limits and time limits. More... | |
cron_run_inner_adhoc_task (\core\task\adhoc_task $task) | |
Shared code that handles running of a single adhoc task within the cron. More... | |
cron_run_inner_scheduled_task (\core\task\task_base $task) | |
Shared code that handles running of a single scheduled task within the cron. More... | |
cron_run_scheduled_tasks (int $timenow) | |
Execute all queued scheduled tasks, applying necessary concurrency limits and time limits. More... | |
cron_run_single_task (\core\task\scheduled_task $task) | |
Runs a single cron task. More... | |
cron_setup_user ($user=null, $course=null, $leavepagealone=false) | |
Sets up current user and course environment (lang, etc.) in cron. More... | |
cron_trace_time_and_memory () | |
Output some standard information during cron runs. More... | |
css_is_colour () | |
css_is_width () | |
css_minify_css () | |
css_send_cached_css ($csspath, $etag) | |
Sends a cached CSS file. More... | |
css_send_cached_css_content ($csscontent, $etag) | |
Sends a cached CSS content. More... | |
css_send_css_not_found () | |
Sends a 404 message about CSS not being found. | |
css_send_temporary_css ($css) | |
Sends CSS directly and disables all caching. More... | |
css_send_uncached_css ($css) | |
Sends CSS directly without caching it. More... | |
css_send_unmodified ($lastmodified, $etag) | |
Send file not modified headers. More... | |
css_sort_by_count () | |
if(!defined('THEME_DESIGNER_CACHE_LIFETIME')) | css_store_css (theme_config $theme, $csspath, $csscontent) |
Stores CSS in a file at the given path. More... | |
css_write_file ($filename, $content) | |
Writes a CSS file. More... | |
current_language () | |
current_theme () | |
custom_script_path () | |
Detect a custom script replacement in the data directory that will replace an existing moodle script. More... | |
data_submitted () | |
Determine if there is data waiting to be processed from a form. More... | |
date_format_string ($date, $format, $tz=99) | |
Returns a formatted date ensuring it is UTF-8. More... | |
dayofweek ($day, $month, $year) | |
days_in_month ($month, $year) | |
db_replace ($search, $replace) | |
Moved from admin/replace.php so that we can use this in cron. More... | |
db_should_replace ($table, $column='') | |
Given a table and optionally a column name should replaces be done? More... | |
debugging ($message='', $level=DEBUG_NORMAL, $backtrace=null) | |
Standard Debugging Function. More... | |
decompose_update_into_safe_changes (array $newvalues, $unusedvalue) | |
Helper used by update_field_with_unique_index(). More... | |
dedupe_user_access () | |
default_error_handler ($errno, $errstr, $errfile, $errline, $errcontext) | |
Default error handler, prevents some white screens. More... | |
default_exception_handler ($ex) | |
Default exception handler. More... | |
default_page_type_list ($pagetype, $parentcontext=null, $currentcontext=null) | |
Generates a default page type list when a more appropriate callback cannot be decided upon. More... | |
delete_context () | |
delete_course ($courseorid, $showfeedback=true) | |
Delete a course, including all related data from the database, and any associated files. More... | |
delete_course_module () | |
delete_event () | |
delete_user (stdClass $user) | |
Marks user deleted in internal user database and notifies the auth plugin. More... | |
delete_user_key ($script, $userid) | |
Delete the user's new private user access keys for a particular script. More... | |
detect_munged_arguments () | |
display_auth_lock_options ($settings, $auth, $userfields, $helptext, $mapremotefields, $updateremotefields, $customfields=array()) | |
Helper function used to print locking for auth plugins on admin pages. More... | |
display_size ($size) | |
Converts bytes into display form. More... | |
dndupload_add_to_course ($course, $modnames) | |
Add the Javascript to enable drag and drop upload to a course page. More... | |
download_as_dataformat ($filename, $dataformat, $columns, $iterator, $callback=null) | |
Sends a formated data file to the browser. More... | |
draw_rand_array ($array, $draws) | |
Given an arbitrary array, and a number of draws, this function returns an array with that amount of items. More... | |
drop_plugin_tables ($name, $file, $feedback=true) | |
Delete all plugin tables. More... | |
dst_changes_for_year () | |
dst_offset_on ($time, $strtimezone=null) | |
during_initial_install () | |
Indicates whether we are in the middle of the initial Moodle install. More... | |
editors_get_available () | |
Get the list of available editors. More... | |
editors_get_enabled () | |
Returns list of enabled text editors. More... | |
editors_get_preferred_editor ($format=NULL) | |
Returns users preferred editor for given format. More... | |
editors_get_preferred_format () | |
Returns users preferred text format. More... | |
editors_head_setup () | |
Setup all JS and CSS needed for editors. More... | |
email_is_not_allowed ($email) | |
Check that an email is allowed. More... | |
email_should_be_diverted ($email) | |
A helper function to test for email diversion. More... | |
email_to_user ($user, $from, $subject, $messagetext, $messagehtml='', $attachment='', $attachname='', $usetrueaddress=true, $replyto='', $replytoname='', $wordwrapwidth=79) | |
Send an email to a specified user. More... | |
enable_cli_maintenance_mode () | |
Enables CLI maintenance mode by creating new dataroot/climaintenance.html file. | |
endecrypt ($pwd, $data, $case) | |
Based on a class by Mukul Sabharwal [mukulsabharwal @ yahoo.com]. More... | |
enrol_accessing_via_instance (stdClass $instance) | |
Is current user accessing course via this enrolment method? More... | |
enrol_add_course_navigation (navigation_node $coursenode, $course) | |
Add navigation nodes. More... | |
enrol_calculate_duration ($timestart, $timeend) | |
Calculate duration base on start time and end time. More... | |
enrol_check_plugins ($user) | |
Check all the login enrolment information for the given user object by querying the enrolment plugins. More... | |
enrol_cohort_can_view_cohort () | |
enrol_cohort_enrol_all_users () | |
enrol_cohort_get_cohorts () | |
enrol_cohort_search_cohorts () | |
enrol_course_delete ($course, $userid=null) | |
Called when course is about to be deleted. More... | |
enrol_course_edit_form (MoodleQuickForm $mform, $data, $context) | |
This function adds necessary enrol plugins UI into the course edit form. More... | |
enrol_course_edit_validation (array $data, $context) | |
Validate course edit form data. More... | |
enrol_course_updated ($inserted, $course, $data) | |
Update enrol instances after course edit form submission. More... | |
enrol_get_all_users_courses ($userid, $onlyactive=false, $fields=null, $sort=null) | |
Returns list of courses user is enrolled into without performing any capability checks. More... | |
enrol_get_course_by_user_enrolment_id ($ueid) | |
Returns the course where a user enrolment belong to. More... | |
enrol_get_course_description_texts ($course) | |
Returns course enrolment detailed information. More... | |
enrol_get_course_info_icons ($course, array $instances=NULL) | |
Returns course enrolment information icons. More... | |
enrol_get_course_users ($courseid=false, $onlyactive=false, $usersfilter=array(), $uefilter=array()) | |
Return all users enrolled in a course. More... | |
enrol_get_course_users_roles (int $courseid) | |
Returns list of roles per users into course. More... | |
enrol_get_courses_sortingsql ($sort=null) | |
Returns SQL ORDER arguments which reflect the admin settings to sort my courses. More... | |
enrol_get_enrolment_end ($courseid, $userid) | |
This function returns the end of current active user enrolment. More... | |
enrol_get_instances ($courseid, $enabled) | |
Returns enrolment instances in given course. More... | |
enrol_get_my_courses ($fields=null, $sort=null, $limit=0, $courseids=[], $allaccessible=false, $offset=0, $excludecourses=[]) | |
Returns list of courses current $USER is enrolled in and can access. More... | |
enrol_get_period_list () | |
Get the list of options for the enrolment period dropdown. More... | |
enrol_get_plugin ($name) | |
Returns instance of enrol plugin. More... | |
enrol_get_plugins ($enabled) | |
Returns instances of enrol plugins. More... | |
moodle_database | enrol_get_shared_courses ($user1, $user2, $preloadcontexts=false, $checkexistsonly=false) |
Returns any courses shared by the two users. More... | |
enrol_get_users_courses ($userid, $onlyactive=false, $fields=null, $sort=null) | |
Returns list of courses user is enrolled into. More... | |
enrol_is_enabled ($enrol) | |
Checks if a given plugin is in the list of enabled enrolment plugins. More... | |
enrol_output_fragment_user_enrolment_form ($args) | |
Serve the user enrolment form as a fragment. More... | |
enrol_selfenrol_available ($courseid) | |
Is there a chance users might self enrol. More... | |
enrol_send_welcome_email_options () | |
Send welcome email "from" options. More... | |
enrol_sharing_course ($user1, $user2) | |
Do these two students share any course? More... | |
enrol_try_internal_enrol ($courseid, $userid, $roleid=null, $timestart=0, $timeend=0) | |
Try to enrol user via default internal auth plugin. More... | |
enrol_user_delete ($user) | |
Called when user is about to be deleted. More... | |
enrol_user_sees_own_courses ($user=null) | |
Can user access at least one enrolled course? More... | |
object | environment_check ($version, $env_select) |
This function will check for everything (DB, PHP and PHP extensions for now) returning an array of environment_result objects. More... | |
environment_check_database ($version, $env_select) | |
This function will check if database requirements are satisfied. More... | |
environment_check_moodle ($version, $env_select) | |
This function will check if Moodle requirements are satisfied. More... | |
environment_check_pcre_unicode ($version, $env_select) | |
Looks for buggy PCRE implementation, we need unicode support in Moodle... More... | |
environment_check_php ($version, $env_select) | |
This function will check if php requirements are satisfied. More... | |
environment_check_php_extensions ($version, $env_select) | |
This function will check if php extensions requirements are satisfied. More... | |
environment_check_php_settings ($version, $env_select) | |
This function will check if php extensions requirements are satisfied. More... | |
environment_check_unicode ($version, $env_select) | |
This function will check if unicode database requirements are satisfied. More... | |
environment_custom_checks ($version, $env_select) | |
This function will do the custom checks. More... | |
environment_get_errors ($environment_results) | |
Returns array of critical errors in plain text format. More... | |
environment_verify_plugin ($plugin, $pluginxml) | |
Checks if a plugin tag has a name attribute and it matches the plugin being tested. More... | |
error () | |
events_cleanup ($component, $cachedhandlers) | |
Deletes cached events that are no longer needed by the component. More... | |
events_cron () | |
events_dequeue ($qhandler) | |
Removes this queued handler from the events_queued_handler table. More... | |
events_dispatch () | |
events_get_cached ($component) | |
Gets the capabilities that have been cached in the database for this component. More... | |
events_get_handlers ($eventname) | |
Returns handlers for given event. More... | |
events_is_registered () | |
events_load_def () | |
events_pending_count () | |
events_process_queued_handler () | |
events_queue_handler () | |
events_trigger () | |
events_trigger_legacy () | |
events_uninstall ($component) | |
events_update_definition () | |
exists_auth_plugin ($auth) | |
Returns whether a given authentication plugin exists. More... | |
external_function_info () | |
extract_draft_file_urls_from_text ($text, $forcehttps=false, $contextid=null, $component=null, $filearea=null, $itemid=null, $filename=null) | |
Factory method for extracting draft file links from arbitrary text using regular expressions. More... | |
fetch_context_capabilities () | |
static | fill_classmap_renames_cache () |
Records all class renames that have been made to facilitate autoloading. | |
moodle_text_filter::filter ($text, array $options=array()) | |
Override this function to actually implement the filtering. More... | |
filter_manager::filter_string ($string, $context) | |
Filter a piece of string. More... | |
null_filter_manager::filter_string ($string, $context) | |
As for the equivalent filter_manager method. More... | |
performance_measuring_filter_manager::filter_string ($string, $context) | |
Filter a piece of string. More... | |
filter_manager::filter_text ($text, $context, array $options=array(), array $skipfilters=null) | |
Filter some text. More... | |
null_filter_manager::filter_text ($text, $context, array $options=array(), array $skipfilters=null) | |
As for the equivalent filter_manager method. More... | |
performance_measuring_filter_manager::filter_text ($text, $context, array $options=array(), array $skipfilters=null) | |
Filter some text. More... | |
filter_text () | |
find_day_in_month ($startday, $weekday, $month, $year) | |
fix_align_rtl ($align) | |
Returns swapped left<=> right if in RTL environment. More... | |
object | fix_course_sortorder () |
Fixes course category and course sortorder, also verifies category and course parents and paths. More... | |
fix_utf8 ($value) | |
Makes sure the data is using valid utf8, invalid characters are discarded. More... | |
force_current_language ($language) | |
Force the current language to get strings and dates localised in the given language. More... | |
format_admin_setting ($setting, $title='', $form='', $description='', $label=true, $warning='', $defaultinfo=NULL, $query='') | |
Format admin settings. More... | |
format_backtrace ($callers, $plaintext=false) | |
Formats a backtrace ready for output. More... | |
format_float ($float, $decimalpoints=1, $localized=true, $stripzeros=false) | |
Given a float, prints it nicely. More... | |
format_module_intro ($module, $activity, $cmid, $filter=true) | |
Formats activity intro text. More... | |
format_string ($string, $striplinks=true, $options=null) | |
Given a simple string, this function returns the string processed by enabled string filters if $CFG->filterall is enabled. More... | |
format_text ($text, $format=FORMAT_MOODLE, $options=null, $courseiddonotuse=null) | |
Given text in a variety of format codings, this function returns the text as safe HTML. More... | |
format_text_email ($text, $format) | |
Given text in a variety of format codings, this function returns the text as plain text suitable for plain email. More... | |
format_text_menu () | |
Just returns an array of text formats suitable for a popup menu. More... | |
format_time ($totalsecs, $str=null) | |
format_weeks_get_section_dates () | |
formerr () | |
fullclone ($thing) | |
This function will make a complete copy of anything it's given, regardless of whether it's an object or not. More... | |
fullname ($user, $override=false) | |
Returns a persons full name. More... | |
gc_cache_flags () | |
Garbage-collect volatile flags. More... | |
generate_email_messageid ($localpart=null) | |
Generate a unique email Message-ID using the moodle domain and install path. More... | |
generate_email_processing_address ($modid, $modargs) | |
Generate an email processing address. More... | |
generate_email_signoff () | |
Generate a signoff for emails based on support settings. More... | |
generate_email_supportuser () | |
generate_image_thumbnail ($filepath, $width, $height) | |
Generates a thumbnail for the given image. More... | |
generate_image_thumbnail_from_image ($original, $imageinfo, $width, $height) | |
Generates a thumbnail for the given image string. More... | |
generate_image_thumbnail_from_string ($filedata, $width, $height) | |
Generates a thumbnail for the given image string. More... | |
generate_page_type_patterns ($pagetype, $parentcontext=null, $currentcontext=null) | |
Given a specific page type, parent context and currect context, return all the page type patterns that might be used by this block. More... | |
generate_password ($maxlen=10) | |
Returns a randomly generated password of length $maxlen. More... | |
generate_uuid () | |
Generate a V4 UUID. More... | |
get_accesshide ($text, $elem='span', $class='', $attrs='') | |
Return a HTML element with the class "accesshide", for accessibility. More... | |
if(!defined('LASTACCESS_UPDATE_SECS')) | get_admin () |
Number of seconds to wait before updating lastaccess information in DB. More... | |
get_admins () | |
Returns list of all admins, using 1 DB query. More... | |
get_all_instances_in_course ($modulename, $course, $userid=NULL, $includeinvisible=false) | |
Returns an array of all the active instances of a particular module in a given course, sorted in the order they are defined. More... | |
object | get_all_instances_in_courses ($modulename, $courses, $userid=NULL, $includeinvisible=false) |
Returns an array of all the active instances of a particular module in given courses, sorted in the order they are defined. More... | |
get_all_mods () | |
get_all_sections () | |
get_all_subcategories () | |
get_all_user_name_fields ($returnsql=false, $tableprefix=null, $prefix=null, $fieldprefix=null, $order=false) | |
A centralised location for the all name fields. More... | |
static | get_all_versions () |
Returns hash of all versions including core and all plugins. More... | |
static | get_all_versions_hash () |
Returns hash of all versions including core and all plugins. More... | |
get_auth_plugin ($auth) | |
Returns an authentication plugin instance. More... | |
get_backpack_settings ($userid, $refresh=false) | |
Returns external backpack settings and badges from this backpack. More... | |
get_backup_temp_directory ($directory) | |
Get the full path of a directory under $CFG->backuptempdir. More... | |
get_browser_version_classes () | |
get_cache_flag ($type, $name, $changedsince=null) | |
Get volatile flags. More... | |
get_cache_flags ($type, $changedsince=null) | |
Get volatile flags. More... | |
get_callable_name ($callable) | |
Get human readable name describing the given callable. More... | |
get_categories () | |
get_category_courses_array () | |
get_category_courses_array_recursively () | |
get_child_categories () | |
get_child_contexts () | |
get_clam_error_code () | |
get_complete_user_data ($field, $value, $mnethostid=null, $throwexception=false) | |
Get a complete user record, which includes all the info in the user record. More... | |
static | get_component_classes_in_namespace ($component=null, $namespace='') |
Returns all classes in a component matching the provided namespace. More... | |
static | get_component_directory ($component) |
Return exact absolute path to a plugin directory. More... | |
static | get_component_list () |
Returns a list of frankenstyle component names and their paths, for all components (plugins and subsystems). More... | |
static | get_component_names () |
Returns a list of frankenstyle component names. More... | |
get_component_version ($component, $source='installed') | |
Returns the version of installed component. More... | |
get_config ($plugin, $name=null) | |
Get configuration values from the global config table or the config_plugins table. More... | |
get_context_instance ($contextlevel, $instance=0, $strictness=IGNORE_MISSING) | |
Get the context instance as an object. More... | |
get_context_instance_by_id () | |
get_context_url () | |
get_contextlevel_name () | |
get_core_subsystems ($fullpaths=false) | |
List all core subsystems and their location. More... | |
static | get_core_subsystems () |
List all core subsystems and their location. More... | |
get_course ($courseid, $clone=true) | |
Gets a course object from database. More... | |
get_course_and_cm_from_cmid ($cmorid, $modulename='', $courseorid=0, $userid=0) | |
Efficiently retrieves the $course (stdclass) and $cm (cm_info) objects, given a cmid. More... | |
get_course_and_cm_from_instance ($instanceorid, $modulename, $courseorid=0, $userid=0) | |
Efficiently retrieves the $course (stdclass) and $cm (cm_info) objects, given an instance id or record and module name. More... | |
get_course_category () | |
get_course_category_tree () | |
get_course_context () | |
get_course_display_name_for_list ($course) | |
Gets the name of a course to be displayed when showing a list of courses. More... | |
object | get_course_mods ($courseid) |
MODULE FUNCTIONS /////////////////////////////////////////////////. More... | |
get_course_participants () | |
get_course_section () | |
get_courseid_from_context () | |
object | get_coursemodule_from_id ($modulename, $cmid, $courseid=0, $sectionnum=false, $strictness=IGNORE_MISSING) |
Given an id of a course module, finds the coursemodule description. More... | |
object | get_coursemodule_from_instance ($modulename, $instance, $courseid=0, $sectionnum=false, $strictness=IGNORE_MISSING) |
Given an instance number of a module, finds the coursemodule description. More... | |
get_coursemodules_in_course ($modulename, $courseid, $extrafields='') | |
Returns all course modules of given activity in course. More... | |
object | get_courses ($categoryid="all", $sort="c.sortorder ASC", $fields="c.*") |
Returns list of courses, for whole site, or category. More... | |
core_course_category::get_courses ($options=array()) | |
Retrieves the list of courses accessible by user. More... | |
get_courses_page ($categoryid="all", $sort="c.sortorder ASC", $fields="c.*", &$totalcount, $limitfrom="", $limitnum="") | |
Returns list of courses, for whole site, or category. More... | |
object | get_courses_search ($searchterms, $sort, $page, $recordsperpage, &$totalcount, $requiredcapabilities=array(), $searchcond=[], $params=[]) |
A list of courses that match a search. More... | |
get_courses_wmanagers () | |
get_current_group () | |
get_db_directories () | |
Returns list of all directories where we expect install.xml files. More... | |
get_device_cfg_var_name () | |
get_device_type () | |
get_device_type_list () | |
get_directory_list ($rootdir, $excludefiles='', $descend=true, $getdirs=false, $getfiles=true) | |
Returns an array with all the filenames in all subdirectories, relative to the given rootdir. More... | |
get_directory_size ($rootdir, $excludefile='') | |
Adds up all the files in a directory and works out the size. More... | |
get_docs_url ($path=null) | |
Returns the Moodle Docs URL in the users language for a given 'More help' link. More... | |
get_emoticon_manager () | |
Factory function for emoticon_manager. More... | |
get_enabled_auth_plugins ($fix=false) | |
Returns array of active auth plugins. More... | |
get_enrolled_join (context $context, $useridcolumn, $onlyactive=false, $onlysuspended=false, $enrolid=0) | |
Returns array with sql joins and parameters returning all ids of users enrolled into course. More... | |
get_enrolled_sql (context $context, $withcapability='', $groupid=0, $onlyactive=false, $onlysuspended=false, $enrolid=0) | |
Returns array with sql code and parameters returning all ids of users enrolled into course. More... | |
get_enrolled_users (context $context, $withcapability='', $groupid=0, $userfields='u.*', $orderby=null, $limitfrom=0, $limitnum=0, $onlyactive=false) | |
Returns list of users enrolled into course. More... | |
get_enrolled_with_capabilities_join (context $context, $prefix='', $capability='', $group=0, $onlyactive=false, $onlysuspended=false, $enrolid=0) | |
Returns an array of joins, wheres and params that will limit the group of users to only those enrolled and with given capability (if specified). More... | |
get_environment_for_version ($version, $env_select) | |
This function will return the xmlized data belonging to one Moodle version. More... | |
get_exception_info ($ex) | |
Returns detailed information about specified exception. More... | |
get_extra_user_fields ($context, $already=array()) | |
Checks if current user is shown any extra fields when listing users. More... | |
get_extra_user_fields_sql ($context, $alias='', $prefix='', $already=array()) | |
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. More... | |
get_fast_modinfo ($courseorid, $userid=0, $resetonly=false) | |
Returns reference to full info about modules in course (including visibility). More... | |
get_file_argument () | |
Extracts file argument either from file parameter or PATH_INFO. More... | |
get_file_browser () | |
Returns local file storage instance. More... | |
get_file_packer ($mimetype='application/zip') | |
Returns file packer. More... | |
get_file_storage ($reset=false) | |
Returns local file storage instance. More... | |
get_file_url () | |
get_formatted_help_string ($identifier, $component, $ajax=false, $a=null) | |
Get the value of a help string fully prepared for display in the current language. More... | |
get_generic_section_name () | |
get_group_picture_url ($group, $courseid, $large=false, $includetoken=false) | |
Return the url to the group picture. More... | |
get_home_page () | |
Gets the homepage to use for the current user. More... | |
get_host_from_url ($url) | |
Returns host part from url. More... | |
get_html_lang ($dir=false) | |
Return a string containing 'lang', xml:lang and optionally 'dir' HTML attributes. More... | |
get_last_soap_messages ($connection) | |
get_latest_version_available ($version, $env_select) | |
This function will return the most recent version in the environment.xml file previous or equal to the version requested. More... | |
get_level ($element) | |
Here all the restrict functions are coded to be used by the environment checker. More... | |
get_list_of_charsets () | |
Returns a list of charset codes. More... | |
get_list_of_environment_versions ($contents) | |
This function will return the list of Moodle versions available. More... | |
get_list_of_plugins ($directory='mod', $exclude='', $basedir='') | |
Lists plugin-like directories within specified directory. More... | |
get_list_of_themes () | |
Returns a list of valid and compatible themes. More... | |
get_list_of_timezones () | |
get_local_referer ($stripquery=true) | |
Returns the cleaned local URL of the HTTP_REFERER less the URL query string parameters if required. More... | |
get_log_manager ($forcereload=false) | |
LOG FUNCTIONS /////////////////////////////////////////////////////. More... | |
get_login_url () | |
Returns full login url. More... | |
get_logs () | |
get_logs_usercourse () | |
get_logs_userday () | |
get_mailer ($action='get') | |
Get mailer instance, enable buffering, flush buffer or disable buffering. More... | |
get_max_upload_file_size ($sitebytes=0, $coursebytes=0, $modulebytes=0, $unused=false) | |
Returns the maximum size for uploading files. More... | |
get_max_upload_sizes ($sitebytes=0, $coursebytes=0, $modulebytes=0, $custombytes=null) | |
Returns an array of possible sizes in local language. More... | |
get_mnet_environment () | |
helper function to load up and initialise the mnet environment this must be called before you use mnet functions. More... | |
get_mnet_remote_client () | |
during xmlrpc server code execution, any code wishing to access information about the remote peer must use this to get it. More... | |
get_moodle_cookie () | |
Gets a moodle cookie with a weakly encrypted username. More... | |
object | get_my_remotecourses ($userid=0) |
List of remote courses that a user has access to via MNET. More... | |
object | get_my_remotehosts () |
List of remote hosts that a user has access to via MNET. More... | |
get_parent_contextid () | |
get_parent_contexts () | |
get_parent_language ($lang=null) | |
get_performance_info () | |
get_performance_info() pairs up with init_performance_info() loaded in setup.php. More... | |
performance_measuring_filter_manager::get_performance_summary () | |
Return performance information, in the form required by get_performance_info(). More... | |
static | get_plugin_directory ($plugintype, $pluginname) |
Returns the exact absolute path to plugin directory. More... | |
static | get_plugin_list ($plugintype) |
Get list of plugins of given type. More... | |
static | get_plugin_list_with_class ($plugintype, $class, $file=null) |
Get a list of all the plugins of a given type that define a certain class in a certain file. More... | |
static | get_plugin_list_with_file ($plugintype, $file, $include=false) |
Get a list of all the plugins of a given type that contain a particular file. More... | |
get_plugin_list_with_file () | |
get_plugin_list_with_function ($plugintype, $function, $file='lib.php') | |
Get a list of all the plugins of a given type that define a certain API function in a certain file. More... | |
get_plugin_types ($fullpaths=true) | |
Lists all plugin types. More... | |
static | get_plugin_types () |
Get list of available plugin types together with their location. More... | |
static | get_plugin_types_with_subplugins () |
Returns list of plugin types that allow subplugins. More... | |
get_plugins_with_function ($function, $file='lib.php', $include=true) | |
Get a list of all the plugins that define a certain API function in a certain file. More... | |
get_print_section_cm_text () | |
get_real_size ($size=0) | |
Converts numbers like 10M into bytes. More... | |
get_recent_enrolments () | |
get_records_csv () | |
get_referer () | |
get_related_contexts_string () | |
get_request_storage_directory ($exceptiononerror=true, bool $forcecreate=false) | |
Get a per-request storage directory in the tempdir. More... | |
get_role_context_caps () | |
get_roles_on_exact_context (context $context) | |
This function finds the roles assigned directly to this context only i.e. More... | |
get_roles_with_assignment_on_context (context $context) | |
Find out which roles has assignment on this context. More... | |
object | get_scales_menu ($courseid=0) |
Returns a menu of all available scales from the site as well as the given course. More... | |
get_selected_theme_for_device_type () | |
get_separator () | |
Return the breadcrumb trail navigation separator. More... | |
get_site () | |
OTHER SITE AND COURSE FUNCTIONS /////////////////////////////////////////////. More... | |
get_site_identifier () | |
Returns the site identifier. More... | |
get_string ($identifier, $component='', $a=null, $lazyload=false) | |
filter_manager::get_string_filters ($context) | |
Get all the filters that apply to a given context for calls to format_string. More... | |
get_string_manager ($forcereload=false) | |
get_strings ($array, $component='') | |
Converts an array of strings to their localized value. More... | |
static | get_subplugins ($component) |
Return all subplugins of this component. More... | |
static | get_subsystem_directory ($subsystem) |
Returns the exact absolute path to plugin directory. More... | |
static | get_subtype_parent ($type) |
Returns parent of this subplugin type. More... | |
get_system_context ($cache=true) | |
Returns system context or null if can not be created yet. More... | |
filter_manager::get_text_filters ($context) | |
Get all the filters that apply to a given context for calls to format_text. More... | |
get_texteditor ($editorname) | |
Returns instance of text editor. More... | |
get_time_interval_string (int $time1, int $time2, string $format='') | |
Get a formatted string representation of an interval between two unix timestamps. More... | |
get_timezone_offset () | |
get_timezone_record () | |
core\task::get_trace () | |
Get the progress_trace. More... | |
get_used_table_names () | |
Returns names of all known tables == tables that moodle knows about. More... | |
get_user_access_sitewide () | |
get_user_courses_bycap () | |
get_user_device_type () | |
get_user_field_name ($field) | |
Returns the display name of a field in the user table. More... | |
get_user_fieldnames () | |
Returns an array of user fields. More... | |
get_user_key ($script, $userid, $instance=null, $iprestriction=null, $validuntil=null) | |
Gets a private user access key (and creates one if one doesn't exist). More... | |
get_user_max_upload_file_size ($context, $sitebytes=0, $coursebytes=0, $modulebytes=0, $user=null, $unused=false) | |
Returns the maximum size for uploading files for the current user. More... | |
get_user_preferences ($name=null, $default=null, $user=null) | |
get_user_timezone ($tz=99) | |
get_user_timezone_offset () | |
object | get_users ($get=true, $search='', $confirmed=false, array $exceptions=null, $sort='firstname ASC', $firstinitial='', $lastinitial='', $page='', $recordsperpage='', $fields=' *', $extraselect='', array $extraparams=null) |
Returns a subset of users. More... | |
object | get_users_confirmed () |
Full list of users that have confirmed their accounts. More... | |
get_users_from_config ($value, $capability, $includeadmins=true) | |
Use this function to get a list of users from a config setting of type admin_setting_users_with_capability. More... | |
get_users_listing ($sort='lastaccess', $dir='ASC', $page=0, $recordsperpage=0, $search='', $firstinitial='', $lastinitial='', $extraselect='', array $extraparams=null, $extracontext=null) | |
Return filtered (if provided) list of users in site, except guest and deleted users. More... | |
getremoteaddr ($default='0.0.0.0') | |
Returns most reliable client address. More... | |
getweek ($startdate, $thedate) | |
Given dates in seconds, how many weeks is the date from startdate The first week is 1, the second 2 etc ... More... | |
groupmode () | |
This means that cm_info::$groupmode should be ignored and cm_info::$coursegroupmode be used instead. More... | |
groups_course_module_visible () | |
groups_filter_users_by_course_module_visible () | |
groups_get_all_groups_for_courses ($courses) | |
guest_user () | |
Retrieve the guest user object. More... | |
handle_soap_wsdl_request ($wsdlfile, $address=false) | |
moodle_text_filter::hash () | |
hash_internal_user_password ($password, $fasthash=false) | |
Calculate hash for a plain text password. More... | |
hide_event () | |
highlight ($needle, $haystack, $matchcase=false, $prefix='< span class="highlight">', $suffix='</span >') | |
This function will highlight search words in a given string. More... | |
highlightfast ($needle, $haystack) | |
This function will highlight instances of $needle in $haystack. More... | |
html_is_blank ($string) | |
Tests whether anything was returned by text editor. More... | |
html_to_text ($html, $width=75, $dolinks=true) | |
Given HTML text, make it into plain text using external function. More... | |
httpsrequired () | |
imagecopybicubic ($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) | |
Copies a rectangular portion of the source image to another rectangle in the destination image. More... | |
in_object_vars ($var, $object) | |
Checks whether the given variable name is defined as a variable within the given object. More... | |
increment_revision_number ($table, $field, $select, array $params=null) | |
Increment standard revision field. More... | |
ini_get_bool ($ini_get_arg) | |
This function makes the return value of ini_get consistent if you are setting server directives through the .htaccess file in apache. More... | |
init_performance_info () | |
Initializes our performance info early. More... | |
initialise_fullme () | |
Initialises $FULLME and friends. More... | |
initialise_fullme_cli () | |
Initialises $FULLME and friends for command line scripts. More... | |
install_cli_database (array $options, $interactive) | |
Install Moodle DB, config.php must exist, there must not be any tables in db yet. More... | |
install_db_validate ($database, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) | |
This is in function because we want the /install.php to parse in PHP4. More... | |
install_generate_configphp ($database, $cfg) | |
Returns content of config.php file. More... | |
install_guess_wwwroot () | |
Tries to detect the right www root setting. More... | |
install_helpbutton ($url, $title='') | |
Print help button. More... | |
install_ini_get_bool ($ini_get_arg) | |
Copy of. More... | |
install_init_dataroot ($dataroot, $dirpermissions) | |
Creates dataroot if not exists yet, makes sure it is writable, add lang directory and add .htaccess just in case it works. More... | |
object | install_print_footer ($config, $reload=false) |
Prints installation page header, we can no use weblib yet in isntaller. More... | |
object | install_print_header ($config, $stagename, $heading, $stagetext, $stageclass="alert-info") |
Prints installation page header, we can no use weblib yet in installer. More... | |
object | install_print_help_page ($help) |
Prints complete help page used during installation. More... | |
static | filter_manager::instance () |
Factory method. More... | |
object | instance_is_visible ($moduletype, $module) |
Determine whether a module instance is visible within a course. More... | |
static | invalidate_opcode_php_cache ($file) |
Invalidate opcode cache for given file, this is intended for php files that are stored in dataroot. More... | |
ip_is_public ($ip) | |
Is IP address a public address? More... | |
iplookup_find_location ($ip) | |
Returns location information. More... | |
static | is_core_subsystem ($subsystemname) |
Return true if subsystemname is core subsystem. More... | |
is_course_participant () | |
is_dataroot_insecure ($fetchtest=false) | |
Try to verify that dataroot is not accessible from web. More... | |
is_early_init ($backtrace) | |
This function encapsulates the tests for whether an exception was thrown in early init – either during setup.php or during init of $OUTPUT. More... | |
is_enabled_auth ($auth) | |
Checks if a given plugin is in the list of enabled authentication plugins. More... | |
is_enrolled (context $context, $user=null, $withcapability='', $onlyactive=false) | |
Returns true if user is enrolled (is participating) in course this is intended for students and teachers. More... | |
is_float_problem () | |
Detects if float supports at least 10 decimal digits. More... | |
is_https () | |
Determines whether or not the Moodle site is being served over HTTPS. More... | |
is_in_popup () | |
Returns true if the page is displayed in a popup window. More... | |
is_internal_auth ($auth) | |
Returns true if an internal authentication method is being used. More... | |
is_major_upgrade_required () | |
Check whether a major upgrade is needed. More... | |
is_mnet_remote_user ($user) | |
Returns whether or not the user object is a remote MNET user. More... | |
is_moodle_cookie_secure () | |
Determine wether the secure flag should be set on cookies. More... | |
is_newnav ($navigation) | |
Check if the passed navigation is of the new style. More... | |
is_number ($value) | |
Return true if given value is integer or string with integer value. More... | |
is_primary_admin ($userid) | |
Is a userid the primary administrator? More... | |
is_proxybypass ( $url) | |
Check if $url matches anything in proxybypass list. More... | |
is_restored_user ($username) | |
Returns true if the user is a 'restored' one. More... | |
is_rtl_compatible ($paramtype) | |
Whether the PARAM_* type is compatible in RTL. More... | |
is_valid_plugin_name ($name) | |
This method validates a plug name. More... | |
static | is_valid_plugin_name ($plugintype, $pluginname) |
This method validates a plug name. More... | |
is_web_crawler () | |
ismoving ($courseid) | |
Determines if the logged in user is currently moving an activity. More... | |
js_minify () | |
js_reset_all_caches () | |
Invalidate all server and client side JS caches. | |
ldap_addslashes ($text) | |
Quote control characters in AttributeValue parts of a RelativeDistinguishedName used in LDAP distinguished names - See RFC 4514/2253. More... | |
ldap_connect_moodle ($host_url, $ldap_version, $user_type, $bind_dn, $bind_pw, $opt_deref, &$debuginfo, $start_tls=false) | |
Tries connect to specified ldap servers. More... | |
ldap_filter_addslashes ($text) | |
Quote control characters in texts used in LDAP filters - see RFC 4515/2254. More... | |
ldap_find_userdn ($ldapconnection, $username, $contexts, $objectclass, $search_attrib, $search_sub) | |
Search specified contexts for username and return the user dn like: cn=username,ou=suborg,o=org. More... | |
if(!defined('LDAP_DN_SPECIAL_CHARS')) if(!defined('LDAP_DN_SPECIAL_CHARS_QUOTED_NUM')) if(!defined('LDAP_DN_SPECIAL_CHARS_QUOTED_ALPHA')) if(!defined('LDAP_DN_SPECIAL_CHARS_QUOTED_ALPHA_REGEX')) | ldap_get_dn_special_chars () |
The order of the special characters in these arrays IS IMPORTANT. More... | |
ldap_get_entries_moodle ($ldapconnection, $searchresult) | |
Returns values like ldap_get_entries but is binary compatible and returns all attributes as array. More... | |
ldap_getdefaults () | |
Initializes needed variables for ldap-module. More... | |
ldap_isgroupmember ($ldapconnection, $userid, $group_dns, $member_attrib) | |
Checks if user belongs to specific group(s) or is in a subtree. More... | |
ldap_normalise_objectclass ($objectclass, $default=' *') | |
Normalise the supplied objectclass filter. More... | |
ldap_paged_results_supported ($ldapversion, $ldapconnection=null) | |
Check if we can use paged results (see RFC 2696). More... | |
ldap_stripslashes ($text) | |
Unquote control characters in AttributeValue parts of a RelativeDistinguishedName used in LDAP distinguished names - See RFC 4514/2253. More... | |
if(!defined('ROOTDSE')) if(!defined('LDAP_PAGED_RESULTS_CONTROL')) if(!defined('LDAP_DEFAULT_PAGESIZE')) | ldap_supported_usertypes () |
Returns predefined user types. More... | |
link_arrow_left ($text, $url='', $accesshide=false, $addclass='', $addparams=[]) | |
Return the left arrow with text ('previous'), and optionally embedded in a link. More... | |
link_arrow_right ($text, $url='', $accesshide=false, $addclass='', $addparams=[]) | |
Return the right arrow with text ('next'), and optionally embedded in a link. More... | |
load_course_context () | |
load_environment_xml ($env_select=ENV_SELECT_NEWER) | |
This function will load the environment.xml file and xmlize it. More... | |
filter_manager::load_filters ($context) | |
Load all the filters required by this context. More... | |
static | load_renamed_classes ($fulldir) |
Loads the db/renamedclasses.php file from the given directory. More... | |
load_role_access_by_context () | |
core\task::log ($message, $depth=1) | |
Log a message to the progress tracer. More... | |
core\task::log_finish ($message, $depth=0) | |
Log an end message to the progress tracer. More... | |
core\task::log_start ($message, $depth=0) | |
Log a start message to the progress tracer. More... | |
login_attempt_failed ($user) | |
To be called after failed user login. More... | |
login_attempt_valid ($user) | |
To be called after valid user login. More... | |
login_is_lockedout ($user) | |
Verify if user is locked out. More... | |
login_lock_account ($user) | |
Lockout user and send notification email. More... | |
login_unlock_account ($user) | |
Unlock user account and reset timers. More... | |
make_backup_temp_directory ($directory, $exceptiononerror=true) | |
Create a directory under $CFG->backuptempdir and make sure it is writable. More... | |
make_cache_directory ($directory, $exceptiononerror=true) | |
Create a directory under cachedir and make sure it is writable. More... | |
make_categories_list () | |
make_editing_buttons () | |
filter_manager::make_filter_object ($filtername, $context, $localconfig) | |
Factory method for creating a filter. More... | |
performance_measuring_filter_manager::make_filter_object ($filtername, $context, $localconfig) | |
Factory method for creating a filter. More... | |
make_grades_menu ($gradingtype) | |
Creates an array that represents all the current grades that can be chosen using the given grading type. More... | |
make_localcache_directory ($directory, $exceptiononerror=true) | |
Create a directory under localcachedir and make sure it is writable. More... | |
make_menu_from_list ($list, $separator=',') | |
Given a list (eg a,b,c,d,e) this function returns an array of 1->a, 2->b, 3->c etc. More... | |
make_request_directory ($exceptiononerror=true, bool $forcecreate=false) | |
Create a per-request directory and make sure it is writable. More... | |
make_soap_fault ($faultcode, $faultstring, $faultactor='', $detail='', $faultname='', $headerfault='') | |
make_temp_directory ($directory, $exceptiononerror=true) | |
Create a directory under tempdir and make sure it is writable. More... | |
make_timestamp ($year, $month=1, $day=1, $hour=0, $minute=0, $second=0, $timezone=99, $applydst=true) | |
make_unique_id_code ($extra='') | |
make_unique_id_code More... | |
make_unique_writable_directory ($basedir, $exceptiononerror=true) | |
Create a new unique directory within the specified directory. More... | |
make_upload_directory ($directory, $exceptiononerror=true) | |
Create a directory under dataroot and make sure it is writable. More... | |
mark_context_dirty () | |
markdown_to_html ($text) | |
Given Markdown formatted text, make it into XHTML using external function. More... | |
matching_page_type_patterns ($pagetype) | |
Given a specific page type, return all the page type patterns that might match it. More... | |
matching_page_type_patterns_from_pattern ($pattern) | |
Give an specific pattern, return all the page type patterns that would also match it. More... | |
mdie ($msg='', $errorcode=1) | |
Print an error to STDOUT and exit with a non-zero code. More... | |
me () | |
Returns the name of the current script, WITH the querystring portion. More... | |
merge_query_params (array &$target, array $values) | |
Merge parsed POST chunks. More... | |
message_add_contact ($contactid, $blocked=0, $userid=0) | |
Add the selected user as a contact for the current user. More... | |
message_block_contact ($contactid, $userid=0) | |
Block a user. More... | |
message_can_delete_message ($message, $userid) | |
Checks if a user can delete a message. More... | |
message_can_post_message () | |
message_contact_link () | |
message_count_blocked_users () | |
message_count_messages () | |
message_current_user_is_involved () | |
message_delete_message ($message, $userid) | |
Deletes a message. More... | |
message_get_blocked_users ($user1=null, $user2=null) | |
Retrieve users blocked by $user1. More... | |
message_get_contact ($contactid) | |
Load a user's contact record. More... | |
message_get_contact_add_remove_link () | |
message_get_contact_block_link () | |
message_get_contacts ($user1=null, $user2=null) | |
Retrieve $user1's contacts (online, offline and strangers) More... | |
message_get_course_contexts () | |
message_get_fragment () | |
message_get_history () | |
message_get_recent_conversations ($userorid, $limitfrom=0, $limitto=100) | |
message_get_recent_notifications () | |
message_history_link () | |
message_is_user_blocked () | |
message_is_user_non_contact_blocked () | |
message_mark_message_read ($message, $timeread, $messageworkingempty=false) | |
Mark a single message as read. More... | |
message_mark_messages_read () | |
message_move_userfrom_unread2read ($userid) | |
Moves messages from a particular user from the message table (unread messages) to message_read This is typically only used when a user is deleted. More... | |
message_page_type_list () | |
message_remove_contact ($contactid, $userid=0) | |
Remove a contact. More... | |
message_remove_url_params () | |
message_search () | |
message_shorten_message () | |
message_unblock_contact ($contactid, $userid=0) | |
Unblock a contact. More... | |
microtime_diff ($a, $b) | |
Calculate the difference between two microtimes. More... | |
min_clean_param ($value, $type) | |
Minimalistic parameter cleaning function. More... | |
min_enable_zlib_compression () | |
This method tries to enable output compression if possible. More... | |
min_fix_utf8 ($value) | |
Minimalistic UTF-8 sanitisation. More... | |
min_get_slash_argument ($clean=true) | |
Returns the slashargument part of the URL. More... | |
min_optional_param ($name, $default, $type) | |
Minimalistic parameter validation function. More... | |
mnet_get_idp_jump_url ($user) | |
return the jump url for a given remote user this is used for rewriting forum post links in emails, etc More... | |
mod_page_type_list ($pagetype, $parentcontext=null, $currentcontext=null) | |
Generates the page type list for a module by either locating and using the modules callback or by generating a default list. More... | |
moodle_getlocale () | |
Gets the system locale. More... | |
moodle_major_version ($fromdisk=false) | |
Returns the major version of this site. More... | |
moodle_minimum_php_version_is_met ($haltexecution=false) | |
Tests the current PHP version against Moodle's minimum requirement. More... | |
moodle_needs_upgrading () | |
Determine if moodle installation requires update. More... | |
moodle_process_email ($modargs, $body) | |
? More... | |
moodle_require_minimum_php_version () | |
Require our minimum php version or halt execution if requirement not met. More... | |
moodle_setlocale ($locale='') | |
move_category () | |
mtrace ($string, $eol="\n", $sleep=0) | |
For outputting debugging info. More... | |
my_page_type_list ($pagetype, $parentcontext=null, $currentcontext=null) | |
Generates the page type list for the my moodle page. More... | |
mygroupid () | |
navmenu () | |
navmenulist ($course, $sections, $modinfo, $strsection, $strjumpto, $width=50, $cmid=0) | |
Returns a popup menu with course activity modules. More... | |
static | normalize_component ($component) |
Normalize the component name using the "frankenstyle" rules. More... | |
static | normalize_componentname ($componentname) |
Normalize the component name. More... | |
normalize_version ($version) | |
This function will normalize any version to just a serie of numbers separated by dots. More... | |
notice ($message, $link='', $course=null) | |
Print a message and exit. More... | |
notify () | |
obfuscate_email ($email) | |
Given an email address, this function will return an obfuscated version of it. More... | |
obfuscate_mailto ($email, $label='', $dimmed=false, $subject='', $body='') | |
This function uses the } and obfuscate_text() to generate a fully obfuscated email link, ready to use. More... | |
obfuscate_text ($plaintext) | |
This function takes some text and replaces about half of the characters with HTML entity equivalents. More... | |
object_array_unique ($array, $keepkeyassoc=true) | |
Returns an array without repeated objects. More... | |
object_property_exists ( $obj, $property) | |
Detect if an object or a class contains a given property will take an actual object or the name of a class. More... | |
optional_param ($parname, $default, $type) | |
Returns a particular value for the named variable, taken from POST or GET, otherwise returning a given default. More... | |
optional_param_array ($parname, $default, $type) | |
Returns a particular array value for the named variable, taken from POST or GET, otherwise returning a given default. More... | |
order_in_string ($values, $stringformat) | |
Returns an array of values in order of occurance in a provided string. More... | |
over_bounce_threshold ($user) | |
Check whether the user has exceeded the bounce threshold. More... | |
p ($var) | |
Add quotes to HTML characters. More... | |
page_doc_link ($text='') | |
Returns a string containing a link to the user documentation for the current page. More... | |
page_get_doc_link_path (moodle_page $page) | |
Returns the path to use when constructing a link to the docs. More... | |
partial () | |
Helper function to do partial function binding. More... | |
password_compat_not_supported () | |
password_is_legacy_hash ($password) | |
Check a password hash to see if it was hashed using the legacy hash algorithm (md5). More... | |
phpunit_bootstrap_error ($errorcode, $text='') | |
Print error and stop execution. More... | |
plugin_callback ($type, $name, $feature, $action, $params=null, $default=null) | |
Invoke plugin's callback functions. More... | |
plugin_supports ($type, $name, $feature, $default=null) | |
Checks whether a plugin supports a specified feature. More... | |
preload_course_contexts () | |
prevent_form_autofill_password () | |
object | print_arrow ($direction='up', $strsort=null, $return=false) |
Returns an image of an up or down arrow, used for column sorting. More... | |
print_badge_image (badge $badge, stdClass $context, $size='small') | |
Print badge image. More... | |
print_category_info () | |
print_checkbox () | |
print_collapsible_region ($contents, $classes, $id, $caption, $userpref='', $default=false, $return=false) | |
Print (or return) a collapsible region, that has a caption that can be clicked to expand or collapse the region. More... | |
print_collapsible_region_end ($return=false) | |
Close a region started with print_collapsible_region_start. More... | |
print_collapsible_region_start ($classes, $id, $caption, $userpref='', $default=false, $return=false) | |
Print (or return) the start of a collapsible region. More... | |
print_container () | |
print_container_end () | |
print_container_start () | |
print_context_name () | |
print_continue () | |
print_course () | |
print_course_search () | |
print_courses () | |
print_error ($errorcode, $module='error', $link='', $a=null, $debuginfo=null) | |
Abort execution by throwing of a general exception, default exception handler displays the error message in most cases. More... | |
print_grade_menu ($courseid, $name, $current, $includenograde=true, $return=false) | |
Prints a grade menu (as part of an existing form) with help showing all possible numerical grades and scales. More... | |
print_group_picture ($group, $courseid, $large=false, $return=false, $link=true, $includetoken=false) | |
Print a specified group's avatar. More... | |
print_header () | |
print_header_simple () | |
print_location_comment ($file, $line, $return=false) | |
Outputs a HTML comment to the browser. More... | |
print_log () | |
print_log_csv () | |
print_log_ods () | |
print_log_xls () | |
print_maintenance_message () | |
Prints a maintenance message from $CFG->maintenance_message or default if empty. | |
print_mnet_log () | |
print_my_moodle () | |
print_navigation () | |
print_object ($object) | |
GENERAL HELPFUL THINGS ///////////////////////////////////. More... | |
print_overview () | |
print_password_policy () | |
Returns a localized sentence in the current language summarizing the current password policy. More... | |
print_recent_activity () | |
print_recent_activity_note ($time, $user, $text, $link, $return=false, $viewfullnames=null) | |
Display a recent activity note. More... | |
print_remote_course () | |
print_remote_host () | |
print_scale_menu_helpbutton () | |
print_section () | |
print_section_add_menus () | |
print_side_block () | |
print_string ($identifier, $component='', $a=null) | |
print_tabs ($tabrows, $selected=null, $inactive=null, $activated=null, $return=false) | |
Returns a string containing a nested list, suitable for formatting into tabs with CSS. More... | |
object | print_textarea ($unused, $rows, $cols, $width, $height, $name, $value='', $obsolete=0, $return=false, $id='') |
Prints a basic textarea field. More... | |
print_whole_category_list () | |
process_environment_bypass ($xml, &$result) | |
This function will post-process the result record by executing the specified function, modifying it as necessary, also a custom message will be added to the result object to be printed by the display layer. More... | |
process_environment_messages ($xml, &$result) | |
This function will detect if there is some message available to be added to the result in order to clarify enviromental details. More... | |
process_environment_restrict ($xml, &$result) | |
This function will post-process the result record by executing the specified function, modifying it as necessary, also a custom message will be added to the result object to be printed by the display layer. More... | |
process_environment_result ($element, &$result) | |
Once the result has been determined, look in the XML for any messages, or other things that should be done depending on the outcome. More... | |
process_manual_award ($recipientid, $issuerid, $issuerrole, $badgeid) | |
process_manual_revoke ($recipientid, $issuerid, $issuerrole, $badgeid) | |
Manually revoke awarded badges. More... | |
process_new_icon ($context, $component, $filearea, $itemid, $originalfile, $preferpng=false) | |
Stores optimised icon images in icon file area. More... | |
profile_display_badges () | |
purge_all_caches () | |
Invalidates browser caches and cached data in temp. More... | |
purge_caches ($options=[]) | |
Selectively invalidate different types of cache. More... | |
purge_other_caches () | |
Purge all non-MUC caches not otherwise purged in purge_caches. More... | |
purify_html ($text, $options=array()) | |
KSES replacement cleaning function - uses HTML Purifier. More... | |
put_records_csv () | |
qualified_me () | |
Guesses the full URL of the current script. More... | |
question_add_tops ($categories, $pcontexts) | |
Organise categories into a single parent category (called the 'Top' category) per context. More... | |
question_is_only_toplevel_category_in_context ($categoryid) | |
Checks if the question category is the highest-level category in the context that can be edited, and has no siblings. More... | |
raise_memory_limit ($newlimit) | |
Function to raise the memory limit to a new value. More... | |
random_bytes_emulate ($length) | |
Try to generates cryptographically secure pseudo-random bytes. More... | |
random_string ($length=15) | |
Generate and return a random string of the specified length. More... | |
rc4decrypt ($data) | |
rc4decrypt More... | |
rc4encrypt ($data) | |
rc4encrypt More... | |
rebuild_contexts () | |
moodle_database | rebuild_course_cache ($courseid=0, $clearonly=false) |
Rebuilds or resets the cached list of course activities stored in MUC. More... | |
rebuildnolinktag ($text) | |
This function is used to rebuild the <nolink> tag because some formats (PLAIN and WIKI) will transform it to html entities. More... | |
recaptcha_check_response ($verifyurl, $privkey, $remoteip, $response) | |
Calls an HTTP POST function to verify if the user's response was correct. More... | |
recaptcha_get_challenge_html ($apiurl, $pubkey, $lang=null) | |
Gets the challenge HTML This is called from the browser, and the resulting reCAPTCHA HTML widget is embedded within the HTML form it was called from. More... | |
recaptcha_lang ($lang=null) | |
Returns the language code the reCAPTCHA element should use. More... | |
redirect ($url, $message='', $delay=null, $messagetype=core\output\notification::NOTIFY_INFO) | |
Redirects the user to another page, after printing a notice. More... | |
redirect_if_major_upgrade_required () | |
Redirect to the Notifications page if a major upgrade is required, and terminate the current user session. | |
reduce_memory_limit ($newlimit) | |
Function to reduce the memory limit to a new value. More... | |
remoteip_in_list ($list) | |
Is the current ip in a given list? More... | |
remove_course_contents ($courseid, $showfeedback=true, array $options=null) | |
Clear a course out completely, deleting all content but don't delete the course itself. More... | |
remove_dir ($dir, $contentonly=false) | |
Delete directory or only its content. More... | |
replace_ampersands_not_followed_by_entity ($string) | |
Given a string, performs a negative lookahead looking for any ampersand character that is not followed by a proper HTML entity. More... | |
report_insights_context_insights (\context $context) | |
Returns the models that generated insights in the provided context. More... | |
require_admin () | |
A convenience function for where we must be logged in as admin. More... | |
require_course_login ($courseorid, $autologinguest=true, $cm=null, $setwantsurltome=true, $preventredirect=false) | |
require_login ($courseorid=null, $autologinguest=true, $cm=null, $setwantsurltome=true, $preventredirect=false) | |
require_logout () | |
require_sesskey () | |
Check the session key using confirm_sesskey(), and cause a fatal error if it does not match. | |
require_user_key_login ($script, $instance=null, $keyvalue=null) | |
Require key login. More... | |
required_param ($parname, $type) | |
Returns a particular value for the named variable, taken from POST or GET. More... | |
required_param_array ($parname, $type) | |
Returns a particular array value for the named variable, taken from POST or GET. More... | |
static | filter_manager::reset_caches () |
Resets the caches, usually to be called between unit tests. | |
reset_course_userdata ($data) | |
This function will empty a course of user data. More... | |
reset_login_count () | |
reset_password_and_mail ($user) | |
Resets specified user's password and send the new password to the user via email. More... | |
reset_text_filters_cache ($phpunitreset=false) | |
Resets some data related to filters, called during upgrade or when general filter settings change. More... | |
resize_image ($filepath, $width, $height, $forcecanvas=false) | |
Resize an image from an image path. More... | |
resize_image_from_image ($original, $imageinfo, $width, $height, $forcecanvas=false) | |
Resize an image from an image object. More... | |
resourcelib_embed_general ($fullurl, $title, $clicktoopen, $mimetype) | |
Returns general link or file embedding html. More... | |
resourcelib_embed_image ($fullurl, $title) | |
Returns image embedding html. More... | |
resourcelib_embed_pdf ($fullurl, $title, $clicktoopen) | |
Returns general link or pdf embedding html. More... | |
resourcelib_get_displayoptions (array $enabled, $current=null) | |
Returns list of available display options. More... | |
resourcelib_get_extension ($fullurl) | |
Looks for the extension. More... | |
resourcelib_guess_url_mimetype ($fullurl) | |
Tries to guess correct mimetype for arbitrary URL. More... | |
resourcelib_try_file_migration ($filepath, $cmid, $courseid, $component, $filearea, $itemid) | |
Try on demand migration of file from old course files. More... | |
restrict_php_version (&$result, $version) | |
Check if the current PHP version is greater than or equal to an unsupported version. More... | |
restrict_php_version_7 (&$result) | |
Check if the current PHP version is greater than or equal to PHP version 7. More... | |
restrict_php_version_71 (&$result) | |
Check if the current PHP version is greater than or equal to PHP version 7.1. More... | |
restrict_php_version_72 (&$result) | |
Check if the current PHP version is greater than or equal to PHP version 7.2. More... | |
restrict_php_version_73 (&$result) | |
Check if the current PHP version is greater than or equal to PHP version 7.3. More... | |
restrict_php_version_74 (&$result) | |
Check if the current PHP version is greater than or equal to PHP version 7.4. More... | |
right_to_left () | |
Returns true if the user is using a right-to-left language. More... | |
s ($var) | |
Add quotes to HTML characters. More... | |
object | search_generate_SQL ($parsetree, $datafield, $metafield, $mainidfield, $useridfield, $userfirstnamefield, $userlastnamefield, $timefield, $instancefield, $tagfields=[]) |
Primitive function to generate a SQL string from a parse tree. More... | |
search_generate_text_SQL ($parsetree, $datafield, $metafield, $mainidfield, $useridfield, $userfirstnamefield, $userlastnamefield, $timefield, $instancefield) | |
Primitive function to generate a SQL string from a parse tree using TEXT indexes. More... | |
object | search_users ($courseid, $groupid, $searchtext, $sort='', array $exceptions=null) |
Search through course users. More... | |
send_confirmation_email ($user, $confirmationurl=null) | |
Send email to specified user with confirmation text and activation link. More... | |
send_headers ($contenttype, $cacheable=true) | |
Send the HTTP headers that Moodle requires. More... | |
send_password_change_confirmation_email ($user, $resetrecord) | |
Sends a password change confirmation email. More... | |
send_password_change_info ($user) | |
Sends an email containing information on how to change your password. More... | |
session_get_instance () | |
session_get_realuser () | |
session_is_legacy () | |
session_is_loggedinas () | |
session_kill () | |
session_kill_all () | |
session_kill_user () | |
session_loginas () | |
session_set_user () | |
session_touch () | |
sesskey () | |
Makes sure that $USER->sesskey exists, if $USER itself exists. More... | |
set_access_log_user () | |
Webserver access user logging. | |
set_bounce_count ($user, $reset=false) | |
Increment or reset user's email bounce count. More... | |
set_cache_flag ($type, $name, $value, $expiry=null) | |
Set a volatile flag. More... | |
set_config ($name, $value, $plugin=null) | |
Set a key in global configuration. More... | |
set_cron_lock ($name, $until, $ignorecurrent=false) | |
Try to obtain or release the cron lock. More... | |
set_current_group () | |
set_debugging ($level, $debugdisplay=null) | |
Alter debugging level for the current request, the change is not saved in database. More... | |
set_login_session_preferences () | |
When logging in, this function is run to set certain preferences for the current SESSION. | |
set_mnet_remote_client ($client) | |
during the xmlrpc server code execution, this will be called to setup the object returned by get_mnet_remote_client More... | |
set_moodle_cookie ($username) | |
Sets a moodle cookie with a weakly encrypted username. More... | |
set_send_count ($user, $reset=false) | |
Used to increment or reset email sent count. More... | |
set_user_device_type () | |
set_user_preference ($name, $value, $user=null) | |
set_user_preferences (array $prefarray, $user=null) | |
setnew_password_and_mail ($user, $fasthash=false) | |
Sets specified user's password and send the new password to the user via email. More... | |
moodle_text_filter::setup ($page, $context) | |
Setup page with filter requirements and other prepare stuff. More... | |
stdClass | setup_DB () |
Sets up global $DB moodle_database instance. More... | |
setup_get_remote_url () | |
Get the URL that PHP/the web server thinks it is serving. More... | |
setup_lang_from_browser () | |
This function will search for browser prefereed languages, setting Moodle to use the best one available if $SESSION->lang is undefined. | |
filter_manager::setup_page_for_filters ($page, $context) | |
Setup page with filters requirements and other prepare stuff. More... | |
filter_manager::setup_page_for_globally_available_filters ($page) | |
Setup the page for globally available filters. More... | |
setup_validate_php_configuration () | |
This function verifies the sanity of PHP configuration and stops execution if anything critical found. | |
shift_course_mod_dates ($modname, $fields, $timeshift, $courseid, $modid=0) | |
Change dates in module - used from course reset. More... | |
shorten_filename ($filename, $length=MAX_FILENAME_SIZE, $includehash=false) | |
Shortens a given filename by removing characters positioned after the ideal string length. More... | |
shorten_filenames (array $path, $length=MAX_FILENAME_SIZE, $includehash=false) | |
Shortens a given array of filenames by removing characters positioned after the ideal string length. More... | |
shorten_text ($text, $ideal=30, $exact=false, $ending='...') | |
show_event () | |
signup_captcha_enabled () | |
Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements. More... | |
signup_get_user_confirmation_authplugin () | |
Check if user confirmation is enabled on this site and return the auth plugin handling registration if enabled. More... | |
signup_is_enabled () | |
Check if sign-up is enabled in the site. More... | |
signup_setup_new_user ($user) | |
Add the missing fields to a user that is going to be created. More... | |
signup_validate_data ($data, $files) | |
Validates the standard sign-up data (except recaptcha that is validated by the form element). More... | |
site_is_public () | |
Tries to guess if $CFG->wwwroot is publicly accessible or not. More... | |
site_scale_used () | |
skip_main_destination () | |
soap_call ($connection, $call, $params) | |
Make a call to a SoapClient. More... | |
soap_connect ($wsdl, $trace=false) | |
Create a new SoapClient object. More... | |
soap_encode ($value, $name, $type, $namespace, $encode=XSD_STRING) | |
soap_encode_array ($value, $name, $type, $namespace) | |
soap_encode_object ($value, $name, $type, $namespace) | |
soap_serve ($wsdl, $functions) | |
stats_check_uptodate ($courseid=0) | |
stats_clean_old () | |
Remove old stats data. | |
stats_compare_times ($a, $b) | |
stats_cron_daily ($maxdays=1) | |
Execute daily statistics gathering. More... | |
stats_cron_monthly () | |
Execute monthly statistics gathering. More... | |
stats_cron_weekly () | |
Execute weekly statistics gathering. More... | |
stats_fix_zeros ($stats, $timeafter, $timestr, $line2=true, $line3=false) | |
Fix missing entries in the statistics. More... | |
stats_get_action_names ($str) | |
stats_get_base_daily ($time=0) | |
Start of day. More... | |
stats_get_base_monthly ($time=0) | |
Start of month. More... | |
stats_get_base_weekly ($time=0) | |
Start of week. More... | |
stats_get_next_day_start ($time) | |
Start of next day. More... | |
stats_get_next_month_start ($time) | |
Start of next month. More... | |
stats_get_next_week_start ($time) | |
Start of next week. More... | |
stats_get_parameters ($time, $report, $courseid, $mode, $roleid=0) | |
stats_get_post_actions () | |
stats_get_report_options ($courseid, $mode) | |
stats_get_start_from ($str) | |
Return starting date of stats processing. More... | |
stats_get_time_options ($now, $lastweekend, $lastmonthend, $earliestday, $earliestweek, $earliestmonth) | |
stats_get_view_actions () | |
stats_progress ($ident) | |
Print daily cron progress. More... | |
stats_run_query ($sql, $parameters=array()) | |
Execute individual daily statistics queries. More... | |
stats_temp_table_clean () | |
Deletes summary logs table for stats calculation. More... | |
stats_temp_table_create () | |
Create temporary tables to speed up log generation. | |
stats_temp_table_drop () | |
Deletes summary logs table for stats calculation. | |
stats_temp_table_fill ($timestart, $timeend) | |
Fills the temporary stats tables with new data. More... | |
stats_temp_table_setup () | |
Fills the temporary stats tables with new data. More... | |
strip_links ($string) | |
Given a string, replaces all . More... | |
strip_pluginfile_content ($source) | |
Removes the usage of Moodle files from a text. More... | |
strip_querystring ($url) | |
Remove query string from url. More... | |
swapshuffle ($array) | |
Given a simple array, this shuffles it up just like shuffle() Unlike PHP's shuffle() this function works on any machine. More... | |
swapshuffle_assoc ($array) | |
Like swapshuffle(), but works on associative arrays. More... | |
tag_add () | |
tag_assign () | |
tag_autocomplete () | |
tag_bulk_delete_instances () | |
tag_cleanup () | |
tag_cloud_sort () | |
tag_compute_correlations () | |
tag_cron () | |
tag_delete () | |
tag_delete_instance () | |
tag_delete_instances () | |
tag_description_set () | |
tag_display_name () | |
tag_find_records () | |
tag_find_tags () | |
tag_get () | |
tag_get_correlated () | |
tag_get_id () | |
tag_get_name () | |
tag_get_related_tags () | |
tag_get_related_tags_csv () | |
tag_get_tags () | |
tag_get_tags_array () | |
tag_get_tags_csv () | |
tag_get_tags_ids () | |
tag_normalize () | |
tag_print_cloud () | |
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_process_computed_correlation () | |
tag_record_count () | |
tag_record_tagged_with () | |
tag_rename () | |
tag_set () | |
tag_set_add () | |
tag_set_delete () | |
tag_set_flag () | |
tag_type_set () | |
tag_unset_flag () | |
template_reset_all_caches () | |
Invalidate all server and client side template caches. | |
testing_cli_argument_path ($moodlepath) | |
Returns relative path against current working directory, to be used for shell execution hints. More... | |
testing_cli_fix_directory_separator ($path) | |
Fix DIRECTORY_SEPARATOR for windows. More... | |
testing_error ($errorcode, $text='') | |
Prints an error and stops execution. More... | |
testing_fix_file_permissions ($file) | |
Try to change permissions to $CFG->dirroot or $CFG->dataroot if possible. More... | |
testing_initdataroot ($dataroot, $framework) | |
Mark empty dataroot to be used for testing. More... | |
testing_is_cygwin () | |
Find out if running under Cygwin on Windows. More... | |
testing_is_mingw () | |
Returns whether a mingw CLI is running. More... | |
testing_update_composer_dependencies () | |
Updates the composer installer and the dependencies. More... | |
filter_manager::text_filtering_hash () | |
null_filter_manager::text_filtering_hash () | |
As for the equivalent filter_manager method. More... | |
text_to_html ($text, $smileyignored=null, $para=true, $newlines=true) | |
Given plain text, makes it into HTML as nicely as possible. More... | |
textlib_get_instance () | |
theme_build_css_for_themes ($themeconfigs=[], $directions=['rtl', 'ltr'], $cache=true) | |
Generates and saves the CSS files for the given theme configs. More... | |
theme_get_config_file_path ($themename) | |
Get the path to a theme config.php file. More... | |
theme_get_css_filename ($themename, $globalrevision, $themerevision, $direction) | |
Get the path to the local cached CSS file. More... | |
theme_get_locked_theme_for_device ($device) | |
Returns the theme named defined in config.php for the given device. More... | |
theme_get_next_revision () | |
Calculates and returns the next theme revision number. More... | |
theme_get_next_sub_revision_for_theme ($themename) | |
Calculates and returns the next theme revision number. More... | |
theme_get_revision () | |
Returns current theme revision number. More... | |
theme_get_sub_revision_for_theme ($themename) | |
Returns current theme sub revision number. More... | |
theme_is_device_locked ($device) | |
Checks if the given device has a theme defined in config.php. More... | |
theme_reset_all_caches () | |
Invalidate all server and client side caches. More... | |
theme_set_designer_mod ($state) | |
Enable or disable theme designer mode. More... | |
theme_set_revision ($revision) | |
Sets the current theme revision number. More... | |
theme_set_sub_revision_for_theme ($themename, $revision) | |
Sets the current theme revision number for a specific theme. More... | |
truncate_userinfo (array $info) | |
Will truncate userinfo as it comes from auth_get_userinfo (from external auth) which may have large fields. More... | |
trusttext_active () | |
Is trusttext feature active? More... | |
trusttext_pre_edit ($object, $field, $context) | |
Must be called before editing of all texts with trust flag. More... | |
trusttext_strip ($text) | |
Legacy function, used for cleaning of old forum and glossary text only. More... | |
trusttext_trusted ($context) | |
Is current user trusted to enter no dangerous XSS in this context? More... | |
unformat_float ($localefloat, $strict=false) | |
Converts locale specific floating point/comma number back to standard PHP float value Do NOT try to do any math operations before this conversion on any user submitted floats! More... | |
uninstall_plugin ($type, $name) | |
Automatically clean-up all plugin data and remove the plugin DB tables. More... | |
filter_manager::unload_all_filters () | |
Unloads all filters and other cached information. | |
performance_measuring_filter_manager::unload_all_filters () | |
Unloads all filters and other cached information. | |
unserialize_array ($expression) | |
Safe analogue of unserialize() that can only parse arrays. More... | |
unset_all_config_for_plugin ($plugin) | |
Remove all the config variables for a given plugin. More... | |
unset_cache_flag ($type, $name) | |
Removes a single volatile flag. More... | |
unset_config ($name, $plugin=null) | |
Removes a key from global configuration. More... | |
unset_user_preference ($name, $user=null) | |
object | unzip_file ($zipfile, $destination='', $showstatus_ignored=true) |
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. More... | |
update_category_button () | |
update_event () | |
update_field_with_unique_index ($table, $field, array $newvalues, array $otherconditions, $unusedvalue=-1) | |
This method can update the values in mulitple database rows for a colum with a unique index, without violating that constraint. More... | |
update_internal_user_password ($user, $password, $fasthash=false) | |
Update password hash in user object (if necessary). More... | |
update_log_display_entry () | |
update_login_count () | |
update_module_button () | |
update_timezone_records () | |
update_user_login_times () | |
Modify the user table by setting the currently logged in user's last login to now. More... | |
update_user_record ($username) | |
Will update a local user record from an external source (MNET users can not be updated using this method!). More... | |
update_user_record_by_id ($id) | |
Will update a local user record from an external source (MNET users can not be updated using this method!). More... | |
upgrade_ensure_not_running ($warningonly=false) | |
Makes sure that upgrade process is not running. More... | |
stdClass | user_accesstime_log ($courseid=0) |
object | user_can_create_courses () |
@uses CONTEXT_COURSECAT More... | |
user_not_fully_set_up ($user, $strict=true) | |
Determines if a user has completed setting up their account. More... | |
user_preference_allow_ajax_update ($name, $paramtype) | |
userdate ($date, $format='', $timezone=99, $fixday=true, $fixhour=true) | |
userdate_htmltime ($date, $format='', $timezone=99, $fixday=true, $fixhour=true) | |
useredit_shared_definition_preferences () | |
usergetdate ($time, $timezone=99) | |
usergetmidnight ($date, $timezone=99) | |
username_load_fields_from_object ($addtoobject, $secondobject, $prefix=null, $additionalfields=null) | |
Reduces lines of duplicated code for getting user name fields. More... | |
users_order_by_sql ($usertablealias='', $search=null, context $context=null) | |
This function generates the standard ORDER BY clause for use when generating lists of users. More... | |
users_search_sql ($search, $u='u', $searchanywhere=true, array $extrafields=array(), array $exclude=null, array $includeonly=null) | |
Returns SQL used to search through user table to find users (in a query which may also join and apply other conditions). More... | |
usertime ($date, $timezone=99) | |
usertimezone ($timezone=99) | |
valid_uploaded_file ($newfile) | |
Returns current name of file on disk if it exists. More... | |
validate_email ($address) | |
Validates an email to make sure it makes sense. More... | |
validate_internal_user_password ($user, $password) | |
Compare password against hash stored in user object to determine if it is valid. More... | |
validate_param ($param, $type, $allownull=NULL_NOT_ALLOWED, $debuginfo='') | |
Strict validation of parameter values, the values are only converted to requested PHP type. More... | |
validate_user_key ($keyvalue, $script, $instance) | |
Validates a user key, checking if the key exists, is not expired and the remote ip is correct. More... | |
wikify_links ($string) | |
This expression turns links into something nice in a text format. More... | |
workaround_max_input_vars () | |
Try to work around the 'max_input_vars' restriction if necessary. | |
xmldb_debug ($message, $object) | |
This function is the official hook inside XMLDB stuff to delegate its debug to one external function. More... | |
xmlize ($data, $whitespace=1, $encoding='UTF-8', $reporterrors=false) | |
XML parsing function calles into class. More... | |
object | zip_files ($originalfiles, $destination) |
Zip an array of files/dirs to a destination zip file Both parameters must be FULL paths to the files/dirs. More... | |
Variables | |
$branch = '38' | |
$capabilities | |
bool | filterobject::$casesensitive |
whether the match needs to be case sensitive. | |
global | $CFG |
$CFG = new stdClass() | |
global | core\hub::$CFG |
global object | $CFG |
$CFG | |
if(file_exists('install/distrolib.php')) | $config = new stdClass() |
$configfile = './config.php' | |
$content = '' | |
context | moodle_text_filter::$context |
The context we are in. | |
global | $COURSE |
$COURSE = new stdClass() | |
global | $DB |
$definitions | |
$distro = null | |
if(file_exists(__DIR__.'/../config.php')) | $files = array('boost/style/moodle.css') |
int | performance_measuring_filter_manager::$filterscreated = 0 |
number of filter objects created. | |
bool | filterobject::$fullmatch |
whether to match complete words. More... | |
$handlers | |
$hint_admindir = '' | |
$hint_database = '' | |
$hint_dataroot = '' | |
string | filterobject::$hreftagbegin |
HTML to insert before any match. | |
string | filterobject::$hreftagend |
HTML to insert after any match. | |
$languages = get_string_manager()->get_list_of_translations() | |
array | moodle_text_filter::$localconfig |
Any local configuration for this filter in this context. | |
$logs | |
$maturity = MATURITY_STABLE | |
$memlimit = @ini_get('memory_limit') | |
$messageproviders | |
$models | |
$observers | |
if($hassiteconfig) | $pages = array() |
string | filterobject::$phrase |
this is the phrase that should be matched. | |
foreach($pages as $page) if($hassiteconfig) if($hassiteconfig) | $plugins = core_plugin_manager::instance()->get_plugins_of_type('tool') |
Add all admin tools. More... | |
$release = '3.8.6 (Build: 20201109)' | |
$renamedclasses | |
null string | filterobject::$replacementphrase |
replacement text to go inside begin and end. More... | |
global | $SESSION |
static filter_manager | filter_manager::$singletoninstance |
Holds the singleton instance. | |
global | $SITE |
global | $SITE |
$SITE = $COURSE | |
$sortorder = clean_param($sortorder, PARAM_ALPHA) | |
array | filter_manager::$stringfilternames = array() |
Exploded version of $CFG->stringfilters. | |
moodle_text_filter[][] | filter_manager::$stringfilters = array() |
This list of active filters, by context, for filtering strings. More... | |
int | performance_measuring_filter_manager::$stringsfiltered = 0 |
number of calls to filter_string. | |
$strmnetedithost = get_string('reviewhostdetails', 'mnet') | |
if(!defined('MOODLE_INTERNAL')) | $strmnetservices = get_string('mnetservices', 'mnet') |
$tabs = array() | |
$tagareas | |
$tasks | |
$tasks | |
moodle_text_filter[][] | filter_manager::$textfilters = array() |
This list of active filters, by context, for filtering content. More... | |
int | performance_measuring_filter_manager::$textsfiltered = 0 |
number of calls to filter_text. | |
stdClass | core\task::$tracestats = null |
global | $USER |
$version = 2019111806.00 | |
null string | filterobject::$workregexp = null |
once initialised, holds the regexp for matching this phrase. | |
null string | filterobject::$workreplacementphrase = null |
once initialised, holds the mangled HTML to replace the regexp with. | |
$config | admin = 'admin' |
$CFG | admin = $config->admin |
const | AJAX_SCRIPT false |
const | ALLOW_GET_PARAMETERS true |
const | ANY_VERSION 'any' |
Any version - special value that can be used in $plugin->dependencies in version.php files. | |
const | AUTH_CONFIRM_ALREADY 2 |
const | AUTH_CONFIRM_ERROR 3 |
const | AUTH_CONFIRM_FAIL 0 |
Authentication - error codes for user confirm. | |
const | AUTH_CONFIRM_OK 1 |
const | AUTH_DENIED 2 |
Returned when the login was denied (a reason for AUTH_FAIL). | |
const | AUTH_ERROR 4 |
Returned when some error occurred (a reason for AUTH_FAIL). | |
const | AUTH_FAIL 1 |
Returned when the login was unsuccessful. | |
const | AUTH_LOGIN_FAILED 3 |
Can not login, most probably password did not match. | |
const | AUTH_LOGIN_LOCKOUT 4 |
Can not login because user is locked out. | |
const | AUTH_LOGIN_NOUSER 1 |
Can not login because user does not exist. | |
const | AUTH_LOGIN_OK 0 |
Login attempt successful. | |
const | AUTH_LOGIN_SUSPENDED 2 |
Can not login because user is suspended. | |
const | AUTH_LOGIN_UNAUTHORISED 5 |
Can not login becauser user is not authorised. | |
const | AUTH_OK 0 |
Returned when the login was successful. | |
const | AUTH_PASSWORD_NOT_CACHED 'not cached' |
Authentication constant: String used in password field when password is not stored. | |
const | AUTH_REMOVEUSER_FULLDELETE 2 |
const | AUTH_REMOVEUSER_KEEP 0 |
const | AUTH_REMOVEUSER_SUSPEND 1 |
$CFG | backuptempdir = $CFG->tempdir.'/backup' |
const | BADGE_BACKPACKAPIURL 'https://backpack.openbadges.org' |
const | BADGE_BACKPACKURL 'https://backpack.openbadges.org' |
const | BADGE_BACKPACKWEBURL 'https://backpack.openbadges.org' |
const | BADGE_CRITERIA_AGGREGATION_ALL 1 |
const | BADGE_CRITERIA_AGGREGATION_ANY 2 |
const | BADGE_CRITERIA_TYPE_ACTIVITY 1 |
const | BADGE_CRITERIA_TYPE_BADGE 7 |
const | BADGE_CRITERIA_TYPE_COHORT 8 |
const | BADGE_CRITERIA_TYPE_COMPETENCY 9 |
const | BADGE_CRITERIA_TYPE_COURSE 4 |
const | BADGE_CRITERIA_TYPE_COURSESET 5 |
const | BADGE_CRITERIA_TYPE_MANUAL 2 |
const | BADGE_CRITERIA_TYPE_OVERALL 0 |
const | BADGE_CRITERIA_TYPE_PROFILE 6 |
const | BADGE_CRITERIA_TYPE_SOCIAL 3 |
const | BADGE_MESSAGE_ALWAYS 1 |
const | BADGE_MESSAGE_DAILY 2 |
const | BADGE_MESSAGE_MONTHLY 4 |
const | BADGE_MESSAGE_NEVER 0 |
const | BADGE_MESSAGE_WEEKLY 3 |
const | BADGE_PERPAGE 50 |
const | BADGE_STATUS_ACTIVE 1 |
const | BADGE_STATUS_ACTIVE_LOCKED 3 |
const | BADGE_STATUS_ARCHIVED 4 |
const | BADGE_STATUS_INACTIVE 0 |
const | BADGE_STATUS_INACTIVE_LOCKED 2 |
const | BADGE_TYPE_COURSE 2 |
const | BADGE_TYPE_SITE 1 |
const | BADGRIO_BACKPACKAPIURL 'https://api.badgr.io/v2' |
const | BADGRIO_BACKPACKWEBURL 'https://badgr.io' |
const | BEHAT_EXITCODE_CONFIG 250 |
const | BEHAT_EXITCODE_INSTALL 254 |
const | BEHAT_EXITCODE_INSTALLED 256 |
const | BEHAT_EXITCODE_PERMISSIONS 252 |
const | BEHAT_EXITCODE_REINSTALL 253 |
const | BEHAT_EXITCODE_REQUIREMENT 251 |
const | BEHAT_PARALLEL_SITE_NAME "behatrun" |
The behat test site fullname and shortname. | |
const | BLOCK_ADDBLOCK_POSITION_CUSTOM -1 |
const | BLOCK_ADDBLOCK_POSITION_DEFAULT 0 |
const | BLOCK_ADDBLOCK_POSITION_FLATNAV 1 |
const | BLOCK_POS_LEFT 'side-pre' |
#+ Default names for the block regions in the standard theme. | |
const | BLOCK_POS_RIGHT 'side-post' |
const | BLOG_COURSE_LEVEL 3 |
const | BLOG_GLOBAL_LEVEL 5 |
const | BLOG_GROUP_LEVEL 2 |
const | BLOG_SITE_LEVEL 4 |
const | BLOG_USER_LEVEL 1 |
const | BUI_CONTEXTS_CURRENT 0 |
const | BUI_CONTEXTS_CURRENT_SUBS 1 |
const | BUI_CONTEXTS_ENTIRE_SITE 2 |
const | BUI_CONTEXTS_FRONTPAGE_ONLY 0 |
#- | |
const | BUI_CONTEXTS_FRONTPAGE_SUBS 1 |
const | CACHE_DISABLE_ALL true |
$CFG | cachedir = $CFG->dataroot.'/cache' |
const | CLI_SCRIPT (file_exists($configfile)) false |
const | COMPONENT_ERROR 0 |
const | COMPONENT_INSTALLED 3 |
const | COMPONENT_NEEDUPDATE 2 |
const | COMPONENT_UPTODATE 1 |
const | core\task::CORE_TASK_TASKS_FILENAME 'db/tasks.php' |
const | COURSE_DISPLAY_MULTIPAGE 1 |
Course display settings: split pages into a page per section. | |
const | COURSE_DISPLAY_SINGLEPAGE 0 |
Course display settings: display all sections on one page. | |
const | CUSTOM_CHECK_FILE_MISSING 13 |
XML Processing Error. | |
const | CUSTOM_CHECK_FUNCTION_MISSING 14 |
XML Processing Error. | |
$config | dataroot = empty($distro->dataroot) ? null : $distro->dataroot |
$CFG | dataroot = $config->dataroot |
const | DAYMINS 1440 |
Time constant - the number of minutes in a day. | |
const | DAYSECS 86400 |
Time constant - the number of seconds in a day. | |
$config | dbhost = empty($distro->dbhost) ? 'localhost' : $distro->dbhost |
$config | dbname = 'moodle' |
$config | dbpass = '' |
$config | dbport = empty($distro->dbport) ? '' : $distro->dbport |
$config | dbsocket = empty($distro->dbsocket) ? '' : $distro->dbsocket |
$config | dbtype = empty($distro->dbtype) ? '' : $distro->dbtype |
$config | dbuser = empty($distro->dbuser) ? '' : $distro->dbuser |
$CFG | debug = (E_ALL | E_STRICT) |
const | DEBUG_ALL E_ALL & ~E_STRICT |
All problems except strict PHP warnings. | |
const | DEBUG_DEVELOPER E_ALL | E_STRICT |
DEBUG_ALL with all debug messages and strict warnings. | |
const | DEBUG_MINIMAL E_ERROR | E_PARSE |
Fatal errors only. | |
const | DEBUG_NONE 0 |
No warnings and errors at all. | |
const | DEBUG_NORMAL E_ERROR | E_PARSE | E_WARNING | E_NOTICE |
Errors, warnings and notices. | |
$CFG | debugdeveloper = true |
$CFG | debugdisplay = true |
defined ( 'HUB_MOODLEORGHUBURL')||define( 'HUB_MOODLEORGHUBURL' | |
URL of the Moodle sites registration portal. | |
die | |
$CFG | directorypermissions = isset($distro->directorypermissions) ? $distro->directorypermissions : 00777 |
$CFG | dirroot = __DIR__ |
$CFG | docroot = 'https://docs.moodle.org' |
$CFG | early_install_lang = true |
if(isset($mnet_peer->id) && $mnet_peer->id > 0) | else |
if(isset($_REQUEST['lang'])) | else |
if(isset($_REQUEST['admin'])) | else |
if(!function_exists('iconv')) if(PHP_INT_SIZE > 4) | else |
if(!empty($_POST)) | else |
if(defined('COMPONENT_CLASSLOADER')) | else |
if($distro) | else |
const | EMAIL_VIA_ALWAYS 1 |
Email from header to always include via information. | |
const | EMAIL_VIA_NEVER 0 |
Email from header to never include via information. | |
const | EMAIL_VIA_NO_REPLY_ONLY 2 |
Email from header to only include via information if the address is no-reply. | |
const | ENROL_ACTION_EDIT 'editenrolment' |
Edit enrolment action. | |
const | ENROL_ACTION_UNENROL 'unenrol' |
Unenrol action. | |
const | ENROL_DO_NOT_SEND_EMAIL 0 |
Do not send email. | |
const | ENROL_EXT_REMOVED_KEEP 1 |
When user disappears from external source, the enrolment is kept as is - one way sync. | |
const | ENROL_EXT_REMOVED_SUSPEND 2 |
When user disappears from external source, user enrolment is suspended, roles are kept as is. More... | |
const | ENROL_EXT_REMOVED_SUSPENDNOROLES 3 |
When user disappears from external source, the enrolment is suspended and roles assigned by enrol instance are removed. More... | |
const | ENROL_EXT_REMOVED_UNENROL 0 |
When user disappears from external source, the enrolment is completely removed. | |
const | ENROL_INSTANCE_DISABLED 1 |
Course enrol instance disabled, user may enter course if other enrol instance enabled. More... | |
const | ENROL_INSTANCE_ENABLED 0 |
Course enrol instance enabled. More... | |
const | ENROL_MAX_TIMESTAMP 2147483647 |
The timestamp indicating forever. | |
const | ENROL_REQUIRE_LOGIN_CACHE_PERIOD 1800 |
const | ENROL_RESTORE_TYPE 'enrolrestore' |
const | ENROL_SEND_EMAIL_FROM_COURSE_CONTACT 1 |
Send email from course contact. | |
const | ENROL_SEND_EMAIL_FROM_KEY_HOLDER 2 |
Send email from enrolment key holder. | |
const | ENROL_SEND_EMAIL_FROM_NOREPLY 3 |
Send email from no reply address. | |
const | ENROL_USER_ACTIVE 0 |
User is active participant (used in user_enrolments->status) | |
const | ENROL_USER_SUSPENDED 1 |
User participation in course is suspended (used in user_enrolments->status) | |
const | ENV_SELECT_DATAROOT 1 |
To enforce the use of the file under dataroot. | |
const | ENV_SELECT_NEWER 0 |
Define algorithm used to select the xml file. More... | |
const | ENV_SELECT_RELEASE 2 |
To enforce the use of the file under admin (release) | |
const | EXTERNAL_TOKEN_EMBEDDED 1 |
Security token used for allowing access of embedded applications, the code is executed in the active user session. More... | |
const | EXTERNAL_TOKEN_PERMANENT 0 |
Security token used for allowing access from external application such as web services. More... | |
const | FEATURE_ADVANCED_GRADING 'grade_advanced_grading' |
True if module supports advanced grading methods. | |
const | FEATURE_BACKUP_MOODLE2 'backup_moodle2' |
True if module supports backup/restore of moodle2 format. | |
const | FEATURE_COMMENT 'comment' |
const | FEATURE_COMPLETION_HAS_RULES 'completion_has_rules' |
True if module has custom completion rules. | |
const | FEATURE_COMPLETION_TRACKS_VIEWS 'completion_tracks_views' |
True if module has code to track whether somebody viewed it. | |
const | FEATURE_CONTROLS_GRADE_VISIBILITY 'controlsgradevisbility' |
True if module controls the grade visibility over the gradebook. | |
const | FEATURE_GRADE_HAS_GRADE 'grade_has_grade' |
True if module can provide a grade. | |
const | FEATURE_GRADE_OUTCOMES 'outcomes' |
True if module supports outcomes. | |
const | FEATURE_GROUPINGS 'groupings' |
True if module supports groupings. | |
const | FEATURE_GROUPMEMBERSONLY 'groupmembersonly' |
True if module supports groupmembersonly (which no longer exists) More... | |
const | FEATURE_GROUPS 'groups' |
True if module supports groups. | |
const | FEATURE_IDNUMBER 'idnumber' |
True (which is default) if the module wants support for setting the ID number for grade calculation purposes. | |
const | FEATURE_MOD_ARCHETYPE 'mod_archetype' |
Type of module. | |
const | FEATURE_MOD_INTRO 'mod_intro' |
True if module supports intro editor. | |
const | FEATURE_MODEDIT_DEFAULT_COMPLETION 'modedit_default_completion' |
True if module has default completion. | |
const | FEATURE_NO_VIEW_LINK 'viewlink' |
True if module has no 'view' page (like label) | |
const | FEATURE_PLAGIARISM 'plagiarism' |
True if module supports plagiarism plugins. | |
const | FEATURE_RATE 'rate' |
const | FEATURE_SHOW_DESCRIPTION 'showdescription' |
True if module can show description on course main page. | |
const | FEATURE_USES_QUESTIONS 'usesquestions' |
True if module uses the question bank. | |
$CFG | filepermissions = ($CFG->directorypermissions & 0666) |
foreach ( $languages as $name=> $value) = core_plugin_manager::instance()->get_plugins_of_type('local') | |
Add all local plugins - must be always last! | |
const | FORMAT_HTML '1' |
Plain HTML (with some tags stripped). | |
const | FORMAT_MARKDOWN '4' |
Markdown-formatted text http://daringfireball.net/projects/markdown/. | |
const | FORMAT_MOODLE '0' |
Does all sorts of transformations and filtering. | |
const | FORMAT_PLAIN '2' |
Plain text (even tags are printed in full). | |
const | FORMAT_WIKI '3' |
Wiki-formatted text. More... | |
const | GETREMOTEADDR_SKIP_DEFAULT GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR|GETREMOTEADDR_SKIP_HTTP_CLIENT_IP |
GETREMOTEADDR_SKIP_DEFAULT defines the default behavior remote IP address validation. | |
const | GETREMOTEADDR_SKIP_HTTP_CLIENT_IP '1' |
Get remote addr constant. | |
const | GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR '2' |
Get remote addr constant. | |
const | HOMEPAGE_MY 1 |
The home page should be the users my page. | |
const | HOMEPAGE_SITE 0 |
The home page should be the site home. | |
const | HOMEPAGE_USER 2 |
The home page can be chosen by the user. | |
const | HOURMINS 60 |
Time constant - the number of minutes in an hour. | |
const | HOURSECS 3600 |
Time constant - the number of seconds in an hour. | |
**ingroup core *subpackage backup convert *copyright Darko Miletic< dmiletic @moodlerooms.com > *license | http |
**ingroup core *subpackage backup convert *copyright Darko Miletic< dmiletic @moodlerooms.com > *license | http |
$CFG | httpswwwroot = $CFG->wwwroot |
$COURSE | id = 1 |
if (!defined( 'MOODLE_INTERNAL')) | |
if (!defined( 'MOODLE_INTERNAL')) | |
if (!defined( 'MOODLE_INTERNAL')) | |
if (!empty( $memlimit) and $memlimit !=-1) | |
const | IGNORE_COMPONENT_CACHE true |
const | IGNORE_MISSING 0 |
Return false if record not found, show debug warning if multiple records found. | |
const | IGNORE_MULTIPLE 1 |
Similar to IGNORE_MISSING but does not show debug warning if multiple records found, not recommended to be used. | |
const | INCORRECT_FEEDBACK_FOR_OPTIONAL 17 |
XML Processing Error. | |
const | INCORRECT_FEEDBACK_FOR_REQUIRED 16 |
XML Processing Error. | |
const | INSECURE_DATAROOT_ERROR 2 |
const | INSECURE_DATAROOT_WARNING 1 |
Add libraries. | |
const | INSTALL_DATABASE 5 |
INSTALL_DATABASE = 5. | |
const | INSTALL_DATABASETYPE 4 |
INSTALL_DATABASETYPE = 4. | |
const | INSTALL_DOWNLOADLANG 3 |
INSTALL_DOWNLOADLANG = 3. | |
const | INSTALL_ENVIRONMENT 1 |
INSTALL_ENVIRONMENT = 1. | |
const | INSTALL_PATHS 2 |
INSTALL_PATHS = 2. | |
const | INSTALL_SAVE 6 |
INSTALL_SAVE = 6. | |
const | INSTALL_WELCOME 0 |
INSTALL_WELCOME = 0. | |
$config | lang = $lang |
$CFG | lang = $config->lang |
$CFG | langlocalroot = $CFG->dataroot.'/lang' |
$CFG | langotherroot = $CFG->dataroot.'/lang' |
$CFG | libdir = "$CFG->dirroot/lib" |
const | LIST_DEFINITION 4 |
const | LIST_NONE 1 |
#- More... | |
const | LIST_ORDERED 3 |
const | LIST_UNORDERED 2 |
$CFG | localcachedir = $CFG->dataroot.'/localcache' |
trait | core\task::logging_trait |
This trait includes functions to assist with logging in tasks. More... | |
const | MATURITY_ALPHA 50 |
Software maturity level - internals can be tested using white box techniques. | |
const | MATURITY_BETA 100 |
Software maturity level - feature complete, ready for preview and testing. | |
const | MATURITY_RC 150 |
Software maturity level - tested, will be released unless there are fatal bugs. | |
const | MATURITY_STABLE 200 |
Software maturity level - ready for production deployment. | |
const | MAX_COURSE_CATEGORIES 10000 |
The maximum number of course categories MAX_COURSES_IN_CATEGORY * MAX_COURSE_CATEGORIES must not be more than max integer! | |
const | MAX_COURSES_IN_CATEGORY 10000 |
The maximum courses in a category MAX_COURSES_IN_CATEGORY * MAX_COURSE_CATEGORIES must not be more than max integer! | |
const | MAX_FILENAME_SIZE 100 |
Maximum filename char size. | |
const | MDL_PERF_TEST false |
const | MEMORY_EXTRA -3 |
Large memory limit for given platform - used in cron, upgrade, and other places that need a lot of memory. More... | |
const | MEMORY_HUGE -4 |
Extremely large memory limit - not recommended for standard scripts. | |
const | MEMORY_STANDARD -2 |
Standard memory limit for given platform. | |
const | MEMORY_UNLIMITED -1 |
Remove any memory limits. | |
const | MINSECS 60 |
Time constant - the number of seconds in a minute. | |
const | MOD_ARCHETYPE_ASSIGNMENT 2 |
Assignment module archetype. | |
const | MOD_ARCHETYPE_OTHER 0 |
Unspecified module archetype. | |
const | MOD_ARCHETYPE_RESOURCE 1 |
Resource-like type module. | |
const | MOD_ARCHETYPE_SYSTEM 3 |
System (not user-addable) module archetype. | |
const | MOODLE_INTERNAL true |
Used by library scripts to check they are being called by Moodle. | |
const | MOODLE_OFFICIAL_MOBILE_SERVICE 'moodle_mobile_app' |
Moodle mobile app service name. | |
const | MUST_EXIST 2 |
Indicates exactly one record must exist. | |
const | NAVIGATION_CACHE_NAME 'navigation' |
The name that will be used to separate the navigation cache within SESSION. | |
const | NAVIGATION_SITE_ADMIN_CACHE_NAME 'navigationsiteadmin' |
const | NO_CUSTOM_CHECK_FOUND 12 |
XML Processing Error. | |
const | NO_DATABASE_SECTION_FOUND 2 |
XML Processing Error. | |
const | NO_DATABASE_VENDOR_MYSQL_FOUND 4 |
XML Processing Error. | |
const | NO_DATABASE_VENDOR_POSTGRES_FOUND 5 |
XML Processing Error. | |
const | NO_DATABASE_VENDOR_VERSION_FOUND 10 |
XML Processing Error. | |
const | NO_DATABASE_VENDORS_FOUND 3 |
XML Processing Error. | |
const | NO_ERROR 0 |
Add required files. More... | |
const | NO_MOODLE_COOKIES true |
const | NO_PHP_EXTENSIONS_NAME_FOUND 9 |
XML Processing Error. | |
const | NO_PHP_EXTENSIONS_SECTION_FOUND 8 |
XML Processing Error. | |
const | NO_PHP_SECTION_FOUND 6 |
XML Processing Error. | |
const | NO_PHP_SETTINGS_NAME_FOUND 15 |
XML Processing Error. | |
const | NO_PHP_VERSION_FOUND 7 |
XML Processing Error. | |
const | NO_UNICODE_SECTION_FOUND 11 |
XML Processing Error. | |
const | NO_VERSION_DATA_FOUND 1 |
XML Processing Error. | |
const | NULL_ALLOWED true |
NULL_ALLOWED - the parameter can be set to null in the database. | |
const | NULL_NOT_ALLOWED false |
NULL_NOT_ALLOWED - the parameter can not be set to null in the database. | |
const | OPEN_BADGES_V1 1 |
const | OPEN_BADGES_V2 2 |
const | OPEN_BADGES_V2_CONTEXT 'https://w3id.org/openbadges/v2' |
const | OPEN_BADGES_V2_TYPE_ASSERTION 'Assertion' |
const | OPEN_BADGES_V2_TYPE_AUTHOR 'Author' |
const | OPEN_BADGES_V2_TYPE_BADGE 'BadgeClass' |
const | OPEN_BADGES_V2_TYPE_ENDORSEMENT 'Endorsement' |
const | OPEN_BADGES_V2_TYPE_ISSUER 'Issuer' |
$CFG | ostype = (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) ? 'WINDOWS' : 'UNIX' |
const | PAGE_COURSE_VIEW 'course-view' |
PAGE_COURSE_VIEW is a definition of a page type. More... | |
const | PARAM_ACTION 'alphanumext' |
PARAM_ACTION - deprecated alias for PARAM_ALPHANUMEXT, use for various actions in forms and urls NOTE: originally alias for PARAM_APLHA. More... | |
const | PARAM_ALPHA 'alpha' |
PARAM_ALPHA - contains only english ascii letters a-zA-Z. | |
const | PARAM_ALPHAEXT 'alphaext' |
PARAM_ALPHAEXT the same contents as PARAM_ALPHA plus the chars in quotes: "_-" allowed NOTE: originally this allowed "/" too, please use PARAM_SAFEPATH if "/" needed. | |
const | PARAM_ALPHANUM 'alphanum' |
PARAM_ALPHANUM - expected numbers and letters only. | |
const | PARAM_ALPHANUMEXT 'alphanumext' |
PARAM_ALPHANUMEXT - expected numbers, letters only and _-. | |
const | PARAM_AREA 'area' |
PARAM_AREA is a name of area used when addressing files, comments, ratings, etc. More... | |
const | PARAM_AUTH 'auth' |
PARAM_AUTH - actually checks to make sure the string is a valid auth plugin. | |
const | PARAM_BASE64 'base64' |
PARAM_BASE64 - Base 64 encoded format. | |
const | PARAM_BOOL 'bool' |
PARAM_BOOL - converts input into 0 or 1, use for switches in forms and urls. | |
const | PARAM_CAPABILITY 'capability' |
PARAM_CAPABILITY - A capability name, like 'moodle/role:manage'. More... | |
const | PARAM_CLEAN 'clean' |
PARAM_CLEAN - obsoleted, please use a more specific type of parameter. More... | |
const | PARAM_CLEANFILE 'file' |
PARAM_CLEANFILE - deprecated alias of PARAM_FILE; originally was removing regional chars too. | |
const | PARAM_CLEANHTML 'cleanhtml' |
PARAM_CLEANHTML - cleans submitted HTML code. More... | |
const | PARAM_COMPONENT 'component' |
PARAM_COMPONENT is used for full component names (aka frankenstyle) such as 'mod_forum', 'core_rating', 'auth_ldap'. More... | |
const | PARAM_EMAIL 'email' |
PARAM_EMAIL - an email address following the RFC. | |
const | PARAM_FILE 'file' |
PARAM_FILE - safe file name, all dangerous chars are stripped, protects against XSS, SQL injections and directory traversals. | |
const | PARAM_FLOAT 'float' |
PARAM_FLOAT - a real/floating point number. More... | |
const | PARAM_FORMAT 'alphanumext' |
PARAM_FORMAT - deprecated alias for PARAM_ALPHANUMEXT, use for names of plugins, formats, etc. More... | |
const | PARAM_HOST 'host' |
PARAM_HOST - expected fully qualified domain name (FQDN) or an IPv4 dotted quad (IP address) | |
const | PARAM_INT 'int' |
PARAM_INT - integers only, use when expecting only numbers. | |
const | PARAM_INTEGER 'int' |
PARAM_INTEGER - deprecated alias for PARAM_INT. More... | |
const | PARAM_LANG 'lang' |
PARAM_LANG - checks to see if the string is a valid installed language in the current site. | |
const | PARAM_LOCALISEDFLOAT 'localisedfloat' |
PARAM_LOCALISEDFLOAT - a localised real/floating point number. More... | |
const | PARAM_LOCALURL 'localurl' |
PARAM_LOCALURL - expected properly formatted URL as well as one that refers to the local server itself. More... | |
const | PARAM_MULTILANG 'text' |
PARAM_MULTILANG - deprecated alias of PARAM_TEXT. More... | |
const | PARAM_NOTAGS 'notags' |
PARAM_NOTAGS - all html tags are stripped from the text. More... | |
const | PARAM_NUMBER 'float' |
PARAM_NUMBER - deprecated alias of PARAM_FLOAT. More... | |
const | PARAM_PATH 'path' |
PARAM_PATH - safe relative path name, all dangerous chars are stripped, protects against XSS, SQL injections and directory traversals note: the leading slash is not removed, window drive letter is not allowed. | |
const | PARAM_PEM 'pem' |
PARAM_PEM - Privacy Enhanced Mail format. | |
const | PARAM_PERMISSION 'permission' |
PARAM_PERMISSION - A permission, one of CAP_INHERIT, CAP_ALLOW, CAP_PREVENT or CAP_PROHIBIT. | |
const | PARAM_PLUGIN 'plugin' |
PARAM_PLUGIN is used for plugin names such as 'forum', 'glossary', 'ldap', 'paypal', 'completionstatus'. More... | |
const | PARAM_RAW 'raw' |
PARAM_RAW specifies a parameter that is not cleaned/processed in any way except the discarding of the invalid utf-8 characters. | |
const | PARAM_RAW_TRIMMED 'raw_trimmed' |
PARAM_RAW_TRIMMED like PARAM_RAW but leading and trailing whitespace is stripped. | |
const | PARAM_SAFEDIR 'safedir' |
PARAM_SAFEDIR - safe directory name, suitable for include() and require() | |
const | PARAM_SAFEPATH 'safepath' |
PARAM_SAFEPATH - several PARAM_SAFEDIR joined by "/", suitable for include() and require(), plugin paths, etc. | |
const | PARAM_SEQUENCE 'sequence' |
PARAM_SEQUENCE - expects a sequence of numbers like 8 to 1,5,6,4,6,8,9. More... | |
const | PARAM_STRINGID 'stringid' |
PARAM_STRINGID - used to check if the given string is valid string identifier for get_string() | |
const | PARAM_TAG 'tag' |
PARAM_TAG - one tag (interests, blogs, etc.) - mostly international characters and space, <> not supported. | |
const | PARAM_TAGLIST 'taglist' |
PARAM_TAGLIST - list of tags separated by commas (interests, blogs, etc.) | |
const | PARAM_TEXT 'text' |
PARAM_TEXT - general plain text compatible with multilang filter, no other html tags. More... | |
const | PARAM_THEME 'theme' |
PARAM_THEME - Checks to see if the string is a valid theme name in the current site. | |
const | PARAM_TIMEZONE 'timezone' |
PARAM_TIMEZONE - expected timezone. More... | |
const | PARAM_URL 'url' |
PARAM_URL - expected properly formatted URL. More... | |
const | PARAM_USERNAME 'username' |
PARAM_USERNAME - Clean username to only contains allowed characters. More... | |
const | PASSWORD_DIGITS '0123456789' |
const | PASSWORD_LOWER 'abcdefghijklmnopqrstuvwxyz' |
const | PASSWORD_NONALPHANUM '.,;:!?_-+/*@#&$' |
const | PASSWORD_UPPER 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
const | PHPUNIT_EXITCODE_CONFIGERROR 135 |
const | PHPUNIT_EXITCODE_CONFIGWARNING 136 |
const | PHPUNIT_EXITCODE_INSTALL 140 |
const | PHPUNIT_EXITCODE_PHPUNITEXTMISSING 131 |
const | PHPUNIT_EXITCODE_PHPUNITMISSING 129 |
const | PHPUNIT_EXITCODE_PHPUNITWRONG 130 |
const | PHPUNIT_EXITCODE_REINSTALL 141 |
const | PHPUNIT_TEST false |
$config | prefix = 'mdl_' |
const | PWRESET_STATUS_ALREADYSENT 4 |
const | PWRESET_STATUS_NOEMAILSENT 1 |
const | PWRESET_STATUS_OTHEREMAILSENT 3 |
const | PWRESET_STATUS_TOKENSENT 2 |
const | RECAPTCHA_API_URL 'https://www.recaptcha.net/recaptcha/api.js' |
The reCAPTCHA URL's. | |
const | RECAPTCHA_VERIFY_URL 'https://www.recaptcha.net/recaptcha/api/siteverify' |
const | RENDERER_TARGET_AJAX 'ajax' |
Plain text rendering for Ajax scripts. | |
const | RENDERER_TARGET_CLI 'cli' |
Plain text rendering for CLI scripts and cron. | |
const | RENDERER_TARGET_GENERAL 'general' |
General rendering target, usually normal browser page. | |
const | RENDERER_TARGET_HTMLEMAIL 'htmlemail' |
Rich text html rendering intended for sending via email. | |
const | RENDERER_TARGET_MAINTENANCE 'maintenance' |
General rendering target, usually normal browser page, but with limited capacity to avoid API use. | |
const | RENDERER_TARGET_TEXTEMAIL 'textemail' |
Plain text rendering intended for sending via email. | |
const | RESOURCELIB_DISPLAY_AUTO 0 |
Try the best way. | |
const | RESOURCELIB_DISPLAY_DOWNLOAD 4 |
Force download of file instead of display. | |
const | RESOURCELIB_DISPLAY_EMBED 1 |
Display using object tag. | |
const | RESOURCELIB_DISPLAY_FRAME 2 |
Display inside frame. | |
const | RESOURCELIB_DISPLAY_NEW 3 |
Display normal link in new window. | |
const | RESOURCELIB_DISPLAY_OPEN 5 |
Open directly. | |
const | RESOURCELIB_DISPLAY_POPUP 6 |
Open in "emulated" pop-up without navigation. | |
const | RESOURCELIB_LEGACYFILES_ACTIVE 2 |
Legacy files conversion in progress. | |
const | RESOURCELIB_LEGACYFILES_DONE 1 |
Legacy files conversion marked as completed. | |
const | RESOURCELIB_LEGACYFILES_NO 0 |
Legacy files not needed or new resource. | |
$CFG | running_installer = true |
const | SITEID 1 |
if(isset($_GET['help'])) if(is_null($CFG->dataroot)) if($config->stage< INSTALL_WELCOME) if($config->stage > INSTALL_SAVE) if($config->stage==INSTALL_SAVE) if($config->stage==INSTALL_DOWNLOADLANG) if($config->stage==INSTALL_DOWNLOADLANG) if($config->stage==INSTALL_DATABASETYPE) if($config->stage==INSTALL_DOWNLOADLANG) if($config->stage==INSTALL_DATABASE) if($config->stage==INSTALL_DATABASETYPE) if($config->stage==INSTALL_ENVIRONMENT or $config->stage==INSTALL_PATHS) if($config->stage==INSTALL_PATHS) $config | stage = INSTALL_WELCOME |
const | STATE_BLOCKQUOTE 3 |
const | STATE_NONE 1 |
#+ state defines | |
const | STATE_NOTIKI 5 |
const | STATE_PARAGRAPH 2 |
const | STATE_PREFORM 4 |
const | STATS_MODE_DETAILED 2 |
const | STATS_MODE_GENERAL 1 |
const | STATS_MODE_RANKED 3 |
const | STATS_PLACEHOLDER_OUTPUT '.' |
const | STATS_REPORT_ACTIVE_COURSES 11 |
const | STATS_REPORT_ACTIVE_COURSES_WEIGHTED 12 |
const | STATS_REPORT_ACTIVITY 4 |
const | STATS_REPORT_ACTIVITYBYROLE 5 |
const | STATS_REPORT_LOGINS 1 |
THESE CONSTANTS ARE USED FOR THE REPORTING PAGE. | |
const | STATS_REPORT_PARTICIPATORY_COURSES 13 |
const | STATS_REPORT_PARTICIPATORY_COURSES_RW 14 |
const | STATS_REPORT_READS 2 |
const | STATS_REPORT_USER_ACTIVITY 7 |
const | STATS_REPORT_USER_ALLACTIVITY 8 |
const | STATS_REPORT_USER_LOGINS 9 |
const | STATS_REPORT_USER_VIEW 10 |
const | STATS_REPORT_WRITES 3 |
const | STATS_TIME_LAST10MONTHS 30 |
const | STATS_TIME_LAST11MONTHS 31 |
const | STATS_TIME_LAST2MONTHS 12 |
const | STATS_TIME_LAST2WEEKS 2 |
const | STATS_TIME_LAST3MONTHS 13 |
const | STATS_TIME_LAST3WEEKS 3 |
const | STATS_TIME_LAST4MONTHS 14 |
const | STATS_TIME_LAST4WEEKS 4 |
const | STATS_TIME_LAST5MONTHS 15 |
const | STATS_TIME_LAST6MONTHS 16 |
const | STATS_TIME_LAST7MONTHS 27 |
const | STATS_TIME_LAST8MONTHS 28 |
const | STATS_TIME_LAST9MONTHS 29 |
const | STATS_TIME_LASTWEEK 1 |
const | STATS_TIME_LASTYEAR 32 |
**Library file of miscellaneous general purpose LDAP functions and *data | structures |
const | TABLE_P_BOTTOM 2 |
const | TABLE_P_TOP 1 |
#- More... | |
const | TABLE_VAR_DIR 8 |
const | TABLE_VAR_HIDE 2 |
const | TABLE_VAR_IFIRST 4 |
const | TABLE_VAR_ILAST 5 |
const | TABLE_VAR_PAGE 6 |
const | TABLE_VAR_RESET 7 |
const | TABLE_VAR_SHOW 3 |
const | TABLE_VAR_SORT 1 |
#+ These constants relate to the table's handling of URL parameters. | |
const | TAG_MAX_LENGTH 50 |
To prevent problems with multibytes strings,Flag updating in nav not working on the review page. More... | |
$CFG | target_release = $release |
$CFG | tempdir = $CFG->dataroot.'/temp' |
const | TESTING_EXITCODE_COMPOSER 255 |
Composer error exit status. | |
const | TEXTFILTER_DISABLED -9999 |
The states a filter can be in, stored in the filter_active table. | |
const | TEXTFILTER_EXCL_SEPARATOR chr(0x1F) . '%' . chr(0x1F) |
Define one exclusive separator that we'll use in the temp saved tags keys. More... | |
const | TEXTFILTER_INHERIT 0 |
The states a filter can be in, stored in the filter_active table. | |
const | TEXTFILTER_OFF -1 |
The states a filter can be in, stored in the filter_active table. | |
const | TEXTFILTER_ON 1 |
The states a filter can be in, stored in the filter_active table. | |
const | TOKEN_DATEFROM "6" |
const | TOKEN_DATETO "7" |
const | TOKEN_EXACT "2" |
const | TOKEN_INSTANCE "8" |
const | TOKEN_META "1" |
const | TOKEN_NEGATE "3" |
const | TOKEN_STRING "4" |
const | TOKEN_TAGS "9" |
const | TOKEN_USER "0" |
Constants for the various types of tokens. More... | |
const | TOKEN_USERID "5" |
$CFG | umaskpermissions = (($CFG->directorypermissions & 0777) ^ 0777) |
const | URL_MATCH_BASE 0 |
A moodle_url comparison using this flag will return true if the base URLs match, params are ignored. | |
const | URL_MATCH_EXACT 2 |
A moodle_url comparison using this flag will return true if the two URLs are identical, except for the order of the params. | |
const | URL_MATCH_PARAMS 1 |
A moodle_url comparison using this flag will return true if the base URLs match and the params of url1 are part of url2. | |
const | USER_CAN_IGNORE_FILE_SIZE_LIMITS -1 |
Indicates the user has the capabilities required to ignore activity and course file size restrictions. | |
const | VALUE_DEFAULT 0 |
VALUE_DEFAULT - if the parameter is not supplied, then the default value is used. | |
const | VALUE_OPTIONAL 2 |
VALUE_OPTIONAL - if the parameter is not supplied, then the param has no value. | |
const | VALUE_REQUIRED 1 |
VALUE_REQUIRED - if the parameter is not supplied, there is an error. | |
const | WEEKSECS 604800 |
Time constant - the number of seconds in a week. | |
$CFG | wwwroot = install_guess_wwwroot() |
const | YEARSECS 31536000 |
Time constant - the number of seconds in a year. | |
filter_get_name ($filter) | |
Look up the name of this filter. More... | |
filter_get_all_installed () | |
Get the names of all the filters installed in this Moodle. More... | |
filter_set_global_state ($filtername, $state, $move=0) | |
Set the global activated state for a text filter. More... | |
filter_is_enabled ($filtername) | |
filter_get_globally_enabled () | |
Return a list of all the filters that may be in use somewhere. More... | |
filter_get_globally_enabled_filters_with_config () | |
Get the globally enabled filters. More... | |
filter_get_string_filters () | |
Return the names of the filters that should also be applied to strings (when they are enabled). More... | |
filter_set_applies_to_strings ($filter, $applytostrings) | |
Sets whether a particular active filter should be applied to all strings by format_string, or just used by format_text. More... | |
filter_set_local_state ($filter, $contextid, $state) | |
Set the local activated state for a text filter. More... | |
filter_set_local_config ($filter, $contextid, $name, $value) | |
Set a particular local config variable for a filter in a context. More... | |
filter_unset_local_config ($filter, $contextid, $name) | |
Remove a particular local config variable for a filter in a context. More... | |
filter_get_local_config ($filter, $contextid) | |
Get local config variables for a filter in a context. More... | |
filter_get_all_local_settings ($contextid) | |
This function is for use by backup. More... | |
filter_get_active_in_context ($context) | |
Get the list of active filters, in the order that they should be used for a particular context, along with any local configuration variables. More... | |
filter_preload_activities (course_modinfo $modinfo) | |
Preloads the list of active filters for all activities (modules) on the course using two database queries. More... | |
filter_get_available_in_context ($context) | |
List all of the filters that are available in this context, and what the local and inherited states of that filter are. More... | |
filter_get_global_states () | |
This function is for use by the filter administration page. More... | |
filter_delete_all_for_filter ($filter) | |
Delete all the data in the database relating to a filter, prior to deleting it. More... | |
filter_delete_all_for_context ($contextid) | |
Delete all the data in the database relating to a context, used when contexts are deleted. More... | |
filter_has_global_settings ($filter) | |
Does this filter have a global settings page in the admin tree? (The settings page for a filter must be called, for example, filtersettingfiltertex.) More... | |
filter_has_local_settings ($filter) | |
Does this filter have local (per-context) settings? More... | |
filter_context_may_have_filter_settings ($context) | |
Certain types of context (block and user) may not have local filter settings. More... | |
filter_phrases ($text, $linkarray, $ignoretagsopen=null, $ignoretagsclose=null, $overridedefaultignore=false, $linkarrayalreadyprepared=false) | |
Process phrases intelligently found within a HTML text (such as adding links). More... | |
filter_prepare_phrases_for_filtering (array $linkarray) | |
Prepare a list of link for processing with filter_phrases(). More... | |
filter_prepare_phrase_for_replacement (filterobject $linkobject) | |
Fill in the remaining ->work... More... | |
filter_remove_duplicates ($linkarray) | |
Remove duplicate from a list of filterobject. More... | |
filter_save_ignore_tags (&$text, $filterignoretagsopen, $filterignoretagsclose, &$ignoretags) | |
Extract open/lose tags and their contents to avoid being processed by filters. More... | |
filter_save_tags (&$text, &$tags) | |
Extract tags (any text enclosed by < and > to avoid being processed by filters. More... | |
filter_add_javascript ($text) | |
Add missing openpopup javascript to HTML files. More... | |
moodle_text_filter::__construct | ( | $context, | |
array | $localconfig | ||
) |
Set any context-specific configuration for this filter.
context | $context | The current context. |
array | $localconfig | Any context-specific configuration for this filter. |
filterobject::__construct | ( | $phrase, | |
$hreftagbegin = '<span class="highlight">' , |
|||
$hreftagend = '</span>' , |
|||
$casesensitive = false , |
|||
$fullmatch = false , |
|||
$replacementphrase = null , |
|||
$replacementcallback = null , |
|||
array | $replacementcallbackdata = null |
||
) |
Constructor.
string | $phrase | this is the phrase that should be matched. |
string | $hreftagbegin | HTML to insert before any match. Default ''. |
string | $hreftagend | HTML to insert after any match. Default ''. |
bool | $casesensitive | whether the match needs to be case sensitive |
bool | $fullmatch | whether to match complete words. If true, 'T' won't be matched in 'Tim'. |
mixed | $replacementphrase | replacement text to go inside begin and end. If not set, the body of the replacement will be the original phrase. |
callback | $replacementcallback | if set, then this will be called just before $hreftagbegin, $hreftagend and $replacementphrase are needed, so they can be computed only if required. The call made is list($linkobject->hreftagbegin, $linkobject->hreftagend, $linkobject->replacementphrase) = call_user_func_array($linkobject->replacementcallback, $linkobject->replacementcallbackdata); so the return should be an array [$hreftagbegin, $hreftagend, $replacementphrase], the last of which may be null. |
array | $replacementcallbackdata | data to be passed to $replacementcallback (optional). |
|
protected |
Constructor.
Protected. Use instance() instead.
object _fix_course_cats | ( | $children, | |
& | $sortorder, | ||
$parent, | |||
$depth, | |||
$path, | |||
& | $fixcontexts | ||
) |
Internal recursive category verification function, do not use directly!
@uses MAX_COURSES_IN_CATEGORY @uses CONTEXT_COURSECAT
array | $children | |
int | $sortorder | |
string | $parent | |
int | $depth | |
string | $path | |
array | $fixcontexts |
bool | if changes were made |
abort_all_db_transactions | ( | ) |
Unconditionally abort all database transactions, this function should be called from exception handlers only.
void |
add_event | ( | ) |
CALENDAR MANAGEMENT ////////////////////////////////////////////////////////////////.
add_mod_to_section | ( | ) |
add_to_log | ( | $courseid, | |
$module, | |||
$action, | |||
$url = '' , |
|||
$info = '' , |
|||
$cm = 0 , |
|||
$user = 0 |
|||
) |
Add an entry to the legacy log table.
int | $courseid | The course id |
string | $module | The module name e.g. forum, journal, resource, course, user etc |
string | $action | 'view', 'update', 'add' or 'delete', possibly followed by another word to clarify. |
string | $url | The file and parameters used to see the results of the action |
string | $info | Additional description information |
int | $cm | The course_module->id if there is one |
int | stdClass | $user | If log regards $user other than $USER |
void |
address_in_subnet | ( | $addr, | |
$subnetstr | |||
) |
Function to check the passed address is within the passed subnet.
The parameter is a comma separated string of subnet definitions. Subnet strings can be in one of three formats: 1: xxx.xxx.xxx.xxx/nn or xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/nnn (number of bits in net mask) 2: xxx.xxx.xxx.xxx-yyy or xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx::xxxx-yyyy (a range of IP addresses in the last group) 3: xxx.xxx or xxx.xxx. or xxx:xxx:xxxx or xxx:xxx:xxxx. (incomplete address, a bit non-technical ;-) Code for type 1 modified from user posted comments by mediator at http://au.php.net/manual/en/function.ip2long.php
string | $addr | The address you are checking |
string | $subnetstr | The string of subnet addresses |
bool |
addslashes_js | ( | $var | ) |
Does proper javascript quoting.
Do not use addslashes anymore, because it does not work when magic_quotes_sybase is enabled.
mixed | $var | String, Array, or Object to add slashes to |
mixed | quoted result |
admin_apply_default_settings | ( | $node = null , |
|
$unconditional = true , |
|||
$admindefaultsettings = array() , |
|||
$settingsoutput = array() |
|||
) |
settings utility functions
This function applies default settings. Because setting the defaults of some settings can enable other settings, this function is called recursively until no more new settings are found.
object | $node,NULL | means complete tree, null by default |
bool | $unconditional | if true overrides all values with defaults, true by default |
array | $admindefaultsettings | default admin settings to apply. Used recursively |
array | $settingsoutput | The names and values of the changed settings. Used recursively |
array::$settingsoutput | The names and values of the changed settings |
admin_critical_warnings_present | ( | ) |
Test if and critical warnings are present.
bool |
moodle_page admin_externalpage_setup | ( | $section, | |
$extrabutton = '' , |
|||
array | $extraurlparams = null , |
||
$actualurl = '' , |
|||
array | $options = array() |
||
) |
Initialise admin page - this function does require login and permission checks specified in page definition.
This function must be called on each admin page before other code.
$PAGE
string | $section | name of page |
string | $extrabutton | extra HTML that is added after the blocks editing on/off button. |
array | $extraurlparams | an array paramname => paramvalue, or parameters that need to be added to the turn blocks editing on/off form, so this page reloads correctly. |
string | $actualurl | if the actual page being viewed is not the normal one for this page (e.g. admin/roles/allow.php, instead of admin/roles/manage.php, you can pass the alternate URL here. |
array | $options | Additional options that can be specified for page setup. pagelayout - This option can be used to set a specific pagelyaout, admin is default. |
admin_find_write_settings | ( | $node, | |
$data | |||
) |
Internal recursive function - finds all settings from submitted form.
object | $node | Instance of admin_category, or admin_settingpage |
array | $data |
array |
admin_get_root | ( | $reload = false , |
|
$requirefulltree = true |
|||
) |
Returns the reference to admin tree root.
object | admin_root object |
admin_output_new_settings_by_page | ( | $node | ) |
Internal function - returns arrays of html pages with uninitialised settings.
object | $node | Instance of admin_category or admin_settingpage |
array |
admin_search_settings_html | ( | $query | ) |
Internal function - prints the search results.
string | $query | String to search for |
string | empty or XHTML |
admin_write_settings | ( | $formdata | ) |
Store changed settings, this function updates the errors variable in $ADMIN.
object | $formdata | from form |
int | number of changed settings |
ajax_capture_output | ( | ) |
Starts capturing output whilst processing an AJAX request.
This should be used in combination with ajax_check_captured_output to report any captured output to the user.
Boolean | Returns true on success or false on failure. |
ajax_check_captured_output | ( | ) |
Check captured output for content.
If the site has a debug level of debugdeveloper set, and the content is non-empty, then throw a coding exception which can be captured by the Y.IO request and displayed to the user.
Any | output that was captured. |
ajaxenabled | ( | ) |
allow_assign | ( | ) |
allow_override | ( | ) |
allow_switch | ( | ) |
any_new_admin_settings | ( | $node | ) |
Based on find_new_settings() in upgradesettings.php Looks to find any admin settings that have not been initialized.
Returns 1 if it finds any.
object | $node | Instance of admin_category, or admin_settingpage |
boolean | true if any settings haven't been initialised, false if they all have |
|
protected |
Apply a list of filters to some content.
string | $text | |
moodle_text_filter[] | $filterchain | array filter name => filter object. |
array | $options | options passed to the filters. |
array | $skipfilters | of filter names. Any filters that should not be applied to this text. |
string::$text |
array_is_nested | ( | $array | ) |
Check if there is a nested array within the passed array.
array | $array |
bool | true if there is a nested array false otherwise |
authenticate_user_login | ( | $username, | |
$password, | |||
$ignorelockout = false , |
|||
& | $failurereason = null , |
||
$logintoken = false |
|||
) |
Authenticates a user against the chosen authentication mechanism.
Given a username and password, this function looks them up using the currently selected authentication mechanism, and if the authentication is successful, it returns a valid $user object from the 'user' table.
Uses auth_ functions from the currently active auth module
After authenticate_user_login() returns success, you will need to log that the user has logged in, and call complete_user_login() to set the session up.
Note: this function works only with non-mnet accounts!
string | $username | User's username (or also email if $CFG->authloginviaemail enabled) |
string | $password | User's password |
bool | $ignorelockout | useful when guessing is prevented by other mechanism such as captcha or SSO |
int | $failurereason | login failure reason, can be used in renderers (it may disclose if account exists) |
mixed | logintoken If this is set to a string it is validated against the login token for the session. |
stdClass|false | A $USER object or false if error |
badge_assemble_notification | ( | stdClass | $badge | ) |
Creates single message for all notification and sends it out.
object | $badge | A badge which is notified about. |
badge_award_criteria_competency_has_records_for_competencies | ( | $competencyids | ) |
Check if any badge has records for competencies.
array | $competencyids | Array of competencies ids. |
boolean | Return true if competencies were found in any badge. |
badge_message_from_template | ( | $message, | |
$params | |||
) |
Replaces variables in a message template and returns text ready to be emailed to a user.
string | $message | Message body. |
string | Message with replaced values |
badges_add_course_navigation | ( | navigation_node | $coursenode, |
stdClass | $course | ||
) |
Extends the course administration navigation with the Badges page.
navigation_node | $coursenode | |
object | $course |
badges_award_handle_manual_criteria_review | ( | stdClass | $data | ) |
Triggered when badge is manually awarded.
object | $data |
boolean |
badges_bake | ( | $hash, | |
$badgeid, | |||
$userid = 0 , |
|||
$pathhash = false |
|||
) |
Bake issued badge.
string | $hash | Unique hash of an issued badge. |
int | $badgeid | ID of the original badge. |
int | $userid | ID of badge recipient (optional). |
boolean | $pathhash | Return file pathhash instead of image url (optional). |
string|url | Returns either new file path hash or new file URL |
badges_calculate_message_schedule | ( | $schedule | ) |
Caclulates date for the next message digest to badge creators.
in | $schedule | Type of message schedule BADGE_MESSAGE_DAILY|BADGE_MESSAGE_WEEKLY|BADGE_MESSAGE_MONTHLY. |
int | Timestamp for next cron |
badges_check_backpack_accessibility | ( | ) |
Checks if badges can be pushed to external backpack.
string | Code of backpack accessibility status. |
badges_create_site_backpack | ( | $data | ) |
Create the backpack with this data.
stdClass | $data | The new backpack data. |
boolean |
badges_disconnect_user_backpack | ( | $userid | ) |
Disconnect from the user backpack by deleting the user preferences.
integer | $userid | The user to diconnect. |
boolean |
badges_download | ( | $userid | ) |
Download all user badges in zip archive.
int | $userid | ID of badge owner. |
badges_external_create_mapping | ( | $sitebackpackid, | |
$type, | |||
$internalid, | |||
$externalid | |||
) |
Save the info about which objects we connected with a backpack before.
integer | $sitebackpackid | The site backpack to connect to. |
string | $type | The type of this remote object. |
string | $internalid | The id for this object on the Moodle site. |
string | $externalid | The id of this object on the remote site. |
boolean |
badges_external_delete_mapping | ( | $sitebackpackid, | |
$type, | |||
$internalid | |||
) |
Delete a specific external mapping information for a backpack.
integer | $sitebackpackid | The site backpack to connect to. |
string | $type | The type of this remote object. |
string | $internalid | The id for this object on the Moodle site. |
boolean |
badges_external_delete_mappings | ( | $sitebackpackid | ) |
Delete all external mapping information for a backpack.
integer | $sitebackpackid | The site backpack to connect to. |
boolean |
badges_external_get_mapping | ( | $sitebackpackid, | |
$type, | |||
$internalid | |||
) |
Used to remember which objects we connected with a backpack before.
integer | $sitebackpackid | The site backpack to connect to. |
string | $type | The type of this remote object. |
string | $internalid | The id for this object on the Moodle site. |
mixed | The id or false if it doesn't exist. |
badges_get_badge_api_versions | ( | ) |
List the supported badges api versions.
array(version) |
badges_get_badges | ( | $type, | |
$courseid = 0 , |
|||
$sort = '' , |
|||
$dir = '' , |
|||
$page = 0 , |
|||
$perpage = BADGE_PERPAGE , |
|||
$user = 0 |
|||
) |
Get all badges.
int | Type of badges to return | |
int | Course ID for course badges | |
string | $sort | An SQL field to sort by |
string | $dir | The sort direction ASC|DESC |
int | $page | The page or records to return |
int | $perpage | The number of records to return per page |
int | $user | User specific search |
array::$badge | Array of records matching criteria |
badges_get_default_issuer | ( | ) |
Get the default issuer for a badge from this site.
array |
badges_get_issued_badge_info | ( | ) |
badges_get_site_backpack | ( | $id | ) |
Get a site backpacks by id or url.
int | $id | The backpack id. |
array(stdClass) |
badges_get_site_backpacks | ( | ) |
List the backpacks at site level.
array(stdClass) |
badges_get_user_badges | ( | $userid, | |
$courseid = 0 , |
|||
$page = 0 , |
|||
$perpage = 0 , |
|||
$search = '' , |
|||
$onlypublic = false |
|||
) |
Get badges for a specific user.
int | $userid | User ID |
int | $courseid | Badges earned by a user in a specific course |
int | $page | The page or records to return |
int | $perpage | The number of records to return per page |
string | $search | A simple string to search for |
bool | $onlypublic | Return only public badges |
array | of badges ordered by decreasing date of issue |
badges_handle_course_deletion | ( | $courseid | ) |
Handles what happens to the course badges when a course is deleted.
int | $courseid | course ID. |
void. |
badges_list_criteria | ( | $enabled = true | ) |
Return all the enabled criteria types for this site.
boolean | $enabled |
array |
badges_local_backpack_js | ( | $checksite = false | ) |
No js files are required for backpack support.
This only exists to directly support the custom V1 backpack api.
boolean | $checksite | Call check site function. |
void |
badges_notify_badge_award | ( | badge | $badge, |
$userid, | |||
$issued, | |||
$filepathhash | |||
) |
Sends notifications to users about awarded badges.
badge | $badge | Badge that was issued |
int | $userid | Recipient ID |
string | $issued | Unique hash of an issued badge |
string | $filepathhash | File path hash of an issued badge for attachments |
badges_open_badges_backpack_api | ( | ) |
Is any backpack enabled that supports open badges V1?
boolean |
badges_process_badge_image | ( | badge | $badge, |
$iconfile | |||
) |
Process badge image from form data.
badge | $badge | Badge object |
string | $iconfile | Original file |
badges_send_verification_email | ( | $email, | |
$backpackid, | |||
$backpackpassword | |||
) |
Create and send a verification email to the email address supplied.
Since we're not sending this email to a user, email_to_user can't be used but this function borrows largely the code from that process.
string | the email address to send the verification email to. | |
int | $backpackid | the id of the backpack to connect to |
string | $backpackpassword | the user entered password to connect to this backpack |
true | if the email was sent successfully, false otherwise. |
badges_setup_backpack_js | ( | ) |
Loads JS files required for backpack support.
@uses $CFG, $PAGE
void |
badges_update_site_backpack | ( | $id, | |
$data | |||
) |
Update the backpack with this id.
integer | $id | The backpack to edit |
stdClass | $data | The new backpack data. |
boolean |
badges_user_has_backpack | ( | $userid | ) |
Checks if user has external backpack connected.
int | $userid | ID of a user. |
bool | True|False whether backpack connection exists. |
badges_verify_backpack | ( | int | $backpackid | ) |
Attempt to authenticate with a backpack credentials and return an error if the authentication fails.
If external backpacks are not enabled or the backpack version is different from OBv2, this will not perform any test.
int | $backpackid | Backpack identifier to verify. |
string | The result of the verification process. |
badges_verify_site_backpack | ( | ) |
Attempt to authenticate with the site backpack credentials and return an error if the authentication fails.
If external backpacks are not enabled, this will not perform any test.
string |
behat_check_config_vars | ( | ) |
Checks that the behat config vars are properly set.
void | Stops execution with error code if something goes wrong. |
behat_clean_init_config | ( | ) |
Restrict the config.php settings allowed.
When running the behat features the config.php settings should not affect the results.
void |
behat_error | ( | $errorcode, | |
$text = '' |
|||
) |
Exits with an error code.
mixed | $errorcode | |
string | $text |
void | Stops execution with error code |
behat_error_handler | ( | $errno, | |
$errstr, | |||
$errfile, | |||
$errline, | |||
$errcontext | |||
) |
PHP errors handler to use when running behat tests.
Adds specific CSS classes to identify the messages.
int | $errno | |
string | $errstr | |
string | $errfile | |
int | $errline | |
array | $errcontext |
bool |
behat_get_error_string | ( | $errtype | ) |
Return logical error string.
int | $errtype | php error type. |
string | string which will be returned. |
behat_get_run_process | ( | ) |
Get behat run process from either $_SERVER or command config.
bool|int | false if single run, else run process number. |
behat_get_shutdown_process_errors | ( | ) |
Return php errors save which were save during shutdown.
array |
behat_is_requested_url | ( | $url | ) |
Checks if the URL requested by the user matches the provided argument.
string | $url |
bool | Returns true if it matches. |
behat_is_test_site | ( | ) |
Should we switch to the test site data?
bool |
behat_update_vars_for_process | ( | ) |
Fix variables for parallel behat testing.
block_add_block_ui | ( | $page, | |
$output | |||
) |
Functions update the blocks if required by the request parameters ==========.
Return a block_contents representing the add a new block UI, if this user is allowed to see it.
block_contents | an appropriate block_contents, or null if the user cannot add any blocks here. |
block_instance | ( | $blockname, | |
$instance = NULL , |
|||
$page = NULL |
|||
) |
Creates a new instance of the specified block class.
string | $blockname | the name of the block. |
$instance | block_instances DB table row (optional). | |
moodle_page | $page | the page this block is appearing on. |
block_base | the requested block instance. |
block_instance_by_id | ( | $blockinstanceid | ) |
Returns a new instance of the specified block instance id.
int | $blockinstanceid |
block_base | the requested block instance. |
block_load_class | ( | $blockname | ) |
Load the block class for a particular type of block.
string | $blockname | the name of the block. |
boolean | success or failure. |
block_method_result | ( | $blockname, | |
$method, | |||
$param = NULL |
|||
) |
Helper functions for working with block classes ============================.
Call a class method (one that does not require a block instance) on a block class.
string | $blockname | the name of the block. |
string | $method | the method name. |
array | $param | parameters to pass to the method. |
mixed | whatever the method returns. |
blocks_add_default_course_blocks | ( | $course | ) |
Add the default blocks to a course.
object | $course | a course object. |
blocks_add_default_system_blocks | ( | ) |
Add the default system-context blocks.
E.g. the admin tree.
blocks_delete_all_for_context | ( | $contextid | ) |
Delete all the blocks that belong to a particular context.
int | $contextid | the context id. |
blocks_delete_instance | ( | $instance, | |
$nolongerused = false , |
|||
$skipblockstables = false |
|||
) |
Delete a block, and associated data.
object | $instance | a row from the block_instances table |
bool | $nolongerused | legacy parameter. Not used, but kept for backwards compatibility. |
bool | $skipblockstables | for internal use only. Makes |
blocks_delete_instances | ( | $instanceids | ) |
Delete multiple blocks at once.
array | $instanceids | A list of block instance ID. |
blocks_find_block | ( | $blockid, | |
$blocksarray | |||
) |
Find a given block by its blockid within a provide array.
int | $blockid | |
array | $blocksarray |
bool|object | Instance if found else false |
blocks_get_default_site_course_blocks | ( | ) |
array | the blocks that should be added to the site course by default. |
blocks_get_record | ( | $blockid = NULL , |
|
$notusedanymore = false |
|||
) |
Get the block record for a particular blockid - that is, a particular type os block.
$int | blockid block type id. If null, an array of all block types is returned. | |
bool | $notusedanymore | No longer used. |
array|object | row from block table, or all rows. |
blocks_name_allowed_in_format | ( | $name, | |
$pageformat | |||
) |
Check that a given name is in a permittable format.
string | $name | |
string | $pageformat |
bool |
blocks_parse_default_blocks_list | ( | $blocksstr | ) |
Parse a list of default blocks.
See config-dist for a description of the format.
string | $blocksstr | Determines the starting point that the blocks are added in the region. |
array | the parsed list of default blocks |
blocks_remove_inappropriate | ( | $course | ) |
Actually delete from the database any blocks that are currently on this page, but which should not be there according to blocks_name_allowed_in_format.
$course |
blocks_set_visibility | ( | $instance, | |
$page, | |||
$newvisibility | |||
) |
Set a block to be visible or hidden on a particular page.
object | $instance | a row from the block_instances, preferably LEFT JOINed with the block_positions table as return by block_manager. |
moodle_page | $page | the back to set the visibility with respect to. |
integer | $newvisibility | 1 for visible, 0 for hidden. |
blog_get_context_url | ( | ) |
bounded_number | ( | $min, | |
$value, | |||
$max | |||
) |
Used to make sure that $min <= $value <= $max.
Make sure that value is between min, and max
int | $min | The minimum value |
int | $value | The value to check |
int | $max | The maximum value |
int |
break_up_long_words | ( | $string, | |
$maxsize = 20 , |
|||
$cutchar = ' ' |
|||
) |
Given some normal text this function will break up any long words to a given size by inserting the given character.
It's multibyte savvy and doesn't change anything inside html tags.
string | $string | the string to be modified |
int | $maxsize | maximum length of the string to be returned |
string | $cutchar | the string used to represent word breaks |
string |
build_context_path | ( | ) |
build_logs_array | ( | ) |
build_navigation | ( | ) |
calculate_user_dst_table | ( | ) |
calendar_cron | ( | ) |
calendar_get_all_allowed_types | ( | ) |
Get all of the allowed types for all of the courses and groups the logged in user belongs to.
The returned array will optionally have 5 keys: 'user' : true if the logged in user can create user events 'site' : true if the logged in user can create site events 'category' : array of course categories that the user can create events for 'course' : array of courses that the user can create events for 'group': array of groups that the user can create events for 'groupcourses' : array of courses that the groups belong to (can be different from the list in 'course'.
array | The array of allowed types. |
calendar_get_block_upcoming | ( | ) |
calendar_get_mini | ( | ) |
calendar_get_upcoming | ( | ) |
calendar_normalize_tz | ( | ) |
calendar_preferences_button | ( | ) |
calendar_print_month_selector | ( | ) |
calendar_wday_name | ( | ) |
can_send_from_real_email_address | ( | $from, | |
$user, | |||
$unused = null |
|||
) |
Check to see if a user's real email address should be used for the "From" field.
object | $from | The user object for the user we are sending the email from. |
object | $user | The user object that we are sending the email to. |
array | $unused | No longer used. |
bool | Returns true if we can use the from user's email adress in the "From" field. |
can_use_html_editor | ( | ) |
can_use_rotated_text | ( | ) |
category_delete_full | ( | ) |
category_delete_move | ( | ) |
check_browser_operating_system | ( | ) |
check_browser_version | ( | ) |
check_consecutive_identical_characters | ( | $password, | |
$maxchars | |||
) |
Check whether the given password has no more than the specified number of consecutive identical characters.
string | $password | password to be checked against the password policy |
integer | $maxchars | maximum number of consecutive identical characters |
bool |
check_dir_exists | ( | $dir, | |
$create = true , |
|||
$recursive = true |
|||
) |
Function to check if a directory exists and by default create it if not exists.
Previously this was accepting paths only from dataroot, but we now allow files outside of dataroot if you supply custom paths for some settings in config.php. This function does not verify that the directory is writable.
NOTE: this function uses current file stat cache, please use clearstatcache() before this if you expect that the directories may have been removed recently from a different request.
string | $dir | absolute directory path |
boolean | $create | directory if does not exist |
boolean | $recursive | create directory recursively |
boolean | true if directory exists or created, false otherwise |
check_gd_version | ( | ) |
check_moodle_environment | ( | $version, | |
$env_select = ENV_SELECT_NEWER |
|||
) |
This function checks all the requirements defined in environment.xml.
string | $version | version to check. |
int | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. Default ENV_SELECT_NEWER (BC) |
array | with two elements. The first element true/false, depending on on whether the check passed. The second element is an array of environment_results objects that has detailed information about the checks and which ones passed. |
check_password_policy | ( | $password, | |
& | $errmsg, | ||
$user = null |
|||
) |
Validate a password against the configured password policy.
string | $password | the password to be checked against the password policy |
string | $errmsg | the error message to display when the password doesn't comply with the policy. |
stdClass | $user | the user object to perform password validation against. Defaults to null if not provided |
bool | true if the password is valid according to the policy. false otherwise. |
check_php_version | ( | $version = '5.2.4' | ) |
Returns true if the current version of PHP is greater that the specified one.
string | $version | The version of php being tested. |
bool |
choose_from_menu | ( | ) |
clam_change_log | ( | ) |
clam_handle_infected_file | ( | ) |
clam_log_infected | ( | ) |
clam_log_upload | ( | ) |
clam_message_admins | ( | ) |
clam_replace_infected_file | ( | ) |
clam_scan_moodle_file | ( | ) |
clean_filename | ( | $string | ) |
Cleans a given filename by removing suspicious or troublesome characters.
string | $string | file name |
string | cleaned file name |
clean_param | ( | $param, | |
$type | |||
) |
Used by } and required_param() to clean the variables and/or cast to specific types, based on an options field.
$course->format = clean_param($course->format, PARAM_ALPHA); $selectedgradeitem = clean_param($selectedgradeitem, PARAM_INT);
mixed | $param | the variable we are cleaning |
string | $type | expected format of param after cleaning. |
mixed |
coding_exception |
clean_param_array | ( | array | $param = null , |
$type, | |||
$recursive = false |
|||
) |
Makes sure array contains only the allowed types, this function does not validate array key names!
$options = clean_param($options, PARAM_INT);
array | $param | the variable array we are cleaning |
string | $type | expected format of param after cleaning. |
bool | $recursive | clean recursive arrays |
array |
coding_exception |
clean_text | ( | $text, | |
$format = FORMAT_HTML , |
|||
$options = array() |
|||
) |
Cleans raw text removing nasties.
Given raw text (eg typed in by a user) this function cleans it up and removes any nasty tags that could mess up Moodle pages through XSS attacks.
The result must be used as a HTML text fragment, this function can not cleanup random parts of html tags such as url or src attributes.
NOTE: the format parameter was deprecated because we can safely clean only HTML.
string | $text | The text to be cleaned |
int | string | $format | deprecated parameter, should always contain FORMAT_HTML or FORMAT_MOODLE |
array | $options | Array of options; currently only option supported is 'allowid' (if true, does not remove id attributes when cleaning) |
string | The cleaned up text |
cleanremoteaddr | ( | $addr, | |
$compress = false |
|||
) |
Cleans an ip address.
Internal addresses are now allowed. (Originally local addresses were not allowed.)
string | $addr | IPv4 or IPv6 address |
bool | $compress | use IPv6 address compression |
string | normalised ip address string, null if error |
cleanup_contexts | ( | ) |
cleardoubleslashes | ( | $path | ) |
Replace 1 or more slashes or backslashes to 1 slash.
string | $path | The path to strip |
string | the path with double slashes removed |
cli_error | ( | $text, | |
$errorcode = 1 |
|||
) |
Write to standard error output and exit with the given code.
string | $text | |
int | $errorcode |
void | (does not return) |
cli_execute_parallel | ( | $cmds, | |
$cwd = null , |
|||
$delay = 0 |
|||
) |
Execute commands in parallel.
array | $cmds | list of commands to be executed. |
string | $cwd | absolute path of working directory. |
int | $delay | time in seconds to add delay between each parallel process. |
array | list of processes. |
cli_get_params | ( | array | $longoptions, |
array | $shortmapping = null |
||
) |
Returns cli script parameters.
array | $longoptions | array of –style options ex:('verbose'=>false) |
array | $shortmapping | array describing mapping of short to long style options ex:('h'=>'help', 'v'=>'verbose') |
array | array of arrays, options, unrecognised as optionlongname=>value |
cli_heading | ( | $string, | |
$return = false |
|||
) |
Print or return section heading string.
string | $string | text |
bool | $return | false means print, true return as string |
mixed | void or string |
cli_input | ( | $prompt, | |
$default = '' , |
|||
array | $options = null , |
||
$casesensitiveoptions = false |
|||
) |
Get input from user.
string | $prompt | text prompt, should include possible options |
string | $default | default value when enter pressed |
array | $options | list of allowed options, empty means any text |
bool | $casesensitive | true if options are case sensitive |
string | entered text |
cli_logo | ( | $padding = 2 , |
|
$return = false |
|||
) |
Print an ASCII version of the Moodle logo.
int | $padding | left padding of the logo |
bool | $return | should we print directly (false) or return the string (true) |
mixed | void or string |
cli_problem | ( | $text | ) |
Write error notification.
$text |
void |
cli_separator | ( | $return = false | ) |
Print or return section separator string.
bool | $return | false means print, true return as string |
mixed | void or string |
cli_write | ( | $text, | |
$stream = STDOUT |
|||
) |
Write a text to the given stream.
string | $text | text to be written |
resource | $stream | output stream to be written to, defaults to STDOUT |
cli_writeln | ( | $text, | |
$stream = STDOUT |
|||
) |
Write a text followed by an end of line symbol to the given stream.
string | $text | text to be written |
resource | $stream | output stream to be written to, defaults to STDOUT |
close_window | ( | $delay = 0 , |
|
$reloadopener = false |
|||
) |
Try and close the current window using JavaScript, either immediately, or after a delay.
Echo's out the resulting XHTML & javascript
integer | $delay | a delay in seconds before closing the window. Default 0. |
boolean | $reloadopener | if true, we will see if this window was a pop-up, and try to reload the parent window before this one closes. |
cohort_get_visible_list | ( | ) |
complete_user_login | ( | $user | ) |
Call to complete the user login process after authenticate_user_login() has succeeded.
It will setup the $USER variable and other required bits and pieces.
NOTE:
stdClass | $user |
stdClass | A $USER object - BC only, do not use |
completion_cron | ( | ) |
complex_random_string | ( | $length = null | ) |
Generate a complex random string (useful for md5 salts)
This function is based on the above random_string() however it uses a larger pool of characters and generates a string between 24 and 32 characters
int | $length | Optional if set generates a string to exactly this length |
string |
component_callback | ( | $component, | |
$function, | |||
array | $params = array() , |
||
$default = null |
|||
) |
Invoke component's callback functions.
string | $component | frankenstyle component name, e.g. 'mod_quiz' |
string | $function | the rest of the function name, e.g. 'cron' will end up calling 'mod_quiz_cron' |
array | $params | parameters of callback function |
mixed | $default | default value if callback function hasn't been defined, or if it retursn null. |
mixed |
component_callback_exists | ( | $component, | |
$function | |||
) |
Determine if a component callback exists and return the function name to call.
Note that this function will include the required library files so that the functioname returned can be called directly.
string | $component | frankenstyle component name, e.g. 'mod_quiz' |
string | $function | the rest of the function name, e.g. 'cron' will end up calling 'mod_quiz_cron' |
mixed | Complete function name to call if the callback exists or false if it doesn't. |
coding_exception | if invalid component specfied |
component_class_callback | ( | $classname, | |
$methodname, | |||
array | $params, | ||
$default = null |
|||
) |
Call the specified callback method on the provided class.
If the callback returns null, then the default value is returned instead. If the class does not exist, then the default value is returned.
string | $classname | The name of the class to call upon. |
string | $methodname | The name of the staticically defined method on the class. |
array | $params | The arguments to pass into the method. |
mixed | $default | The default value. |
mixed | The return value. |
confirm_sesskey | ( | $sesskey = NULL | ) |
Check the sesskey and return true of false for whether it is valid.
(You might like to imagine this function is called sesskey_is_valid().)
Every script that lets the user perform a significant action (that is, changes data in the database) should check the sesskey before doing the action. Depending on your code flow, you may want to use the require_sesskey() helper function.
string | $sesskey | The sesskey value to check (optional). Normally leave this blank and this function will do required_param('sesskey', ...). |
bool | whether the sesskey sent in the request matches the one stored in the session. |
content_to_text | ( | $content, | |
$contentformat | |||
) |
Converts texts or strings to plain text.
string | $content | The text as entered by the user |
int | false | $contentformat | False for strings or the text format: FORMAT_MOODLE/FORMAT_HTML/FORMAT_PLAIN/FORMAT_MARKDOWN |
string | Plain text. |
context_instance_preload | ( | ) |
context_instance_preload_sql | ( | ) |
context_moved | ( | ) |
convert_tabrows_to_tree | ( | ) |
convert_to_array | ( | $var | ) |
Converts an object into an associative array.
This function converts an object into an associative array by iterating over its public properties. Because this function uses the foreach construct, Iterators are respected. It works recursively on arrays of objects. Arrays and simple values are returned as is.
If class has magic properties, it can implement IteratorAggregate and return all available properties in getIterator()
mixed | $var |
array |
convert_tree_to_html | ( | ) |
core_login_extend_change_password_form | ( | $mform, | |
$user | |||
) |
Plugins can extend forms.
Inject form elements into change_password_form.
mform | $mform | the form to inject elements into. |
stdClass | $user | the user object to use for context. |
core_login_extend_forgot_password_form | ( | $mform | ) |
Inject form elements into forgot_password_form.
mform | $mform | the form to inject elements into. |
core_login_extend_set_password_form | ( | $mform, | |
$user | |||
) |
Inject form elements into set_password_form.
mform | $mform | the form to inject elements into. |
stdClass | $user | the user object to use for context. |
core_login_extend_signup_form | ( | $mform | ) |
Inject form elements into signup_form.
mform | $mform | the form to inject elements into. |
core_login_generate_password_reset | ( | $user | ) |
Create a new record in the database to track a new password set request for user.
object | $user | the user record, the requester would like a new password set for. |
record | created. |
core_login_get_return_url | ( | ) |
Determine where a user should be redirected after they have been logged in.
string | url the user should be redirected to. |
core_login_post_change_password_requests | ( | $data | ) |
Plugins can perform post submission actions.
Post change_password_form submission actions.
stdClass | $data | the data object from the submitted form. |
core_login_post_forgot_password_requests | ( | $data | ) |
Post forgot_password_form submission actions.
stdClass | $data | the data object from the submitted form. |
core_login_post_set_password_requests | ( | $data, | |
$user | |||
) |
Post set_password_form submission actions.
stdClass | $data | the data object from the submitted form. |
stdClass | $user | the user object for set_password context. |
core_login_post_signup_requests | ( | $data | ) |
Post signup_form submission actions.
stdClass | $data | the data object from the submitted form. |
core_login_process_password_reset | ( | $username, | |
) |
Process the password reset for the given user (via username or email).
string | $username | the user name |
string | the user email |
array | an array containing fields indicating the reset status, a info notice and redirect URL. |
core_login_process_password_reset_request | ( | ) |
Processes a user's request to set a new password in the event they forgot the old one.
If no user identifier has been supplied, it displays a form where they can submit their identifier. Where they have supplied identifier, the function will check their status, and send email as appropriate.
core_login_process_password_set | ( | $token | ) |
This function processes a user's submitted token to validate the request to set a new password.
If the user's token is validated, they are prompted to set a new password.
string | $token | the one-use identifier which should verify the password reset request as being valid. |
void |
core_login_validate_extend_change_password_form | ( | $data, | |
$user | |||
) |
Plugins can add additional validation to forms.
Inject validation into change_password_form.
array | $data | the data array from submitted form values. |
stdClass | $user | the user object to use for context. |
array::$errors | the updated array of errors from validation. |
core_login_validate_extend_forgot_password_form | ( | $data | ) |
Inject validation into forgot_password_form.
array | $data | the data array from submitted form values. |
array::$errors | the updated array of errors from validation. |
core_login_validate_extend_set_password_form | ( | $data, | |
$user | |||
) |
Inject validation into set_password_form.
array | $data | the data array from submitted form values. |
stdClass | $user | the user object to use for context. |
array::$errors | the updated array of errors from validation. |
core_login_validate_extend_signup_form | ( | $data | ) |
Inject validation into signup_form.
array | $data | the data array from submitted form values. |
array::$errors | the updated array of errors from validation. |
core_login_validate_forgot_password_data | ( | $data | ) |
Validates the forgot password form data.
This is used by the forgot_password_form and by the core_auth_request_password_rest WS.
array | $data | array containing the data to be validated (email and username) |
array | array of errors compatible with mform |
core_myprofile_navigation | ( | core_user\output\myprofile\tree | $tree, |
$user, | |||
$iscurrentuser, | |||
$course | |||
) |
Defines core nodes for my profile navigation tree.
core_user\output\myprofile\tree | $tree | Tree object |
stdClass | $user | user object |
bool | $iscurrentuser | is the user viewing profile, current user ? |
stdClass | $course | course object |
bool |
count_enrolled_users | ( | context | $context, |
$withcapability = '' , |
|||
$groupid = 0 , |
|||
$onlyactive = false |
|||
) |
Counts list of users enrolled into course (as per above function)
context | $context | |
string | $withcapability | |
int | $groupid | 0 means ignore groups, any other value limits the result by group id |
bool | $onlyactive | consider only active enrolments in enabled plugins and time restrictions |
array | of user records |
count_login_failures | ( | ) |
course_category_hide | ( | ) |
course_category_show | ( | ) |
course_get_cm_rename_action | ( | ) |
course_scale_used | ( | ) |
coursemodule_visible_for_user | ( | ) |
coursetag_delete_course_tags | ( | ) |
coursetag_delete_keyword | ( | ) |
coursetag_get_all_tags | ( | ) |
coursetag_get_jscript | ( | ) |
coursetag_get_jscript_links | ( | ) |
coursetag_get_records | ( | ) |
coursetag_get_tagged_courses | ( | ) |
coursetag_get_tags | ( | ) |
coursetag_store_keywords | ( | ) |
create_contexts | ( | ) |
create_course_category | ( | ) |
create_user_key | ( | $script, | |
$userid, | |||
$instance = null , |
|||
$iprestriction = null , |
|||
$validuntil = null |
|||
) |
Creates a new private user access key.
string | $script | unique target identifier |
int | $userid | |
int | $instance | optional instance id |
string | $iprestriction | optional ip restricted access |
int | $validuntil | key valid only until given data |
string | access key value |
create_user_record | ( | $username, | |
$password, | |||
$auth = 'manual' |
|||
) |
Creates a bare-bones user record.
string | $username | New user's username to add to record |
string | $password | New user's password to add to record |
string | $auth | Form of authentication required |
stdClass | A complete user object |
cron_bc_hack_plugin_functions | ( | $plugintype, | |
$plugins | |||
) |
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.)
string | $plugintype | Plugin type e.g. 'report' |
array | $plugins | Array from plugin name (e.g. 'report_frog') to function name (e.g. 'report_frog_cron') for plugin cron functions that were already found using the new API |
array | Revised version of $plugins that adds in any extra plugin functions found by looking in the older location |
cron_execute_plugin_type | ( | $plugintype, | |
$description = null |
|||
) |
Executes cron functions for a specific type of plugin.
string | $plugintype | Plugin type (e.g. 'report') |
string | $description | If specified, will display 'Starting (whatever)' and 'Finished (whatever)' lines, otherwise does not display |
cron_prepare_core_renderer | ( | $restore = false | ) |
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.
bool | $restore | Whether to restore the original PAGE and OUTPUT |
cron_run_adhoc_tasks | ( | int | $timenow | ) |
Execute all queued adhoc tasks, applying necessary concurrency limits and time limits.
int | $timenow | The time this process started. |
moodle_exception |
cron_run_inner_adhoc_task | ( | \core\task\adhoc_task | $task | ) |
Shared code that handles running of a single adhoc task within the cron.
core\task\adhoc_task | $task |
cron_run_inner_scheduled_task | ( | \core\task\task_base | $task | ) |
Shared code that handles running of a single scheduled task within the cron.
Not intended for calling directly outside of this library!
core\task\task_base | $task |
cron_run_scheduled_tasks | ( | int | $timenow | ) |
Execute all queued scheduled tasks, applying necessary concurrency limits and time limits.
int | $timenow | The time this process started. |
moodle_exception |
cron_run_single_task | ( | \core\task\scheduled_task | $task | ) |
Runs a single cron task.
This function assumes it is displaying output in pseudo-CLI mode.
The function will fail if the task is disabled.
Warning: Because this function closes the browser session, it may not be safe to continue with other processing (other than displaying the rest of the page) after using this function!
core\task\scheduled_task | $task | Task to run |
bool | True if cron run successful |
cron_setup_user | ( | $user = null , |
|
$course = null , |
|||
$leavepagealone = false |
|||
) |
Sets up current user and course environment (lang, etc.) in cron.
Do not use outside of cron script!
stdClass | $user | full user object, null means default cron user (admin), value 'reset' means reset internal static caches. |
stdClass | $course | full course record, null means $SITE |
bool | $leavepagealone | If specified, stops it messing with global page object |
void |
cron_trace_time_and_memory | ( | ) |
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.
css_is_colour | ( | ) |
css_is_width | ( | ) |
css_minify_css | ( | ) |
css_send_cached_css | ( | $csspath, | |
$etag | |||
) |
Sends a cached CSS file.
This function sends the cached CSS file. Remember it is generated on the first request, then optimised/minified, and finally cached for serving.
string | $csspath | The path to the CSS file we want to serve. |
string | $etag | The revision to make sure we utilise any caches. |
css_send_cached_css_content | ( | $csscontent, | |
$etag | |||
) |
Sends a cached CSS content.
string | $csscontent | The actual CSS markup. |
string | $etag | The revision to make sure we utilise any caches. |
css_send_temporary_css | ( | $css | ) |
Sends CSS directly and disables all caching.
The Content-Length of the body is also included, but the script is not ended.
string | $css | The CSS content to send |
css_send_uncached_css | ( | $css | ) |
Sends CSS directly without caching it.
This function takes a raw CSS string, optimises it if required, and then serves it. Turning both themedesignermode and CSS optimiser on at the same time is awful for performance because of the optimiser running here. However it was done so that theme designers could utilise the optimised output during development to help them optimise their CSS... not that they should write lazy CSS.
string | $css |
css_send_unmodified | ( | $lastmodified, | |
$etag | |||
) |
Send file not modified headers.
int | $lastmodified | |
string | $etag |
css_sort_by_count | ( | ) |
if (!defined( 'THEME_DESIGNER_CACHE_LIFETIME')) css_store_css | ( | theme_config | $theme, |
$csspath, | |||
$csscontent | |||
) |
Stores CSS in a file at the given path.
This function either succeeds or throws an exception.
theme_config | $theme | The theme that the CSS belongs to. |
string | $csspath | The path to store the CSS at. |
string | $csscontent | the complete CSS in one string. |
css_write_file | ( | $filename, | |
$content | |||
) |
Writes a CSS file.
string | $filename | |
string | $content |
current_theme | ( | ) |
custom_script_path | ( | ) |
Detect a custom script replacement in the data directory that will replace an existing moodle script.
string|bool | full path name if a custom script exists, false if no custom script exists |
data_submitted | ( | ) |
Determine if there is data waiting to be processed from a form.
Used on most forms in Moodle to check for data Returns the data as an object, if it's found. This object can be used in foreach loops without casting because it's cast to (array) automatically
Checks that submitted POST data exists and returns it as object.
mixed | false or object |
date_format_string | ( | $date, | |
$format, | |||
$tz = 99 |
|||
) |
Returns a formatted date ensuring it is UTF-8.
If we are running under Windows convert to Windows encoding and then back to UTF-8 (because it's impossible to specify UTF-8 to fetch locale info in Win32).
int | $date | the timestamp - since Moodle 2.9 this is a real UTC timestamp |
string | $format | strftime format. |
int | float | string | $tz | the user timezone |
string | the formatted date/time. |
db_replace | ( | $search, | |
$replace | |||
) |
Moved from admin/replace.php so that we can use this in cron.
string | $search | string to look for |
string | $replace | string to replace |
bool | success or fail |
db_should_replace | ( | $table, | |
$column = '' |
|||
) |
Given a table and optionally a column name should replaces be done?
string | $table | name |
string | $column | name |
bool | success or fail |
debugging | ( | $message = '' , |
|
$level = DEBUG_NORMAL , |
|||
$backtrace = null |
|||
) |
Standard Debugging Function.
Returns true if the current site debugging settings are equal or above specified level. If passed a parameter it will emit a debugging notice similar to trigger_error(). The routing of notices is controlled by $CFG->debugdisplay eg use like this:
1) debugging('a normal debug notice'); 2) debugging('something really picky', DEBUG_ALL); 3) debugging('annoying debug message only for developers', DEBUG_DEVELOPER); 4) if (debugging()) { perform extra debugging operations (do not use print or echo) }
In code blocks controlled by debugging() (such as example 4) any output should be routed via debugging() itself, or the lower-level trigger_error() or error_log(). Using echo or print will break XHTML JS and HTTP headers.
It is also possible to define NO_DEBUG_DISPLAY which redirects the message to error_log.
string | $message | a message to print |
int | $level | the level at which this debugging statement should show |
array | $backtrace | use different backtrace |
bool |
decompose_update_into_safe_changes | ( | array | $newvalues, |
$unusedvalue | |||
) |
Helper used by update_field_with_unique_index().
Given a desired set of changes, break them down into single udpates that can be done one at a time without breaking any unique index constraints.
Suppose the input is array(1 => 2, 2 => 1) and -1. Then the output will be array (array(1, -1), array(2, 1), array(-1, 2)). This function solves this problem in the general case, not just for simple swaps. The unit tests give more examples.
Note that, it is the responsibility of the caller to make sure that the requested rename is legal. For example, if you ask for something impossible like array(1 => 2, 2 => 2) then the results are undefined. (You will probably get a unique key violation error from the database later.)
array | $newvalues | The desired re-ordering. E.g. array(1 => 4, 2 => 1, 3 => 3, 4 => 2). |
int | $unusedvalue | A value that is not currently used. |
array | A safe way to perform the re-order. An array of two-element arrays array($from, $to). E.g. array(array(1, -1), array(2, 1), array(4, 2), array(-1, 4)). |
dedupe_user_access | ( | ) |
default_error_handler | ( | $errno, | |
$errstr, | |||
$errfile, | |||
$errline, | |||
$errcontext | |||
) |
Default error handler, prevents some white screens.
int | $errno | |
string | $errstr | |
string | $errfile | |
int | $errline | |
array | $errcontext |
bool | false means use default error handler |
default_exception_handler | ( | $ex | ) |
Default exception handler.
Exception | $ex |
void | -does not return. Terminates execution! |
default_page_type_list | ( | $pagetype, | |
$parentcontext = null , |
|||
$currentcontext = null |
|||
) |
Generates a default page type list when a more appropriate callback cannot be decided upon.
string | $pagetype | |
stdClass | $parentcontext | |
stdClass | $currentcontext |
array |
delete_context | ( | ) |
delete_course | ( | $courseorid, | |
$showfeedback = true |
|||
) |
Delete a course, including all related data from the database, and any associated files.
mixed | $courseorid | The id of the course or course object to delete. |
bool | $showfeedback | Whether to display notifications of each action the function performs. |
bool | true if all the removals succeeded. false if there were any failures. If this method returns false, some of the removals will probably have succeeded, and others failed, but you have no way of knowing which. |
delete_course_module | ( | ) |
delete_event | ( | ) |
delete_user | ( | stdClass | $user | ) |
Marks user deleted in internal user database and notifies the auth plugin.
Also unenrols user from all roles and does other cleanup.
Any plugin that needs to purge user data should register the 'user_deleted' event.
stdClass | $user | full user object before delete |
boolean | success |
coding_exception | if invalid $user parameter detected |
delete_user_key | ( | $script, | |
$userid | |||
) |
Delete the user's new private user access keys for a particular script.
string | $script | unique target identifier |
int | $userid |
void |
detect_munged_arguments | ( | ) |
display_auth_lock_options | ( | $settings, | |
$auth, | |||
$userfields, | |||
$helptext, | |||
$mapremotefields, | |||
$updateremotefields, | |||
$customfields = array() |
|||
) |
Helper function used to print locking for auth plugins on admin pages.
stdclass | $settings | Moodle admin settings instance |
string | $auth | authentication plugin shortname |
array | $userfields | user profile fields |
string | $helptext | help text to be displayed at top of form |
boolean | $mapremotefields | Map fields or lock only. |
boolean | $updateremotefields | Allow remote updates |
array | $customfields | list of custom profile fields |
|
static |
Converts bytes into display form.
string $gb Localized string for size in gigabytes string $mb Localized string for size in megabytes string $kb Localized string for size in kilobytes string $b Localized string for size in bytes
int | $size | The size to convert to human readable form |
string |
dndupload_add_to_course | ( | $course, | |
$modnames | |||
) |
Add the Javascript to enable drag and drop upload to a course page.
object | $course | The currently displayed course |
array | $modnames | The list of enabled (visible) modules on this site |
void |
download_as_dataformat | ( | $filename, | |
$dataformat, | |||
$columns, | |||
$iterator, | |||
$callback = null |
|||
) |
Sends a formated data file to the browser.
@subpackage dataformat
string | $filename | The base filename without an extension |
string | $dataformat | A dataformat name |
array | $columns | An ordered map of column keys and labels |
Iterator | $iterator | An iterator over the records, usually a RecordSet |
function | $callback | An option function applied to each record before writing |
mixed | $extra | An optional value which is passed into the callback function |
draw_rand_array | ( | $array, | |
$draws | |||
) |
Given an arbitrary array, and a number of draws, this function returns an array with that amount of items.
The indexes are retained.
array | $array | |
int | $draws |
array |
drop_plugin_tables | ( | $name, | |
$file, | |||
$feedback = true |
|||
) |
Delete all plugin tables.
string | $name | Name of plugin, used as table prefix |
string | $file | Path to install.xml file |
bool | $feedback | defaults to true |
bool | Always returns true |
dst_changes_for_year | ( | ) |
during_initial_install | ( | ) |
Indicates whether we are in the middle of the initial Moodle install.
Very occasionally it is necessary avoid running certain bits of code before the Moodle installation has completed. The installed flag is set in admin/index.php after Moodle core and all the plugins have been installed, but just before the person doing the initial install is asked to choose the admin password.
boolean | true if the initial install is not complete. |
editors_get_available | ( | ) |
Get the list of available editors.
array | Array ('editorname'=>'localised editor name') |
editors_get_enabled | ( | ) |
Returns list of enabled text editors.
array | of name=>texteditor |
editors_get_preferred_editor | ( | $format = NULL | ) |
Returns users preferred editor for given format.
int | $format | text format or null of none |
texteditor | object |
editors_get_preferred_format | ( | ) |
Returns users preferred text format.
int | standard text format |
editors_head_setup | ( | ) |
Setup all JS and CSS needed for editors.
void |
email_is_not_allowed | ( | ) |
Check that an email is allowed.
It returns an error message if there was a problem.
string | Content of email |
string|false |
email_should_be_diverted | ( | ) |
A helper function to test for email diversion.
string |
bool | Returns true if the email should be diverted |
email_to_user | ( | $user, | |
$from, | |||
$subject, | |||
$messagetext, | |||
$messagehtml = '' , |
|||
$attachment = '' , |
|||
$attachname = '' , |
|||
$usetrueaddress = true , |
|||
$replyto = '' , |
|||
$replytoname = '' , |
|||
$wordwrapwidth = 79 |
|||
) |
Send an email to a specified user.
stdClass | $user | A } object * stdClass $from A $USER object |
string | $subject | plain text subject line of the email |
string | $messagetext | plain text version of the message |
string | $messagehtml | complete html version of the message (optional) |
string | $attachment | a file on the filesystem, either relative to $CFG->dataroot or a full path to a file in one of the following directories: $CFG->cachedir, $CFG->dataroot, $CFG->dirroot, $CFG->localcachedir, $CFG->tempdir |
string | $attachname | the name of the file (extension indicates MIME) |
bool | $usetrueaddress | determines whether $from email address should be sent out. Will be overruled by user profile setting for maildisplay |
string | $replyto | Email address to reply to |
string | $replytoname | Name of reply to recipient |
int | $wordwrapwidth | custom word wrap width, default 79 |
bool | Returns true if mail was sent OK and false if there was an error. |
endecrypt | ( | $pwd, | |
$data, | |||
$case | |||
) |
Based on a class by Mukul Sabharwal [mukulsabharwal @ yahoo.com].
string | $pwd | The password to use when encrypting or decrypting |
string | $data | The data to be decrypted/encrypted |
string | $case | Either 'de' for decrypt or '' for encrypt |
string |
enrol_accessing_via_instance | ( | stdClass | $instance | ) |
Is current user accessing course via this enrolment method?
This is intended for operations that are going to affect enrol instances.
stdClass | $instance | enrol instance |
bool |
enrol_add_course_navigation | ( | navigation_node | $coursenode, |
$course | |||
) |
enrol_calculate_duration | ( | $timestart, | |
$timeend | |||
) |
Calculate duration base on start time and end time.
int | $timestart | Time start |
int | $timeend | Time end |
float|int | Calculated duration |
enrol_check_plugins | ( | $user | ) |
Check all the login enrolment information for the given user object by querying the enrolment plugins.
This function may be very slow, use only once after log-in or login-as.
stdClass | $user |
void |
enrol_cohort_can_view_cohort | ( | ) |
enrol_cohort_enrol_all_users | ( | ) |
enrol_cohort_get_cohorts | ( | ) |
enrol_cohort_search_cohorts | ( | ) |
enrol_course_delete | ( | $course, | |
$userid = null |
|||
) |
Called when course is about to be deleted.
If a user id is passed, only enrolments that the user has permission to un-enrol will be removed, otherwise all enrolments in the course will be removed.
stdClass | $course | |
int | null | $userid |
void |
enrol_course_edit_form | ( | MoodleQuickForm | $mform, |
$data, | |||
$context | |||
) |
This function adds necessary enrol plugins UI into the course edit form.
MoodleQuickForm | $mform | |
object | $data | course edit form data |
object | $context | context of existing course or parent category if course does not exist |
void |
enrol_course_edit_validation | ( | array | $data, |
$context | |||
) |
Validate course edit form data.
array | $data | raw form data |
object | $context | context of existing course or parent category if course does not exist |
array | errors array |
enrol_course_updated | ( | $inserted, | |
$course, | |||
$data | |||
) |
Update enrol instances after course edit form submission.
bool | $inserted | true means new course added, false course already existed |
object | $course | |
object | $data | form data |
void |
enrol_get_all_users_courses | ( | $userid, | |
$onlyactive = false , |
|||
$fields = null , |
|||
$sort = null |
|||
) |
Returns list of courses user is enrolled into without performing any capability checks.
The $fields param is a list of field names to ADD so name just the fields you really need, which will be added and uniq'd.
int | $userid | User whose courses are returned, defaults to the current user. |
bool | $onlyactive | Return only active enrolments in courses user may see. |
string | array | $fields | Extra fields to be returned (array or comma-separated list). |
string | null | $sort | Comma separated list of fields to sort by, defaults to respecting navsortmycoursessort. |
array |
enrol_get_course_by_user_enrolment_id | ( | $ueid | ) |
Returns the course where a user enrolment belong to.
int | $ueid | user_enrolments id |
stdClass |
enrol_get_course_description_texts | ( | $course | ) |
Returns course enrolment detailed information.
object | $course |
array | of html fragments - can be used to construct lists |
enrol_get_course_info_icons | ( | $course, | |
array | $instances = NULL |
||
) |
Returns course enrolment information icons.
object | $course | |
array | $instances | enrol instances of this course, improves performance |
array | of pix_icon |
enrol_get_course_users | ( | $courseid = false , |
|
$onlyactive = false , |
|||
$usersfilter = array() , |
|||
$uefilter = array() |
|||
) |
Return all users enrolled in a course.
int | $courseid | Course id or false if using $uefilter (user enrolment ids may belong to different courses) |
bool | $onlyactive | consider only active enrolments in enabled plugins and time restrictions |
array | $usersfilter | Limit the results obtained to this list of user ids. $uefilter compatibility not guaranteed. |
array | $uefilter | Limit the results obtained to this list of user enrolment ids. $usersfilter compatibility not guaranteed. |
stdClass[] |
enrol_get_course_users_roles | ( | int | $courseid | ) |
Returns list of roles per users into course.
int | $courseid | Course id. |
array | Array[$userid][$roleid] = role_assignment. |
enrol_get_courses_sortingsql | ( | $sort = null | ) |
Returns SQL ORDER arguments which reflect the admin settings to sort my courses.
string | null | $sort | SQL ORDER arguments which were originally requested (optionally). |
string | SQL ORDER arguments. |
enrol_get_enrolment_end | ( | $courseid, | |
$userid | |||
) |
This function returns the end of current active user enrolment.
It deals correctly with multiple overlapping user enrolments.
int | $courseid | |
int | $userid |
int|bool | timestamp when active enrolment ends, false means no active enrolment now, 0 means never |
enrol_get_instances | ( | $courseid, | |
$enabled | |||
) |
Returns enrolment instances in given course.
int | $courseid | |
bool | $enabled |
array | of enrol instances |
enrol_get_my_courses | ( | $fields = null , |
|
$sort = null , |
|||
$limit = 0 , |
|||
$courseids = [] , |
|||
$allaccessible = false , |
|||
$offset = 0 , |
|||
$excludecourses = [] |
|||
) |
Returns list of courses current $USER is enrolled in and can access.
The $fields param is a list of field names to ADD so name just the fields you really need, which will be added and uniq'd.
If $allaccessible is true, this will additionally return courses that the current user is not enrolled in, but can access because they are open to the user for other reasons (course view permission, currently viewing course as a guest, or course allows guest access without password).
string | array | $fields | Extra fields to be returned (array or comma-separated list). |
string | null | $sort | Comma separated list of fields to sort by, defaults to respecting navsortmycoursessort. Allowed prefixes for sort fields are: "ul" for the user_lastaccess table, "c" for the courses table, "ue" for the user_enrolments table. |
int | $limit | max number of courses |
array | $courseids | the list of course ids to filter by |
bool | $allaccessible | Include courses user is not enrolled in, but can access |
int | $offset | Offset the result set by this number |
array | $excludecourses | IDs of hidden courses to exclude from search |
array |
enrol_get_period_list | ( | ) |
Get the list of options for the enrolment period dropdown.
array | List of options for the enrolment period dropdown |
enrol_get_plugin | ( | $name | ) |
Returns instance of enrol plugin.
string | $name | name of enrol plugin ('manual', 'guest', ...) |
enrol_plugin |
enrol_get_plugins | ( | $enabled | ) |
Returns instances of enrol plugins.
bool | $enabled | return enabled only |
array | of enrol plugins name=>instance |
moodle_database enrol_get_shared_courses | ( | $user1, | |
$user2, | |||
$preloadcontexts = false , |
|||
$checkexistsonly = false |
|||
) |
Returns any courses shared by the two users.
The courses has to be visible and enrolments has to be active, timestart and timeend restrictions are ignored.
$DB
stdClass | int | $user1 | |
stdClass | int | $user2 | |
bool | $preloadcontexts | If set to true contexts for the returned courses will be preloaded. |
bool | $checkexistsonly | If set to true then this function will return true if the users share any courses and false if not. |
array|bool | An array of courses that both users are enrolled in OR if $checkexistsonly set returns true if the users share any courses and false if not. |
enrol_get_users_courses | ( | $userid, | |
$onlyactive = false , |
|||
$fields = null , |
|||
$sort = null |
|||
) |
Returns list of courses user is enrolled into.
Note: Use enrol_get_all_users_courses() if you need the list without any capability checks.
The $fields param is a list of field names to ADD so name just the fields you really need, which will be added and uniq'd.
int | $userid | User whose courses are returned, defaults to the current user. |
bool | $onlyactive | Return only active enrolments in courses user may see. |
string | array | $fields | Extra fields to be returned (array or comma-separated list). |
string | null | $sort | Comma separated list of fields to sort by, defaults to respecting navsortmycoursessort. |
array |
enrol_is_enabled | ( | $enrol | ) |
Checks if a given plugin is in the list of enabled enrolment plugins.
string | $enrol | Enrolment plugin name |
boolean | Whether the plugin is enabled |
enrol_output_fragment_user_enrolment_form | ( | $args | ) |
Serve the user enrolment form as a fragment.
array | $args | List of named arguments for the fragment loader. |
string |
enrol_selfenrol_available | ( | $courseid | ) |
Is there a chance users might self enrol.
int | $courseid |
bool |
enrol_send_welcome_email_options | ( | ) |
Send welcome email "from" options.
array | list of from options |
enrol_sharing_course | ( | $user1, | |
$user2 | |||
) |
Do these two students share any course?
The courses has to be visible and enrolments has to be active, timestart and timeend restrictions are ignored.
This function calls {
stdClass | int | $user1 | |
stdClass | int | $user2 |
bool |
enrol_try_internal_enrol | ( | $courseid, | |
$userid, | |||
$roleid = null , |
|||
$timestart = 0 , |
|||
$timeend = 0 |
|||
) |
Try to enrol user via default internal auth plugin.
For now this is always using the manual enrol plugin...
$courseid | |
$userid | |
$roleid | |
$timestart | |
$timeend |
bool | success |
enrol_user_delete | ( | $user | ) |
Called when user is about to be deleted.
object | $user |
void |
enrol_user_sees_own_courses | ( | $user = null | ) |
Can user access at least one enrolled course?
Cheat if necessary, but find out as fast as possible!
int | stdClass | $user | null means use current user |
bool |
object environment_check | ( | $version, | |
$env_select | |||
) |
This function will check for everything (DB, PHP and PHP extensions for now) returning an array of environment_result objects.
string | $version | xml version we are going to use to test this server |
int | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. |
environment_results[] | array of results encapsulated in one environment_result object |
environment_check_database | ( | $version, | |
$env_select | |||
) |
This function will check if database requirements are satisfied.
@uses NO_VERSION_DATA_FOUND @uses NO_DATABASE_SECTION_FOUND @uses NO_DATABASE_VENDORS_FOUND @uses NO_DATABASE_VENDOR_MYSQL_FOUND @uses NO_DATABASE_VENDOR_POSTGRES_FOUND @uses NO_DATABASE_VENDOR_VERSION_FOUND
string | $version | xml version we are going to use to test this server |
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
object | results encapsulated in one environment_result object |
environment_check_moodle | ( | $version, | |
$env_select | |||
) |
This function will check if Moodle requirements are satisfied.
@uses NO_VERSION_DATA_FOUND
string | $version | xml version we are going to use to test this server |
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
object | results encapsulated in one environment_result object |
environment_check_pcre_unicode | ( | $version, | |
$env_select | |||
) |
Looks for buggy PCRE implementation, we need unicode support in Moodle...
string | $version | xml version we are going to use to test this server |
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
stdClass | results encapsulated in one environment_result object, null if irrelevant |
environment_check_php | ( | $version, | |
$env_select | |||
) |
This function will check if php requirements are satisfied.
@uses NO_VERSION_DATA_FOUND @uses NO_PHP_SECTION_FOUND @uses NO_PHP_VERSION_FOUND
string | $version | xml version we are going to use to test this server |
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
object | results encapsulated in one environment_result object |
environment_check_php_extensions | ( | $version, | |
$env_select | |||
) |
This function will check if php extensions requirements are satisfied.
@uses NO_VERSION_DATA_FOUND @uses NO_PHP_EXTENSIONS_SECTION_FOUND @uses NO_PHP_EXTENSIONS_NAME_FOUND
string | $version | xml version we are going to use to test this server |
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
array | array of results encapsulated in one environment_result object |
environment_check_php_settings | ( | $version, | |
$env_select | |||
) |
This function will check if php extensions requirements are satisfied.
@uses NO_VERSION_DATA_FOUND @uses NO_PHP_SETTINGS_NAME_FOUND
string | $version | xml version we are going to use to test this server |
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
array | array of results encapsulated in one environment_result object |
environment_check_unicode | ( | $version, | |
$env_select | |||
) |
This function will check if unicode database requirements are satisfied.
@uses NO_VERSION_DATA_FOUND @uses NO_UNICODE_SECTION_FOUND
string | $version | xml version we are going to use to test this server |
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
object | results encapsulated in one environment_result object |
environment_custom_checks | ( | $version, | |
$env_select | |||
) |
This function will do the custom checks.
@uses CUSTOM_CHECK_FUNCTION_MISSING @uses CUSTOM_CHECK_FILE_MISSING @uses NO_CUSTOM_CHECK_FOUND
string | $version | xml version we are going to use to test this server. |
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
array | array of results encapsulated in environment_result objects. |
environment_get_errors | ( | $environment_results | ) |
Returns array of critical errors in plain text format.
array | $environment_results | array of results gathered |
array | errors |
environment_verify_plugin | ( | $plugin, | |
$pluginxml | |||
) |
Checks if a plugin tag has a name attribute and it matches the plugin being tested.
string | $plugin | the name of the plugin. |
array | $pluginxml | the xmlised structure for the plugin tag being tested. |
boolean | true if the name attribute exists and matches the plugin being tested. |
error | ( | ) |
|
protected |
Deletes cached events that are no longer needed by the component.
To be used from eventslib only
string | $component | examples: 'moodle', 'mod_forum', 'block_quiz_results' |
array | $cachedhandlers | array of the cached events definitions that will be |
int | number of unused handlers that have been removed |
events_cron | ( | ) |
|
protected |
Removes this queued handler from the events_queued_handler table.
Removes events_queue record from events_queue if no more references to this event object exists
To be used from eventslib only
stdClass | $qhandler | A row from the events_queued_handler table |
events_dispatch | ( | ) |
|
protected |
Gets the capabilities that have been cached in the database for this component.
To be used from eventslib only
string | $component | examples: 'moodle', 'mod_forum', 'block_quiz_results' |
array | of events |
|
protected |
Returns handlers for given event.
Uses caching for better perf.
To be used from eventslib only
@staticvar array $handlers
string | $eventname | name of event or 'reset' |
array|false | array of handlers or false otherwise |
events_is_registered | ( | ) |
events_load_def | ( | ) |
events_pending_count | ( | ) |
events_process_queued_handler | ( | ) |
events_queue_handler | ( | ) |
events_trigger | ( | ) |
events_trigger_legacy | ( | ) |
events_update_definition | ( | ) |
exists_auth_plugin | ( | $auth | ) |
Returns whether a given authentication plugin exists.
string | $auth | Form of authentication to check for. Defaults to the global setting in $CFG. |
boolean | Whether the plugin is available. |
external_function_info | ( | ) |
extract_draft_file_urls_from_text | ( | $text, | |
$forcehttps = false , |
|||
$contextid = null , |
|||
$component = null , |
|||
$filearea = null , |
|||
$itemid = null , |
|||
$filename = null |
|||
) |
Factory method for extracting draft file links from arbitrary text using regular expressions.
Only text is required; other file fields may be passed to filter.
string | $text | Some html content. |
bool | $forcehttps | force https urls. |
int | $contextid | This parameter and the next three identify the file area to save to. |
string | $component | The component name. |
string | $filearea | The filearea. |
int | $itemid | The item id for the filearea. |
string | $filename | The specific filename of the file. |
array |
fetch_context_capabilities | ( | ) |
|
abstract |
Override this function to actually implement the filtering.
string | $text | some HTML content to process. |
array | $options | options passed to the filters |
string | the HTML content after the filtering has been applied. |
Reimplemented in filter_urltolink, filter_tidy, filter_tex, filter_multilang, filter_mediaplugin, filter_mathjaxloader, filter_glossary, filter_emoticon, filter_emailprotect, filter_displayh5p, filter_data, filter_censor, filter_algebra, and filter_activitynames.
filter_add_javascript | ( | $text | ) |
Add missing openpopup javascript to HTML files.
string | $text |
string |
filter_context_may_have_filter_settings | ( | $context | ) |
Certain types of context (block and user) may not have local filter settings.
the function checks a context to see whether it may have local config.
object | $context | a context. |
boolean | whether this context may have local filter settings. |
filter_delete_all_for_context | ( | $contextid | ) |
Delete all the data in the database relating to a context, used when contexts are deleted.
integer | $contextid | The id of the context being deleted. |
filter_delete_all_for_filter | ( | $filter | ) |
Delete all the data in the database relating to a filter, prior to deleting it.
string | $filter | The filter name, for example 'tex'. |
filter_get_active_in_context | ( | $context | ) |
Get the list of active filters, in the order that they should be used for a particular context, along with any local configuration variables.
context | $context | a context |
array | an array where the keys are the filter names, for example 'tex' and the values are any local configuration for that filter, as an array of name => value pairs from the filter_config table. In a lot of cases, this will be an empty array. So, an example return value for this function might be array(tex' => array()) |
filter_get_all_installed | ( | ) |
Get the names of all the filters installed in this Moodle.
array | path => filter name from the appropriate lang file. e.g. array('tex' => 'TeX Notation'); sorted in alphabetical order of name. |
filter_get_all_local_settings | ( | $contextid | ) |
This function is for use by backup.
Gets all the filter information specific to one context.
int | $contextid |
array | Array with two elements. The first element is an array of objects with fields filter and active. These come from the filter_active table. The second element is an array of objects with fields filter, name and value from the filter_config table. |
filter_get_available_in_context | ( | $context | ) |
List all of the filters that are available in this context, and what the local and inherited states of that filter are.
context | $context | a context that is not the system context. |
array | an array with filter names, for example 'tex' as keys. and and the values are objects with fields: ->filter filter name, same as the key. ->localstate TEXTFILTER_ON/OFF/INHERIT ->inheritedstate TEXTFILTER_ON/OFF - the state that will be used if localstate is set to TEXTFILTER_INHERIT. |
filter_get_global_states | ( | ) |
This function is for use by the filter administration page.
array | 'filtername' => object with fields 'filter' (=filtername), 'active' and 'sortorder' |
filter_get_globally_enabled | ( | ) |
Return a list of all the filters that may be in use somewhere.
array | where the keys and values are both the filter name, like 'tex'. |
filter_get_globally_enabled_filters_with_config | ( | ) |
Get the globally enabled filters.
This returns the filters which could be used in any context. Essentially the filters which are not disabled for the entire site.
array | Keys are filter names, and values the config. |
filter_get_local_config | ( | $filter, | |
$contextid | |||
) |
Get local config variables for a filter in a context.
Normally (when your filter is running) you don't need to call this, becuase the config is fetched for you automatically. You only need this, for example, when you are getting the config so you can show the user an editing from.
string | $filter | The filter name, for example 'tex'. |
integer | $contextid | The ID of the context to get the local config for. |
array | of name => value pairs. |
filter_get_name | ( | $filter | ) |
Look up the name of this filter.
string | $filter | the filter name |
string | the human-readable name for this filter. |
filter_get_string_filters | ( | ) |
Return the names of the filters that should also be applied to strings (when they are enabled).
array | where the keys and values are both the filter name, like 'tex'. |
filter_has_global_settings | ( | $filter | ) |
Does this filter have a global settings page in the admin tree? (The settings page for a filter must be called, for example, filtersettingfiltertex.)
string | $filter | The filter name, for example 'tex'. |
boolean | Whether there should be a 'Settings' link on the config page. |
filter_has_local_settings | ( | $filter | ) |
Does this filter have local (per-context) settings?
string | $filter | The filter name, for example 'tex'. |
boolean | Whether there should be a 'Settings' link on the manage filters in context page. |
filter_is_enabled | ( | $filtername | ) |
string | $filtername | The filter name, for example 'tex'. |
boolean | is this filter allowed to be used on this site. That is, the admin has set the global 'active' setting to On, or Off, but available. |
filter_phrases | ( | $text, | |
$linkarray, | |||
$ignoretagsopen = null , |
|||
$ignoretagsclose = null , |
|||
$overridedefaultignore = false , |
|||
$linkarrayalreadyprepared = false |
|||
) |
Process phrases intelligently found within a HTML text (such as adding links).
string | $text | the text that we are filtering |
filterobject[] | $linkarray | an array of filterobjects |
array | $ignoretagsopen | an array of opening tags that we should ignore while filtering |
array | $ignoretagsclose | an array of corresponding closing tags |
bool | $overridedefaultignore | True to only use tags provided by arguments |
bool | $linkarrayalreadyprepared | True to say that filter_prepare_phrases_for_filtering has already been called for $linkarray. Default false. |
string |
filter_preload_activities | ( | course_modinfo | $modinfo | ) |
Preloads the list of active filters for all activities (modules) on the course using two database queries.
course_modinfo | $modinfo | Course object from get_fast_modinfo |
filter_prepare_phrase_for_replacement | ( | filterobject | $linkobject | ) |
Fill in the remaining ->work...
fields, that would be needed to replace the phrase.
filterobject | $linkobject | the link object on which to set additional fields. |
filter_prepare_phrases_for_filtering | ( | array | $linkarray | ) |
Prepare a list of link for processing with filter_phrases().
filterobject[] | $linkarray | the links that will be passed to filter_phrases(). |
filterobject[] | the updated list of links with necessary pre-processing done. |
filter_remove_duplicates | ( | $linkarray | ) |
Remove duplicate from a list of filterobject.
filterobject[] | $linkarray | a list of filterobject. |
filterobject[] | the same list, but with dupicates removed. |
filter_save_ignore_tags | ( | & | $text, |
$filterignoretagsopen, | |||
$filterignoretagsclose, | |||
& | $ignoretags | ||
) |
Extract open/lose tags and their contents to avoid being processed by filters.
Useful to extract pieces of code like ... tags. It returns the text converted with some <#xTEXTFILTER_EXCL_SEPARATORx#> codes replacing the extracted text. Such extracted texts are returned in the ignoretags array (as values), with codes as keys.
string | $text | the text that we are filtering (in/out) |
array | $filterignoretagsopen | an array of open tags to start searching |
array | $filterignoretagsclose | an array of close tags to end searching |
array | $ignoretags | an array of saved strings useful to rebuild the original text (in/out) |
filter_save_tags | ( | & | $text, |
& | $tags | ||
) |
Extract tags (any text enclosed by < and > to avoid being processed by filters.
It returns the text converted with some <xTEXTFILTER_EXCL_SEPARATORx%> codes replacing the extracted text. Such extracted texts are returned in the tags array (as values), with codes as keys.
string | $text | the text that we are filtering (in/out) |
array | $tags | an array of saved strings useful to rebuild the original text (in/out) |
filter_set_applies_to_strings | ( | $filter, | |
$applytostrings | |||
) |
Sets whether a particular active filter should be applied to all strings by format_string, or just used by format_text.
string | $filter | The filter name, for example 'tex'. |
boolean | $applytostrings | if true, this filter will apply to format_string and format_text, when it is enabled. |
filter_set_global_state | ( | $filtername, | |
$state, | |||
$move = 0 |
|||
) |
Set the global activated state for a text filter.
string | $filtername | The filter name, for example 'tex'. |
int | $state | One of the values TEXTFILTER_ON, TEXTFILTER_OFF or TEXTFILTER_DISABLED. |
int | $move | -1 means up, 0 means the same, 1 means down |
filter_set_local_config | ( | $filter, | |
$contextid, | |||
$name, | |||
$value | |||
) |
Set a particular local config variable for a filter in a context.
string | $filter | The filter name, for example 'tex'. |
integer | $contextid | The id of the context to get the local config for. |
string | $name | the setting name. |
string | $value | the corresponding value. |
filter_set_local_state | ( | $filter, | |
$contextid, | |||
$state | |||
) |
Set the local activated state for a text filter.
string | $filter | The filter name, for example 'tex'. |
integer | $contextid | The id of the context to get the local config for. |
integer | $state | One of the values TEXTFILTER_ON, TEXTFILTER_OFF or TEXTFILTER_INHERIT. |
void |
filter_manager::filter_string | ( | $string, | |
$context | |||
) |
Filter a piece of string.
string | $string | The text to filter |
context | $context | the context. |
string | resulting string |
Reimplemented in performance_measuring_filter_manager.
null_filter_manager::filter_string | ( | $string, | |
$context | |||
) |
As for the equivalent filter_manager method.
string | $string | The text to filter |
context | $context | not used. |
string | resulting string |
performance_measuring_filter_manager::filter_string | ( | $string, | |
$context | |||
) |
Filter a piece of string.
string | $string | The text to filter |
context | $context | the context. |
string | resulting string |
Reimplemented from filter_manager.
filter_manager::filter_text | ( | $text, | |
$context, | |||
array | $options = array() , |
||
array | $skipfilters = null |
||
) |
Filter some text.
string | $text | The text to filter |
context | $context | the context. |
array | $options | options passed to the filters |
array | $skipfilters | of filter names. Any filters that should not be applied to this text. |
string | resulting text |
Reimplemented in performance_measuring_filter_manager.
null_filter_manager::filter_text | ( | $text, | |
$context, | |||
array | $options = array() , |
||
array | $skipfilters = null |
||
) |
As for the equivalent filter_manager method.
string | $text | The text to filter |
context | $context | not used. |
array | $options | not used |
array | $skipfilters | not used |
string | resulting text. |
performance_measuring_filter_manager::filter_text | ( | $text, | |
$context, | |||
array | $options = array() , |
||
array | $skipfilters = null |
||
) |
Filter some text.
string | $text | The text to filter |
context | $context | the context. |
array | $options | options passed to the filters |
array | $skipfilters | of filter names. Any filters that should not be applied to this text. |
string | resulting text |
Reimplemented from filter_manager.
filter_text | ( | ) |
filter_unset_local_config | ( | $filter, | |
$contextid, | |||
$name | |||
) |
Remove a particular local config variable for a filter in a context.
string | $filter | The filter name, for example 'tex'. |
integer | $contextid | The id of the context to get the local config for. |
string | $name | the setting name. |
fix_align_rtl | ( | $align | ) |
Returns swapped left<=> right if in RTL environment.
Part of RTL Moodles support.
string | $align | align to check |
string |
object fix_course_sortorder | ( | ) |
Fixes course category and course sortorder, also verifies category and course parents and paths.
(circular references are not fixed)
@global object @uses MAX_COURSES_IN_CATEGORY @uses MAX_COURSE_CATEGORIES @uses SITEID @uses CONTEXT_COURSE
void |
fix_utf8 | ( | $value | ) |
Makes sure the data is using valid utf8, invalid characters are discarded.
Note: this function is not intended for full objects with methods and private properties.
mixed | $value |
mixed | with proper utf-8 encoding |
force_current_language | ( | $language | ) |
Force the current language to get strings and dates localised in the given language.
After calling this function, all strings will be provided in the given language until this function is called again, or equivalent code is run.
string | $language |
string | previous $SESSION->forcelang value |
format_admin_setting | ( | $setting, | |
$title = '' , |
|||
$form = '' , |
|||
$description = '' , |
|||
$label = true , |
|||
$warning = '' , |
|||
$defaultinfo = NULL , |
|||
$query = '' |
|||
) |
Format admin settings.
object | $setting | |
string | $title | label element |
string | $form | form fragment, html code - not highlighted automatically |
string | $description | |
mixed | $label | link label to id, true by default or string being the label to connect it to |
string | $warning | warning text |
sting | $defaultinfo | defaults info, null means nothing, '' is converted to "Empty" string, defaults to null |
string | $query | search query to be highlighted |
string | XHTML |
format_backtrace | ( | $callers, | |
$plaintext = false |
|||
) |
Formats a backtrace ready for output.
This function does not include function arguments because they could contain sensitive information not suitable to be exposed in a response.
array | $callers | backtrace array, as returned by debug_backtrace(). |
boolean | $plaintext | if false, generates HTML, if true generates plain text. |
string | formatted backtrace, ready for output. |
format_float | ( | $float, | |
$decimalpoints = 1 , |
|||
$localized = true , |
|||
$stripzeros = false |
|||
) |
Given a float, prints it nicely.
Localized floats must not be used in calculations!
The stripzeros feature is intended for making numbers look nicer in small areas where it is not necessary to indicate the degree of accuracy by showing ending zeros. If you turn it on with $decimalpoints set to 3, for example, then it will display '5.4' instead of '5.400' or '5' instead of '5.000'.
float | $float | The float to print |
int | $decimalpoints | The number of decimal places to print. -1 is a special value for auto detect (full precision). |
bool | $localized | use localized decimal separator |
bool | $stripzeros | If true, removes final zeros after decimal point. It will be ignored and the trailing zeros after the decimal point are always striped if $decimalpoints is -1. |
string | locale float |
format_module_intro | ( | $module, | |
$activity, | |||
$cmid, | |||
$filter = true |
|||
) |
Formats activity intro text.
string | $module | name of module |
object | $activity | instance of activity |
int | $cmid | course module id |
bool | $filter | filter resulting html text |
string |
format_string | ( | $string, | |
$striplinks = true , |
|||
$options = null |
|||
) |
Given a simple string, this function returns the string processed by enabled string filters if $CFG->filterall is enabled.
This function should be used to print short strings (non html) that need filter processing e.g. activity titles, post subjects, glossary concepts.
@staticvar bool $strcache
string | $string | The string to be filtered. Should be plain text, expect possibly for multilang tags. |
boolean | $striplinks | To strip any link in the result text. Moodle 1.8 default changed from false to true! MDL-8713 |
array | $options | options array/object or courseid |
string |
format_text | ( | $text, | |
$format = FORMAT_MOODLE , |
|||
$options = null , |
|||
$courseiddonotuse = null |
|||
) |
Given text in a variety of format codings, this function returns the text as safe HTML.
This function should mainly be used for long strings like posts, answers, glossary items etc. For short strings format_string().
Options: trusted : If true the string won't be cleaned. Default false required noclean=true. noclean : If true the string won't be cleaned, unless $CFG->forceclean is set. Default false required trusted=true. nocache : If true the strign will not be cached and will be formatted every call. Default false. filter : If true the string will be run through applicable filters as well. Default true. para : If true then the returned string will be wrapped in div tags. Default true. newlines : If true then lines newline breaks will be converted to HTML newline breaks. Default true. context : The context that will be used for filtering. overflowdiv : If set to true the formatted text will be encased in a div with the class no-overflow before being returned. Default false. allowid : If true then id attributes will not be removed, even when using htmlpurifier. Default false. blanktarget : If true all tags will have target="_blank" added unless target is explicitly specified.
@staticvar array $croncache
string | $text | The text to be formatted. This is raw text originally from user input. |
int | $format | Identifier of the text format to be used [FORMAT_MOODLE, FORMAT_HTML, FORMAT_PLAIN, FORMAT_MARKDOWN] |
object/array | $options text formatting options | |
int | $courseiddonotuse | deprecated course id, use context option instead |
string |
format_text_email | ( | $text, | |
$format | |||
) |
Given text in a variety of format codings, this function returns the text as plain text suitable for plain email.
string | $text | The text to be formatted. This is raw text originally from user input. |
int | $format | Identifier of the text format to be used [FORMAT_MOODLE, FORMAT_HTML, FORMAT_PLAIN, FORMAT_WIKI, FORMAT_MARKDOWN] |
string |
format_text_menu | ( | ) |
Just returns an array of text formats suitable for a popup menu.
array |
format_weeks_get_section_dates | ( | ) |
formerr | ( | ) |
fullclone | ( | $thing | ) |
This function will make a complete copy of anything it's given, regardless of whether it's an object or not.
mixed | $thing | Something you want cloned |
mixed | What ever it is you passed it |
fullname | ( | $user, | |
$override = false |
|||
) |
Returns a persons full name.
Given an object containing all of the users name values, this function returns a string with the full name of the person. The result may depend on system settings or language. 'override' will force the alternativefullnameformat to be used. In English, fullname as well as alternativefullnameformat is set to 'firstname lastname' by default. But you could have fullname set to 'firstname lastname' and alternativefullnameformat set to 'firstname middlename alternatename lastname'.
stdClass | $user | A $USER object to get full name of. |
bool | $override | If true then the alternativefullnameformat format rather than fullnamedisplay format will be used. |
string |
gc_cache_flags | ( | ) |
Garbage-collect volatile flags.
bool | Always returns true |
generate_email_messageid | ( | $localpart = null | ) |
Generate a unique email Message-ID using the moodle domain and install path.
string | $localpart | An optional unique message id prefix. |
string | The formatted ID ready for appending to the email headers. |
generate_email_processing_address | ( | $modid, | |
$modargs | |||
) |
Generate an email processing address.
int | $modid | |
string | $modargs |
string | Returns email processing address |
generate_email_signoff | ( | ) |
Generate a signoff for emails based on support settings.
string |
generate_email_supportuser | ( | ) |
generate_image_thumbnail | ( | $filepath, | |
$width, | |||
$height | |||
) |
Generates a thumbnail for the given image.
If the GD library has at least version 2 and PNG support is available, the returned data is the content of a transparent PNG file containing the thumbnail. Otherwise, the function returns contents of a JPEG file with black background containing the thumbnail.
string | $filepath | the full path to the original image file |
int | $width | the width of the requested thumbnail |
int | $height | the height of the requested thumbnail |
string|bool | false if a problem occurs, the thumbnail image data otherwise |
generate_image_thumbnail_from_image | ( | $original, | |
$imageinfo, | |||
$width, | |||
$height | |||
) |
Generates a thumbnail for the given image string.
If the GD library has at least version 2 and PNG support is available, the returned data is the content of a transparent PNG file containing the thumbnail. Otherwise, the function returns contents of a JPEG file with black background containing the thumbnail.
resource | $original | The image to work on. |
array | $imageinfo | Contains [0] => originalwidth, [1] => originalheight. |
int | $width | The width of the requested thumbnail. |
int | $height | The height of the requested thumbnail. |
string|bool | False if a problem occurs, the thumbnail image data otherwise. |
generate_image_thumbnail_from_string | ( | $filedata, | |
$width, | |||
$height | |||
) |
Generates a thumbnail for the given image string.
If the GD library has at least version 2 and PNG support is available, the returned data is the content of a transparent PNG file containing the thumbnail. Otherwise, the function returns contents of a JPEG file with black background containing the thumbnail.
string | $filedata | The image content as a string |
int | $width | the width of the requested thumbnail |
int | $height | the height of the requested thumbnail |
string|bool | false if a problem occurs, the thumbnail image data otherwise |
generate_page_type_patterns | ( | $pagetype, | |
$parentcontext = null , |
|||
$currentcontext = null |
|||
) |
Given a specific page type, parent context and currect context, return all the page type patterns that might be used by this block.
string | $pagetype | for example 'course-view-weeks' or 'mod-quiz-view'. |
stdClass | $parentcontext | Block's parent context |
stdClass | $currentcontext | Current context of block |
array | an array of all the page type patterns that might match this page type. |
generate_password | ( | $maxlen = 10 | ) |
Returns a randomly generated password of length $maxlen.
inspired by
* @javalink http://es2.php.net/manual/en/function.str-shuffle.php#73254
int | $maxlen | The maximum size of the password being generated. |
string |
generate_uuid | ( | ) |
Generate a V4 UUID.
Unique is hard. Very hard. Attempt to use the PECL UUID function if available, and if not then revert to constructing the uuid using mt_rand.
It is important that this token is not solely based on time as this could lead to duplicates in a clustered environment (especially on VMs due to poor time precision).
string | The uuid. |
get_accesshide | ( | $text, | |
$elem = 'span' , |
|||
$class = '' , |
|||
$attrs = '' |
|||
) |
Return a HTML element with the class "accesshide", for accessibility.
Please use cautiously - where possible, text should be visible!
string | $text | Plain text. |
string | $elem | Lowercase element name, default "span". |
string | $class | Additional classes for the element. |
string | $attrs | Additional attributes string in the form, "name='value' name2='value2'" |
string | HTML string. |
Number of seconds to wait before updating lastaccess information in DB.
We allow overwrites from config.php, useful to ensure coherence in performance tests results.
Note: For web service requests in the external_tokens field, we use a different constant webservice::TOKEN_LASTACCESS_UPDATE_SECS. Returns $user object of the main admin user
stdClass $mainadmin
stdClass | $USER record from DB, false if not found |
get_admins | ( | ) |
Returns list of all admins, using 1 DB query.
array |
get_all_instances_in_course | ( | $modulename, | |
$course, | |||
$userid = NULL , |
|||
$includeinvisible = false |
|||
) |
Returns an array of all the active instances of a particular module in a given course, sorted in the order they are defined.
Returns an array of all the active instances of a particular module in a given course, sorted in the order they are defined in the course. Returns an empty array on any errors.
The returned objects includle the columns cw.section, cm.visible, cm.groupmode, and cm.groupingid, and are indexed by cm.id.
Simply calls all_instances_in_courses() with a single provided course
string | $modulename | The name of the module to get instances for |
object | $course | The course obect. |
array | of module instance objects, including some extra fields from the course_modules and course_sections tables, or an empty array if an error occurred. |
int | $userid | |
int | $includeinvisible |
object get_all_instances_in_courses | ( | $modulename, | |
$courses, | |||
$userid = NULL , |
|||
$includeinvisible = false |
|||
) |
Returns an array of all the active instances of a particular module in given courses, sorted in the order they are defined.
Returns an array of all the active instances of a particular module in given courses, sorted in the order they are defined in the course. Returns an empty array on any errors.
The returned objects includle the columns cw.section, cm.visible, cm.groupmode, and cm.groupingid, and are indexed by cm.id.
@global object
string | $modulename | The name of the module to get instances for |
array | $courses | an array of course objects. |
int | $userid | |
int | $includeinvisible |
array | of module instance objects, including some extra fields from the course_modules and course_sections tables, or an empty array if an error occurred. |
get_all_mods | ( | ) |
get_all_sections | ( | ) |
get_all_subcategories | ( | ) |
get_all_user_name_fields | ( | $returnsql = false , |
|
$tableprefix = null , |
|||
$prefix = null , |
|||
$fieldprefix = null , |
|||
$order = false |
|||
) |
A centralised location for the all name fields.
Returns an array / sql string snippet.
bool | $returnsql | True for an sql select field snippet. |
string | $tableprefix | table query prefix to use in front of each field. |
string | $prefix | prefix added to the name fields e.g. authorfirstname. |
string | $fieldprefix | sql field prefix e.g. id AS userid. |
bool | $order | moves firstname and lastname to the top of the array / start of the string. |
array|string | All name fields. |
|
static |
Returns hash of all versions including core and all plugins.
This is relatively slow and not fully cached, use with care!
array | as (string)plugintype_pluginname => (int)version |
|
static |
Returns hash of all versions including core and all plugins.
This is relatively slow and not fully cached, use with care!
string | sha1 hash |
get_auth_plugin | ( | $auth | ) |
Returns an authentication plugin instance.
string | $auth | name of authentication plugin |
auth_plugin_base | An instance of the required authentication plugin. |
get_backpack_settings | ( | $userid, | |
$refresh = false |
|||
) |
Returns external backpack settings and badges from this backpack.
This function first checks if badges for the user are cached and tries to retrieve them from the cache. Otherwise, badges are obtained through curl request to the backpack.
int | $userid | Backpack user ID. |
boolean | $refresh | Refresh badges collection in cache. |
null|object | Returns null is there is no backpack or object with backpack settings. |
get_backup_temp_directory | ( | $directory | ) |
Get the full path of a directory under $CFG->backuptempdir.
string | $directory | the relative path of the directory under $CFG->backuptempdir |
string|false | Returns full path to directory given a valid string; otherwise, false. |
get_browser_version_classes | ( | ) |
get_cache_flag | ( | $type, | |
$name, | |||
$changedsince = null |
|||
) |
Get volatile flags.
string | $type | |
string | $name | |
int | $changedsince | default null |
string|false | The cache flag value or false |
get_cache_flags | ( | $type, | |
$changedsince = null |
|||
) |
Get volatile flags.
string | $type | |
int | $changedsince | default null |
array | records array |
get_callable_name | ( | $callable | ) |
Get human readable name describing the given callable.
This performs syntax check only to see if the given param looks like a valid function, method or closure. It does not check if the callable actually exists.
callable | string | array | $callable |
string|bool | Human readable name of callable, or false if not a valid callable. |
get_categories | ( | ) |
get_category_courses_array | ( | ) |
get_category_courses_array_recursively | ( | ) |
get_child_categories | ( | ) |
get_child_contexts | ( | ) |
get_clam_error_code | ( | ) |
get_complete_user_data | ( | $field, | |
$value, | |||
$mnethostid = null , |
|||
$throwexception = false |
|||
) |
Get a complete user record, which includes all the info in the user record.
Intended for setting as $USER session variable
string | $field | The user field to be checked for a given value. |
string | $value | The value to match for $field. |
int | $mnethostid | |
bool | $throwexception | If true, it will throw an exception when there's no record found or when there are multiple records found. Otherwise, it will just return false. |
mixed | False, or A $USER object. |
|
static |
Returns all classes in a component matching the provided namespace.
It checks that the class exists.
e.g. get_component_classes_in_namespace('mod_forum', 'event')
string | null | $component | A valid moodle component (frankenstyle) or null if searching all components |
string | $namespace | Namespace from the component name or empty string if all $component classes. |
array | The full class name as key and the class path as value, empty array if $component is null and $namespace is empty. |
|
static |
Return exact absolute path to a plugin directory.
string | $component | name such as 'moodle', 'mod_forum' |
string | full path to component directory; NULL if not found |
string | $component | name such as 'moodle', 'mod_forum' |
string | full path to component directory; NULL if not found |
|
static |
Returns a list of frankenstyle component names and their paths, for all components (plugins and subsystems).
E.g. [ 'mod' => [ 'mod_forum' => FORUM_PLUGIN_PATH, ... ], ... 'core' => [ 'core_comment' => COMMENT_SUBSYSTEM_PATH, ... ] ]
array | an associative array of components and their corresponding paths. |
|
static |
Returns a list of frankenstyle component names.
E.g. [ 'core_course', 'core_message', 'mod_assign', ... ]
array | the list of frankenstyle component names. |
get_component_version | ( | $component, | |
$source = 'installed' |
|||
) |
Returns the version of installed component.
string | $component | component name |
string | $source | either 'disk' or 'installed' - where to get the version information from |
string|bool | version number or false if the component is not found |
|
static |
Get configuration values from the global config table or the config_plugins table.
If called with one parameter, it will load all the config variables for one plugin, and return them as an object.
If called with 2 parameters it will return a string single value or false if the value is not found.
NOTE: this function is called from lib/db/upgrade.php
string|false $siteidentifier The site identifier is not cached. We use this static cache so that we need only fetch it once per request.
string | $plugin | full component name |
string | $name | default null |
mixed | hash-like object or single value, return false no config found |
dml_exception |
get_context_instance | ( | $contextlevel, | |
$instance = 0 , |
|||
$strictness = IGNORE_MISSING |
|||
) |
Get the context instance as an object.
This function will create the context instance if it does not exist yet.
integer | $contextlevel | The context level, for example CONTEXT_COURSE, or CONTEXT_MODULE. |
integer | $instance | The instance id. For $level = CONTEXT_COURSE, this would be $course->id, for $level = CONTEXT_MODULE, this would be $cm->id. And so on. Defaults to 0 |
int | $strictness | IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; MUST_EXIST means throw exception if no record or multiple records found |
context | The context object. |
get_context_instance_by_id | ( | ) |
get_context_url | ( | ) |
get_contextlevel_name | ( | ) |
get_core_subsystems | ( | $fullpaths = false | ) |
List all core subsystems and their location.
This is a whitelist of components that are part of the core and their language strings are defined in /lang/en/<<subsystem>>.php. If a given plugin is not listed here and it does not have proper plugintype prefix, then it is considered as course activity module.
The location is optionally dirroot relative path. NULL means there is no special directory for this subsystem. If the location is set, the subsystem's renderer.php is expected to be there.
bool | $fullpaths | false means relative paths from dirroot, use true for performance reasons |
array | of (string)name => (string|null)location |
|
static |
List all core subsystems and their location.
This is a whitelist of components that are part of the core and their language strings are defined in /lang/en/<<subsystem>>.php. If a given plugin is not listed here and it does not have proper plugintype prefix, then it is considered as course activity module.
The location is absolute file path to dir. 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.
array | of (string)name => (string|null)full dir location |
get_course | ( | $courseid, | |
$clone = true |
|||
) |
Gets a course object from database.
If the course id corresponds to an already-loaded $COURSE or $SITE object, then the loaded object will be used, saving a database query.
If it reuses an existing object, by default the object will be cloned. This means you can modify the object safely without affecting other code.
int | $courseid | Course id |
bool | $clone | If true (default), makes a clone of the record |
stdClass | A course object |
dml_exception | If not found in database |
get_course_and_cm_from_cmid | ( | $cmorid, | |
$modulename = '' , |
|||
$courseorid = 0 , |
|||
$userid = 0 |
|||
) |
Efficiently retrieves the $course (stdclass) and $cm (cm_info) objects, given a cmid.
If module name is also provided, it will ensure the cm is of that type.
Usage: list($course, $cm) = get_course_and_cm_from_cmid($cmid, 'forum');
Using this method has a performance advantage because it works by loading modinfo for the course - which will then be cached and it is needed later in most requests. It also guarantees that the $cm object is a cm_info and not a stdclass.
The $course object can be supplied if already known and will speed up this function - although it is more efficient to use this function to get the course if you are starting from a cmid.
To avoid security problems and obscure bugs, you should always specify $modulename if the cmid value came from user input.
By default this obtains information (for example, whether user can access the activity) for current user, but you can specify a userid if required.
stdClass | int | $cmorid | Id of course-module, or database object |
string | $modulename | Optional modulename (improves security) |
stdClass | int | $courseorid | Optional course object if already loaded |
int | $userid | Optional userid (default = current) |
array | Array with 2 elements $course and $cm |
moodle_exception | If the item doesn't exist or is of wrong module name |
get_course_and_cm_from_instance | ( | $instanceorid, | |
$modulename, | |||
$courseorid = 0 , |
|||
$userid = 0 |
|||
) |
Efficiently retrieves the $course (stdclass) and $cm (cm_info) objects, given an instance id or record and module name.
Usage: list($course, $cm) = get_course_and_cm_from_instance($forum, 'forum');
Using this method has a performance advantage because it works by loading modinfo for the course - which will then be cached and it is needed later in most requests. It also guarantees that the $cm object is a cm_info and not a stdclass.
The $course object can be supplied if already known and will speed up this function - although it is more efficient to use this function to get the course if you are starting from an instance id.
By default this obtains information (for example, whether user can access the activity) for current user, but you can specify a userid if required.
stdclass | int | $instanceorid | Id of module instance, or database object |
string | $modulename | Modulename (required) |
stdClass | int | $courseorid | Optional course object if already loaded |
int | $userid | Optional userid (default = current) |
array | Array with 2 elements $course and $cm |
moodle_exception | If the item doesn't exist or is of wrong module name |
get_course_category | ( | ) |
get_course_category_tree | ( | ) |
get_course_context | ( | ) |
get_course_display_name_for_list | ( | $course | ) |
Gets the name of a course to be displayed when showing a list of courses.
By default this is just $course->fullname but user can configure it. The result of this function should be passed through print_string.
stdClass | core_course_list_element | $course | Moodle course object |
string | Display name of course (either fullname or short + fullname) |
object get_course_mods | ( | $courseid | ) |
MODULE FUNCTIONS /////////////////////////////////////////////////.
Just gets a raw list of all modules in a course
int | $courseid | The id of the course as found in the 'course' table. |
array |
get_course_participants | ( | ) |
get_course_section | ( | ) |
get_courseid_from_context | ( | ) |
object get_coursemodule_from_id | ( | $modulename, | |
$cmid, | |||
$courseid = 0 , |
|||
$sectionnum = false , |
|||
$strictness = IGNORE_MISSING |
|||
) |
Given an id of a course module, finds the coursemodule description.
Please note that this function performs 1-2 DB queries. When possible use cached course modinfo. For example get_fast_modinfo($courseorid)->get_cm($cmid) See also cm_info::get_course_module_record()
string | $modulename | name of module type, eg. resource, assignment,... (optional, slower and less safe if not specified) |
int | $cmid | course module id (id in course_modules table) |
int | $courseid | optional course id for extra validation |
bool | $sectionnum | include relative section number (0,1,2 ...) |
int | $strictness | IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; IGNORE_MULTIPLE means return first, ignore multiple records found(not recommended); MUST_EXIST means throw exception if no record or multiple records found |
stdClass |
object get_coursemodule_from_instance | ( | $modulename, | |
$instance, | |||
$courseid = 0 , |
|||
$sectionnum = false , |
|||
$strictness = IGNORE_MISSING |
|||
) |
Given an instance number of a module, finds the coursemodule description.
Please note that this function performs DB query. When possible use cached course modinfo. For example get_fast_modinfo($courseorid)->instances[$modulename][$instance] See also cm_info::get_course_module_record()
string | $modulename | name of module type, eg. resource, assignment,... |
int | $instance | module instance number (id in resource, assignment etc. table) |
int | $courseid | optional course id for extra validation |
bool | $sectionnum | include relative section number (0,1,2 ...) |
int | $strictness | IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found; IGNORE_MULTIPLE means return first, ignore multiple records found(not recommended); MUST_EXIST means throw exception if no record or multiple records found |
stdClass |
get_coursemodules_in_course | ( | $modulename, | |
$courseid, | |||
$extrafields = '' |
|||
) |
Returns all course modules of given activity in course.
string | $modulename | The module name (forum, quiz, etc.) |
int | $courseid | The course id to get modules for |
string | $extrafields | extra fields starting with m. |
array | Array of results |
object get_courses | ( | $categoryid = "all" , |
|
$sort = "c.sortorder ASC" , |
|||
$fields = "c.*" |
|||
) |
Returns list of courses, for whole site, or category.
Returns list of courses, for whole site, or category Important: Using c.* for fields is extremely expensive because we are using distinct. You almost NEVER need all the fields in such a large SELECT
Consider using core_course_category::get_courses() or core_course_category::search_courses() instead since they use caching.
@global object @global object @uses CONTEXT_COURSE
string | int | $categoryid | Either a category id or 'all' for everything |
string | $sort | A field and direction to sort by |
string | $fields | The additional fields to return |
array | Array of courses |
read int $summaryformat Summary format Field is present if core_course_category::get_courses | ( | $options = array() | ) |
Retrieves the list of courses accessible by user.
was called with option 'summary'.
Not all information is cached, try to avoid calling this method twice in the same request.
The following fields are always retrieved:
If you plan to use properties/methods core_course_list_element::$summary and/or core_course_list_element::get_course_contacts() you can preload this information using appropriate 'options'. Otherwise they will be retrieved from DB on demand and it may end with bigger DB load.
Note that method core_course_list_element::has_summary() will not perform additional DB queries even if $options['summary'] is not specified
List of found course ids is cached for 10 minutes. Cache may be purged prior to this when somebody edits courses or categories, however it is very difficult to keep track of all possible changes that may affect list of courses.
array | $options | options for retrieving children
|
core_course_list_element[] | Otherwise will be retrieved from DB on first request |
get_courses_page | ( | $categoryid = "all" , |
|
$sort = "c.sortorder ASC" , |
|||
$fields = "c.*" , |
|||
& | $totalcount, | ||
$limitfrom = "" , |
|||
$limitnum = "" |
|||
) |
Returns list of courses, for whole site, or category.
Similar to get_courses, but allows paging Important: Using c.* for fields is extremely expensive because we are using distinct. You almost NEVER need all the fields in such a large SELECT
string | int | $categoryid | Either a category id or 'all' for everything |
string | $sort | A field and direction to sort by |
string | $fields | The additional fields to return |
int | $totalcount | Reference for the number of courses |
string | $limitfrom | The course to start from |
string | $limitnum | The number of courses to limit to |
array | Array of courses |
object get_courses_search | ( | $searchterms, | |
$sort, | |||
$page, | |||
$recordsperpage, | |||
& | $totalcount, | ||
$requiredcapabilities = array() , |
|||
$searchcond = [] , |
|||
$params = [] |
|||
) |
A list of courses that match a search.
@global object
array | $searchterms | An array of search criteria |
string | $sort | A field and direction to sort by |
int | $page | The page number to get |
int | $recordsperpage | The number of records per page |
int | $totalcount | Passed in by reference. |
array | $requiredcapabilities | Extra list of capabilities used to filter courses |
array | $searchcond | additional search conditions, for example ['c.enablecompletion = :p1'] |
array | $params | named parameters for additional search conditions, for example ['p1' => 1] |
stdClass[] | $COURSE records |
get_courses_wmanagers | ( | ) |
get_current_group | ( | ) |
Returns list of all directories where we expect install.xml files.
array | Array of paths |
get_device_cfg_var_name | ( | ) |
get_device_type | ( | ) |
get_device_type_list | ( | ) |
get_directory_list | ( | $rootdir, | |
$excludefiles = '' , |
|||
$descend = true , |
|||
$getdirs = false , |
|||
$getfiles = true |
|||
) |
Returns an array with all the filenames in all subdirectories, relative to the given rootdir.
If excludefiles is defined, then that file/directory is ignored If getdirs is true, then (sub)directories are included in the output If getfiles is true, then files are included in the output (at least one of these must be true!)
string | $rootdir | A given root directory to start from |
string | array | $excludefiles | If defined then the specified file/directory is ignored |
bool | $descend | If true then subdirectories are recursed as well |
bool | $getdirs | If true then (sub)directories are included in the output |
bool | $getfiles | If true then files are included in the output |
array | An array with all the filenames in all subdirectories, relative to the given rootdir |
get_directory_size | ( | $rootdir, | |
$excludefile = '' |
|||
) |
Adds up all the files in a directory and works out the size.
string | $rootdir | The directory to start from |
string | $excludefile | A file to exclude when summing directory size |
int | The summed size of all files and subfiles within the root directory |
get_docs_url | ( | $path = null | ) |
Returns the Moodle Docs URL in the users language for a given 'More help' link.
There are three cases:
This is the only option that should be used in standard Moodle code. The other two options have been implemented because they are useful for third-party plugins.
string | $path | the place to link to. See above for details. |
string | The MoodleDocs URL in the user's language. for example $path} |
get_emoticon_manager | ( | ) |
Factory function for emoticon_manager.
emoticon_manager | singleton |
get_enabled_auth_plugins | ( | $fix = false | ) |
Returns array of active auth plugins.
bool | $fix | fix $CFG->auth if needed |
array |
get_enrolled_join | ( | context | $context, |
$useridcolumn, | |||
$onlyactive = false , |
|||
$onlysuspended = false , |
|||
$enrolid = 0 |
|||
) |
Returns array with sql joins and parameters returning all ids of users enrolled into course.
This function is using 'ej[0-9]+_' prefix for table names and parameters.
coding_exception |
context | $context | |
string | $useridcolumn | User id column used the calling query, e.g. u.id |
bool | $onlyactive | consider only active enrolments in enabled plugins and time restrictions |
bool | $onlysuspended | inverse of onlyactive, consider only suspended enrolments |
int | $enrolid | The enrolment ID. If not 0, only users enrolled using this enrolment method will be returned. |
core |
get_enrolled_sql | ( | context | $context, |
$withcapability = '' , |
|||
$groupid = 0 , |
|||
$onlyactive = false , |
|||
$onlysuspended = false , |
|||
$enrolid = 0 |
|||
) |
Returns array with sql code and parameters returning all ids of users enrolled into course.
This function is using 'eu[0-9]+_' prefix for table names and parameters.
context | $context | |
string | $withcapability | |
int | $groupid | 0 means ignore groups, USERSWITHOUTGROUP without any group and any other value limits the result by group id |
bool | $onlyactive | consider only active enrolments in enabled plugins and time restrictions |
bool | $onlysuspended | inverse of onlyactive, consider only suspended enrolments |
int | $enrolid | The enrolment ID. If not 0, only users enrolled using this enrolment method will be returned. |
array | list($sql, $params) |
get_enrolled_users | ( | context | $context, |
$withcapability = '' , |
|||
$groupid = 0 , |
|||
$userfields = 'u.*' , |
|||
$orderby = null , |
|||
$limitfrom = 0 , |
|||
$limitnum = 0 , |
|||
$onlyactive = false |
|||
) |
Returns list of users enrolled into course.
context | $context | |
string | $withcapability | |
int | $groupid | 0 means ignore groups, USERSWITHOUTGROUP without any group and any other value limits the result by group id |
string | $userfields | requested user record fields |
string | $orderby | |
int | $limitfrom | return a subset of records, starting at this point (optional, required if $limitnum is set). |
int | $limitnum | return a subset comprising this many records (optional, required if $limitfrom is set). |
bool | $onlyactive | consider only active enrolments in enabled plugins and time restrictions |
array | of user records |
get_enrolled_with_capabilities_join | ( | context | $context, |
$prefix = '' , |
|||
$capability = '' , |
|||
$group = 0 , |
|||
$onlyactive = false , |
|||
$onlysuspended = false , |
|||
$enrolid = 0 |
|||
) |
Returns an array of joins, wheres and params that will limit the group of users to only those enrolled and with given capability (if specified).
Note this join will return duplicate rows for users who have been enrolled several times (e.g. as manual enrolment, and as self enrolment). You may need to use a SELECT DISTINCT in your query (see get_enrolled_sql for example).
context | $context | |
string | $prefix | optional, a prefix to the user id column |
string | array | $capability | optional, may include a capability name, or array of names. If an array is provided then this is the equivalent of a logical 'OR', i.e. the user needs to have one of these capabilities. |
int | $group | optional, 0 indicates no current group and USERSWITHOUTGROUP users without any group; otherwise the group id |
bool | $onlyactive | consider only active enrolments in enabled plugins and time restrictions |
bool | $onlysuspended | inverse of onlyactive, consider only suspended enrolments |
int | $enrolid | The enrolment ID. If not 0, only users enrolled using this enrolment method will be returned. |
core |
get_environment_for_version | ( | $version, | |
$env_select | |||
) |
This function will return the xmlized data belonging to one Moodle version.
string | $version | top version from which we start to look backwards |
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
mixed | the xmlized structure or false on error |
get_exception_info | ( | $ex | ) |
Returns detailed information about specified exception.
exception | $ex |
object |
get_extra_user_fields | ( | $context, | |
$already = array() |
|||
) |
Checks if current user is shown any extra fields when listing users.
object | $context | Context |
array | $already | Array of fields that we're going to show anyway so don't bother listing them |
array | Array of field names from user table, not including anything listed in $already |
get_extra_user_fields_sql | ( | $context, | |
$alias = '' , |
|||
$prefix = '' , |
|||
$already = array() |
|||
) |
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.
context | $context | Context |
string | $alias | Alias of user table, e.g. 'u' (default none) |
string | $prefix | Prefix for field names using AS, e.g. 'u_' (default none) |
array | $already | Array of fields that we're going to include anyway so don't list them (default none) |
string | Partial SQL select clause, beginning with comma, for example ',u.idnumber,u.department' unless it is blank |
get_fast_modinfo | ( | $courseorid, | |
$userid = 0 , |
|||
$resetonly = false |
|||
) |
Returns reference to full info about modules in course (including visibility).
Cached and as fast as possible (0 or 1 db query).
use get_fast_modinfo($courseid, 0, true) to reset the static cache for particular course use get_fast_modinfo(0, 0, true) to reset the static cache for all courses
use rebuild_course_cache($courseid, true) to reset the application AND static cache for particular course when it's contents has changed
int | stdClass | $courseorid | object from DB table 'course' (must have field 'id' and recommended to have field 'cacherev') or just a course id. Just course id is enough when calling get_fast_modinfo() for current course or site or when calling for any other course for the second time. |
int | $userid | User id to populate 'availble' and 'uservisible' attributes of modules and sections. Set to 0 for current user (default). Set to -1 to avoid calculation of dynamic user-depended data. |
bool | $resetonly | whether we want to get modinfo or just reset the cache |
course_modinfo|null | Module information for course, or null if resetting |
moodle_exception | when course is not found (nothing is thrown if resetting) |
get_file_argument | ( | ) |
Extracts file argument either from file parameter or PATH_INFO.
Note: $scriptname parameter is not needed anymore
string | file path (only safe characters) |
get_file_browser | ( | ) |
Returns local file storage instance.
file_browser |
get_file_packer | ( | $mimetype = 'application/zip' | ) |
get_file_storage | ( | $reset = false | ) |
Returns local file storage instance.
file_storage |
get_file_url | ( | ) |
get_formatted_help_string | ( | $identifier, | |
$component, | |||
$ajax = false , |
|||
$a = null |
|||
) |
Get the value of a help string fully prepared for display in the current language.
string | $identifier | The identifier of the string to search for. |
string | $component | The module the string is associated with. |
boolean | $ajax | Whether this help is called from an AJAX script. This is used to influence text formatting and determines which format to output the doclink in. |
string | object | array | $a | An object, string or number that can be used within translation strings |
Object | An object containing:
|
get_generic_section_name | ( | ) |
get_group_picture_url | ( | $group, | |
$courseid, | |||
$large = false , |
|||
$includetoken = false |
|||
) |
Return the url to the group picture.
stdClass | $group | A group object. |
int | $courseid | The course ID for the group. |
bool | $large | A large or small group picture? Default is small. |
boolean | $includetoken | Whether to use a user token when displaying this group image. True indicates to generate a token for current user, and integer value indicates to generate a token for the user whose id is the value indicated. If the group picture is included in an e-mail or some other location where the audience is a specific user who will not be logged in when viewing, then we use a token to authenticate the user. |
moodle_url | Returns the url for the group picture. |
get_home_page | ( | ) |
Gets the homepage to use for the current user.
int | One of HOMEPAGE_* |
get_host_from_url | ( | $url | ) |
Returns host part from url.
string | $url | full url |
string | host, null if not found |
get_html_lang | ( | $dir = false | ) |
Return a string containing 'lang', xml:lang and optionally 'dir' HTML attributes.
Internationalisation, for print_header and backup/restorelib.
bool | $dir | Default false |
string | Attributes |
get_latest_version_available | ( | $version, | |
$env_select | |||
) |
This function will return the most recent version in the environment.xml file previous or equal to the version requested.
string | $version | top version from which we start to look backwards |
int | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. |
string|bool | string more recent version or false if not found |
get_level | ( | $element | ) |
Here all the restrict functions are coded to be used by the environment checker.
All those functions will receive the result object and will return it modified as needed (status and bypass string)
array | $element | the element from the environment.xml file that should have either a level="required" or level="optional" attribute. |
string | "required" or "optional". |
get_list_of_charsets | ( | ) |
Returns a list of charset codes.
Returns a list of charset codes. It's hardcoded, so they should be added manually (checking that such charset is supported by the texlib library!)
array | And associative array with contents in the form of charset => charset |
get_list_of_environment_versions | ( | $contents | ) |
This function will return the list of Moodle versions available.
array | of versions |
get_list_of_plugins | ( | $directory = 'mod' , |
|
$exclude = '' , |
|||
$basedir = '' |
|||
) |
Lists plugin-like directories within specified directory.
This function was originally used for standard Moodle plugins, please use new core_component::get_plugin_list() now.
This function is used for general directory listing and backwards compatility.
string | $directory | relative directory from root |
string | $exclude | dir name to exclude from the list (defaults to none) |
string | $basedir | full path to the base dir where $plugin resides (defaults to $CFG->dirroot) |
array | Sorted array of directory names found under the requested parameters |
get_list_of_themes | ( | ) |
Returns a list of valid and compatible themes.
array |
get_list_of_timezones | ( | ) |
get_local_referer | ( | $stripquery = true | ) |
Returns the cleaned local URL of the HTTP_REFERER less the URL query string parameters if required.
bool | $stripquery | if true, also removes the query part of the url. |
string | The resulting referer or empty string. |
get_log_manager | ( | $forcereload = false | ) |
LOG FUNCTIONS /////////////////////////////////////////////////////.
Get instance of log manager.
bool | $forcereload |
core |
get_login_url | ( | ) |
Returns full login url.
Any form submissions for authentication to this URL must include username, password as well as a logintoken generated by core\session\manager::get_login_token().
string | login url |
get_logs | ( | ) |
get_logs_usercourse | ( | ) |
get_logs_userday | ( | ) |
get_mailer | ( | $action = 'get' | ) |
Get mailer instance, enable buffering, flush buffer or disable buffering.
string | $action | 'get', 'buffer', 'close' or 'flush' |
moodle_phpmailer|null | mailer instance if 'get' used or nothing |
get_max_upload_file_size | ( | $sitebytes = 0 , |
|
$coursebytes = 0 , |
|||
$modulebytes = 0 , |
|||
$unused = false |
|||
) |
Returns the maximum size for uploading files.
There are seven possible upload limits:
These last two are passed to this function as arguments (in bytes). Anything defined as 0 is ignored. The smallest of all the non-zero numbers is returned.
int | $sitebytes | Set maximum size |
int | $coursebytes | Current course $course->maxbytes (in bytes) |
int | $modulebytes | Current module ->maxbytes (in bytes) |
bool | $unused | This parameter has been deprecated and is not used any more. |
int | The maximum size for uploading files. |
get_max_upload_sizes | ( | $sitebytes = 0 , |
|
$coursebytes = 0 , |
|||
$modulebytes = 0 , |
|||
$custombytes = null |
|||
) |
Returns an array of possible sizes in local language.
Related to get_max_upload_file_size() - this function returns an array of possible sizes in an array, translated to the local language.
The list of options will go up to the minimum of $sitebytes, $coursebytes or $modulebytes.
If $coursebytes or $sitebytes is not 0, an option will be included for "Course/Site upload limit (X)" with the value set to 0. This option will be the first in the list.
@uses SORT_NUMERIC
int | $sitebytes | Set maximum size |
int | $coursebytes | Current course $course->maxbytes (in bytes) |
int | $modulebytes | Current module ->maxbytes (in bytes) |
int | array | $custombytes | custom upload size/s which will be added to list, Only value/s smaller then maxsize will be added to list. |
array |
get_mnet_environment | ( | ) |
helper function to load up and initialise the mnet environment this must be called before you use mnet functions.
mnet_environment | the equivalent of old $MNET global |
get_mnet_remote_client | ( | ) |
during xmlrpc server code execution, any code wishing to access information about the remote peer must use this to get it.
mnet_remote_client | the equivalent of old $MNETREMOTE_CLIENT global |
get_moodle_cookie | ( | ) |
Gets a moodle cookie with a weakly encrypted username.
string | username |
object get_my_remotecourses | ( | $userid = 0 | ) |
List of remote courses that a user has access to via MNET.
Works only on the IDP
@global object
int | @userid The user id to get remote courses for |
array | Array of $COURSE of course objects |
object get_my_remotehosts | ( | ) |
List of remote hosts that a user has access to via MNET.
Works on the SP
@global object
array|bool | Array of host objects or false |
get_parent_contextid | ( | ) |
get_parent_contexts | ( | ) |
get_performance_info | ( | ) |
get_performance_info() pairs up with init_performance_info() loaded in setup.php.
Returns an array with 'html' and 'txt' values ready for use, and each of the individual stats provided separately as well.
array |
performance_measuring_filter_manager::get_performance_summary | ( | ) |
Return performance information, in the form required by get_performance_info().
array | the performance info. |
|
static |
Returns the exact absolute path to plugin directory.
string | $plugintype | type of plugin |
string | $pluginname | name of the plugin |
string | full path to plugin directory; null if not found |
string | $plugintype | type of plugin |
string | $name | name of the plugin |
string | full path to plugin directory; NULL if not found |
|
static |
Get list of plugins of given type.
Use when listing real plugins of one type.
string | $plugintype |
array | as (string)pluginname => (string)fulldir |
string | $plugintype | type of plugin |
array | name=>fulllocation pairs of plugins of given type |
|
static |
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.
string | $plugintype | the type of plugin, e.g. 'mod' or 'report'. |
string | $class | the part of the name of the class after the frankenstyle prefix. e.g 'thing' if you are looking for classes with names like report_courselist_thing. If you are looking for classes with the same name as the plugin name (e.g. qtype_multichoice) then pass ''. Frankenstyle namespaces are also supported. |
string | $file | the name of file within the plugin that defines the class. |
array | with frankenstyle plugin names as keys (e.g. 'report_courselist', 'mod_forum') and the class names as values (e.g. 'report_courselist_thing', 'qtype_multichoice'). |
The plugin component names and class names are returned.
string | $plugintype | the type of plugin, e.g. 'mod' or 'report'. |
string | $class | the part of the name of the class after the frankenstyle prefix. e.g 'thing' if you are looking for classes with names like report_courselist_thing. If you are looking for classes with the same name as the plugin name (e.g. qtype_multichoice) then pass ''. |
string | $file | the name of file within the plugin that defines the class. |
array | with frankenstyle plugin names as keys (e.g. 'report_courselist', 'mod_forum') and the class names as values (e.g. 'report_courselist_thing', 'qtype_multichoice'). |
|
static |
Get a list of all the plugins of a given type that contain a particular file.
string | $plugintype | the type of plugin, e.g. 'mod' or 'report'. |
string | $file | the name of file that must be present in the plugin. (e.g. 'view.php', 'db/install.xml'). |
bool | $include | if true (default false), the file will be include_once-ed if found. |
array | with plugin name as keys (e.g. 'forum', 'courselist') and the path to the file relative to dirroot as value (e.g. "$CFG->dirroot/mod/forum/view.php"). |
get_plugin_list_with_file | ( | ) |
get_plugin_list_with_function | ( | $plugintype, | |
$function, | |||
$file = 'lib.php' |
|||
) |
Get a list of all the plugins of a given type that define a certain API function in a certain file.
The plugin component names and function names are returned.
string | $plugintype | the type of plugin, e.g. 'mod' or 'report'. |
string | $function | the part of the name of the function after the frankenstyle prefix. e.g 'hook' if you are looking for functions with names like report_courselist_hook. |
string | $file | the name of file within the plugin that defines the function. Defaults to lib.php. |
array | with frankenstyle plugin names as keys (e.g. 'report_courselist', 'mod_forum') and the function names as values (e.g. 'report_courselist_hook', 'forum_hook'). |
get_plugin_types | ( | $fullpaths = true | ) |
Lists all plugin types.
bool | $fullpaths | false means relative paths from dirroot |
array | Array of strings - name=>location |
|
static |
Get list of available plugin types together with their location.
array | as (string)plugintype => (string)fulldir |
|
static |
Returns list of plugin types that allow subplugins.
array | as (string)plugintype => (string)fulldir |
get_plugins_with_function | ( | $function, | |
$file = 'lib.php' , |
|||
$include = true |
|||
) |
Get a list of all the plugins that define a certain API function in a certain file.
string | $function | the part of the name of the function after the frankenstyle prefix. e.g 'hook' if you are looking for functions with names like report_courselist_hook. |
string | $file | the name of file within the plugin that defines the function. Defaults to lib.php. |
bool | $include | Whether to include the files that contain the functions or not. |
array | with [plugintype][plugin] = functionname |
get_print_section_cm_text | ( | ) |
get_real_size | ( | $size = 0 | ) |
Converts numbers like 10M into bytes.
string | $size | The size to be converted |
int |
get_recent_enrolments | ( | ) |
get_records_csv | ( | ) |
get_referer | ( | ) |
get_related_contexts_string | ( | ) |
get_request_storage_directory | ( | $exceptiononerror = true , |
|
bool | $forcecreate = false |
||
) |
Get a per-request storage directory in the tempdir.
The directory is automatically cleaned up during the shutdown handler.
bool | $exceptiononerror | throw exception if error encountered |
bool | $forcecreate | Force creation of a new parent directory |
string | Returns full path to directory if successful, false if not; may throw exception |
get_role_context_caps | ( | ) |
get_roles_on_exact_context | ( | context | $context | ) |
This function finds the roles assigned directly to this context only i.e.
no roles in parent contexts
context | $context |
array |
get_roles_with_assignment_on_context | ( | context | $context | ) |
Find out which roles has assignment on this context.
context | $context |
array |
object get_scales_menu | ( | $courseid = 0 | ) |
Returns a menu of all available scales from the site as well as the given course.
int | $courseid | The id of the course as found in the 'course' table. |
array |
get_selected_theme_for_device_type | ( | ) |
get_separator | ( | ) |
Return the breadcrumb trail navigation separator.
string | HTML string. |
get_site | ( | ) |
OTHER SITE AND COURSE FUNCTIONS /////////////////////////////////////////////.
Returns $course object of the top-level site.
object | A $COURSE object for the site, exception if not found |
get_site_identifier | ( | ) |
Returns the site identifier.
string::$CFG-,>siteidentifier,first | making sure it is properly initialised. |
|
protected |
Get all the filters that apply to a given context for calls to format_string.
context | $context | the context. |
moodle_text_filter[] | A text filter |
get_strings | ( | $array, | |
$component = '' |
|||
) |
Converts an array of strings to their localized value.
array | $array | An array of strings |
string | $component | The language module that these strings can be found in. |
stdClass | translated strings. |
|
static |
Return all subplugins of this component.
string | $component,. |
array::$subtype,=>array($component,..),null | if no subtypes defined |
|
static |
Returns the exact absolute path to plugin directory.
string | $subsystem | type of core subsystem |
string | full path to subsystem directory; null if not found |
|
static |
Returns parent of this subplugin type.
string | $type |
string | parent component or null |
get_system_context | ( | $cache = true | ) |
Returns system context or null if can not be created yet.
bool | $cache | use caching |
context | system context (null if context table not created yet) |
|
protected |
Get all the filters that apply to a given context for calls to format_text.
context | $context |
moodle_text_filter[] | A text filter |
get_texteditor | ( | $editorname | ) |
Returns instance of text editor.
string | $editorname | name of editor (textarea, tinymce, ...) |
object|bool | texeditor instance or false if does not exist |
get_time_interval_string | ( | int | $time1, |
int | $time2, | ||
string | $format = '' |
||
) |
Get a formatted string representation of an interval between two unix timestamps.
E.g. $intervalstring = get_time_interval_string(12345600, 12345660); Will produce the string: '0d 0h 1m'
int | $time1 | unix timestamp |
int | $time2 | unix timestamp |
string | $format | string (can be lang string) containing format chars: https://www.php.net/manual/en/dateinterval.format.php. |
string | the formatted string describing the time difference, e.g. '10d 11h 45m'. |
get_timezone_offset | ( | ) |
get_timezone_record | ( | ) |
|
protected |
Get the progress_trace.
progress_trace |
get_used_table_names | ( | ) |
Returns names of all known tables == tables that moodle knows about.
array | Array of lowercase table names |
get_user_access_sitewide | ( | ) |
get_user_courses_bycap | ( | ) |
get_user_device_type | ( | ) |
get_user_field_name | ( | $field | ) |
Returns the display name of a field in the user table.
Works for most fields that are commonly displayed to users.
string | $field | Field name, e.g. 'phone1' |
string | Text description taken from language file, e.g. 'Phone number' |
get_user_fieldnames | ( | ) |
Returns an array of user fields.
array | User field/column names |
get_user_key | ( | $script, | |
$userid, | |||
$instance = null , |
|||
$iprestriction = null , |
|||
$validuntil = null |
|||
) |
Gets a private user access key (and creates one if one doesn't exist).
string | $script | unique target identifier |
int | $userid | |
int | $instance | optional instance id |
string | $iprestriction | optional ip restricted access |
int | $validuntil | key valid only until given date |
string | access key value |
get_user_max_upload_file_size | ( | $context, | |
$sitebytes = 0 , |
|||
$coursebytes = 0 , |
|||
$modulebytes = 0 , |
|||
$user = null , |
|||
$unused = false |
|||
) |
Returns the maximum size for uploading files for the current user.
This function takes in account get_max_upload_file_size() the user's capabilities
context | $context | The context in which to check user capabilities |
int | $sitebytes | Set maximum size |
int | $coursebytes | Current course $course->maxbytes (in bytes) |
int | $modulebytes | Current module ->maxbytes (in bytes) |
stdClass | $user | The user |
bool | $unused | This parameter has been deprecated and is not used any more. |
int | The maximum size for uploading files. |
get_user_timezone_offset | ( | ) |
object get_users | ( | $get = true , |
|
$search = '' , |
|||
$confirmed = false , |
|||
array | $exceptions = null , |
||
$sort = 'firstname ASC' , |
|||
$firstinitial = '' , |
|||
$lastinitial = '' , |
|||
$page = '' , |
|||
$recordsperpage = '' , |
|||
$fields = '*' , |
|||
$extraselect = '' , |
|||
array | $extraparams = null |
||
) |
Returns a subset of users.
@uses DEBUG_DEVELOPER @uses SQL_PARAMS_NAMED
bool | $get | If false then only a count of the records is returned |
string | $search | A simple string to search for |
bool | $confirmed | A switch to allow/disallow unconfirmed users |
array | $exceptions | A list of IDs to ignore, eg 2,4,5,8,9,10 |
string | $sort | A SQL snippet for the sorting criteria to use |
string | $firstinitial | Users whose first name starts with $firstinitial |
string | $lastinitial | Users whose last name starts with $lastinitial |
string | $page | The page or records to return |
string | $recordsperpage | The number of records to return per page |
string | $fields | A comma separated list of fields to be returned from the chosen table. |
array|int|bool | $USER records unless get is false in which case the integer count of the records found is returned. False is returned if an error is encountered. |
object get_users_confirmed | ( | ) |
Full list of users that have confirmed their accounts.
array | of unconfirmed users |
get_users_from_config | ( | $value, | |
$capability, | |||
$includeadmins = true |
|||
) |
Use this function to get a list of users from a config setting of type admin_setting_users_with_capability.
All users are verified if they still have the necessary capability.
string | $value | the value of the config setting. |
string | $capability | the capability - must match the one passed to the admin_setting_users_with_capability constructor. |
bool | $includeadmins | include administrators. |
array | of user objects. |
get_users_listing | ( | $sort = 'lastaccess' , |
|
$dir = 'ASC' , |
|||
$page = 0 , |
|||
$recordsperpage = 0 , |
|||
$search = '' , |
|||
$firstinitial = '' , |
|||
$lastinitial = '' , |
|||
$extraselect = '' , |
|||
array | $extraparams = null , |
||
$extracontext = null |
|||
) |
Return filtered (if provided) list of users in site, except guest and deleted users.
string | $sort | An SQL field to sort by |
string | $dir | The sort direction ASC|DESC |
int | $page | The page or records to return |
int | $recordsperpage | The number of records to return per page |
string | $search | A simple string to search for |
string | $firstinitial | Users whose first name starts with $firstinitial |
string | $lastinitial | Users whose last name starts with $lastinitial |
string | $extraselect | An additional SQL select statement to append to the query |
array | $extraparams | Additional parameters to use for the above $extraselect |
stdClass | $extracontext | If specified, will include user 'extra fields' as appropriate for current user and given context |
array | Array of $USER records |
getremoteaddr | ( | $default = '0.0.0.0' | ) |
Returns most reliable client address.
string | $default | If an address can't be determined, then return this |
string | The remote IP address |
getweek | ( | $startdate, | |
$thedate | |||
) |
Given dates in seconds, how many weeks is the date from startdate The first week is 1, the second 2 etc ...
int | $startdate | Timestamp for the start date |
int | $thedate | Timestamp for the end date |
string |
read bool $coursegroupmodeforce Indicates whether the course containing the module has forced the groupmode | ( | ) |
This means that cm_info::$groupmode should be ignored and cm_info::$coursegroupmode be used instead.
groups_course_module_visible | ( | ) |
groups_filter_users_by_course_module_visible | ( | ) |
guest_user | ( | ) |
Retrieve the guest user object.
stdClass | A $USER object |
moodle_text_filter::hash | ( | ) |
Reimplemented in filter_censor.
hash_internal_user_password | ( | $password, | |
$fasthash = false |
|||
) |
Calculate hash for a plain text password.
string | $password | Plain text password to be hashed. |
bool | $fasthash | If true, use a low cost factor when generating the hash This is much faster to generate but makes the hash less secure. It is used when lots of hashes need to be generated quickly. |
string | The hashed password. |
moodle_exception | If a problem occurs while generating the hash. |
hide_event | ( | ) |
highlight | ( | $needle, | |
$haystack, | |||
$matchcase = false , |
|||
$prefix = '<span class="highlight">' , |
|||
$suffix = '</span>' |
|||
) |
This function will highlight search words in a given string.
It cares about HTML and will not ruin links. It's best to use this function after performing any conversions to HTML.
string | $needle | The search string. Syntax like "word1 +word2 -word3" is dealt with correctly. |
string | $haystack | The string (HTML) within which to highlight the search terms. |
boolean | $matchcase | whether to do case-sensitive. Default case-insensitive. |
string | $prefix | the string to put before each search term found. |
string | $suffix | the string to put after each search term found. |
string | The highlighted HTML. |
highlightfast | ( | $needle, | |
$haystack | |||
) |
This function will highlight instances of $needle in $haystack.
It's faster that the above function highlight() and doesn't care about HTML or anything.
string | $needle | The string to search for |
string | $haystack | The string to search for $needle in |
string | The highlighted HTML |
html_is_blank | ( | $string | ) |
Tests whether anything was returned by text editor.
This function is useful for testing whether something you got back from the HTML editor actually contains anything. Sometimes the HTML editor appear to be empty, but actually you get back a
tag or something.
string | $string | a string containing HTML. |
boolean | does the string contain any actual content - that is text, images, objects, etc. |
html_to_text | ( | $html, | |
$width = 75 , |
|||
$dolinks = true |
|||
) |
Given HTML text, make it into plain text using external function.
string | $html | The text to be converted. |
integer | $width | Width to wrap the text at. (optional, default 75 which is a good value for email. 0 means do not limit line length.) |
boolean | $dolinks | By default, any links in the HTML are collected, and printed as a list at the end of the HTML. If you don't want that, set this argument to false. |
string | plain text equivalent of the HTML. |
httpsrequired | ( | ) |
imagecopybicubic | ( | $dst_img, | |
$src_img, | |||
$dst_x, | |||
$dst_y, | |||
$src_x, | |||
$src_y, | |||
$dst_w, | |||
$dst_h, | |||
$src_w, | |||
$src_h | |||
) |
Copies a rectangular portion of the source image to another rectangle in the destination image.
This function calls imagecopyresampled() if it is available and GD version is 2 at least. Otherwise it reimplements the same behaviour. See the PHP manual page for more info.
@externalurl http://php.net/manual/en/function.imagecopyresampled.php
resource | $dst_img | the destination GD image resource |
resource | $src_img | the source GD image resource |
int | $dst_x | vthe X coordinate of the upper left corner in the destination image |
int | $dst_y | the Y coordinate of the upper left corner in the destination image |
int | $src_x | the X coordinate of the upper left corner in the source image |
int | $src_y | the Y coordinate of the upper left corner in the source image |
int | $dst_w | the width of the destination rectangle |
int | $dst_h | the height of the destination rectangle |
int | $src_w | the width of the source rectangle |
int | $src_h | the height of the source rectangle |
bool | tru on success, false otherwise |
in_object_vars | ( | $var, | |
$object | |||
) |
Checks whether the given variable name is defined as a variable within the given object.
This will NOT work with stdClass objects, which have no class variables.
string | $var | The variable name |
object | $object | The object to check |
boolean |
increment_revision_number | ( | $table, | |
$field, | |||
$select, | |||
array | $params = null |
||
) |
Increment standard revision field.
The revision are based on current time and are incrementing. There is a protection for runaway revisions, it may not go further than one hour into future.
The field has to be XMLDB_TYPE_INTEGER with size 10.
string | $table | |
string | $field | name of the field containing revision |
string | $select | use empty string when updating all records |
array | $params | optional select parameters |
ini_get_bool | ( | $ini_get_arg | ) |
This function makes the return value of ini_get consistent if you are setting server directives through the .htaccess file in apache.
Current behavior for value set from php.ini On = 1, Off = [blank] Current behavior for value set from .htaccess On = On, Off = Off Contributed by jdell @ unr.edu
string | $ini_get_arg | The argument to get |
bool | True for on false for not |
init_performance_info | ( | ) |
Initializes our performance info early.
Pairs up with get_performance_info() which is actually in moodlelib.php. This function is here so that we can call it before all the libs are pulled in.
@uses $PERF
initialise_fullme | ( | ) |
Initialises $FULLME and friends.
Private function. Should only be called from setup.php.
initialise_fullme_cli | ( | ) |
Initialises $FULLME and friends for command line scripts.
This is a private method for use by initialise_fullme.
install_cli_database | ( | array | $options, |
$interactive | |||
) |
Install Moodle DB, config.php must exist, there must not be any tables in db yet.
array | $options | adminpass is mandatory |
bool | $interactive |
void |
install_db_validate | ( | $database, | |
$dbhost, | |||
$dbuser, | |||
$dbpass, | |||
$dbname, | |||
$prefix, | |||
$dboptions | |||
) |
This is in function because we want the /install.php to parse in PHP4.
object | $database | |
string | $dbhsot | |
string | $dbuser | |
string | $dbpass | |
string | $dbname | |
string | $prefix | |
mixed | $dboptions |
string |
install_generate_configphp | ( | $database, | |
$cfg | |||
) |
Returns content of config.php file.
Uses PHP_EOL for generating proper end of lines for the given platform.
moodle_database | $database | database instance |
object | $cfg | copy of $CFG |
string |
install_guess_wwwroot | ( | ) |
Tries to detect the right www root setting.
string | detected www root |
install_helpbutton | ( | $url, | |
$title = '' |
|||
) |
Print help button.
string | $url | |
string | $titel |
void |
install_ini_get_bool | ( | $ini_get_arg | ) |
install_init_dataroot | ( | $dataroot, | |
$dirpermissions | |||
) |
Creates dataroot if not exists yet, makes sure it is writable, add lang directory and add .htaccess just in case it works.
string | $dataroot | full path to dataroot |
int | $dirpermissions |
bool | success |
object install_print_footer | ( | $config, | |
$reload = false |
|||
) |
Prints installation page header, we can no use weblib yet in isntaller.
array | $config | |
bool | $reload | print reload button instead of next |
void |
object install_print_header | ( | $config, | |
$stagename, | |||
$heading, | |||
$stagetext, | |||
$stageclass = "alert-info" |
|||
) |
Prints installation page header, we can no use weblib yet in installer.
array | $config | |
string | $stagename | |
string | $heading | |
string | $stagetext | |
string | $stageclass |
void |
object install_print_help_page | ( | $help | ) |
Prints complete help page used during installation.
Does not return.
string | $help |
|
static |
Factory method.
Use this to get the filter manager.
filter_manager | the singleton instance. |
object instance_is_visible | ( | $moduletype, | |
$module | |||
) |
Determine whether a module instance is visible within a course.
Given a valid module object with info about the id and course, and the module's type (eg "forum") returns whether the object is visible or not according to the 'eye' icon only.
NOTE: This does NOT take into account visibility to a particular user. To get visibility access for a specific user, use get_fast_modinfo, get a cm_info object from this, and check the ->uservisible property; or use the core_availability\info_module::is_user_visible() static function.
$moduletype | Name of the module eg 'forum' |
$module | Object which is the instance of the module |
bool | Success |
|
static |
Invalidate opcode cache for given file, this is intended for php files that are stored in dataroot.
Note: we need it here because this class must be self-contained.
string | $file |
ip_is_public | ( | $ip | ) |
Is IP address a public address?
string | $ip | The ip to check |
bool | true if the ip is public |
iplookup_find_location | ( | $ip | ) |
Returns location information.
string | $ip |
array |
|
static |
Return true if subsystemname is core subsystem.
string | $subsystemname | name of the subsystem. |
bool | true if core subsystem. |
is_course_participant | ( | ) |
is_dataroot_insecure | ( | $fetchtest = false | ) |
Try to verify that dataroot is not accessible from web.
Try to verify that dataroot is not accessible from web. It is not 100% correct but might help to reduce number of vulnerable sites. Protection from httpd.conf and .htaccess is not detected properly.
@uses INSECURE_DATAROOT_WARNING @uses INSECURE_DATAROOT_ERROR
bool | $fetchtest | try to test public access by fetching file, default false |
mixed | empty means secure, INSECURE_DATAROOT_ERROR found a critical problem, INSECURE_DATAROOT_WARNING might be problematic |
is_early_init | ( | $backtrace | ) |
This function encapsulates the tests for whether an exception was thrown in early init – either during setup.php or during init of $OUTPUT.
If another exception is thrown then, and if we do not take special measures, we would just get a very cryptic message "Exception thrown without a stack frame in Unknown on line 0". That makes debugging very hard, so we do take special measures in default_exception_handler, with the help of this function.
array | $backtrace | the stack trace to analyse. |
boolean | whether the stack trace is somewhere in output initialisation. |
is_enabled_auth | ( | $auth | ) |
Checks if a given plugin is in the list of enabled authentication plugins.
string | $auth | Authentication plugin. |
boolean | Whether the plugin is enabled. |
is_enrolled | ( | context | $context, |
$user = null , |
|||
$withcapability = '' , |
|||
$onlyactive = false |
|||
) |
Returns true if user is enrolled (is participating) in course this is intended for students and teachers.
Since 2.2 the result for active enrolments and current user are cached.
context | $context | |
int | stdClass | $user | if null $USER is used, otherwise user object or id expected |
string | $withcapability | extra capability name |
bool | $onlyactive | consider only active enrolments in enabled plugins and time restrictions |
bool |
is_float_problem | ( | ) |
Detects if float supports at least 10 decimal digits.
Detects if float supports at least 10 decimal digits and also if float-->string conversion works as expected.
bool | true if problem found |
is_https | ( | ) |
Determines whether or not the Moodle site is being served over HTTPS.
This is done simply by checking the value of $CFG->wwwroot, which seems to be the only reliable method.
boolean | True if site is served over HTTPS, false otherwise. |
is_in_popup | ( | ) |
Returns true if the page is displayed in a popup window.
Gets the information from the URL parameter inpopup.
boolean |
is_internal_auth | ( | $auth | ) |
Returns true if an internal authentication method is being used.
if method not specified then, global default is assumed
string | $auth | Form of authentication required |
bool |
is_major_upgrade_required | ( | ) |
Check whether a major upgrade is needed.
That is defined as an upgrade that changes something really fundamental in the database, so nothing can possibly work until the database has been updated, and that is defined by the hard-coded version number in this function.
bool |
is_mnet_remote_user | ( | $user | ) |
Returns whether or not the user object is a remote MNET user.
This function is in moodlelib because it does not rely on loading any of the MNET code.
object | $user | A valid user object |
bool | True if the user is from a remote Moodle. |
is_moodle_cookie_secure | ( | ) |
Determine wether the secure flag should be set on cookies.
bool |
is_newnav | ( | $navigation | ) |
Check if the passed navigation is of the new style.
mixed | $navigation |
bool | true for yes false for no |
is_number | ( | $value | ) |
Return true if given value is integer or string with integer value.
mixed | $value | String or Int |
bool | true if number, false if not |
is_primary_admin | ( | $userid | ) |
Is a userid the primary administrator?
int | $userid | int id of user to check |
boolean |
is_proxybypass | ( | $url | ) |
Check if $url matches anything in proxybypass list.
Any errors just result in the proxy being used (least bad)
string | $url | url to check |
boolean | true if we should bypass the proxy |
is_restored_user | ( | $username | ) |
Returns true if the user is a 'restored' one.
Used in the login process to inform the user and allow him/her to reset the password
string | $username | username to be checked |
bool |
is_rtl_compatible | ( | $paramtype | ) |
Whether the PARAM_* type is compatible in RTL.
Being compatible with RTL means that the data they contain can flow from right-to-left or left-to-right without compromising the user experience.
Take URLs for example, they are not RTL compatible as they should always flow from the left to the right. This also applies to numbers, email addresses, configuration snippets, base64 strings, etc...
This function tries to best guess which parameters can contain localised strings.
string | $paramtype | Constant PARAM_*. |
bool |
is_valid_plugin_name | ( | $name | ) |
This method validates a plug name.
It is much faster than calling clean_param.
string | $name | a string that might be a plugin name. |
bool | if this string is a valid plugin name. |
|
static |
This method validates a plug name.
It is much faster than calling clean_param.
string | $plugintype | type of plugin |
string | $pluginname | a string that might be a plugin name. |
bool | if this string is a valid plugin name. |
is_web_crawler | ( | ) |
ismoving | ( | $courseid | ) |
Determines if the logged in user is currently moving an activity.
int | $courseid | The id of the course being tested |
bool |
js_minify | ( | ) |
ldap_addslashes | ( | $text | ) |
Quote control characters in AttributeValue parts of a RelativeDistinguishedName used in LDAP distinguished names - See RFC 4514/2253.
string | the AttributeValue to quote |
string | the AttributeValue quoted |
ldap_connect_moodle | ( | $host_url, | |
$ldap_version, | |||
$user_type, | |||
$bind_dn, | |||
$bind_pw, | |||
$opt_deref, | |||
& | $debuginfo, | ||
$start_tls = false |
|||
) |
Tries connect to specified ldap servers.
Returns a valid LDAP connection or false.
string | $host_url | |
integer | $ldap_version | either 2 (LDAPv2) or 3 (LDAPv3). |
string | $user_type | the configured user type for this connection. |
string | $bind_dn | the binding user dn. If an emtpy string, anonymous binding is used. |
string | $bind_pw | the password for the binding user. Ignored for anonymous bindings. |
boolean | $opt_deref | whether to set LDAP_OPT_DEREF on this connection or not. |
string | &$debuginfo | the debugging information in case the connection fails. |
boolean | $start_tls | whether to use LDAP with TLS (not to be confused with LDAP+SSL) |
mixed | connection result or false. |
ldap_filter_addslashes | ( | $text | ) |
Quote control characters in texts used in LDAP filters - see RFC 4515/2254.
string | filter string to quote |
string | the filter string quoted |
ldap_find_userdn | ( | $ldapconnection, | |
$username, | |||
$contexts, | |||
$objectclass, | |||
$search_attrib, | |||
$search_sub | |||
) |
Search specified contexts for username and return the user dn like: cn=username,ou=suborg,o=org.
mixed | $ldapconnection | a valid LDAP connection. |
mixed | $username | username (external LDAP encoding, no db slashes). |
array | $contexts | contexts to look for the user. |
string | $objectclass | objectlass of the user (in LDAP filter syntax). |
string | $search_attrib | the attribute use to look for the user. |
boolean | $search_sub | whether to search subcontexts or not. |
mixed | the user dn (external LDAP encoding, no db slashes) or false |
if (!defined( 'LDAP_DN_SPECIAL_CHARS')) if (!defined( 'LDAP_DN_SPECIAL_CHARS_QUOTED_NUM')) if (!defined( 'LDAP_DN_SPECIAL_CHARS_QUOTED_ALPHA')) if (!defined( 'LDAP_DN_SPECIAL_CHARS_QUOTED_ALPHA_REGEX')) ldap_get_dn_special_chars | ( | ) |
The order of the special characters in these arrays IS IMPORTANT.
Make sure '\5C' (and '\') are the first elements of the arrays. Otherwise we'll double replace '\' with '\5C' which is Bad(tm)
ldap_get_entries_moodle | ( | $ldapconnection, | |
$searchresult | |||
) |
Returns values like ldap_get_entries but is binary compatible and returns all attributes as array.
mixed | $ldapconnection | A valid LDAP connection |
mixed | $searchresult | A search result from ldap_search, ldap_list, etc. |
array | ldap-entries with lower-cased attributes as indexes |
ldap_getdefaults | ( | ) |
Initializes needed variables for ldap-module.
Uses names defined in ldap_supported_usertypes. $default is first defined as: $default['pseudoname'] = array( 'typename1' => 'value', 'typename2' => 'value' .... );
array | of default values |
ldap_isgroupmember | ( | $ldapconnection, | |
$userid, | |||
$group_dns, | |||
$member_attrib | |||
) |
Checks if user belongs to specific group(s) or is in a subtree.
Returns true if user belongs to a group in grupdns string OR if the DN of the user is in a subtree of the DN provided as "group"
mixed | $ldapconnection | A valid LDAP connection. |
string | $userid | LDAP user id (dn/cn/uid/...) to test membership for. |
array | $group_dns | arrary of group dn |
string | $member_attrib | the name of the membership attribute. |
boolean |
ldap_normalise_objectclass | ( | $objectclass, | |
$default = '*' |
|||
) |
Normalise the supplied objectclass filter.
This normalisation is a rudimentary attempt to format the objectclass filter correctly.
string | $objectclass | The objectclass to normalise |
string | $default | The default objectclass value to use if no objectclass was supplied |
string | The normalised objectclass. |
ldap_paged_results_supported | ( | $ldapversion, | |
$ldapconnection = null |
|||
) |
Check if we can use paged results (see RFC 2696).
We need to use LDAP version 3 (or later), otherwise the server cannot use them. If we also pass in a valid LDAP connection handle, we also check whether the server actually supports them.
ldapversion | integer The LDAP protocol version we use. |
ldapconnection | resource An existing LDAP connection (optional). |
boolean | true is paged results can be used, false otherwise. |
ldap_stripslashes | ( | $text | ) |
Unquote control characters in AttributeValue parts of a RelativeDistinguishedName used in LDAP distinguished names - See RFC 4514/2253.
string | the AttributeValue quoted |
string | the AttributeValue unquoted |
if (!defined( 'ROOTDSE')) if (!defined( 'LDAP_PAGED_RESULTS_CONTROL')) if (!defined( 'LDAP_DEFAULT_PAGESIZE')) ldap_supported_usertypes | ( | ) |
Returns predefined user types.
array | of predefined user types |
link_arrow_left | ( | $text, | |
$url = '' , |
|||
$accesshide = false , |
|||
$addclass = '' , |
|||
$addparams = [] |
|||
) |
Return the left arrow with text ('previous'), and optionally embedded in a link.
string | $text | HTML/plain text label (set to blank only for breadcrumb separator cases). |
string | $url | An optional link to use in a surrounding HTML anchor. |
bool | $accesshide | True if text should be hidden (for screen readers only). |
string | $addclass | Additional class names for the link, or the arrow character. |
string | HTML string. |
link_arrow_right | ( | $text, | |
$url = '' , |
|||
$accesshide = false , |
|||
$addclass = '' , |
|||
$addparams = [] |
|||
) |
Return the right arrow with text ('next'), and optionally embedded in a link.
string | $text | HTML/plain text label (set to blank only for breadcrumb separator cases). |
string | $url | An optional link to use in a surrounding HTML anchor. |
bool | $accesshide | True if text should be hidden (for screen readers only). |
string | $addclass | Additional class names for the link, or the arrow character. |
string | HTML string. |
load_course_context | ( | ) |
load_environment_xml | ( | $env_select = ENV_SELECT_NEWER | ) |
This function will load the environment.xml file and xmlize it.
@staticvar array $data @uses ENV_SELECT_NEWER @uses ENV_SELECT_DATAROOT @uses ENV_SELECT_RELEASE
int | string | $env_select | one of ENV_SELECT_NEWER | ENV_SELECT_DATAROOT | ENV_SELECT_RELEASE decide xml to use. String means plugin name. |
mixed | the xmlized structure or false on error |
|
protected |
Load all the filters required by this context.
context | $context | the context. |
|
staticprotected |
Loads the db/renamedclasses.php file from the given directory.
The renamedclasses.php should contain a key => value array ($renamedclasses) where the key is old class name, and the value is the new class name. It is only included when we are populating the component cache. After that is not needed.
string | $fulldir |
load_role_access_by_context | ( | ) |
|
protected |
Log a message to the progress tracer.
string | $message | |
int | $depth |
|
protected |
Log an end message to the progress tracer.
string | $message | |
int | $depth |
|
protected |
Log a start message to the progress tracer.
string | $message | |
int | $depth |
login_attempt_failed | ( | $user | ) |
To be called after failed user login.
stdClass | $user |
login_attempt_valid | ( | $user | ) |
To be called after valid user login.
stdClass | $user |
login_is_lockedout | ( | $user | ) |
Verify if user is locked out.
stdClass | $user |
bool | true if user locked out |
login_lock_account | ( | $user | ) |
Lockout user and send notification email.
stdClass | $user |
login_unlock_account | ( | $user | ) |
Unlock user account and reset timers.
stdClass | $user |
make_backup_temp_directory | ( | $directory, | |
$exceptiononerror = true |
|||
) |
Create a directory under $CFG->backuptempdir and make sure it is writable.
Do not use for storing generic temp files - see make_temp_directory() instead for this purpose.
Backup temporary files must be on a shared storage.
string | $directory | the relative path of the directory to be created under $CFG->backuptempdir |
bool | $exceptiononerror | throw exception if error encountered |
string|false | Returns full path to directory if successful, false if not; may throw exception |
make_cache_directory | ( | $directory, | |
$exceptiononerror = true |
|||
) |
Create a directory under cachedir and make sure it is writable.
Note: this cache directory is shared by all cluster nodes.
string | $directory | the full path of the directory to be created under $CFG->cachedir |
bool | $exceptiononerror | throw exception if error encountered |
string|false | Returns full path to directory if successful, false if not; may throw exception |
make_categories_list | ( | ) |
make_editing_buttons | ( | ) |
|
protected |
Factory method for creating a filter.
string | $filtername | The filter name, for example 'tex'. |
context | $context | context object. |
array | $localconfig | array of local configuration variables for this filter. |
moodle_text_filter | The filter, or null, if this type of filter is not recognised or could not be created. |
Reimplemented in performance_measuring_filter_manager.
|
protected |
Factory method for creating a filter.
string | $filtername | The filter name, for example 'tex'. |
context | $context | context object. |
array | $localconfig | array of local configuration variables for this filter. |
moodle_text_filter | The filter, or null, if this type of filter is not recognised or could not be created. |
Reimplemented from filter_manager.
make_grades_menu | ( | $gradingtype | ) |
Creates an array that represents all the current grades that can be chosen using the given grading type.
Negative numbers are scales, zero is no grade, and positive numbers are maximum grades.
int | $gradingtype |
array |
make_localcache_directory | ( | $directory, | |
$exceptiononerror = true |
|||
) |
Create a directory under localcachedir and make sure it is writable.
The files in this directory MUST NOT change, use revisions or content hashes to work around this limitation - this means you can only add new files here.
The content of this directory gets purged automatically on all cluster nodes after calling purge_all_caches() before new data is written to this directory.
Note: this local cache directory does not need to be shared by cluster nodes.
string | $directory | the relative path of the directory to be created under $CFG->localcachedir |
bool | $exceptiononerror | throw exception if error encountered |
string|false | Returns full path to directory if successful, false if not; may throw exception |
make_menu_from_list | ( | $list, | |
$separator = ',' |
|||
) |
Given a list (eg a,b,c,d,e) this function returns an array of 1->a, 2->b, 3->c etc.
string | $list | The string to explode into array bits |
string | $separator | The separator used within the list string |
array | The now assembled array |
make_request_directory | ( | $exceptiononerror = true , |
|
bool | $forcecreate = false |
||
) |
Create a per-request directory and make sure it is writable.
This can only be used during the current request and will be tidied away automatically afterwards.
A new, unique directory is always created within a shared base request directory.
In some exceptional cases an alternative base directory may be required. This can be accomplished using the $forcecreate parameter. Typically this will only be requried where the file may be required during a shutdown handler which may or may not be registered after a previous request directory has been created.
bool | $exceptiononerror | throw exception if error encountered |
bool | $forcecreate | Force creation of a new parent directory |
string | The full path to directory if successful, false if not; may throw exception |
make_temp_directory | ( | $directory, | |
$exceptiononerror = true |
|||
) |
Create a directory under tempdir and make sure it is writable.
Where possible, please use make_request_directory() and limit the scope of your data to the current HTTP request.
Do not use for storing cache files - see make_cache_directory(), and make_localcache_directory() instead for this purpose.
Temporary files must be on a shared storage, and heavy usage is discouraged due to the performance impact upon clustered environments.
string | $directory | the full path of the directory to be created under $CFG->tempdir |
bool | $exceptiononerror | throw exception if error encountered |
string|false | Returns full path to directory if successful, false if not; may throw exception |
make_unique_id_code | ( | $extra = '' | ) |
make_unique_id_code
@uses $_SERVER
string | $extra | Extra string to append to the end of the code |
string |
make_unique_writable_directory | ( | $basedir, | |
$exceptiononerror = true |
|||
) |
Create a new unique directory within the specified directory.
string | $basedir | The directory to create your new unique directory within. |
bool | $exceptiononerror | throw exception if error encountered |
string | The created directory |
invalid_dataroot_permissions |
make_upload_directory | ( | $directory, | |
$exceptiononerror = true |
|||
) |
Create a directory under dataroot and make sure it is writable.
Do not use for temporary and cache files - see make_temp_directory() and make_cache_directory().
string | $directory | the full path of the directory to be created under $CFG->dataroot |
bool | $exceptiononerror | throw exception if error encountered |
string|false | Returns full path to directory if successful, false if not; may throw exception |
mark_context_dirty | ( | ) |
markdown_to_html | ( | $text | ) |
Given Markdown formatted text, make it into XHTML using external function.
string | $text | The markdown formatted text to be converted. |
string | Converted text |
matching_page_type_patterns | ( | $pagetype | ) |
Given a specific page type, return all the page type patterns that might match it.
string | $pagetype | for example 'course-view-weeks' or 'mod-quiz-view'. |
array | an array of all the page type patterns that might match this page type. |
matching_page_type_patterns_from_pattern | ( | $pattern | ) |
Give an specific pattern, return all the page type patterns that would also match it.
string | $pattern | the pattern, e.g. 'mod-forum-*' or 'mod-quiz-view'. |
array | of all the page type patterns matching. |
mdie | ( | $msg = '' , |
|
$errorcode = 1 |
|||
) |
Print an error to STDOUT and exit with a non-zero code.
For commandline scripts.
Default errorcode is 1.
Very useful for perl-like error-handling: do_somethting() or mdie("Something went wrong");
string | $msg | Error message |
integer | $errorcode | Error code to emit |
me | ( | ) |
Returns the name of the current script, WITH the querystring portion.
This function is necessary because PHP_SELF and REQUEST_URI and SCRIPT_NAME return different things depending on a lot of things like your OS, Web server, and the way PHP is compiled (ie. as a CGI, module, ISAPI, etc.) NOTE: This function returns false if the global variables needed are not set.
mixed | String or false if the global variables needed are not set. |
merge_query_params | ( | array & | $target, |
array | $values | ||
) |
Merge parsed POST chunks.
NOTE: this is not perfect, but it should work in most cases hopefully.
array | $target | |
array | $values |
message_add_contact | ( | $contactid, | |
$blocked = 0 , |
|||
$userid = 0 |
|||
) |
Add the selected user as a contact for the current user.
int | $contactid | the ID of the user to add as a contact |
int | $blocked | 1 if you wish to block the contact |
int | $userid | the user ID of the user we want to add the contact for, defaults to current user if not specified. |
bool/int | false if the $contactid isnt a valid user id. True if no changes made. Otherwise returns the result of update_record() or insert_record() |
message_block_contact | ( | $contactid, | |
$userid = 0 |
|||
) |
Block a user.
int | $contactid | the user ID of the user to block |
int | $userid | the user ID of the user we want to unblock the contact for, defaults to current user if not specified. |
bool |
message_can_delete_message | ( | $message, | |
$userid | |||
) |
Checks if a user can delete a message.
stdClass | $message | the message to delete |
string | $userid | the user id of who we want to delete the message for (this may be done by the admin but will still seem as if it was by the user) |
bool | Returns true if a user can delete the message, false otherwise. |
message_can_post_message | ( | ) |
message_contact_link | ( | ) |
message_count_blocked_users | ( | ) |
message_count_messages | ( | ) |
message_current_user_is_involved | ( | ) |
message_delete_message | ( | $message, | |
$userid | |||
) |
Deletes a message.
This function does not verify any permissions.
stdClass | $message | the message to delete |
string | $userid | the user id of who we want to delete the message for (this may be done by the admin but will still seem as if it was by the user) |
bool |
message_get_blocked_users | ( | $user1 = null , |
|
$user2 = null |
|||
) |
Retrieve users blocked by $user1.
object | $user1 | the user whose messages are being viewed |
object | $user2 | the user $user1 is talking to. If they are being blocked they will have a variable called 'isblocked' added to their user object |
array | the users blocked by $user1 |
message_get_contact | ( | $contactid | ) |
Load a user's contact record.
int | $contactid | the user ID of the user whose contact record you want |
array | message contacts |
message_get_contact_add_remove_link | ( | ) |
message_get_contact_block_link | ( | ) |
message_get_contacts | ( | $user1 = null , |
|
$user2 = null |
|||
) |
Retrieve $user1's contacts (online, offline and strangers)
object | $user1 | the user whose messages are being viewed |
object | $user2 | the user $user1 is talking to. If they are a contact they will have a variable called 'iscontact' added to their user object |
array | containing 3 arrays. array($onlinecontacts, $offlinecontacts, $strangers) |
message_get_course_contexts | ( | ) |
message_get_fragment | ( | ) |
message_get_history | ( | ) |
message_get_recent_conversations | ( | $userorid, | |
$limitfrom = 0 , |
|||
$limitto = 100 |
|||
) |
message_get_recent_notifications | ( | ) |
message_history_link | ( | ) |
message_is_user_blocked | ( | ) |
message_is_user_non_contact_blocked | ( | ) |
message_mark_message_read | ( | $message, | |
$timeread, | |||
$messageworkingempty = false |
|||
) |
Mark a single message as read.
stdClass | $message | An object with an object property ie $message->id which is an id in the message table |
int | $timeread | the timestamp for when the message should be marked read. Usually time(). |
bool | $messageworkingempty | Is the message_working table already confirmed empty for this message? |
int | the ID of the message in the messags table |
message_mark_messages_read | ( | ) |
message_move_userfrom_unread2read | ( | $userid | ) |
Moves messages from a particular user from the message table (unread messages) to message_read This is typically only used when a user is deleted.
object | $userid | User id |
boolean | success |
message_page_type_list | ( | ) |
message_remove_contact | ( | $contactid, | |
$userid = 0 |
|||
) |
Remove a contact.
int | $contactid | the user ID of the contact to remove |
int | $userid | the user ID of the user we want to remove the contacts for, defaults to current user if not specified. |
bool | returns the result of delete_records() |
message_remove_url_params | ( | ) |
message_search | ( | ) |
message_shorten_message | ( | ) |
message_unblock_contact | ( | $contactid, | |
$userid = 0 |
|||
) |
Unblock a contact.
int | $contactid | the user ID of the contact to unblock |
int | $userid | the user ID of the user we want to unblock the contact for, defaults to current user if not specified. |
bool | returns the result of delete_records() |
microtime_diff | ( | $a, | |
$b | |||
) |
Calculate the difference between two microtimes.
string | $a | The first Microtime |
string | $b | The second Microtime |
string |
min_clean_param | ( | $value, | |
$type | |||
) |
Minimalistic parameter cleaning function.
Note: Can not use optional param because moodlelib.php is not loaded yet.
string | $value | |
string | $type |
mixed |
min_enable_zlib_compression | ( | ) |
This method tries to enable output compression if possible.
This function must be called before any output or headers.
(IE6 is not supported at all.)
boolean,true | if compression enabled |
min_fix_utf8 | ( | $value | ) |
Minimalistic UTF-8 sanitisation.
Note: This duplicates fix_utf8() intentionally for now.
string | $value |
string |
min_get_slash_argument | ( | $clean = true | ) |
Returns the slashargument part of the URL.
Note: ".php" is NOT allowed in slasharguments, it is intended for ASCII characters only.
boolean | $clean | - Should we do cleaning on this path argument. If you set this to false you MUST be very careful and do the cleaning manually. |
string |
min_optional_param | ( | $name, | |
$default, | |||
$type | |||
) |
Minimalistic parameter validation function.
Can not use optional param because moodlelib.php is not loaded yet
string | $name | |
mixed | $default | |
string | $type |
mixed |
mnet_get_idp_jump_url | ( | $user | ) |
return the jump url for a given remote user this is used for rewriting forum post links in emails, etc
stdclass | $user | the user to get the idp url for |
mod_page_type_list | ( | $pagetype, | |
$parentcontext = null , |
|||
$currentcontext = null |
|||
) |
Generates the page type list for a module by either locating and using the modules callback or by generating a default list.
string | $pagetype | |
stdClass | $parentcontext | |
stdClass | $currentcontext |
array |
moodle_getlocale | ( | ) |
Gets the system locale.
string | Retuns the current locale. |
moodle_major_version | ( | $fromdisk = false | ) |
Returns the major version of this site.
Moodle version numbers consist of three numbers separated by a dot, for example 1.9.11 or 2.0.2. The first two numbers, like 1.9 or 2.0, represent so called major version. This function extracts the major version from either $CFG->release (default) or eventually from the $release variable defined in the main version.php.
bool | $fromdisk | should the version if source code files be used |
string|false | the major version like '2.3', false if could not be determined |
moodle_minimum_php_version_is_met | ( | $haltexecution = false | ) |
Tests the current PHP version against Moodle's minimum requirement.
When requirement is not met returns false or halts execution depending $haltexecution param.
bool | $haltexecution | Should execution be halted when requirement not met? Defaults to false. |
bool | returns true if requirement is met (false if not) |
moodle_needs_upgrading | ( | ) |
Determine if moodle installation requires update.
Checks version numbers of main code and all plugins to see if there are any mismatches.
bool |
moodle_process_email | ( | $modargs, | |
$body | |||
) |
moodle_require_minimum_php_version | ( | ) |
Require our minimum php version or halt execution if requirement not met.
void | Execution is halted if version is not met. |
move_category | ( | ) |
mtrace | ( | $string, | |
$eol = "\n" , |
|||
$sleep = 0 |
|||
) |
For outputting debugging info.
string | $string | The string to write |
string | $eol | The end of line char(s) to use |
string | $sleep | Period to make the application sleep This ensures any messages have time to display before redirect |
my_page_type_list | ( | $pagetype, | |
$parentcontext = null , |
|||
$currentcontext = null |
|||
) |
Generates the page type list for the my moodle page.
string | $pagetype | |
stdClass | $parentcontext | |
stdClass | $currentcontext |
array |
mygroupid | ( | ) |
navmenu | ( | ) |
navmenulist | ( | $course, | |
$sections, | |||
$modinfo, | |||
$strsection, | |||
$strjumpto, | |||
$width = 50 , |
|||
$cmid = 0 |
|||
) |
Returns a popup menu with course activity modules.
Given a course this function returns a small popup menu with all the course activity modules in it, as a navigation menu outputs a simple list structure in XHTML. The data is taken from the serialised array stored in the course record.
course | $course | A $COURSE object. |
array | $sections | |
course_modinfo | $modinfo | |
string | $strsection | |
string | $strjumpto | |
int | $width | |
string | $cmid |
string | The HTML block |
|
static |
Normalize the component name using the "frankenstyle" rules.
Normalize the component name using the "frankenstyle" names.
Note: this does not verify the validity of plugin or type names.
string | $component |
array | two-items list of [(string)type, (string|null)name] |
string | $component |
array | two-items list of [(string)type, (string|null)name] |
|
static |
Normalize the component name.
Note: this does not verify the validity of the plugin or component.
string | $component |
string |
normalize_version | ( | $version | ) |
This function will normalize any version to just a serie of numbers separated by dots.
Everything else will be removed.
string | $version | the original version |
string | the normalized version |
notice | ( | $message, | |
$link = '' , |
|||
$course = null |
|||
) |
Print a message and exit.
string | $message | The message to print in the notice |
moodle_url | string | $link | The link to use for the continue button |
object | $course | A course object. Unused. |
void | This function simply exits |
notify | ( | ) |
obfuscate_email | ( | ) |
Given an email address, this function will return an obfuscated version of it.
string | The email address to obfuscate |
string | The obfuscated email address |
obfuscate_mailto | ( | $email, | |
$label = '' , |
|||
$dimmed = false , |
|||
$subject = '' , |
|||
$body = '' |
|||
) |
This function uses the } and obfuscate_text() to generate a fully obfuscated email link, ready to use.
string | The email address to display | |
string | $label | The text to displayed as hyperlink to $email |
boolean | $dimmed | If true then use css class 'dimmed' for hyperlink |
string | $subject | The subject of the email in the mailto link |
string | $body | The content of the email in the mailto link |
string | The obfuscated mailto link |
obfuscate_text | ( | $plaintext | ) |
This function takes some text and replaces about half of the characters with HTML entity equivalents.
Return string is obviously longer.
string | $plaintext | The text to be obfuscated |
string | The obfuscated text |
object_array_unique | ( | $array, | |
$keepkeyassoc = true |
|||
) |
Returns an array without repeated objects.
This function is similar to array_unique, but for arrays that have objects as values
array | $array | |
bool | $keepkeyassoc |
array |
object_property_exists | ( | $obj, | |
$property | |||
) |
Detect if an object or a class contains a given property will take an actual object or the name of a class.
mix | $obj | Name of class or real object to test |
string | $property | name of property to find |
bool | true if property exists |
optional_param | ( | $parname, | |
$default, | |||
$type | |||
) |
Returns a particular value for the named variable, taken from POST or GET, otherwise returning a given default.
This function should be used to initialise all optional values in a script that are based on parameters. Usually it will be used like this: $name = optional_param('name', 'Fred', PARAM_TEXT);
Please note the $type parameter is now required and the value can not be array.
string | $parname | the name of the page parameter we want |
mixed | $default | the default value to return if nothing is found |
string | $type | expected type of parameter |
mixed |
coding_exception |
optional_param_array | ( | $parname, | |
$default, | |||
$type | |||
) |
Returns a particular array value for the named variable, taken from POST or GET, otherwise returning a given default.
This function should be used to initialise all optional values in a script that are based on parameters. Usually it will be used like this: $ids = optional_param('id', array(), PARAM_INT);
Note: arrays of arrays are not supported, only alphanumeric keys with _ and - are supported
string | $parname | the name of the page parameter we want |
mixed | $default | the default value to return if nothing is found |
string | $type | expected type of parameter |
array |
coding_exception |
order_in_string | ( | $values, | |
$stringformat | |||
) |
Returns an array of values in order of occurance in a provided string.
The key in the result is the character postion in the string.
array | $values | Values to be found in the string format |
string | $stringformat | The string which may contain values being searched for. |
array | An array of values in order according to placement in the string format. |
over_bounce_threshold | ( | $user | ) |
Check whether the user has exceeded the bounce threshold.
stdClass | $user | A $USER object |
bool | true => User has exceeded bounce threshold |
p | ( | $var | ) |
page_doc_link | ( | $text = '' | ) |
Returns a string containing a link to the user documentation for the current page.
Also contains an icon by default. Shown to teachers and admin only.
string | $text | The text to be displayed for the link |
string | The link to user documentation for this current page |
page_get_doc_link_path | ( | moodle_page | $page | ) |
Returns the path to use when constructing a link to the docs.
moodle_page | $page |
string |
partial | ( | ) |
Helper function to do partial function binding.
so we can use it for preg_replace_callback, for example this works with php functions, user functions, static methods and class methods it returns you a callback that you can pass on like so:
$callback = partial('somefunction', $arg1, $arg2); or $callback = partial(array('someclass', 'somestaticmethod'), $arg1, $arg2); or even $obj = new someclass(); $callback = partial(array($obj, 'somemethod'), $arg1, $arg2);
and then the arguments that are passed through at calltime are appended to the argument list.
mixed | $function | a php callback |
mixed | $arg1,... | $argv arguments to partially bind with |
array | Array callback |
password_compat_not_supported | ( | ) |
password_is_legacy_hash | ( | $password | ) |
Check a password hash to see if it was hashed using the legacy hash algorithm (md5).
string | $password | String to check. |
boolean | True if the $password matches the format of an md5 sum. |
phpunit_bootstrap_error | ( | $errorcode, | |
$text = '' |
|||
) |
Print error and stop execution.
int | $errorcode | The exit error code |
string | $text | An error message to display |
void | stops code execution with error code |
plugin_callback | ( | $type, | |
$name, | |||
$feature, | |||
$action, | |||
$params = null , |
|||
$default = null |
|||
) |
Invoke plugin's callback functions.
string | $type | plugin type e.g. 'mod' |
string | $name | plugin name |
string | $feature | feature name |
string | $action | feature's action |
array | $params | parameters of callback function, should be an array |
mixed | $default | default value if callback function hasn't been defined, or if it retursn null. |
mixed |
plugin_supports | ( | $type, | |
$name, | |||
$feature, | |||
$default = null |
|||
) |
Checks whether a plugin supports a specified feature.
string | $type | Plugin type e.g. 'mod' |
string | $name | Plugin name e.g. 'forum' |
string | $feature | Feature code (FEATURE_xx constant) |
mixed | $default | default value if feature support unknown |
mixed | Feature result (false if not supported, null if feature is unknown, otherwise usually true but may have other feature-specific value such as array) |
coding_exception |
preload_course_contexts | ( | ) |
prevent_form_autofill_password | ( | ) |
object print_arrow | ( | $direction = 'up' , |
|
$strsort = null , |
|||
$return = false |
|||
) |
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.
If no sort string is associated with the direction, an arrow with no alt text will be printed/returned.
string | $direction | 'up' or 'down' |
string | $strsort | The language string used for the alt attribute of this image |
bool | $return | Whether to print directly or return the html string |
string|void | depending on $return |
print_badge_image | ( | badge | $badge, |
stdClass | $context, | ||
$size = 'small' |
|||
) |
Print badge image.
badge | $badge | Badge object |
stdClass | $context | |
string | $size |
print_category_info | ( | ) |
print_checkbox | ( | ) |
print_collapsible_region | ( | $contents, | |
$classes, | |||
$id, | |||
$caption, | |||
$userpref = '' , |
|||
$default = false , |
|||
$return = false |
|||
) |
Print (or return) a collapsible region, that has a caption that can be clicked to expand or collapse the region.
If JavaScript is off, then the region will always be expanded.
string | $contents | the contents of the box. |
string | $classes | class names added to the div that is output. |
string | $id | id added to the div that is output. Must not be blank. |
string | $caption | text displayed at the top. Clicking on this will cause the region to expand or contract. |
string | $userpref | the name of the user preference that stores the user's preferred default state. (May be blank if you do not wish the state to be persisted. |
boolean | $default | Initial collapsed state to use if the user_preference it not set. |
boolean | $return | if true, return the HTML as a string, rather than printing it. |
string|void | If $return is false, returns nothing, otherwise returns a string of HTML. |
print_collapsible_region_end | ( | $return = false | ) |
Close a region started with print_collapsible_region_start.
boolean | $return | if true, return the HTML as a string, rather than printing it. |
string|void | if $return is false, returns nothing, otherwise returns a string of HTML. |
print_collapsible_region_start | ( | $classes, | |
$id, | |||
$caption, | |||
$userpref = '' , |
|||
$default = false , |
|||
$return = false |
|||
) |
Print (or return) the start of a collapsible region.
The collapsibleregion has a caption that can be clicked to expand or collapse the region. If JavaScript is off, then the region will always be expanded.
string | $classes | class names added to the div that is output. |
string | $id | id added to the div that is output. Must not be blank. |
string | $caption | text displayed at the top. Clicking on this will cause the region to expand or contract. |
string | $userpref | the name of the user preference that stores the user's preferred default state. (May be blank if you do not wish the state to be persisted. |
boolean | $default | Initial collapsed state to use if the user_preference it not set. |
boolean | $return | if true, return the HTML as a string, rather than printing it. |
string|void | if $return is false, returns nothing, otherwise returns a string of HTML. |
print_container | ( | ) |
print_container_end | ( | ) |
print_container_start | ( | ) |
print_context_name | ( | ) |
print_continue | ( | ) |
print_course | ( | ) |
print_course_search | ( | ) |
print_courses | ( | ) |
print_error | ( | $errorcode, | |
$module = 'error' , |
|||
$link = '' , |
|||
$a = null , |
|||
$debuginfo = null |
|||
) |
Abort execution by throwing of a general exception, default exception handler displays the error message in most cases.
string | $errorcode | The name of the language string containing the error message. Normally this should be in the error.php lang file. |
string | $module | The language file to get the error message from. |
string | $link | The url where the user will be prompted to continue. If no url is provided the user will be directed to the site index page. |
object | $a | Extra words and phrases that might be required in the error string |
string | $debuginfo | optional debugging information |
void,always | throws exception! |
print_grade_menu | ( | $courseid, | |
$name, | |||
$current, | |||
$includenograde = true , |
|||
$return = false |
|||
) |
Prints a grade menu (as part of an existing form) with help showing all possible numerical grades and scales.
int | $courseid | The course ID |
string | $name | |
string | $current | |
boolean | $includenograde | Include those with no grades |
boolean | $return | If set to true returns rather than echo's |
string|bool | Depending on value of $return |
print_group_picture | ( | $group, | |
$courseid, | |||
$large = false , |
|||
$return = false , |
|||
$link = true , |
|||
$includetoken = false |
|||
) |
Print a specified group's avatar.
array | stdClass | $group | A single group object OR array of groups. |
int | $courseid | The course ID. |
boolean | $large | Default small picture, or large. |
boolean | $return | If false print picture, otherwise return the output as string |
boolean | $link | Enclose image in a link to view specified course? |
boolean | $includetoken | Whether to use a user token when displaying this group image. True indicates to generate a token for current user, and integer value indicates to generate a token for the user whose id is the value indicated. If the group picture is included in an e-mail or some other location where the audience is a specific user who will not be logged in when viewing, then we use a token to authenticate the user. |
string|void | Depending on the setting of $return |
print_header | ( | ) |
print_header_simple | ( | ) |
print_location_comment | ( | $file, | |
$line, | |||
$return = false |
|||
) |
Outputs a HTML comment to the browser.
This is used for those hard-to-debug pages that use bits from many different files in very confusing ways (e.g. blocks).
print_location_comment(FILE, LINE);
string | $file | |
integer | $line | |
boolean | $return | Whether to return or print the comment |
string|void | Void unless true given as third parameter |
print_log | ( | ) |
print_log_csv | ( | ) |
print_log_ods | ( | ) |
print_log_xls | ( | ) |
print_mnet_log | ( | ) |
print_my_moodle | ( | ) |
print_navigation | ( | ) |
print_object | ( | $object | ) |
GENERAL HELPFUL THINGS ///////////////////////////////////.
Dumps a given object's information for debugging purposes
When used in a CLI script, the object's information is written to the standard error output stream. When used in a web script, the object is dumped to a pre-formatted block with the "notifytiny" CSS class.
mixed | $object | The data to be printed |
void | output is echo'd |
print_overview | ( | ) |
print_password_policy | ( | ) |
Returns a localized sentence in the current language summarizing the current password policy.
string |
print_recent_activity | ( | ) |
print_recent_activity_note | ( | $time, | |
$user, | |||
$text, | |||
$link, | |||
$return = false , |
|||
$viewfullnames = null |
|||
) |
Display a recent activity note.
@staticvar string $strftimerecent
int | $time | A timestamp int. |
stdClass | $user | A user object from the database. |
string | $text | Text for display for the note |
string | $link | The link to wrap around the text |
bool | $return | If set to true the HTML is returned rather than echo'd |
string | $viewfullnames |
string | If $retrun was true returns HTML for a recent activity notice. |
print_remote_course | ( | ) |
print_remote_host | ( | ) |
print_scale_menu_helpbutton | ( | ) |
print_section | ( | ) |
print_section_add_menus | ( | ) |
print_side_block | ( | ) |
print_tabs | ( | $tabrows, | |
$selected = null , |
|||
$inactive = null , |
|||
$activated = null , |
|||
$return = false |
|||
) |
Returns a string containing a nested list, suitable for formatting into tabs with CSS.
It is not recommended to use this function in Moodle 2.5 but it is left for backward compartibility.
Example how to print a single line tabs: $rows = array( new tabobject(...), new tabobject(...) ); echo $OUTPUT->tabtree($rows, $selectedid);
Multiple row tabs may not look good on some devices but if you want to use them you can specify ->subtree for the active tabobject.
array | $tabrows | An array of rows where each row is an array of tab objects |
string | $selected | The id of the selected tab (whatever row it's on) |
array | $inactive | An array of ids of inactive tabs that are not selectable. |
array | $activated | An array of ids of other tabs that are currently activated |
bool | $return | If true output is returned rather then echo'd |
string | HTML output if $return was set to true. |
object print_textarea | ( | $unused, | |
$rows, | |||
$cols, | |||
$width, | |||
$height, | |||
$name, | |||
$value = '' , |
|||
$obsolete = 0 , |
|||
$return = false , |
|||
$id = '' |
|||
) |
Prints a basic textarea field.
This was 'deprecated' in 2.0, but not properly (there was no alternative) so the debugging message was commented out.
When using this function, you should
bool | $unused | No longer used. |
int | $rows | Number of rows to display (minimum of 10 when $height is non-null) |
int | $cols | Number of columns to display (minimum of 65 when $width is non-null) |
null | $width | (Deprecated) Width of the element; if a value is passed, the minimum value for $cols will be 65. Value is otherwise ignored. |
null | $height | (Deprecated) Height of the element; if a value is passe, the minimum value for $rows will be 10. Value is otherwise ignored. |
string | $name | Name to use for the textarea element. |
string | $value | Initial content to display in the textarea. |
int | $obsolete | deprecated |
bool | $return | If false, will output string. If true, will return string value. |
string | $id | CSS ID to add to the textarea element. |
string|void | depending on the value of $return |
print_whole_category_list | ( | ) |
process_environment_bypass | ( | $xml, | |
& | $result | ||
) |
This function will post-process the result record by executing the specified function, modifying it as necessary, also a custom message will be added to the result object to be printed by the display layer.
Every bypass function must be defined in this file and it'll return true/false to decide if the original test is bypassed or no. Also such bypass functions are able to directly handling the result object although it should be only under exceptional conditions.
string | xmldata containing the bypass data |
object | result object to be updated |
void |
process_environment_messages | ( | $xml, | |
& | $result | ||
) |
This function will detect if there is some message available to be added to the result in order to clarify enviromental details.
@uses INCORRECT_FEEDBACK_FOR_REQUIRED @uses INCORRECT_FEEDBACK_FOR_OPTIONAL
string | xmldata containing the feedback data |
object | reult object to be updated |
process_environment_restrict | ( | $xml, | |
& | $result | ||
) |
This function will post-process the result record by executing the specified function, modifying it as necessary, also a custom message will be added to the result object to be printed by the display layer.
Every restrict function must be defined in this file and it'll return true/false to decide if the original test is restricted or no. Also such restrict functions are able to directly handling the result object although it should be only under exceptional conditions.
string | xmldata containing the restrict data |
object | result object to be updated |
void |
process_environment_result | ( | $element, | |
& | $result | ||
) |
Once the result has been determined, look in the XML for any messages, or other things that should be done depending on the outcome.
array | $element | the element from the environment.xml file which may have children defining what should be done with the outcome. |
object | $result | the result of the test, which may be modified by this function as specified in the XML. |
process_manual_revoke | ( | $recipientid, | |
$issuerid, | |||
$issuerrole, | |||
$badgeid | |||
) |
Manually revoke awarded badges.
int | $recipientid | |
int | $issuerid | |
int | $issuerrole | |
int | $badgeid |
bool |
process_new_icon | ( | $context, | |
$component, | |||
$filearea, | |||
$itemid, | |||
$originalfile, | |||
$preferpng = false |
|||
) |
Stores optimised icon images in icon file area.
Since 2.9 this function will generate an icon in the same format as the original file when possible. To counter that behaviour, you can use the argument $preferpng to generate a PNG icon.
context | $context | |
string | $component | |
string | filearea | |
int | $itemid | |
string | $originalfile | |
boolean | $preferpng | When true, it will try to generate a PNG file regardless of the original file. |
mixed | new unique revision number or false if not saved |
profile_display_badges | ( | ) |
purge_all_caches | ( | ) |
Invalidates browser caches and cached data in temp.
void |
purge_caches | ( | $options = [] | ) |
Selectively invalidate different types of cache.
Purges the cache areas specified. By default, this will purge all caches but can selectively purge specific areas alone or in combination.
bool[] | $options | Specific parts of the cache to purge. Valid options are: 'muc' Purge MUC caches? 'theme' Purge theme cache? 'lang' Purge language string cache? 'js' Purge javascript cache? 'filter' Purge text filter cache? 'other' Purge all other caches? |
purge_other_caches | ( | ) |
Purge all non-MUC caches not otherwise purged in purge_caches.
IMPORTANT - If you are adding anything here to do with the cache directory you should also have a look at phpunit_util::reset_dataroot()
purify_html | ( | $text, | |
$options = array() |
|||
) |
KSES replacement cleaning function - uses HTML Purifier.
string | $text | The (X)HTML string to purify |
array | $options | Array of options; currently only option supported is 'allowid' (if set, does not remove id attributes when cleaning) |
string |
put_records_csv | ( | ) |
qualified_me | ( | ) |
Guesses the full URL of the current script.
This function is using $PAGE->url, but may fall back to $FULLME which is constructed from PHP_SELF and REQUEST_URI or SCRIPT_NAME
mixed | full page URL string or false if unknown |
question_add_tops | ( | $categories, | |
$pcontexts | |||
) |
Organise categories into a single parent category (called the 'Top' category) per context.
array | $categories | List of question categories in the format of ["$categoryid,$contextid" => $category]. |
array | $pcontexts | List of context ids. |
array |
question_is_only_toplevel_category_in_context | ( | $categoryid | ) |
Checks if the question category is the highest-level category in the context that can be edited, and has no siblings.
int | $categoryid | a category id. |
bool |
raise_memory_limit | ( | $newlimit | ) |
Function to raise the memory limit to a new value.
Will respect the memory limit if it is higher, thus allowing settings in php.ini, apache conf or command line switches to override it.
The memory limit should be expressed with a constant MEMORY_STANDARD, MEMORY_EXTRA or MEMORY_HUGE. It is possible to use strings or integers too (eg:'128M').
mixed | $newlimit | the new memory limit |
bool | success |
random_bytes_emulate | ( | $length | ) |
Try to generates cryptographically secure pseudo-random bytes.
Note this is achieved by fallbacking between:
int | $length | requested length in bytes |
string | binary data |
random_string | ( | $length = 15 | ) |
Generate and return a random string of the specified length.
int | $length | The length of the string to be created. |
string |
rc4decrypt | ( | $data | ) |
rc4decrypt
string | $data | Data to decrypt. |
string | The now decrypted data. |
rc4encrypt | ( | $data | ) |
rc4encrypt
string | $data | Data to encrypt. |
string | The now encrypted data. |
rebuild_contexts | ( | ) |
moodle_database rebuild_course_cache | ( | $courseid = 0 , |
|
$clearonly = false |
|||
) |
Rebuilds or resets the cached list of course activities stored in MUC.
rebuild_course_cache() must NEVER be called from lib/db/upgrade.php. At the same time course cache may ONLY be cleared using this function in upgrade scripts of plugins.
During the bulk operations if it is necessary to reset cache of multiple courses it is enough to call increment_revision_number() for the table 'course' and field 'cacherev' specifying affected courses in select.
Cached course information is stored in MUC core/coursemodinfo and is validated with the DB field {course}.cacherev
$DB
int | $courseid | id of course to rebuild, empty means all |
boolean | $clearonly | only clear the cache, gets rebuild automatically on the fly. Recommended to set to true to avoid unnecessary multiple rebuilding. |
rebuildnolinktag | ( | $text | ) |
This function is used to rebuild the <nolink> tag because some formats (PLAIN and WIKI) will transform it to html entities.
string | $text | Text to search for nolink tag in |
string |
recaptcha_check_response | ( | $verifyurl, | |
$privkey, | |||
$remoteip, | |||
$response | |||
) |
Calls an HTTP POST function to verify if the user's response was correct.
string | $verifyurl | URL for reCAPTCHA verification |
string | $privkey | The private key for reCAPTCHA |
string | $remoteip | The user's IP |
string | $response | The response from reCAPTCHA |
ReCaptchaResponse |
recaptcha_get_challenge_html | ( | $apiurl, | |
$pubkey, | |||
$lang = null |
|||
) |
Gets the challenge HTML This is called from the browser, and the resulting reCAPTCHA HTML widget is embedded within the HTML form it was called from.
string | $apiurl | URL for reCAPTCHA API |
string | $pubkey | The public key for reCAPTCHA |
string | $lang | Language to use. If not provided, get current language. |
string | - The HTML to be embedded in the user's form. |
recaptcha_lang | ( | $lang = null | ) |
Returns the language code the reCAPTCHA element should use.
Google reCAPTCHA uses different language codes than Moodle so we must convert. https://developers.google.com/recaptcha/docs/language
string | $lang | Language to use. If not provided, get current language. |
string | A language code |
redirect | ( | $url, | |
$message = '' , |
|||
$delay = null , |
|||
$messagetype = core\output\notification::NOTIFY_INFO |
|||
) |
Redirects the user to another page, after printing a notice.
This function calls the OUTPUT redirect method, echo's the output and then dies to ensure nothing else happens.
Good practice: You should call this method before starting page output by using any of the OUTPUT methods.
moodle_url | string | $url | A moodle_url to redirect to. Strings are not to be trusted! |
string | $message | The message to display to the user |
int | $delay | The delay before redirecting |
string | $messagetype | The type of notification to show the message in. See constants on core\output\notification. |
moodle_exception |
reduce_memory_limit | ( | $newlimit | ) |
Function to reduce the memory limit to a new value.
Will respect the memory limit if it is lower, thus allowing settings in php.ini, apache conf or command line switches to override it
The memory limit should be expressed with a string (eg:'64M')
string | $newlimit | the new memory limit |
bool |
remoteip_in_list | ( | $list | ) |
Is the current ip in a given list?
string | $list |
bool |
remove_course_contents | ( | $courseid, | |
$showfeedback = true , |
|||
array | $options = null |
||
) |
Clear a course out completely, deleting all content but don't delete the course itself.
This function does not verify any permissions.
Please note this function also deletes all user enrolments, enrolment instances and role assignments by default.
$options:
int | $courseid | The id of the course that is being deleted |
bool | $showfeedback | Whether to display notifications of each action the function performs. |
array | $options | extra options |
bool | true if all the removals succeeded. false if there were any failures. If this method returns false, some of the removals will probably have succeeded, and others failed, but you have no way of knowing which. |
remove_dir | ( | $dir, | |
$contentonly = false |
|||
) |
Delete directory or only its content.
string | $dir | directory path |
bool | $contentonly |
bool | success, true also if dir does not exist |
replace_ampersands_not_followed_by_entity | ( | $string | ) |
Given a string, performs a negative lookahead looking for any ampersand character that is not followed by a proper HTML entity.
If any is found, it is replaced by &. The string is then returned.
string | $string |
string |
report_insights_context_insights | ( | \context | $context | ) |
Returns the models that generated insights in the provided context.
context | $context |
int[] |
require_admin | ( | ) |
A convenience function for where we must be logged in as admin.
void |
require_user_key_login | ( | $script, | |
$instance = null , |
|||
$keyvalue = null |
|||
) |
Require key login.
Function terminates with error if key not found or incorrect.
@uses NO_MOODLE_COOKIES @uses PARAM_ALPHANUM
string | $script | unique script identifier |
int | $instance | optional instance id |
string | $keyvalue | The key. If not supplied, this will be fetched from the current session. |
int | Instance ID |
required_param | ( | $parname, | |
$type | |||
) |
Returns a particular value for the named variable, taken from POST or GET.
If the parameter doesn't exist then an error is thrown because we require this variable.
This function should be used to initialise all required values in a script that are based on parameters. Usually it will be used like this: $id = required_param('id', PARAM_INT);
Please note the $type parameter is now required and the value can not be array.
string | $parname | the name of the page parameter we want |
string | $type | expected type of parameter |
mixed |
coding_exception |
required_param_array | ( | $parname, | |
$type | |||
) |
Returns a particular array value for the named variable, taken from POST or GET.
If the parameter doesn't exist then an error is thrown because we require this variable.
This function should be used to initialise all required values in a script that are based on parameters. Usually it will be used like this: $ids = required_param_array('ids', PARAM_INT);
Note: arrays of arrays are not supported, only alphanumeric keys with _ and - are supported
string | $parname | the name of the page parameter we want |
string | $type | expected type of parameter |
array |
coding_exception |
reset_course_userdata | ( | $data | ) |
This function will empty a course of user data.
It will retain the activities and the structure of the course.
object | $data | an object containing all the settings including courseid (without magic quotes) |
array | status array of array component, item, error |
reset_login_count | ( | ) |
reset_password_and_mail | ( | $user | ) |
Resets specified user's password and send the new password to the user via email.
stdClass | $user | A $USER object |
bool | Returns true if mail was sent OK and false if there was an error. |
reset_text_filters_cache | ( | $phpunitreset = false | ) |
Resets some data related to filters, called during upgrade or when general filter settings change.
bool | $phpunitreset | true means called from our PHPUnit integration test reset |
void |
resize_image | ( | $filepath, | |
$width, | |||
$height, | |||
$forcecanvas = false |
|||
) |
Resize an image from an image path.
This maintains the aspect ratio of the image. This will not enlarge the image.
string | $filepath | The full path to the original image file. |
int | null | $width | The max width of the resized image, or null to only use the height. |
int | null | $height | The max height of the resized image, or null to only use the width. |
bool | $forcecanvas | Whether the final dimensions should be set to $width and $height. |
string|bool | False if a problem occurs, else the resized image data. |
resize_image_from_image | ( | $original, | |
$imageinfo, | |||
$width, | |||
$height, | |||
$forcecanvas = false |
|||
) |
Resize an image from an image object.
resource | $original | The image to work on. |
array | $imageinfo | Contains [0] => originalwidth, [1] => originalheight. |
int | null | $width | The max width of the resized image, or null to only use the height. |
int | null | $height | The max height of the resized image, or null to only use the width. |
bool | $forcecanvas | Whether the final dimensions should be set to $width and $height. |
string|bool | False if a problem occurs, else the resized image data. |
resourcelib_embed_general | ( | $fullurl, | |
$title, | |||
$clicktoopen, | |||
$mimetype | |||
) |
Returns general link or file embedding html.
string | $fullurl | |
string | $title | |
string | $clicktoopen | |
string | $mimetype |
string | html |
resourcelib_embed_image | ( | $fullurl, | |
$title | |||
) |
Returns image embedding html.
string | $fullurl | |
string | $title |
string | html |
resourcelib_embed_pdf | ( | $fullurl, | |
$title, | |||
$clicktoopen | |||
) |
Returns general link or pdf embedding html.
string | $fullurl | |
string | $title | |
string | $clicktoopen |
string | html |
resourcelib_get_displayoptions | ( | array | $enabled, |
$current = null |
|||
) |
Returns list of available display options.
array | $enabled | list of options enabled in module configuration |
int | $current | current display options for existing instances |
array | of key=>name pairs |
resourcelib_get_extension | ( | $fullurl | ) |
Looks for the extension.
string | $fullurl |
string | file extension |
resourcelib_guess_url_mimetype | ( | $fullurl | ) |
Tries to guess correct mimetype for arbitrary URL.
string | $fullurl |
string | mimetype |
resourcelib_try_file_migration | ( | $filepath, | |
$cmid, | |||
$courseid, | |||
$component, | |||
$filearea, | |||
$itemid | |||
) |
Try on demand migration of file from old course files.
string | $filepath | old file path |
int | $cmid | migrated course module if |
int | $courseid | |
string | $component | |
string | $filearea | new file area |
int | $itemid | migrated file item id |
mixed,false | if not found, stored_file instance if migrated to new area |
restrict_php_version | ( | & | $result, |
$version | |||
) |
Check if the current PHP version is greater than or equal to an unsupported version.
object | $result | an environment_results instance |
string | $version | the version of PHP that can't be used |
bool | result of version check |
restrict_php_version_7 | ( | & | $result | ) |
Check if the current PHP version is greater than or equal to PHP version 7.
object | $result | an environment_results instance |
bool | result of version check |
restrict_php_version_71 | ( | & | $result | ) |
Check if the current PHP version is greater than or equal to PHP version 7.1.
object | $result | an environment_results instance |
bool | result of version check |
restrict_php_version_72 | ( | & | $result | ) |
Check if the current PHP version is greater than or equal to PHP version 7.2.
object | $result | an environment_results instance |
bool | result of version check |
restrict_php_version_73 | ( | & | $result | ) |
Check if the current PHP version is greater than or equal to PHP version 7.3.
object | $result | an environment_results instance |
bool | result of version check |
restrict_php_version_74 | ( | & | $result | ) |
Check if the current PHP version is greater than or equal to PHP version 7.4.
object | $result | an environment_results instance |
bool | result of version check |
right_to_left | ( | ) |
Returns true if the user is using a right-to-left language.
boolean | true if the current language is right-to-left (Hebrew, Arabic etc) |
s | ( | $var | ) |
Add quotes to HTML characters.
Returns $var with HTML characters (like "<", ">", etc.) properly quoted. Related function p() simply prints the output of this function.
string | $var | the string potentially containing HTML characters |
string |
object search_generate_SQL | ( | $parsetree, | |
$datafield, | |||
$metafield, | |||
$mainidfield, | |||
$useridfield, | |||
$userfirstnamefield, | |||
$userlastnamefield, | |||
$timefield, | |||
$instancefield, | |||
$tagfields = [] |
|||
) |
Primitive function to generate a SQL string from a parse tree.
Parameters:
$parsetree should be a parse tree generated by a search_lexer/search_parser combination. Other fields are database table names to search.
@global object
search_generate_text_SQL | ( | $parsetree, | |
$datafield, | |||
$metafield, | |||
$mainidfield, | |||
$useridfield, | |||
$userfirstnamefield, | |||
$userlastnamefield, | |||
$timefield, | |||
$instancefield | |||
) |
Primitive function to generate a SQL string from a parse tree using TEXT indexes.
If searches aren't suitable to use TEXT this function calls the default search_generate_SQL() one.
object search_users | ( | $courseid, | |
$groupid, | |||
$searchtext, | |||
$sort = '' , |
|||
array | $exceptions = null |
||
) |
Search through course users.
If $coursid specifies the site course then this function searches through all undeleted and confirmed users
@uses SITEID @uses SQL_PARAMS_NAMED @uses CONTEXT_COURSE
int | $courseid | The course in question. |
int | $groupid | The group in question. |
string | $searchtext | The string to search for |
string | $sort | A field to sort by |
array | $exceptions | A list of IDs to ignore, eg 2,4,5,8,9,10 |
array |
send_confirmation_email | ( | $user, | |
$confirmationurl = null |
|||
) |
Send email to specified user with confirmation text and activation link.
stdClass | $user | A $USER object |
string | $confirmationurl | user confirmation URL |
bool | Returns true if mail was sent OK and false if there was an error. |
send_headers | ( | $contenttype, | |
$cacheable = true |
|||
) |
Send the HTTP headers that Moodle requires.
There is a backwards compatibility hack for legacy code that needs to add custom IE compatibility directive.
Example: if (!isset($CFG->additionalhtmlhead)) { $CFG->additionalhtmlhead = ''; } $CFG->additionalhtmlhead .= '<meta http-equiv="X-UA-Compatible" content="IE=8" >'; header('X-UA-Compatible: IE=8'); echo $OUTPUT->header();
Please note the $CFG->additionalhtmlhead alone might not work, you should send the IE compatibility header() too.
string | $contenttype | |
bool | $cacheable | Can this page be cached on back? |
void,sends | HTTP headers |
send_password_change_confirmation_email | ( | $user, | |
$resetrecord | |||
) |
Sends a password change confirmation email.
stdClass | $user | A $USER object |
stdClass | $resetrecord | An object tracking metadata regarding password reset request |
bool | Returns true if mail was sent OK and false if there was an error. |
send_password_change_info | ( | $user | ) |
Sends an email containing information on how to change your password.
stdClass | $user | A $USER object |
bool | Returns true if mail was sent OK and false if there was an error. |
session_get_instance | ( | ) |
session_get_realuser | ( | ) |
session_is_legacy | ( | ) |
session_is_loggedinas | ( | ) |
session_kill | ( | ) |
session_kill_all | ( | ) |
session_kill_user | ( | ) |
session_loginas | ( | ) |
session_set_user | ( | ) |
session_touch | ( | ) |
sesskey | ( | ) |
Makes sure that $USER->sesskey exists, if $USER itself exists.
It sets a new sesskey if one does not already exist, but does not overwrite existing sesskeys. Returns the sesskey string if $USER exists, or boolean false if not.
@uses $USER
string |
set_bounce_count | ( | $user, | |
$reset = false |
|||
) |
Increment or reset user's email bounce count.
stdClass | $user | object containing an id |
bool | $reset | will reset the count to 0 |
set_cache_flag | ( | $type, | |
$name, | |||
$value, | |||
$expiry = null |
|||
) |
Set a volatile flag.
string | $type | the "type" namespace for the key |
string | $name | the key to set |
string | $value | the value to set (without magic quotes) - null will remove the flag |
int | $expiry | (optional) epoch indicating expiry - defaults to now()+ 24hs |
bool | Always returns true |
set_config | ( | $name, | |
$value, | |||
$plugin = null |
|||
) |
Set a key in global configuration.
Set a key/value pair in both this session's $CFG global variable and in the 'config' database table for future sessions.
Can also be used to update keys for plugin-scoped configs in config_plugin table. In that case it doesn't affect $CFG.
A NULL value will delete the entry.
NOTE: this function is called from lib/db/upgrade.php
string | $name | the key to set |
string | $value | the value to set (without magic quotes) |
string | $plugin | (optional) the plugin scope, default null |
bool | true or exception |
set_cron_lock | ( | $name, | |
$until, | |||
$ignorecurrent = false |
|||
) |
Try to obtain or release the cron lock.
string | $name | name of lock |
int | $until | timestamp when this lock considered stale, null means remove lock unconditionally |
bool | $ignorecurrent | ignore current lock state, usually extend previous lock, defaults to false |
bool | true if lock obtained |
set_current_group | ( | ) |
set_debugging | ( | $level, | |
$debugdisplay = null |
|||
) |
Alter debugging level for the current request, the change is not saved in database.
int | $level | one of the DEBUG_* constants |
bool | $debugdisplay |
set_mnet_remote_client | ( | $client | ) |
during the xmlrpc server code execution, this will be called to setup the object returned by get_mnet_remote_client
mnet_remote_client | $client | the client to set up |
moodle_exception |
set_moodle_cookie | ( | $username | ) |
Sets a moodle cookie with a weakly encrypted username.
string | $username | to encrypt and place in a cookie, '' means delete current cookie |
void |
set_send_count | ( | $user, | |
$reset = false |
|||
) |
Used to increment or reset email sent count.
stdClass | $user | object containing an id |
bool | $reset | will reset the count to 0 |
void |
set_user_device_type | ( | ) |
setnew_password_and_mail | ( | $user, | |
$fasthash = false |
|||
) |
Sets specified user's password and send the new password to the user via email.
stdClass | $user | A $USER object |
bool | $fasthash | If true, use a low cost factor when generating the hash for speed. |
bool|string | Returns "true" if mail was sent OK and "false" if there was an error |
moodle_text_filter::setup | ( | $page, | |
$context | |||
) |
Setup page with filter requirements and other prepare stuff.
Override this method if the filter needs to setup page requirements or needs other stuff to be executed.
Note this method is invoked from {
moodle_page | $page | the page we are going to add requirements to. |
context | $context | the context which contents are going to be filtered. |
Reimplemented in filter_mediaplugin, filter_mathjaxloader, and filter_glossary.
stdClass setup_DB | ( | ) |
Sets up global $DB moodle_database instance.
$CFG The global configuration instance.
void|bool | Returns true when finished setting up $DB. Returns void when $DB has already been set. |
setup_get_remote_url | ( | ) |
Get the URL that PHP/the web server thinks it is serving.
Private function used by initialise_fullme. In your code, use $PAGE->url, $SCRIPT, etc.
array | in the same format that parse_url returns, with the addition of a 'fullpath' element, which includes any slasharguments path. |
filter_manager::setup_page_for_filters | ( | $page, | |
$context | |||
) |
Setup page with filters requirements and other prepare stuff.
This method is used by {
Note it's executed for each piece of text filtered, so filter implementations are responsible of controlling the cardinality of the executions that may be different depending of the stuff to prepare.
moodle_page | $page | the page we are going to add requirements to. |
context | $context | the context which contents are going to be filtered. |
filter_manager::setup_page_for_globally_available_filters | ( | $page | ) |
Setup the page for globally available filters.
This helps setting up the page for filters which may be applied to the page, even if they do not belong to the current context, or are not yet visible because the content is lazily added (ajax). This method always uses to the system context which determines the globally available filters.
This should only ever be called once per request.
moodle_page | $page | The page. |
shift_course_mod_dates | ( | $modname, | |
$fields, | |||
$timeshift, | |||
$courseid, | |||
$modid = 0 |
|||
) |
Change dates in module - used from course reset.
string | $modname | forum, assignment, etc |
array | $fields | array of date fields from mod table |
int | $timeshift | time difference |
int | $courseid | |
int | $modid | (Optional) passed if specific mod instance in course needs to be updated. |
bool | success |
shorten_filename | ( | $filename, | |
$length = MAX_FILENAME_SIZE , |
|||
$includehash = false |
|||
) |
Shortens a given filename by removing characters positioned after the ideal string length.
When the filename is too long, the file cannot be created on the filesystem due to exceeding max byte size. Limiting the filename to a certain size (considering multibyte characters) will prevent this.
string | $filename | file name |
int | $length | ideal string length |
bool | $includehash | Whether to include a file hash in the shortened version. This ensures uniqueness. |
string::$shortened | shortened file name |
shorten_filenames | ( | array | $path, |
$length = MAX_FILENAME_SIZE , |
|||
$includehash = false |
|||
) |
Shortens a given array of filenames by removing characters positioned after the ideal string length.
array | $path | The paths to reduce the length. |
int | $length | Ideal string length |
bool | $includehash | Whether to include a file hash in the shortened version. This ensures uniqueness. |
array::$result | Shortened paths in array. |
show_event | ( | ) |
signup_captcha_enabled | ( | ) |
Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements.
bool |
signup_get_user_confirmation_authplugin | ( | ) |
Check if user confirmation is enabled on this site and return the auth plugin handling registration if enabled.
stdClass | the current auth plugin handling user registration or false if registration not enabled |
signup_is_enabled | ( | ) |
Check if sign-up is enabled in the site.
If is enabled, the function will return the authplugin instance.
mixed | false if sign-up is not enabled, the authplugin instance otherwise. |
signup_setup_new_user | ( | $user | ) |
Add the missing fields to a user that is going to be created.
stdClass | $user | the new user object |
stdClass | the user filled |
signup_validate_data | ( | $data, | |
$files | |||
) |
Validates the standard sign-up data (except recaptcha that is validated by the form element).
array | $data | the sign-up data |
array | $files | files among the data |
array | list of errors, being the key the data element name and the value the error itself |
site_is_public | ( | ) |
Tries to guess if $CFG->wwwroot is publicly accessible or not.
Never put your faith on this function and rely on its accuracy as there might be false positives. It just performs some simple checks, and mainly is used for places where we want to hide some options such as site registration when $CFG->wwwroot is not publicly accessible. Good thing is there is no false negative.
bool |
site_scale_used | ( | ) |
skip_main_destination | ( | ) |
soap_call | ( | $connection, | |
$call, | |||
$params | |||
) |
Make a call to a SoapClient.
SoapClient | $connection | The SoapClient to call |
string | $call | Operation to be performed by client |
array | $params | Parameters for the call |
mixed | The return parameters of the operation or a SoapFault If the operation returned several parameters then these are returned as an object rather than an array |
soap_connect | ( | $wsdl, | |
$trace = false |
|||
) |
Create a new SoapClient object.
string | $wsdl | URI of the WSDL file |
boolean | $trace | indicates if the soap messages should be saved (i.e. if get_soap_messages is used) and should be used only for debugging |
mixed | Returns either a SoapClient object or, if the connection failed, a SoapFault object. |
stats_cron_daily | ( | $maxdays = 1 | ) |
Execute daily statistics gathering.
int | $maxdays | maximum number of days to be processed |
boolean | success |
stats_cron_monthly | ( | ) |
Execute monthly statistics gathering.
boolean | success |
stats_cron_weekly | ( | ) |
Execute weekly statistics gathering.
boolean | success |
stats_fix_zeros | ( | $stats, | |
$timeafter, | |||
$timestr, | |||
$line2 = true , |
|||
$line3 = false |
|||
) |
Fix missing entries in the statistics.
This creates a dummy stat when nothing happened during a day/week/month.
array | $stats | array of statistics. |
int | $timeafter | unused. |
string | $timestr | type of statistics to generate (dayly, weekly, monthly). |
boolean | $line2 | |
boolean | $line3 |
array | of fixed statistics. |
stats_get_base_daily | ( | $time = 0 | ) |
Start of day.
int | $time | timestamp |
int | start of day |
stats_get_base_monthly | ( | $time = 0 | ) |
Start of month.
int | $time | timestamp |
int | start of month |
stats_get_base_weekly | ( | $time = 0 | ) |
Start of week.
int | $time | timestamp |
int | start of week |
stats_get_next_day_start | ( | $time | ) |
Start of next day.
int | $time | timestamp |
start | of next day |
stats_get_next_month_start | ( | $time | ) |
Start of next month.
int | $time | timestamp |
start | of next month |
stats_get_next_week_start | ( | $time | ) |
Start of next week.
int | $time | timestamp |
start | of next week |
stats_get_start_from | ( | $str | ) |
Return starting date of stats processing.
string | $str | name of table - daily, weekly or monthly |
int | timestamp |
stats_progress | ( | $ident | ) |
Print daily cron progress.
string | $ident |
stats_run_query | ( | $sql, | |
$parameters = array() |
|||
) |
Execute individual daily statistics queries.
string | $sql | The query to run |
boolean | success |
stats_temp_table_clean | ( | ) |
Deletes summary logs table for stats calculation.
bool | success (true) or failure(false) |
stats_temp_table_fill | ( | $timestart, | |
$timeend | |||
) |
Fills the temporary stats tables with new data.
This function is meant to be called to get a new day of data
int | timestamp of the start time of logs view |
int | timestamp of the end time of logs view |
bool | success (true) or failure(false) |
stats_temp_table_setup | ( | ) |
Fills the temporary stats tables with new data.
This function is meant to be called once at the start of stats generation
int | timestart timestamp of the start time of logs view |
int | timeend timestamp of the end time of logs view |
bool | success (true) or failure(false) |
strip_links | ( | $string | ) |
Given a string, replaces all .
* by .* and returns the string.
string | $string |
string |
strip_pluginfile_content | ( | $source | ) |
Removes the usage of Moodle files from a text.
In some rare cases we need to re-use a text that already has embedded links to some files hosted within Moodle. But the new area in which we will push this content does not support files... therefore we need to remove those files.
string | $source | The text |
string | The stripped text |
strip_querystring | ( | $url | ) |
Remove query string from url.
Takes in a URL and returns it without the querystring portion.
string | $url | the url which may have a query string attached. |
string | The remaining URL. |
swapshuffle | ( | $array | ) |
Given a simple array, this shuffles it up just like shuffle() Unlike PHP's shuffle() this function works on any machine.
array | $array | The array to be rearranged |
array |
swapshuffle_assoc | ( | $array | ) |
Like swapshuffle(), but works on associative arrays.
array | $array | The associative array to be rearranged |
array |
tag_add | ( | ) |
tag_assign | ( | ) |
tag_autocomplete | ( | ) |
tag_bulk_delete_instances | ( | ) |
tag_cleanup | ( | ) |
tag_cloud_sort | ( | ) |
tag_compute_correlations | ( | ) |
tag_cron | ( | ) |
tag_delete | ( | ) |
tag_delete_instance | ( | ) |
tag_delete_instances | ( | ) |
tag_description_set | ( | ) |
tag_display_name | ( | ) |
tag_find_records | ( | ) |
tag_find_tags | ( | ) |
tag_get | ( | ) |
tag_get_correlated | ( | ) |
tag_get_id | ( | ) |
tag_get_name | ( | ) |
tag_get_related_tags | ( | ) |
tag_get_related_tags_csv | ( | ) |
tag_get_tags | ( | ) |
tag_get_tags_array | ( | ) |
tag_get_tags_csv | ( | ) |
tag_get_tags_ids | ( | ) |
tag_normalize | ( | ) |
tag_print_cloud | ( | ) |
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_process_computed_correlation | ( | ) |
tag_record_count | ( | ) |
tag_record_tagged_with | ( | ) |
tag_rename | ( | ) |
tag_set | ( | ) |
tag_set_add | ( | ) |
tag_set_delete | ( | ) |
tag_set_flag | ( | ) |
tag_type_set | ( | ) |
tag_unset_flag | ( | ) |
testing_cli_argument_path | ( | $moodlepath | ) |
Returns relative path against current working directory, to be used for shell execution hints.
string | $moodlepath | starting with "/", ex: "/admin/tool/cli/init.php" |
string | path relative to current directory or absolute path |
testing_cli_fix_directory_separator | ( | $path | ) |
Fix DIRECTORY_SEPARATOR for windows.
In PHP on Windows, DIRECTORY_SEPARATOR is set to the backslash () character. However, if you're running a Cygwin/Msys/Git shell exec() calls will return paths using the forward slash (/) character.
NOTE: Because PHP on Windows will accept either forward or backslashes, paths should be built using ONLY forward slashes, regardless of OS. MOODLE_DIRECTORY_SEPARATOR should only be used when parsing paths returned by the shell.
string | $path |
string. |
testing_error | ( | $errorcode, | |
$text = '' |
|||
) |
Prints an error and stops execution.
integer | $errorcode | |
string | $text |
void | exits |
testing_fix_file_permissions | ( | $file | ) |
Try to change permissions to $CFG->dirroot or $CFG->dataroot if possible.
string | $file |
bool | success |
testing_initdataroot | ( | $dataroot, | |
$framework | |||
) |
Mark empty dataroot to be used for testing.
string | $dataroot | The dataroot directory |
string | $framework | The test framework |
void |
testing_is_cygwin | ( | ) |
Find out if running under Cygwin on Windows.
bool |
testing_is_mingw | ( | ) |
Returns whether a mingw CLI is running.
MinGW sets $_SERVER['TERM'] to cygwin, but it can not run .bat files; this function may be useful when we need to output proposed commands to users using Windows CLI interfaces.
@externalurl http://sourceforge.net/p/mingw/bugs/1902
bool |
testing_update_composer_dependencies | ( | ) |
Updates the composer installer and the dependencies.
void | exit() if something goes wrong |
filter_manager::text_filtering_hash | ( | ) |
null_filter_manager::text_filtering_hash | ( | ) |
As for the equivalent filter_manager method.
text_to_html | ( | $text, | |
$smileyignored = null , |
|||
$para = true , |
|||
$newlines = true |
|||
) |
Given plain text, makes it into HTML as nicely as possible.
May contain HTML tags already.
Do not abuse this function. It is intended as lower level formatting feature used by format_text() to convert FORMAT_MOODLE to HTML. You are supposed to call format_text() in most of cases.
string | $text | The string to convert. |
boolean | $smileyignored | Was used to determine if smiley characters should convert to smiley images, ignored now |
boolean | $para | If true then the returned string will be wrapped in div tags |
boolean | $newlines | If true then lines newline breaks will be converted to HTML newline breaks. |
string |
textlib_get_instance | ( | ) |
theme_build_css_for_themes | ( | $themeconfigs = [] , |
|
$directions = ['rtl' , |
|||
'ltr'] | , | ||
$cache = true |
|||
) |
Generates and saves the CSS files for the given theme configs.
theme_config[] | $themeconfigs | An array of theme_config instances. |
array | $directions | Must be a subset of ['rtl', 'ltr']. |
bool | $cache | Should the generated files be stored in local cache. |
array | The built theme content in a multi-dimensional array of name => direction => content |
theme_get_config_file_path | ( | $themename | ) |
Get the path to a theme config.php file.
string | $themename | The non-frankenstyle name of the theme to check |
theme_get_css_filename | ( | $themename, | |
$globalrevision, | |||
$themerevision, | |||
$direction | |||
) |
Get the path to the local cached CSS file.
string | $themename | The non-frankenstyle theme name. |
int | $globalrevision | The global theme revision. |
int | $themerevision | The theme specific revision. |
string | $direction | Either 'ltr' or 'rtl' (case sensitive). |
theme_get_locked_theme_for_device | ( | $device | ) |
Returns the theme named defined in config.php for the given device.
string | or null |
theme_get_next_revision | ( | ) |
Calculates and returns the next theme revision number.
int |
theme_get_next_sub_revision_for_theme | ( | $themename | ) |
Calculates and returns the next theme revision number.
string | $themename | The non-frankenstyle name of the theme |
int |
theme_get_revision | ( | ) |
Returns current theme revision number.
int |
theme_get_sub_revision_for_theme | ( | $themename | ) |
Returns current theme sub revision number.
This is the revision for this theme exclusively, not the global theme revision.
string | $themename | The non-frankenstyle name of the theme |
int |
theme_is_device_locked | ( | $device | ) |
Checks if the given device has a theme defined in config.php.
bool |
theme_reset_all_caches | ( | ) |
Invalidate all server and client side caches.
This method deletes the physical directory that is used to cache the theme files used for serving. Because it deletes the main theme cache directory all themes are reset by this function.
theme_set_designer_mod | ( | $state | ) |
Enable or disable theme designer mode.
bool | $state |
theme_set_revision | ( | $revision | ) |
Sets the current theme revision number.
int | $revision | The new theme revision number |
theme_set_sub_revision_for_theme | ( | $themename, | |
$revision | |||
) |
Sets the current theme revision number for a specific theme.
This does not affect the global themerev value.
string | $themename | The non-frankenstyle name of the theme |
int | $revision | The new theme revision number |
truncate_userinfo | ( | array | $info | ) |
Will truncate userinfo as it comes from auth_get_userinfo (from external auth) which may have large fields.
array | $info | Array of user properties to truncate if needed |
array | The now truncated information that was passed in |
trusttext_active | ( | ) |
Is trusttext feature active?
bool |
trusttext_pre_edit | ( | $object, | |
$field, | |||
$context | |||
) |
Must be called before editing of all texts with trust flag.
Removes all XSS nasties from texts stored in database if needed.
stdClass | $object | data object with xxx, xxxformat and xxxtrust fields |
string | $field | name of text field |
context | $context | active context |
stdClass | updated $object |
trusttext_strip | ( | $text | ) |
Legacy function, used for cleaning of old forum and glossary text only.
string | $text | text that may contain legacy TRUSTTEXT marker |
string | text without legacy TRUSTTEXT marker |
trusttext_trusted | ( | $context | ) |
Is current user trusted to enter no dangerous XSS in this context?
Please note the user must be in fact trusted everywhere on this server!!
context | $context |
bool | true if user trusted |
unformat_float | ( | $localefloat, | |
$strict = false |
|||
) |
Converts locale specific floating point/comma number back to standard PHP float value Do NOT try to do any math operations before this conversion on any user submitted floats!
string | $localefloat | locale aware float representation |
bool | $strict | If true, then check the input and return false if it is not a valid number. |
mixed | float|bool - false or the parsed float. |
uninstall_plugin | ( | $type, | |
$name | |||
) |
Automatically clean-up all plugin data and remove the plugin DB tables.
NOTE: do not call directly, use new /admin/plugins.php?uninstall=component instead!
string | $type | The plugin type, eg. 'mod', 'qtype', 'workshopgrading' etc. |
string | $name | The plugin name, eg. 'forum', 'multichoice', 'accumulative' etc. @uses global $OUTPUT to produce notices and other messages |
void |
unserialize_array | ( | $expression | ) |
Safe analogue of unserialize() that can only parse arrays.
Arrays may contain only integers or strings as both keys and values. Nested arrays are allowed. Note: If any string (key or value) has semicolon (;) as part of the string parsing will fail. This is a simple method to substitute unnecessary unserialize() in code and not intended to cover all possible cases.
string | $expression |
array|bool | either parsed array or false if parsing was impossible. |
unset_all_config_for_plugin | ( | $plugin | ) |
Remove all the config variables for a given plugin.
NOTE: this function is called from lib/db/upgrade.php
string | $plugin | a plugin, for example 'quiz' or 'qtype_multichoice'; |
boolean | whether the operation succeeded. |
unset_cache_flag | ( | $type, | |
$name | |||
) |
Removes a single volatile flag.
string | $type | the "type" namespace for the key |
string | $name | the key to set |
bool |
unset_config | ( | $name, | |
$plugin = null |
|||
) |
Removes a key from global configuration.
NOTE: this function is called from lib/db/upgrade.php
string | $name | the key to set |
string | $plugin | (optional) the plugin scope |
boolean | whether the operation succeeded. |
object unzip_file | ( | $zipfile, | |
$destination = '' , |
|||
$showstatus_ignored = true |
|||
) |
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.
string | $zipfile | The zip file to unzip |
string | $destination | The location to unzip to |
bool | $showstatus_ignored | Unused |
update_category_button | ( | ) |
update_event | ( | ) |
update_field_with_unique_index | ( | $table, | |
$field, | |||
array | $newvalues, | ||
array | $otherconditions, | ||
$unusedvalue = -1 |
|||
) |
This method can update the values in mulitple database rows for a colum with a unique index, without violating that constraint.
Suppose we have a table with a unique index on (otherid, sortorder), and for a particular value of otherid, we want to change all the sort orders. You have to do this carefully or you will violate the unique index at some time. This method takes care of the details for you.
Note that, it is the responsibility of the caller to make sure that the requested rename is legal. For example, if you ask for [1 => 2, 2 => 2] then you will get a unique key violation error from the database.
string | $table | The database table to modify. |
string | $field | the field that contains the values we are going to change. |
array | $newvalues | oldvalue => newvalue how to change the values. E.g. [1 => 4, 2 => 1, 3 => 3, 4 => 2]. |
array | $otherconditions | array fieldname => requestedvalue extra WHERE clause conditions to restrict which rows are affected. E.g. array('otherid' => 123). |
int | $unusedvalue | (defaults to -1) a value that is never used in $ordercol. |
update_internal_user_password | ( | $user, | |
$password, | |||
$fasthash = false |
|||
) |
Update password hash in user object (if necessary).
The password is updated if:
Updating the password will modify the $user object and the database record to use the current hashing algorithm. It will remove Web Services user tokens too.
stdClass | $user | User object (password property may be updated). |
string | $password | Plain text password. |
bool | $fasthash | If true, use a low cost factor when generating the hash This is much faster to generate but makes the hash less secure. It is used when lots of hashes need to be generated quickly. |
bool | Always returns true. |
update_log_display_entry | ( | ) |
update_login_count | ( | ) |
update_module_button | ( | ) |
update_timezone_records | ( | ) |
update_user_login_times | ( | ) |
Modify the user table by setting the currently logged in user's last login to now.
bool | Always returns true |
update_user_record | ( | $username | ) |
Will update a local user record from an external source (MNET users can not be updated using this method!).
string | $username | user's username to update the record |
stdClass | A complete user object |
update_user_record_by_id | ( | $id | ) |
Will update a local user record from an external source (MNET users can not be updated using this method!).
int | $id | user id |
stdClass | A complete user object |
upgrade_ensure_not_running | ( | $warningonly = false | ) |
Makes sure that upgrade process is not running.
To be inserted in the core functions that can not be called by pluigns during upgrade. Core upgrade should not use any API functions at all. See http://docs.moodle.org/dev/Upgrade_API#Upgrade_code_restrictions
moodle_exception | if executed from inside of upgrade script and $warningonly is false |
bool | $warningonly | if true displays a warning instead of throwing an exception |
bool | true if executed from outside of upgrade process, false if from inside upgrade process and function is used for warning only |
object user_can_create_courses | ( | ) |
@uses CONTEXT_COURSECAT
boolean | Whether the user can create courses in any category in the system. |
user_not_fully_set_up | ( | $user, | |
$strict = true |
|||
) |
Determines if a user has completed setting up their account.
The lax mode (with $strict = false) has been introduced for special cases only where we want to skip certain checks intentionally. This is valid in certain mnet or ajax scenarios when the user cannot / should not be redirected to edit their profile. In most cases, you should perform the strict check.
stdClass | $user | A $USER object to test for the existence of a valid name and email |
bool | $strict | Be more strict and assert id and custom profile fields set, too |
bool |
useredit_shared_definition_preferences | ( | ) |
username_load_fields_from_object | ( | $addtoobject, | |
$secondobject, | |||
$prefix = null , |
|||
$additionalfields = null |
|||
) |
Reduces lines of duplicated code for getting user name fields.
See also user_picture::unalias()
object | $addtoobject | Object to add user name fields to. |
object | $secondobject | Object that contains user name field information. |
string | $prefix | prefix to be added to all fields (including $additionalfields) e.g. authorfirstname. |
array | $additionalfields | Additional fields to be matched with data in the second object. The key can be set to the user table field name. |
object | User name fields. |
users_order_by_sql | ( | $usertablealias = '' , |
|
$search = null , |
|||
context | $context = null |
||
) |
This function generates the standard ORDER BY clause for use when generating lists of users.
If you don't have a reason to use a different order, then you should use this method to generate the order when displaying lists of users.
If the optional $search parameter is passed, then exact matches to the search will be sorted first. For example, suppose you have two users 'Al Zebra' and 'Alan Aardvark'. The default sort is Alan, then Al. If, however, you search for 'Al', then Al will be listed first. (With two users, this is not a big deal, but with thousands of users, it is essential.)
The list of fields scanned for exact matches are:
If named parameters are used (which is the default, and highly recommended), then the parameter names are like :usersortexactN, where N is an int.
The simplest possible example use is: list($sort, $params) = users_order_by_sql(); $sql = 'SELECT * FROM {users} ORDER BY ' . $sort;
A more complex example, showing that this sort can be combined with other sorts: list($sort, $sortparams) = users_order_by_sql('u'); $sql = "SELECT g.id AS groupid, gg.groupingid, u.id AS userid, u.firstname, u.lastname, u.idnumber, u.username FROM {groups} g LEFT JOIN {groupings_groups} gg ON g.id = gg.groupid LEFT JOIN {groups_members} gm ON g.id = gm.groupid LEFT JOIN {user} u ON gm.userid = u.id WHERE g.courseid = :courseid $groupwhere $groupingwhere ORDER BY g.name, $sort"; $params += $sortparams;
An example showing the use of $search: list($sort, $sortparams) = users_order_by_sql('u', $search, $this->get_context()); $order = ' ORDER BY ' . $sort; $params += $sortparams; $availableusers = $DB->get_records_sql($fields . $sql . $order, $params, $page*$perpage, $perpage);
string | $usertablealias | (optional) any table prefix for the {users} table. E.g. 'u'. |
string | $search | (optional) a current search string. If given, any exact matches to this string will be sorted first. |
context | $context | the context we are in. Use by get_extra_user_fields. Defaults to $PAGE->context. |
array | with two elements: string SQL fragment to use in the ORDER BY clause. For example, "firstname, lastname". array of parameters used in the SQL fragment. |
users_search_sql | ( | $search, | |
$u = 'u' , |
|||
$searchanywhere = true , |
|||
array | $extrafields = array() , |
||
array | $exclude = null , |
||
array | $includeonly = null |
||
) |
Returns SQL used to search through user table to find users (in a query which may also join and apply other conditions).
You can combine this SQL with an existing query by adding 'AND $sql' to the WHERE clause of your query (where $sql is the first element in the array returned by this function), and merging in the $params array to the parameters of your query (where $params is the second element). Your query should use named parameters such as :param, rather than the question mark style.
There are examples of basic usage in the unit test for this function.
string | $search | the text to search for (empty string = find all) |
string | $u | the table alias for the user table in the query being built. May be ''. |
bool | $searchanywhere | If true (default), searches in the middle of names, otherwise only searches at start |
array | $extrafields | Array of extra user fields to include in search |
array | $exclude | Array of user ids to exclude (empty = don't exclude) |
array | $includeonly | If specified, only returns users that have ids incldued in this array (empty = don't restrict) |
array | an array with two elements, a fragment of SQL to go in the where clause the query, and an associative array containing any required parameters (using named placeholders). |
valid_uploaded_file | ( | $newfile | ) |
Returns current name of file on disk if it exists.
string | $newfile | File to be verified |
string | Current name of file on disk if true |
validate_email | ( | $address | ) |
Validates an email to make sure it makes sense.
string | $address | The email address to validate. |
boolean |
validate_internal_user_password | ( | $user, | |
$password | |||
) |
Compare password against hash stored in user object to determine if it is valid.
If necessary it also updates the stored hash to the current format.
stdClass | $user | (Password property may be updated). |
string | $password | Plain text password. |
bool | True if password is valid. |
validate_param | ( | $param, | |
$type, | |||
$allownull = NULL_NOT_ALLOWED , |
|||
$debuginfo = '' |
|||
) |
Strict validation of parameter values, the values are only converted to requested PHP type.
Internally it is using clean_param, the values before and after cleaning must be equal - otherwise an invalid_parameter_exception is thrown. Objects and classes are not accepted.
mixed | $param | |
string | $type | PARAM_ constant |
bool | $allownull | are nulls valid value? |
string | $debuginfo | optional debug information |
mixed | the $param value converted to PHP type |
invalid_parameter_exception | if $param is not of given type |
validate_user_key | ( | $keyvalue, | |
$script, | |||
$instance | |||
) |
Validates a user key, checking if the key exists, is not expired and the remote ip is correct.
string | $keyvalue | the key value |
string | $script | unique script identifier |
int | $instance | instance id |
stdClass | the key entry in the user_private_key table |
moodle_exception |
wikify_links | ( | $string | ) |
This expression turns links into something nice in a text format.
(Russell Jungwirth)
string | $string |
string |
xmldb_debug | ( | $message, | |
$object | |||
) |
This function is the official hook inside XMLDB stuff to delegate its debug to one external function.
Any script can avoid calls to this function by defining XMLDB_SKIP_DEBUG_HOOK before using XMLDB classes. Obviously, also, if this function doesn't exist, it isn't invoked ;-)
@uses DEBUG_DEVELOPER
string | $message | string contains the error message |
object | $object | object XMLDB object that fired the debug |
xmlize | ( | $data, | |
$whitespace = 1 , |
|||
$encoding = 'UTF-8' , |
|||
$reporterrors = false |
|||
) |
XML parsing function calles into class.
Note: Used by xml element handler as callback.
string | $data | the XML source to parse. |
int | $whitespace | If set to 1 allows the parser to skip "space" characters in xml document. Default is 1 |
string | $encoding | Specify an OUTPUT encoding. If not specified, it defaults to UTF-8. |
bool | $reporterrors | if set to true, then a xml_format_exception exception will be thrown if the XML is not well-formed. Otherwise errors are ignored. |
array | representation of the parsed XML. |
object zip_files | ( | $originalfiles, | |
$destination | |||
) |
Zip an array of files/dirs to a destination zip file Both parameters must be FULL paths to the files/dirs.
array | $originalfiles | Files to zip |
string | $destination | The destination path |
bool | Outcome |
$capabilities |
bool filterobject::$fullmatch |
whether to match complete words.
If true, 'T' won't be matched in 'Tim'.
$handlers |
foreach ( $plugins as $plugin) if ( $hassiteconfig) if ( $hassiteconfig) if ( $hassiteconfig) $plugins = core_plugin_manager::instance()->get_plugins_of_type('tool') |
Add all admin tools.
Add all local plugins - must be always last!
$renamedclasses |
null string filterobject::$replacementphrase |
replacement text to go inside begin and end.
If not set, the body of the replacement will be the original phrase.
|
protected |
This list of active filters, by context, for filtering strings.
An array contextid => ordered array of filter name => filter objects.
$tasks |
|
protected |
This list of active filters, by context, for filtering content.
An array contextid => ordered array of filter name => filter objects.
if (isset( $_REQUEST[ 'lang'])) else |
if (isset( $_REQUEST[ 'admin'])) else |
if (!empty( $_POST)) else |
if ( $distro) else |
const ENROL_EXT_REMOVED_SUSPEND 2 |
When user disappears from external source, user enrolment is suspended, roles are kept as is.
In some cases user needs a role with some capability to be visible in UI - suc has in gradebook, assignments, etc.
const ENROL_EXT_REMOVED_SUSPENDNOROLES 3 |
When user disappears from external source, the enrolment is suspended and roles assigned by enrol instance are removed.
Please note that user may "disappear" from gradebook and other areas.
const ENROL_INSTANCE_DISABLED 1 |
Course enrol instance disabled, user may enter course if other enrol instance enabled.
(used in enrol->status)
const ENROL_INSTANCE_ENABLED 0 |
Course enrol instance enabled.
(used in enrol->status)
const ENROL_REQUIRE_LOGIN_CACHE_PERIOD 1800 |
const ENROL_RESTORE_TYPE 'enrolrestore' |
const ENV_SELECT_NEWER 0 |
Define algorithm used to select the xml file.
To select the newer file available to perform checks
const EXTERNAL_TOKEN_EMBEDDED 1 |
Security token used for allowing access of embedded applications, the code is executed in the active user session.
Token is invalidated after user logs out. Scripts are executed serially - normal session locking is used.
const EXTERNAL_TOKEN_PERMANENT 0 |
Security token used for allowing access from external application such as web services.
Scripts do not use any session, performance is relatively low because we need to load access info in each request. Scripts are executed in parallel.
const FEATURE_GROUPMEMBERSONLY 'groupmembersonly' |
True if module supports groupmembersonly (which no longer exists)
const FORMAT_WIKI '3' |
Wiki-formatted text.
Deprecated: left here just to note that '3' is not used (at the moment) and to catch any latent wiki-like text (which generates an error)
const LIST_NONE 1 |
#-
#+ list defines
trait core::task\logging_trait |
This trait includes functions to assist with logging in tasks.
const MEMORY_EXTRA -3 |
Large memory limit for given platform - used in cron, upgrade, and other places that need a lot of memory.
Can be overridden with $CFG->extramemorylimit setting.
const NO_ERROR 0 |
Add required files.
Include the necessary Define a bunch of XML processing errors XML Processing Error
const PAGE_COURSE_VIEW 'course-view' |
PAGE_COURSE_VIEW is a definition of a page type.
For more information on the page class see moodle/lib/pagelib.php.
const PARAM_ACTION 'alphanumext' |
PARAM_ACTION - deprecated alias for PARAM_ALPHANUMEXT, use for various actions in forms and urls NOTE: originally alias for PARAM_APLHA.
const PARAM_AREA 'area' |
PARAM_AREA is a name of area used when addressing files, comments, ratings, etc.
It is usually used together with context id and component. Only lowercase ascii letters, numbers and underscores are allowed, it has to start with a letter.
const PARAM_CAPABILITY 'capability' |
PARAM_CAPABILITY - A capability name, like 'moodle/role:manage'.
Actually checked against the list of capabilities in the database.
const PARAM_CLEAN 'clean' |
PARAM_CLEAN - obsoleted, please use a more specific type of parameter.
It was one of the first types, that is why it is abused so much ;-)
const PARAM_CLEANHTML 'cleanhtml' |
PARAM_CLEANHTML - cleans submitted HTML code.
Note that you almost never want to use this. The normal mode of operation is to use PARAM_RAW when receiving the input (required/optional_param or formslib) and then sanitise the HTML using format_text on output. This is for the rare cases when you want to sanitise the HTML on input. This cleaning may also fix xhtml strictness.
const PARAM_COMPONENT 'component' |
PARAM_COMPONENT is used for full component names (aka frankenstyle) such as 'mod_forum', 'core_rating', 'auth_ldap'.
Short legacy subsystem names and module names are accepted too ex: 'forum', 'rating', 'user'. Only lowercase ascii letters, numbers and underscores are allowed, it has to start with a letter. NOTE: numbers and underscores are strongly discouraged in plugin names!
const PARAM_FLOAT 'float' |
PARAM_FLOAT - a real/floating point number.
Note that you should not use PARAM_FLOAT for numbers typed in by the user. It does not work for languages that use , as a decimal separator. Use PARAM_LOCALISEDFLOAT instead.
const PARAM_FORMAT 'alphanumext' |
PARAM_FORMAT - deprecated alias for PARAM_ALPHANUMEXT, use for names of plugins, formats, etc.
NOTE: originally alias for PARAM_APLHA
const PARAM_INTEGER 'int' |
PARAM_INTEGER - deprecated alias for PARAM_INT.
const PARAM_LOCALISEDFLOAT 'localisedfloat' |
PARAM_LOCALISEDFLOAT - a localised real/floating point number.
This is preferred over PARAM_FLOAT for numbers typed in by the user. Cleans localised numbers to computer readable numbers; false for invalid numbers.
const PARAM_LOCALURL 'localurl' |
PARAM_LOCALURL - expected properly formatted URL as well as one that refers to the local server itself.
(NOT orthogonal to the others! Implies PARAM_URL!)
const PARAM_MULTILANG 'text' |
PARAM_MULTILANG - deprecated alias of PARAM_TEXT.
const PARAM_NOTAGS 'notags' |
PARAM_NOTAGS - all html tags are stripped from the text.
Do not abuse this type.
const PARAM_NUMBER 'float' |
PARAM_NUMBER - deprecated alias of PARAM_FLOAT.
const PARAM_PLUGIN 'plugin' |
PARAM_PLUGIN is used for plugin names such as 'forum', 'glossary', 'ldap', 'paypal', 'completionstatus'.
Only lowercase ascii letters, numbers and underscores are allowed, it has to start with a letter. NOTE: numbers and underscores are strongly discouraged in plugin names! Underscores are forbidden in module names.
const PARAM_SEQUENCE 'sequence' |
PARAM_SEQUENCE - expects a sequence of numbers like 8 to 1,5,6,4,6,8,9.
Numbers and comma only.
const PARAM_TEXT 'text' |
PARAM_TEXT - general plain text compatible with multilang filter, no other html tags.
Please note '<', or '>' are allowed here.
const PARAM_TIMEZONE 'timezone' |
PARAM_TIMEZONE - expected timezone.
Timezone can be int +-(0-13) or float +-(0.5-12.5) or string separated by '/' and can have '-' &/ '_' (eg. America/North_Dakota/New_Salem America/Port-au-Prince)
const PARAM_URL 'url' |
PARAM_URL - expected properly formatted URL.
Please note that domain part is required, http://localhost/ is not accepted but http://localhost.localdomain/ is ok.
const PARAM_USERNAME 'username' |
PARAM_USERNAME - Clean username to only contains allowed characters.
This is to be used ONLY when manually creating user accounts, do NOT use when syncing with external systems!!
const TABLE_P_TOP 1 |
#-
#+ Constants that indicate whether the paging bar for the table appears above or below the table.
const TAG_MAX_LENGTH 50 |
To prevent problems with multibytes strings,Flag updating in nav not working on the review page.
this should not exceed the length of "varchar(255) / 3 (bytes / utf-8 character) = 85". TODO: this is not correct, varchar(255) are 255 unicode chars ;-)
const TEXTFILTER_EXCL_SEPARATOR chr(0x1F) . '%' . chr(0x1F) |
Define one exclusive separator that we'll use in the temp saved tags keys.
It must be something rare enough to avoid having matches with filterobjects. MDL-18165
const TOKEN_USER "0" |
Constants for the various types of tokens.