Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402] [Versions 402 and 403]
Functions and classes used during installation, upgrades and for admin settings. ADMIN SETTINGS TREE INTRODUCTION
Copyright: | 1999 onwards Martin Dougiamas http://dougiamas.com |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 11572 lines (398 kb) |
Included or required: | 1 time |
Referenced: | 0 times |
Includes or requires: | 0 files |
part_of_admin_tree:: (6 methods):
locate()
prune()
search()
check_access()
is_hidden()
show_save()
parentable_part_of_admin_tree:: (1 method):
add()
admin_category:: (14 methods):
__construct()
get_settings_page_url()
locate()
search()
prune()
add()
check_access()
is_hidden()
show_save()
set_sorting()
get_children()
__get()
__set()
__isset()
admin_root:: (2 methods):
__construct()
purge_children()
admin_externalpage:: (8 methods):
__construct()
get_settings_page_url()
locate()
prune()
search()
check_access()
is_hidden()
show_save()
admin_settingdependency:: (3 methods):
__construct()
parse_name()
prepare_for_javascript()
admin_settingpage:: (13 methods):
__construct()
get_settings_page_url()
locate()
search()
prune()
add()
hide_if()
check_access()
output_html()
is_hidden()
show_save()
has_dependencies()
get_dependencies_for_javascript()
admin_setting:: (29 methods):
__construct()
set_flag_options()
set_enabled_flag_options()
set_advanced_flag_options()
set_locked_flag_options()
set_required_flag_options()
is_readonly()
get_setting_flag_value()
get_setting_flag_defaults()
output_setting_flags()
write_setting_flags()
parse_setting_name()
get_full_name()
get_id()
set_affects_modinfo()
config_read()
config_write()
add_to_config_log()
get_defaultsetting()
output_html()
set_updatedcallback()
post_write_settings()
is_related()
get_force_ltr()
set_force_ltr()
add_dependent_on()
get_dependent_on()
has_custom_form_control()
is_forceable()
admin_setting_flag:: (8 methods):
__construct()
set_options()
is_enabled()
get_default()
get_shortname()
get_displayname()
write_setting_flag()
output_setting_flag()
admin_setting_heading:: (5 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
output_html()
admin_setting_description:: (5 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
output_html()
admin_setting_configtext:: (6 methods):
__construct()
get_force_ltr()
get_setting()
write_setting()
validate()
output_html()
admin_setting_configtext_with_maxlength:: (2 methods):
__construct()
validate()
admin_setting_configtextarea:: (2 methods):
__construct()
output_html()
admin_setting_confightmleditor:: (3 methods):
__construct()
output_html()
write_setting()
admin_setting_configpasswordunmask:: (3 methods):
__construct()
add_to_config_log()
output_html()
admin_setting_configpasswordunmask_with_advanced:: (1 method):
__construct()
admin_setting_encryptedpassword:: (4 methods):
__construct()
get_setting()
write_setting()
output_html()
admin_setting_configempty:: (2 methods):
__construct()
output_html()
admin_setting_configfile:: (3 methods):
__construct()
output_html()
write_setting()
admin_setting_configexecutable:: (1 method):
output_html()
admin_setting_configdirectory:: (1 method):
output_html()
admin_setting_configcheckbox:: (4 methods):
__construct()
get_setting()
write_setting()
output_html()
admin_setting_configmulticheckbox:: (6 methods):
__construct()
load_choices()
is_related()
get_setting()
write_setting()
output_html()
admin_setting_configmulticheckbox2:: (2 methods):
get_setting()
write_setting()
admin_setting_configselect:: (9 methods):
__construct()
set_validate_function()
load_choices()
is_related()
get_setting()
write_setting()
validate_setting()
output_select_html()
output_html()
admin_setting_configmultiselect:: (5 methods):
__construct()
get_setting()
write_setting()
is_related()
output_html()
admin_setting_configtime:: (4 methods):
__construct()
get_setting()
write_setting()
output_html()
admin_setting_configduration:: (11 methods):
__construct()
set_min_duration()
set_max_duration()
set_validate_function()
validate_setting()
get_units()
get_duration_text()
parse_seconds()
get_setting()
write_setting()
output_html()
admin_setting_configduration_with_advanced:: (1 method):
__construct()
admin_setting_configiplist:: (1 method):
validate()
admin_setting_configmixedhostiplist:: (5 methods):
validate()
ace_encode()
ace_decode()
get_setting()
write_setting()
admin_setting_configportlist:: (1 method):
validate()
admin_setting_users_with_capability:: (5 methods):
__construct()
load_choices()
get_defaultsetting()
get_setting()
write_setting()
admin_setting_special_adminseesall:: (2 methods):
__construct()
write_setting()
admin_setting_special_selectsetup:: (2 methods):
get_setting()
write_setting()
admin_setting_sitesetselect:: (3 methods):
get_setting()
write_setting()
is_forceable()
admin_setting_bloglevel:: (1 method):
write_setting()
admin_setting_courselist_frontpage:: (5 methods):
__construct()
load_choices()
get_setting()
write_setting()
output_html()
admin_setting_sitesetcheckbox:: (3 methods):
get_setting()
write_setting()
is_forceable()
admin_setting_sitesettext:: (5 methods):
__construct()
get_setting()
validate()
write_setting()
is_forceable()
admin_setting_requiredtext:: (1 method):
validate()
admin_setting_special_frontpagedesc:: (4 methods):
__construct()
get_setting()
write_setting()
is_forceable()
admin_setting_emoticons:: (6 methods):
__construct()
get_setting()
write_setting()
output_html()
prepare_form_data()
process_form_data()
admin_setting_langlist:: (3 methods):
__construct()
validate()
write_setting()
admin_setting_countrycodes:: (2 methods):
__construct()
validate()
admin_settings_country_select:: (2 methods):
__construct()
load_choices()
admin_settings_num_course_sections:: (2 methods):
__construct()
load_choices()
admin_settings_coursecat_select:: (2 methods):
__construct()
load_choices()
admin_setting_special_backupdays:: (2 methods):
__construct()
load_choices()
admin_setting_special_backup_auto_destination:: (2 methods):
__construct()
write_setting()
admin_setting_special_debug:: (2 methods):
__construct()
load_choices()
admin_setting_special_calendar_weekend:: (4 methods):
__construct()
get_setting()
write_setting()
output_html()
admin_setting_question_behaviour:: (2 methods):
__construct()
load_choices()
admin_setting_pickroles:: (3 methods):
__construct()
load_choices()
get_defaultsetting()
admin_setting_pickfilters:: (2 methods):
__construct()
load_choices()
admin_setting_configtext_with_advanced:: (1 method):
__construct()
admin_setting_configcheckbox_with_advanced:: (1 method):
__construct()
admin_setting_configcheckbox_with_lock:: (1 method):
__construct()
admin_setting_configselect_autocomplete:: (1 method):
output_html()
admin_setting_configselect_with_advanced:: (1 method):
__construct()
admin_setting_configselect_with_lock:: (1 method):
__construct()
admin_setting_special_gradebookroles:: (1 method):
__construct()
admin_setting_regradingcheckbox:: (1 method):
write_setting()
admin_setting_special_coursecontact:: (1 method):
__construct()
admin_setting_special_gradelimiting:: (2 methods):
__construct()
admin_setting_special_gradelimiting()
name:: (2 methods):
regrade_all()
write_setting()
admin_setting_special_grademinmaxtouse:: (2 methods):
__construct()
write_setting()
admin_setting_special_gradeexport:: (2 methods):
__construct()
load_choices()
admin_setting_special_gradepointdefault:: (2 methods):
__construct()
validate()
admin_setting_special_gradepointmax:: (4 methods):
__construct()
write_setting()
validate()
output_html()
admin_setting_gradecat_combo:: (4 methods):
__construct()
get_setting()
write_setting()
output_html()
admin_setting_grade_profilereport:: (2 methods):
__construct()
load_choices()
admin_setting_my_grades_report:: (2 methods):
__construct()
load_choices()
admin_setting_special_registerauth:: (3 methods):
__construct()
get_defaultsetting()
load_choices()
admin_page_pluginsoverview:: (1 method):
__construct()
admin_page_managemods:: (2 methods):
__construct()
search()
admin_setting_manageenrols:: (6 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
output_html()
admin_page_manageblocks:: (2 methods):
__construct()
search()
admin_page_managemessageoutputs:: (2 methods):
__construct()
search()
admin_page_manageqbehaviours:: (2 methods):
__construct()
search()
admin_page_manageqtypes:: (2 methods):
__construct()
search()
admin_page_manageportfolios:: (2 methods):
__construct()
search()
admin_page_managerepositories:: (2 methods):
__construct()
search()
admin_setting_manageauths:: (6 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
output_html()
admin_setting_manageantiviruses:: (6 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
output_html()
admin_setting_manageformats:: (6 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
output_html()
admin_setting_managecustomfields:: (6 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
output_html()
admin_setting_managedataformats:: (6 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
output_html()
admin_page_managefilters:: (2 methods):
__construct()
search()
admin_setting_manage_plugins:: (9 methods):
get_section_name()
get_info_column_name()
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
get_manage_url()
output_html()
admin_setting_manage_fileconverter_plugins:: (4 methods):
get_section_title()
get_plugin_type()
get_info_column_name()
get_info_column()
admin_setting_managemediaplayers:: (7 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
get_sorted_plugins()
output_html()
admin_setting_managecontentbankcontenttypes:: (17 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
output_html()
admin_externalpage_setup()
admin_get_root()
admin_apply_default_settings()
admin_write_settings()
admin_find_write_settings()
admin_search_settings_html()
admin_output_new_settings_by_page()
format_admin_setting()
any_new_admin_settings()
db_should_replace()
db_replace()
admin_setting_managerepository:: (8 methods):
__construct()
get_setting()
get_defaultsetting()
get_full_name()
write_setting()
is_related()
repository_action_url()
output_html()
admin_setting_enablemobileservice:: (5 methods):
is_protocol_cap_allowed()
set_protocol_cap()
output_html()
get_setting()
write_setting()
admin_setting_manageexternalservices:: (6 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
output_html()
admin_setting_webservicesoverview:: (5 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
output_html()
admin_setting_managewebserviceprotocols:: (6 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
is_related()
output_html()
admin_setting_configcolourpicker:: (5 methods):
__construct()
get_setting()
write_setting()
validate()
output_html()
admin_setting_configstoredfile:: (6 methods):
__construct()
get_options()
get_setting()
write_setting()
post_write_settings()
output_html()
admin_setting_devicedetectregex:: (6 methods):
__construct()
get_setting()
write_setting()
output_html()
prepare_form_data()
process_form_data()
admin_setting_configmultiselect_modules:: (2 methods):
__construct()
load_choices()
admin_setting_php_extension_enabled:: (5 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
output_html()
admin_setting_servertimezone:: (2 methods):
__construct()
load_choices()
admin_setting_forcetimezone:: (2 methods):
__construct()
load_choices()
admin_setting_searchsetupinfo:: (5 methods):
__construct()
get_setting()
get_defaultsetting()
write_setting()
output_html()
admin_setting_scsscode:: (1 method):
validate()
admin_setting_filetypes:: (5 methods):
__construct()
write_setting()
validate()
output_html()
get_force_ltr()
admin_setting_agedigitalconsentmap:: (2 methods):
__construct()
validate()
admin_settings_sitepolicy_handler_select:: (2 methods):
__construct()
load_choices()
admin_setting_configthemepreset:: (3 methods):
__construct()
write_setting()
validate()
admin_settings_h5plib_handler_select:: (2 methods):
__construct()
load_choices()
Interface: part_of_admin_tree - X-Ref
Interface for anything appearing in the admin treelocate($name) X-Ref |
Finds a named part_of_admin_tree. Used to find a part_of_admin_tree. If a class only inherits part_of_admin_tree and not parentable_part_of_admin_tree, then this function should only check if $this->name matches $name. If it does, it should return a reference to $this, otherwise, it should return a reference to NULL. If a class inherits parentable_part_of_admin_tree, this method should be called recursively on all child objects (assuming, of course, the parent object's name doesn't match the search criterion). param: string $name The internal name of the part_of_admin_tree we're searching for. return: mixed An object reference or a NULL reference. |
prune($name) X-Ref |
Removes named part_of_admin_tree. param: string $name The internal name of the part_of_admin_tree we want to remove. return: bool success. |
search($query) X-Ref |
Search using query param: string $query return: mixed array-object structure of found settings and pages |
check_access() X-Ref |
Verifies current user's access to this part_of_admin_tree. Used to check if the current user has access to this part of the admin tree or not. If a class only inherits part_of_admin_tree and not parentable_part_of_admin_tree, then this method is usually just a call to has_capability() in the site context. If a class inherits parentable_part_of_admin_tree, this method should return the logical OR of the return of check_access() on all child objects. return: bool True if the user has access, false if she doesn't. |
is_hidden() X-Ref |
Mostly useful for removing of some parts of the tree in admin tree block. return: True is hidden from normal list view |
show_save() X-Ref |
Show we display Save button at the page bottom? return: bool |
Interface: parentable_part_of_admin_tree - X-Ref
Interface implemented by any part_of_admin_tree that has children.add($destinationname, $something, $beforesibling = null) X-Ref |
Adds a part_of_admin_tree object to the admin tree. Used to add a part_of_admin_tree object to this object or a child of this object. $something should only be added if $destinationname matches $this->name. If it doesn't, add should be called on child objects that are also parentable_part_of_admin_tree's. $something should be appended as the last child in the $destinationname. If the $beforesibling is specified, $something should be prepended to it. If the given sibling is not found, $something should be appended to the end of $destinationname and a developer debugging message should be displayed. param: string $destinationname The internal name of the new parent for $something. param: part_of_admin_tree $something The object to be added. return: bool True on success, false on failure. |
Class: admin_category - X-Ref
The object used to represent folders (a.k.a. categories) in the admin tree block.__construct($name, $visiblename, $hidden=false) X-Ref |
Constructor for an empty admin category param: string $name The internal name for this category. Must be unique amongst ALL part_of_admin_tree objects param: string $visiblename The displayed named for this category. Usually obtained through get_string() param: bool $hidden hide category in admin tree block, defaults to false |
get_settings_page_url() X-Ref |
Get the URL to view this settings page. return: moodle_url |
locate($name, $findpath=false) X-Ref |
Returns a reference to the part_of_admin_tree object with internal name $name. param: string $name The internal name of the object we want. param: bool $findpath initialize path and visiblepath arrays return: mixed A reference to the object with internal name $name if found, otherwise a reference to NULL. |
search($query) X-Ref |
Search using query param: string query return: mixed array-object structure of found settings and pages |
prune($name) X-Ref |
Removes part_of_admin_tree object with internal name $name. param: string $name The internal name of the object we want to remove. return: bool success |
add($parentname, $something, $beforesibling = null) X-Ref |
Adds a part_of_admin_tree to a child or grandchild (or great-grandchild, and so forth) of this object. By default the new part of the tree is appended as the last child of the parent. You can specify a sibling node that the new part should be prepended to. If the given sibling is not found, the part is appended to the end (as it would be by default) and a developer debugging message is displayed. param: string $destinationame The internal name of the immediate parent that we want for $something. param: mixed $something A part_of_admin_tree or setting instance to be added. param: string $beforesibling The name of the parent's child the $something should be prepended to. return: bool True if successfully added, false if $something can not be added. |
check_access() X-Ref |
Checks if the user has access to anything in this category. return: bool True if the user has access to at least one child in this category, false otherwise. |
is_hidden() X-Ref |
Is this category hidden in admin tree block? return: bool True if hidden |
show_save() X-Ref |
Show we display Save button at the page bottom? return: bool |
set_sorting($sort, $asc = true, $split = true) X-Ref |
Sets sorting on this category. Please note this function doesn't actually do the sorting. It can be called anytime. Sorting occurs when the user calls get_children. Code using the children array directly won't see the sorted results. param: bool $sort If set to true children will be sorted, if false they won't be. param: bool $asc If true sorting will be ascending, otherwise descending. param: bool $split If true we sort pages and sub categories separately. |
get_children() X-Ref |
Returns the children associated with this category. return: part_of_admin_tree[] |
__get($property) X-Ref |
Magically gets a property from this object. param: $property return: part_of_admin_tree[] |
__set($property, $value) X-Ref |
Magically sets a property against this object. param: string $property param: mixed $value |
__isset($property) X-Ref |
Checks if an inaccessible property is set. param: string $property return: bool |
Class: admin_root - X-Ref
Root of admin settings tree, does not have any parent.__construct($fulltree) X-Ref |
param: bool $fulltree true means all settings required, |
purge_children($requirefulltree) X-Ref |
Empties children array, and sets loaded to false param: bool $requirefulltree |
Class: admin_externalpage - X-Ref
Links external PHP pages into the admin tree.__construct($name, $visiblename, $url, $req_capability='moodle/site:config', $hidden=false, $context=NULL) X-Ref |
Constructor for adding an external page into the admin tree. param: string $name The internal name for this external page. Must be unique amongst ALL part_of_admin_tree objects. param: string $visiblename The displayed name for this external page. Usually obtained through get_string(). param: string $url The external URL that we should link to when someone requests this external page. param: mixed $req_capability The role capability/permission a user must have to access this external page. Defaults to 'moodle/site:config'. param: boolean $hidden Is this external page hidden in admin tree block? Default false. param: stdClass $context The context the page relates to. Not sure what happens |
get_settings_page_url() X-Ref |
Get the URL to view this settings page. return: moodle_url |
locate($name, $findpath=false) X-Ref |
Returns a reference to the part_of_admin_tree object with internal name $name. param: string $name The internal name of the object we want. param: bool $findpath defaults to false return: mixed A reference to the object with internal name $name if found, otherwise a reference to NULL. |
prune($name) X-Ref |
This function always returns false, required function by interface param: string $name return: false |
search($query) X-Ref |
Search using query param: string $query return: mixed array-object structure of found settings and pages |
check_access() X-Ref |
Determines if the current user has access to this external page based on $this->req_capability. return: bool True if user has access, false otherwise. |
is_hidden() X-Ref |
Is this external page hidden in admin tree block? return: bool True if hidden |
show_save() X-Ref |
Show we display Save button at the page bottom? return: bool |
Class: admin_settingdependency - X-Ref
Used to store details of the dependency between two settings elements.__construct($settingname, $dependenton, $condition, $value) X-Ref |
admin_settingdependency constructor. param: string $settingname param: string $dependenton param: string $condition param: string $value |
parse_name($name) X-Ref |
Convert the setting name into the form field name. param: string $name return: string |
prepare_for_javascript($dependencies) X-Ref |
Gather together all the dependencies in a format suitable for initialising javascript param: admin_settingdependency[] $dependencies return: array |
Class: admin_settingpage - X-Ref
Used to group a number of admin_setting objects into a page and add them to the admin tree.__construct($name, $visiblename, $req_capability='moodle/site:config', $hidden=false, $context=NULL) X-Ref |
see admin_settingpage for details of this function param: string $name The internal name for this external page. Must be unique amongst ALL part_of_admin_tree objects. param: string $visiblename The displayed name for this external page. Usually obtained through get_string(). param: mixed $req_capability The role capability/permission a user must have to access this external page. Defaults to 'moodle/site:config'. param: boolean $hidden Is this external page hidden in admin tree block? Default false. param: stdClass $context The context the page relates to. Not sure what happens |
get_settings_page_url() X-Ref |
Get the URL to view this page. return: moodle_url |
locate($name, $findpath=false) X-Ref |
see admin_category param: string $name param: bool $findpath return: mixed Object (this) if name == this->name, else returns null |
search($query) X-Ref |
Search string in settings page. param: string $query return: array |
prune($name) X-Ref |
This function always returns false, required by interface param: string $name return: bool Always false |
add($setting) X-Ref |
adds an admin_setting to this admin_settingpage not the same as add for admin_category. adds an admin_setting to this admin_settingpage. settings appear (on the settingpage) in the order in which they're added n.b. each admin_setting in an admin_settingpage must have a unique internal name param: object $setting is the admin_setting object you want to add return: bool true if successful, false if not |
hide_if($settingname, $dependenton, $condition = 'notchecked', $value = '1') X-Ref |
Hide the named setting if the specified condition is matched. param: string $settingname param: string $dependenton param: string $condition param: string $value |
check_access() X-Ref |
see admin_externalpage return: bool Returns true for yes false for no |
output_html() X-Ref |
outputs this page as html in a table (suitable for inclusion in an admin pagetype) return: string Returns an XHTML string |
is_hidden() X-Ref |
Is this settings page hidden in admin tree block? return: bool True if hidden |
show_save() X-Ref |
Show we display Save button at the page bottom? return: bool |
has_dependencies() X-Ref |
Should any of the settings on this page be shown / hidden based on conditions? return: bool |
get_dependencies_for_javascript() X-Ref |
Format the setting show/hide conditions ready to initialise the page javascript return: array |
Class: admin_setting - X-Ref
Admin settings class. Only exists on setting pages.__construct($name, $visiblename, $description, $defaultsetting) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, param: string $visiblename localised name param: string $description localised long description param: mixed $defaultsetting string or array depending on implementation |
set_flag_options($enabled, $default, $shortname, $displayname) X-Ref |
Generic function to add a flag to this admin setting. param: bool $enabled - One of self::OPTION_ENABLED or self::OPTION_DISABLED param: bool $default - The default for the flag param: string $shortname - The shortname for this flag. Used as a suffix for the setting name. param: string $displayname - The display name for this flag. Used as a label next to the checkbox. |
set_enabled_flag_options($enabled, $default) X-Ref |
Set the enabled options flag on this admin setting. param: bool $enabled - One of self::OPTION_ENABLED or self::OPTION_DISABLED param: bool $default - The default for the flag |
set_advanced_flag_options($enabled, $default) X-Ref |
Set the advanced options flag on this admin setting. param: bool $enabled - One of self::OPTION_ENABLED or self::OPTION_DISABLED param: bool $default - The default for the flag |
set_locked_flag_options($enabled, $default) X-Ref |
Set the locked options flag on this admin setting. param: bool $enabled - One of self::OPTION_ENABLED or self::OPTION_DISABLED param: bool $default - The default for the flag |
set_required_flag_options($enabled, $default) X-Ref |
Set the required options flag on this admin setting. param: bool $enabled - One of self::OPTION_ENABLED or self::OPTION_DISABLED. param: bool $default - The default for the flag. |
is_readonly() X-Ref |
Is this option forced in config.php? return: bool |
get_setting_flag_value(admin_setting_flag $flag) X-Ref |
Get the currently saved value for a setting flag param: admin_setting_flag $flag - One of the admin_setting_flag for this admin_setting. return: bool |
get_setting_flag_defaults(& $defaults) X-Ref |
Get the list of defaults for the flags on this setting. param: array of strings describing the defaults for this setting. This is appended to by this function. |
output_setting_flags() X-Ref |
Output the input fields for the advanced and locked flags on this setting. param: bool $adv - The current value of the advanced flag. param: bool $locked - The current value of the locked flag. return: string $output - The html for the flags. |
write_setting_flags($data) X-Ref |
Write the values of the flags for this admin setting. param: array $data - The data submitted from the form or null to set the default value for new installs. return: bool - true if successful. |
parse_setting_name($name) X-Ref |
Set up $this->name and potentially $this->plugin Set up $this->name and possibly $this->plugin based on whether $name looks like 'settingname' or 'plugin/settingname'. Also, do some sanity checking on the names, that is, output a developer debug warning if the name contains anything other than [a-zA-Z0-9_]+. param: string $name the setting name passed in to the constructor. |
get_full_name() X-Ref |
Returns the fullname prefixed by the plugin return: string |
get_id() X-Ref |
Returns the ID string based on plugin and name return: string |
set_affects_modinfo($affectsmodinfo) X-Ref |
param: bool $affectsmodinfo If true, changes to this setting will |
config_read($name) X-Ref |
Returns the config if possible return: mixed returns config if successful else null |
config_write($name, $value) X-Ref |
Used to set a config pair and log change param: string $name param: mixed $value Gets converted to string if not null return: bool Write setting to config table |
add_to_config_log($name, $oldvalue, $value) X-Ref |
Log config changes if necessary. param: string $name param: string $oldvalue param: string $value |
get_defaultsetting() X-Ref |
Returns default setting if exists return: mixed array or string depending on instance; NULL means no default, user must supply |
output_html($data, $query='') X-Ref |
Return part of form with setting This function should always be overwritten param: mixed $data array or string depending on setting param: string $query return: string |
set_updatedcallback($functionname) X-Ref |
Function called if setting updated - cleanup, cache reset, etc. param: string $functionname Sets the function name return: void |
post_write_settings($original) X-Ref |
Execute postupdatecallback if necessary. param: mixed $original original value before write_setting() return: bool true if changed, false if not. |
is_related($query) X-Ref |
Is setting related to query text - used when searching param: string $query return: bool |
get_force_ltr() X-Ref |
Get whether this should be displayed in LTR mode. return: bool|null |
set_force_ltr($value) X-Ref |
Set whether to force LTR or not. param: bool $value True when forced, false when not force, null when unknown. |
add_dependent_on($dependenton) X-Ref |
Add a setting to the list of those that could cause this one to be hidden param: string $dependenton |
get_dependent_on() X-Ref |
Get a list of the settings that could cause this one to be hidden. return: array |
has_custom_form_control() X-Ref |
Whether this setting uses a custom form control. This function is especially useful to decide if we should render a label element for this setting or not. return: bool |
is_forceable() X-Ref |
Whether the setting can be overridden in config.php. Returning true will allow the setting to be defined and overridden in config.php. Returning false will prevent the config setting from being overridden even when it gets defined in config.php. return: bool |
Class: admin_setting_flag - X-Ref
An additional option that can be applied to an admin setting.__construct($enabled, $default, $shortname, $displayname) X-Ref |
Constructor param: bool $enabled Can this option can be toggled. param: bool $default The default checked state for this setting option. param: string $shortname The shortname of this flag. Currently supported flags are 'locked' and 'adv' param: string $displayname The displayname of this flag. Used as a label for the flag. |
set_options($enabled, $default) X-Ref |
Update the values of this setting options class param: bool $enabled Can this option can be toggled. param: bool $default The default checked state for this setting option. |
is_enabled() X-Ref |
Should this option appear in the interface and be toggleable? return: bool Is it enabled? |
get_default() X-Ref |
Should this option be checked by default? return: bool Is it on by default? |
get_shortname() X-Ref |
Return the short name for this flag. e.g. 'adv' or 'locked' return: string |
get_displayname() X-Ref |
Return the display name for this flag. e.g. 'Advanced' or 'Locked' return: string |
write_setting_flag(admin_setting $setting, $data) X-Ref |
Save the submitted data for this flag - or set it to the default if $data is null. param: admin_setting $setting - The admin setting for this flag param: array $data - The data submitted from the form or null to set the default value for new installs. return: bool |
output_setting_flag(admin_setting $setting) X-Ref |
Output the checkbox for this setting flag. Should only be called if the flag is enabled. param: admin_setting $setting - The admin setting for this flag return: string - The html for the checkbox. |
Class: admin_setting_heading - X-Ref
No setting - just heading and text.__construct($name, $heading, $information) X-Ref |
not a setting, just text param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $heading heading param: string $information text in box |
get_setting() X-Ref |
Always returns true return: bool Always returns true |
get_defaultsetting() X-Ref |
Always returns true return: bool Always returns true |
write_setting($data) X-Ref |
Never write settings return: string Always returns an empty string |
output_html($data, $query='') X-Ref |
Returns an HTML string return: string Returns an HTML string |
Class: admin_setting_description - X-Ref
No setting - just name and description in same row.__construct($name, $visiblename, $description) X-Ref |
Not a setting, just text param: string $name param: string $visiblename param: string $description |
get_setting() X-Ref |
Always returns true return: bool Always returns true |
get_defaultsetting() X-Ref |
Always returns true return: bool Always returns true |
write_setting($data) X-Ref |
Never write settings param: mixed $data Gets converted to str for comparison against yes value return: string Always returns an empty string |
output_html($data, $query='') X-Ref |
Returns an HTML string param: string $data param: string $query return: string Returns an HTML string |
Class: admin_setting_configtext - X-Ref
The most flexible setting, the user enters text.__construct($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW, $size=null) X-Ref |
Config text constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: string $defaultsetting param: mixed $paramtype int means PARAM_XXX type, string is a allowed format in regex param: int $size default field size |
get_force_ltr() X-Ref |
Get whether this should be displayed in LTR mode. Try to guess from the PARAM type unless specifically set. |
get_setting() X-Ref |
Return the setting return: mixed returns config if successful else null |
write_setting($data) X-Ref |
No description |
validate($data) X-Ref |
Validate data before storage param: string data return: mixed true if ok string if error found |
output_html($data, $query='') X-Ref |
Return an XHTML string for the setting return: string Returns an XHTML string |
Class: admin_setting_configtext_with_maxlength - X-Ref
Text input with a maximum length constraint.__construct($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW,$size=null, $maxlength = 0) X-Ref |
Config text constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, param: string $visiblename localised param: string $description long localised info param: string $defaultsetting param: mixed $paramtype int means PARAM_XXX type, string is a allowed format in regex param: int $size default field size param: mixed $maxlength int maxlength allowed, 0 for infinite. |
validate($data) X-Ref |
Validate data before storage param: string $data data return: mixed true if ok string if error found |
Class: admin_setting_configtextarea - X-Ref
General text area without html editor.__construct($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW, $cols='60', $rows='8') X-Ref |
param: string $name param: string $visiblename param: string $description param: mixed $defaultsetting string or array param: mixed $paramtype param: string $cols The number of columns to make the editor param: string $rows The number of rows to make the editor |
output_html($data, $query='') X-Ref |
Returns an XHTML string for the editor param: string $data param: string $query return: string XHTML string for the editor |
Class: admin_setting_confightmleditor - X-Ref
General text area with html editor.__construct($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW, $cols='60', $rows='8') X-Ref |
param: string $name param: string $visiblename param: string $description param: mixed $defaultsetting string or array param: mixed $paramtype |
output_html($data, $query='') X-Ref |
Returns an XHTML string for the editor param: string $data param: string $query return: string XHTML string for the editor |
write_setting($data) X-Ref |
Checks if data has empty html. param: string $data return: string Empty when no errors. |
Class: admin_setting_configpasswordunmask - X-Ref
Password field, allows unmasking of password__construct($name, $visiblename, $description, $defaultsetting) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: string $defaultsetting default password |
add_to_config_log($name, $oldvalue, $value) X-Ref |
Log config changes if necessary. param: string $name param: string $oldvalue param: string $value |
output_html($data, $query='') X-Ref |
Returns HTML for the field. param: string $data Value for the field param: string $query Passed as final argument for format_admin_setting return: string Rendered HTML |
Class: admin_setting_configpasswordunmask_with_advanced - X-Ref
Password field, allows unmasking of password, with an advanced checkbox that controls an additional $name.'_adv' setting.__construct($name, $visiblename, $description, $defaultsetting) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: array $defaultsetting ('value'=>string, 'adv'=>bool) |
Class: admin_setting_encryptedpassword - X-Ref
Admin setting class for encrypted values using secure encryption.__construct(string $name, string $visiblename, string $description) X-Ref |
Constructor. Same as parent except that the default value is always an empty string. param: string $name Internal name used in config table param: string $visiblename Name shown on form param: string $description Description that appears below field |
get_setting() X-Ref |
No description |
write_setting($data) X-Ref |
No description |
output_html($data, $query='') X-Ref |
No description |
Class: admin_setting_configempty - X-Ref
Empty setting used to allow flags (advanced) on settings that can have no sensible default.__construct($name, $visiblename, $description) X-Ref |
param: string $name param: string $visiblename param: string $description |
output_html($data, $query='') X-Ref |
Returns an XHTML string for the hidden field param: string $data param: string $query return: string XHTML string for the editor |
Class: admin_setting_configfile - X-Ref
Path to directory__construct($name, $visiblename, $description, $defaultdirectory) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: string $defaultdirectory default directory location |
output_html($data, $query='') X-Ref |
Returns XHTML for the field Returns XHTML for the field and also checks whether the file specified in $data exists using file_exists() param: string $data File name and path to use in value attr param: string $query return: string XHTML field |
write_setting($data) X-Ref |
Checks if execpatch has been disabled in config.php |
Class: admin_setting_configexecutable - X-Ref
Path to executable fileoutput_html($data, $query='') X-Ref |
Returns an XHTML field param: string $data This is the value for the field param: string $query return: string XHTML field |
Class: admin_setting_configdirectory - X-Ref
Path to directoryoutput_html($data, $query='') X-Ref |
Returns an XHTML field param: string $data This is the value for the field param: string $query return: string XHTML |
Class: admin_setting_configcheckbox - X-Ref
Checkbox__construct($name, $visiblename, $description, $defaultsetting, $yes='1', $no='0') X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: string $defaultsetting param: string $yes value used when checked param: string $no value used when not checked |
get_setting() X-Ref |
Retrieves the current setting using the objects name return: string |
write_setting($data) X-Ref |
Sets the value for the setting Sets the value for the setting to either the yes or no values of the object by comparing $data to yes param: mixed $data Gets converted to str for comparison against yes value return: string empty string or error |
output_html($data, $query='') X-Ref |
Returns an XHTML checkbox field param: string $data If $data matches yes then checkbox is checked param: string $query return: string XHTML field |
Class: admin_setting_configmulticheckbox - X-Ref
Multiple checkboxes, each represents different value, stored in csv format__construct($name, $visiblename, $description, $defaultsetting, $choices) X-Ref |
Constructor: uses parent::__construct The $choices parameter may be either an array of $value => $label format, e.g. [1 => get_string('yes')], or a callback function which takes no parameters and returns an array in that format. param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: array $defaultsetting array of selected param: array|callable $choices array of $value => $label for each checkbox, or a callback |
load_choices() X-Ref |
This function may be used in ancestors for lazy loading of choices Override this method if loading of choices is expensive, such as when it requires multiple db requests. return: bool true if loaded, false if error |
is_related($query) X-Ref |
Is setting related to query text - used when searching param: string $query return: bool true on related, false on not or failure |
get_setting() X-Ref |
Returns the current setting if it is set return: mixed null if null, else an array |
write_setting($data) X-Ref |
Saves the setting(s) provided in $data param: array $data An array of data, if not array returns empty str return: mixed empty string on useless data or bool true=success, false=failed |
output_html($data, $query='') X-Ref |
Returns XHTML field(s) as required by choices Relies on data being an array should data ever be another valid vartype with acceptable value this may cause a warning/error if (!is_array($data)) would fix the problem param: array $data An array of checked values param: string $query return: string XHTML field |
Class: admin_setting_configmulticheckbox2 - X-Ref
Multiple checkboxes 2, value stored as string 00101011get_setting() X-Ref |
Returns the setting if set return: mixed null if not set, else an array of set settings |
write_setting($data) X-Ref |
Save setting(s) provided in $data param param: array $data An array of settings to save return: mixed empty string for bad data or bool true=>success, false=>error |
Class: admin_setting_configselect - X-Ref
Select one value from list__construct($name, $visiblename, $description, $defaultsetting, $choices) X-Ref |
Constructor. If you want to lazy-load the choices, pass a callback function that returns a choice array for the $choices parameter. param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: string|int $defaultsetting param: array|callable|null $choices array of $value=>$label for each selection, or callback |
set_validate_function(?callable $validatefunction = null) X-Ref |
Sets a validate function. The callback will be passed one parameter, the new setting value, and should return either an empty string '' if the value is OK, or an error message if not. param: callable|null $validatefunction Validate function or null to clear |
load_choices() X-Ref |
This function may be used in ancestors for lazy loading of choices Override this method if loading of choices is expensive, such as when it requires multiple db requests. return: bool true if loaded, false if error |
is_related($query) X-Ref |
Check if this is $query is related to a choice param: string $query return: bool true if related, false if not |
get_setting() X-Ref |
Return the setting return: mixed returns config if successful else null |
write_setting($data) X-Ref |
Save a setting param: string $data return: string empty of error string |
validate_setting(string $data) X-Ref |
Validate the setting. This uses the callback function if provided; subclasses could override to carry out validation directly in the class. param: string $data New value being set return: string Empty string if valid, or error message text |
output_select_html($data, $current, $default, $extraname = '') X-Ref |
Returns XHTML select field Ensure the options are loaded, and generate the XHTML for the select element and any warning message. Separating this out from output_html makes it easier to subclass this class. param: string $data the option to show as selected. param: string $current the currently selected option in the database, null if none. param: string $default the default selected option. return: array the HTML for the select element, and a warning message. |
output_html($data, $query='') X-Ref |
Returns XHTML select field and wrapping div(s) param: string $data the option to show as selected param: string $query return: string XHTML field and wrapping div |
Class: admin_setting_configmultiselect - X-Ref
Select multiple items from list__construct($name, $visiblename, $description, $defaultsetting, $choices) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: array $defaultsetting array of selected items param: array $choices array of $value=>$label for each list item |
get_setting() X-Ref |
Returns the select setting(s) return: mixed null or array. Null if no settings else array of setting(s) |
write_setting($data) X-Ref |
Saves setting(s) provided through $data Potential bug in the works should anyone call with this function using a vartype that is not an array param: array $data |
is_related($query) X-Ref |
Is setting related to query text - used when searching param: string $query return: bool true if related, false if not |
output_html($data, $query='') X-Ref |
Returns XHTML multi-select field param: array $data Array of values to select by default param: string $query return: string XHTML multi-select field |
Class: admin_setting_configtime - X-Ref
Time selector__construct($hoursname, $minutesname, $visiblename, $description, $defaultsetting) X-Ref |
Constructor param: string $hoursname setting for hours param: string $minutesname setting for hours param: string $visiblename localised param: string $description long localised info param: array $defaultsetting array representing default time 'h'=>hours, 'm'=>minutes |
get_setting() X-Ref |
Get the selected time return: mixed An array containing 'h'=>xx, 'm'=>xx, or null if not set |
write_setting($data) X-Ref |
Store the time (hours and minutes) param: array $data Must be form 'h'=>xx, 'm'=>xx return: bool true if success, false if not |
output_html($data, $query='') X-Ref |
Returns XHTML time select fields param: array $data Must be form 'h'=>xx, 'm'=>xx param: string $query return: string XHTML time select fields and wrapping div(s) |
Class: admin_setting_configduration - X-Ref
Seconds duration setting.__construct($name, $visiblename, $description, $defaultsetting, $defaultunit = 86400) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, param: string $visiblename localised name param: string $description localised long description param: mixed $defaultsetting string or array depending on implementation param: int $defaultunit - day, week, etc. (in seconds) |
set_min_duration(int $duration) X-Ref |
Set the minimum allowed value. This must be at least 0. param: int $duration |
set_max_duration(?int $duration) X-Ref |
Set the maximum allowed value. A value of null will disable the maximum duration value. param: int|null $duration |
set_validate_function(?callable $validatefunction = null) X-Ref |
Sets a validate function. The callback will be passed one parameter, the new setting value, and should return either an empty string '' if the value is OK, or an error message if not. param: callable|null $validatefunction Validate function or null to clear |
validate_setting(int $data) X-Ref |
Validate the setting. This uses the callback function if provided; subclasses could override to carry out validation directly in the class. param: int $data New value being set return: string Empty string if valid, or error message text |
get_units() X-Ref |
Returns selectable units. return: array |
get_duration_text(int $seconds, ?string $emptyvalue = null) X-Ref |
Converts seconds to some more user friendly string. param: int $seconds param: null|string The value to use when the duration is empty. If not specified, a "None" value is used. return: string |
parse_seconds($seconds) X-Ref |
Finds suitable units for given duration. param: int $seconds return: array |
get_setting() X-Ref |
Get the selected duration as array. return: mixed An array containing 'v'=>xx, 'u'=>xx, or null if not set |
write_setting($data) X-Ref |
Store the duration as seconds. param: array $data Must be form 'h'=>xx, 'm'=>xx return: bool true if success, false if not |
output_html($data, $query='') X-Ref |
Returns duration text+select fields. param: array $data Must be form 'v'=>xx, 'u'=>xx param: string $query return: string duration text+select fields and wrapping div(s) |
Class: admin_setting_configduration_with_advanced - X-Ref
Seconds duration setting with an advanced checkbox, that controls a additional__construct($name, $visiblename, $description, $defaultsetting, $defaultunit = 86400) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, param: string $visiblename localised name param: string $description localised long description param: array $defaultsetting array of int value, and bool whether it is param: int $defaultunit - day, week, etc. (in seconds) |
Class: admin_setting_configmixedhostiplist - X-Ref
Used to validate a textarea used for domain names, wildcard domain names and IP addresses/ranges (both IPv4 and IPv6 format).validate($data) X-Ref |
Validate the contents of the textarea as either IP addresses, domain name or wildcard domain name (RFC 4592). Used to validate a new line separated list of entries collected from a textarea control. This setting provides support for internationalised domain names (IDNs), however, such UTF-8 names will be converted to their ascii-compatible encoding (punycode) on save, and converted back to their UTF-8 representation when fetched via the get_setting() method, which has been overriden. param: string $data A list of FQDNs, DNS wildcard format domains, and IP addresses, separated by new lines. return: mixed bool true for success or string:error on failure |
ace_encode($data) X-Ref |
Convert any lines containing international domain names (IDNs) to their ascii-compatible encoding (ACE). param: string $data the setting data, as sent from the web form. return: string $data the setting data, with all IDNs converted (using punycode) to their ascii encoded version. |
ace_decode($data) X-Ref |
Decode any ascii-encoded domain names back to their utf-8 representation for display. param: string $data the setting data, as found in the database. return: string $data the setting data, with all ascii-encoded IDNs decoded back to their utf-8 representation. |
get_setting() X-Ref |
Override, providing utf8-decoding for ascii-encoded IDN strings. return: mixed returns punycode-converted setting string if successful, else null. |
write_setting($data) X-Ref |
Override, providing ascii-encoding for utf8 (native) IDN strings. param: string $data return: string |
Class: admin_setting_users_with_capability - X-Ref
An admin setting for selecting one or more users who have a capability__construct($name, $visiblename, $description, $defaultsetting, $capability, $includeadmins = true) X-Ref |
Constructor. param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised name param: string $description localised long description param: array $defaultsetting array of usernames param: string $capability string capability name. param: bool $includeadmins include administrators |
load_choices() X-Ref |
Load all of the uses who have the capability into choice array return: bool Always returns true |
get_defaultsetting() X-Ref |
Returns the default setting for class return: mixed Array, or string. Empty string if no default |
get_setting() X-Ref |
Returns the current setting return: mixed array or string |
write_setting($data) X-Ref |
Save the chosen setting provided as $data param: array $data return: mixed string or array |
Class: admin_setting_special_adminseesall - X-Ref
Special checkbox for calendar - resets SESSION vars.__construct() X-Ref |
Calls the parent::__construct with default values name => calendar_adminseesall visiblename => get_string('adminseesall', 'admin') description => get_string('helpadminseesall', 'admin') defaultsetting => 0 |
write_setting($data) X-Ref |
Stores the setting passed in $data param: mixed gets converted to string for comparison return: string empty string or error message |
Class: admin_setting_special_selectsetup - X-Ref
Special select for settings that are altered in setup.php and can not be altered on the flyget_setting() X-Ref |
Reads the setting directly from the database return: mixed |
write_setting($data) X-Ref |
Save the setting passed in $data param: string $data The setting to save return: string empty or error message |
Class: admin_setting_sitesetselect - X-Ref
Special select for frontpage - stores data in course tableget_setting() X-Ref |
Returns the site name for the selected site return: string The site name of the selected site |
write_setting($data) X-Ref |
Updates the database and save the setting param: string data return: string empty or error message |
is_forceable() X-Ref |
admin_setting_sitesetselect is not meant to be overridden in config.php. return: bool |
Class: admin_setting_bloglevel - X-Ref
Select for blog's bloglevel setting: if set to 0, will set blog_menuwrite_setting($data) X-Ref |
Updates the database and save the setting param: string data return: string empty or error message |
Class: admin_setting_courselist_frontpage - X-Ref
Special select - lists on the frontpage - hacky__construct($loggedin) X-Ref |
Construct override, requires one param param: bool $loggedin Is the user logged in |
load_choices() X-Ref |
Loads the choices available return: bool always returns true |
get_setting() X-Ref |
Returns the selected settings param: mixed array or setting or null |
write_setting($data) X-Ref |
Save the selected options param: array $data return: mixed empty string (data is not an array) or bool true=success false=failure |
output_html($data, $query='') X-Ref |
Return XHTML select field and wrapping div param: array $data Array of elements to select by default return: string XHTML select field and wrapping div |
Class: admin_setting_sitesetcheckbox - X-Ref
Special checkbox for frontpage - stores data in course tableget_setting() X-Ref |
Returns the current sites name return: string |
write_setting($data) X-Ref |
Save the selected setting param: string $data The selected site return: string empty string or error message |
is_forceable() X-Ref |
admin_setting_sitesetcheckbox is not meant to be overridden in config.php. return: bool |
Class: admin_setting_sitesettext - X-Ref
Special text for frontpage - stores data in course table.__construct() X-Ref |
Constructor. |
get_setting() X-Ref |
Return the current setting return: mixed string or null |
validate($data) X-Ref |
Validate the selected data param: string $data The selected value to validate return: mixed true or message string |
write_setting($data) X-Ref |
Save the selected setting param: string $data The selected value return: string empty or error message |
is_forceable() X-Ref |
admin_setting_sitesettext is not meant to be overridden in config.php. return: bool |
Class: admin_setting_requiredtext - X-Ref
This type of field should be used for mandatory config settings.Class: admin_setting_special_frontpagedesc - X-Ref
Special text editor for site description.__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Return the current setting return: string The current setting |
write_setting($data) X-Ref |
Save the new setting param: string $data The new value to save return: string empty or error message |
is_forceable() X-Ref |
admin_setting_special_frontpagedesc is not meant to be overridden in config.php. return: bool |
Class: admin_setting_emoticons - X-Ref
Administration interface for emoticon_manager settings.__construct() X-Ref |
Calls parent::__construct with specific args |
get_setting() X-Ref |
Return the current setting(s) return: array Current settings array |
write_setting($data) X-Ref |
Save selected settings param: array $data Array of settings to save return: bool |
output_html($data, $query='') X-Ref |
Return XHTML field(s) for options param: array $data Array of options to set in HTML return: string XHTML string for the fields and wrapping div(s) |
prepare_form_data(array $emoticons) X-Ref |
Converts the array of emoticon objects provided by {@see emoticon_manager} into admin settings form data param: array $emoticons array of emoticon objects as returned by {@see emoticon_manager} return: array of form fields and their values |
process_form_data(array $form) X-Ref |
Converts the data from admin settings form into an array of emoticon objects param: array $data array of admin form fields and values return: false|array of emoticon objects |
Class: admin_setting_langlist - X-Ref
Special setting for limiting of the list of available languages.__construct() X-Ref |
Calls parent::__construct with specific arguments |
validate($data) X-Ref |
Validate that each language identifier exists on the site param: string $data return: bool|string True if validation successful, otherwise error string |
write_setting($data) X-Ref |
Save the new setting param: string $data The new setting return: bool |
Class: admin_setting_countrycodes - X-Ref
Allows to specify comma separated list of known country codes.__construct($name, $visiblename, $description, $defaultsetting = '', $size = null) X-Ref |
Construct the instance of the setting. param: string $name Name of the admin setting such as 'allcountrycodes' or 'myplugin/countries'. param: lang_string|string $visiblename Language string with the field label text. param: lang_string|string $description Language string with the field description text. param: string $defaultsetting Default value of the setting. param: int $size Input text field size. |
validate($data) X-Ref |
Validate the setting value before storing it. The value is first validated through custom regex so that it is a word consisting of letters, numbers or underscore; or a comma separated list of such words. param: string $data Value inserted into the setting field. return: bool|string True if the value is OK, error string otherwise. |
Class: admin_settings_country_select - X-Ref
Selection of one of the recognised countries using the list__construct($name, $visiblename, $description, $defaultsetting, $includeall=false) X-Ref |
No description |
load_choices() X-Ref |
Lazy-load the available choices for the select box |
Class: admin_settings_num_course_sections - X-Ref
admin_setting_configselect for the default number of sections in a course,__construct($name, $visiblename, $description, $defaultsetting) X-Ref |
No description |
load_choices() X-Ref |
No description |
Class: admin_settings_coursecat_select - X-Ref
Course category selection__construct($name, $visiblename, $description, $defaultsetting = 1) X-Ref |
Calls parent::__construct with specific arguments |
load_choices() X-Ref |
Load the available choices for the select box return: bool |
Class: admin_setting_special_backupdays - X-Ref
Special control for selecting days to backup__construct() X-Ref |
Calls parent::__construct with specific arguments |
load_choices() X-Ref |
Load the available choices for the select box return: bool Always returns true |
Class: admin_setting_special_backup_auto_destination - X-Ref
Special setting for backup auto destination.__construct() X-Ref |
Calls parent::__construct with specific arguments. |
write_setting($data) X-Ref |
Check if the directory must be set, depending on backup/backup_auto_storage. Note: backup/backup_auto_storage must be specified BEFORE this setting otherwise there will be conflicts if this validation happens before the other one. param: string $data Form data. return: string Empty when no errors. |
Class: admin_setting_special_debug - X-Ref
Special debug setting__construct() X-Ref |
Calls parent::__construct with specific arguments |
load_choices() X-Ref |
Load the available choices for the select box return: bool |
Class: admin_setting_special_calendar_weekend - X-Ref
Special admin control__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Gets the current settings as an array return: mixed Null if none, else array of settings |
write_setting($data) X-Ref |
Save the new settings param: array $data Array of new settings return: bool |
output_html($data, $query='') X-Ref |
Return XHTML to display the control param: array $data array of selected days param: string $query return: string XHTML for display (field + wrapping div(s) |
Class: admin_setting_question_behaviour - X-Ref
Admin setting that allows a user to pick a behaviour.__construct($name, $visiblename, $description, $default) X-Ref |
param: string $name name of config variable param: string $visiblename display name param: string $description description param: string $default default. |
load_choices() X-Ref |
Load list of behaviours as choices return: bool true => success, false => error. |
Class: admin_setting_pickroles - X-Ref
Admin setting that allows a user to pick appropriate roles for something.__construct($name, $visiblename, $description, $types) X-Ref |
param: string $name Name of config variable param: string $visiblename Display name param: string $description Description param: array $types Array of archetypes which identify |
load_choices() X-Ref |
Load roles as choices return: bool true=>success, false=>error |
get_defaultsetting() X-Ref |
Return the default setting for this control return: array Array of default settings |
Class: admin_setting_pickfilters - X-Ref
Admin setting that is a list of installed filter plugins.__construct($name, $visiblename, $description, $default) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings param: string $visiblename localised name param: string $description localised long description param: array $default the default. E.g. array('urltolink' => 1, 'emoticons' => 1) |
load_choices() X-Ref |
No description |
Class: admin_setting_configtext_with_advanced - X-Ref
Text field with an advanced checkbox, that controls a additional $name.'_adv' setting.__construct($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW, $size=null) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: array $defaultsetting ('value'=>string, '__construct'=>bool) param: mixed $paramtype int means PARAM_XXX type, string is a allowed format in regex param: int $size default field size |
Class: admin_setting_configcheckbox_with_advanced - X-Ref
Checkbox with an advanced checkbox that controls an additional $name.'_adv' config setting.__construct($name, $visiblename, $description, $defaultsetting, $yes='1', $no='0') X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: array $defaultsetting ('value'=>string, 'adv'=>bool) param: string $yes value used when checked param: string $no value used when not checked |
Class: admin_setting_configcheckbox_with_lock - X-Ref
Checkbox with an advanced checkbox that controls an additional $name.'_locked' config setting.__construct($name, $visiblename, $description, $defaultsetting, $yes='1', $no='0') X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. param: string $visiblename localised param: string $description long localised info param: array $defaultsetting ('value'=>string, 'locked'=>bool) param: string $yes value used when checked param: string $no value used when not checked |
Class: admin_setting_configselect_autocomplete - X-Ref
Autocomplete as you type form element.output_html($data, $query='') X-Ref |
Returns XHTML select field and wrapping div(s) param: string $data the option to show as selected param: string $query return: string XHTML field and wrapping div |
Class: admin_setting_configselect_with_advanced - X-Ref
Dropdown menu with an advanced checkbox, that controls a additional $name.'_adv' setting.__construct($name, $visiblename, $description, $defaultsetting, $choices) X-Ref |
Calls parent::__construct with specific arguments |
Class: admin_setting_configselect_with_lock - X-Ref
Select with an advanced checkbox that controls an additional $name.'_locked' config setting.__construct($name, $visiblename, $description, $defaultsetting, $choices) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, param: string $visiblename localised param: string $description long localised info param: array $defaultsetting ('value'=>string, 'locked'=>bool) param: array $choices array of $value=>$label for each selection |
Class: admin_setting_special_gradebookroles - X-Ref
Graded roles in gradebook__construct() X-Ref |
Calls parent::__construct with specific arguments |
Class: admin_setting_regradingcheckbox - X-Ref
write_setting($data) X-Ref |
Saves the new settings passed in $data param: string $data return: mixed string or Array |
Class: admin_setting_special_coursecontact - X-Ref
Which roles to show on course description page__construct() X-Ref |
Calls parent::__construct with specific arguments |
Class: admin_setting_special_gradelimiting - X-Ref
__construct() X-Ref |
Calls parent::__construct with specific arguments |
admin_setting_special_gradelimiting() X-Ref |
Old syntax of class constructor. Deprecated in PHP7. |
regrade_all() X-Ref |
Force site regrading |
write_setting($data) X-Ref |
Saves the new settings param: mixed $data return: string empty string or error message |
Class: admin_setting_special_grademinmaxtouse - X-Ref
Special setting for $CFG->grade_minmaxtouse.__construct() X-Ref |
Constructor. |
write_setting($data) X-Ref |
Saves the new setting. param: mixed $data return: string empty string or error message |
Class: admin_setting_special_gradeexport - X-Ref
Primary grade export plugin - has state tracking.__construct() X-Ref |
Calls parent::__construct with specific arguments |
load_choices() X-Ref |
Load the available choices for the multicheckbox return: bool always returns true |
Class: admin_setting_special_gradepointdefault - X-Ref
A setting for setting the default grade point value. Must be an integer between 1 and $CFG->gradepointmax.__construct($name = '', $visiblename = '', $description = '', $defaultsetting = '', $paramtype = PARAM_INT, $size = 5) X-Ref |
Config gradepointmax constructor param: string $name Overidden by "gradepointmax" param: string $visiblename Overridden by "gradepointmax" language string. param: string $description Overridden by "gradepointmax_help" language string. param: string $defaultsetting Not used, overridden by 100. param: mixed $paramtype Overridden by PARAM_INT. param: int $size Overridden by 5. |
validate($data) X-Ref |
Validate data before storage param: string $data The submitted data return: bool|string true if ok, string if error found |
Class: admin_setting_special_gradepointmax - X-Ref
A setting for setting the maximum grade value. Must be an integer between 1 and 10000.__construct($name = '', $visiblename = '', $description = '', $defaultsetting = '', $paramtype = PARAM_INT, $size = 5) X-Ref |
Config gradepointmax constructor param: string $name Overidden by "gradepointmax" param: string $visiblename Overridden by "gradepointmax" language string. param: string $description Overridden by "gradepointmax_help" language string. param: string $defaultsetting Not used, overridden by 100. param: mixed $paramtype Overridden by PARAM_INT. param: int $size Overridden by 5. |
write_setting($data) X-Ref |
Save the selected setting param: string $data The selected site return: string empty string or error message |
validate($data) X-Ref |
Validate data before storage param: string $data The submitted data return: bool|string true if ok, string if error found |
output_html($data, $query = '') X-Ref |
Return an XHTML string for the setting param: array $data Associative array of value=>xx, forced=>xx, adv=>xx param: string $query search query to be highlighted return: string XHTML to display control |
Class: admin_setting_gradecat_combo - X-Ref
Grade category settings__construct($name, $visiblename, $description, $defaultsetting, $choices) X-Ref |
Sets choices and calls parent::__construct with passed arguments param: string $name param: string $visiblename param: string $description param: mixed $defaultsetting string or array depending on implementation param: array $choices An array of choices for the control |
get_setting() X-Ref |
Return the current setting(s) array return: array Array of value=>xx, forced=>xx, adv=>xx |
write_setting($data) X-Ref |
Save the new settings passed in $data param: array $data Associative array of value=>xx, forced=>xx, adv=>xx return: string empty or error message |
output_html($data, $query='') X-Ref |
Return XHTML to display the field and wrapping div param: array $data Associative array of value=>xx, forced=>xx, adv=>xx param: string $query return: string XHTML to display control |
Class: admin_setting_grade_profilereport - X-Ref
Selection of grade report in user profiles__construct() X-Ref |
Calls parent::__construct with specific arguments |
load_choices() X-Ref |
Loads an array of choices for the configselect control return: bool always return true |
Class: admin_setting_my_grades_report - X-Ref
Provides a selection of grade reports to be used for "grades".__construct() X-Ref |
Calls parent::__construct with specific arguments. |
load_choices() X-Ref |
Loads an array of choices for the configselect control. return: bool always returns true. |
Class: admin_setting_special_registerauth - X-Ref
Special class for register auth selection__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_defaultsetting() X-Ref |
Returns the default option return: string empty or default option |
load_choices() X-Ref |
Loads the possible choices for the array return: bool always returns true |
Class: admin_page_pluginsoverview - X-Ref
General plugins manager__construct() X-Ref |
Sets basic information about the external page |
Class: admin_page_managemods - X-Ref
Module manage page__construct() X-Ref |
Calls parent::__construct with specific arguments |
search($query) X-Ref |
Try to find the specified module param: string $query The module to search for return: array |
Class: admin_setting_manageenrols - X-Ref
Special class for enrol plugins management.__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true, does nothing return: true |
write_setting($data) X-Ref |
Always returns '', does not write anything return: string Always returns '' |
is_related($query) X-Ref |
Checks if $query is one of the available enrol plugins param: string $query The string to search for return: bool Returns true if found, false if not |
output_html($data, $query='') X-Ref |
Builds the XHTML to display the control param: string $data Unused param: string $query return: string |
Class: admin_page_manageblocks - X-Ref
Blocks manage page__construct() X-Ref |
Calls parent::__construct with specific arguments |
search($query) X-Ref |
Search for a specific block param: string $query The string to search for return: array |
Class: admin_page_managemessageoutputs - X-Ref
Message outputs configuration__construct() X-Ref |
Calls parent::__construct with specific arguments |
search($query) X-Ref |
Search for a specific message processor param: string $query The string to search for return: array |
Class: admin_page_manageqbehaviours - X-Ref
Manage question behaviours page__construct() X-Ref |
Constructor |
search($query) X-Ref |
Search question behaviours for the specified string param: string $query The string to search for in question behaviours return: array |
Class: admin_page_manageqtypes - X-Ref
Question type manage page__construct() X-Ref |
Calls parent::__construct with specific arguments |
search($query) X-Ref |
Search question types for the specified string param: string $query The string to search for in question types return: array |
Class: admin_page_manageportfolios - X-Ref
__construct() X-Ref |
Calls parent::__construct with specific arguments |
search($query) X-Ref |
Searches page for the specified string. param: string $query The string to search for return: bool True if it is found on this page |
Class: admin_page_managerepositories - X-Ref
__construct() X-Ref |
Calls parent::__construct with specific arguments |
search($query) X-Ref |
Searches page for the specified string. param: string $query The string to search for return: bool True if it is found on this page |
Class: admin_setting_manageauths - X-Ref
Special class for authentication administration.__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true return: true |
get_defaultsetting() X-Ref |
Always returns true return: true |
write_setting($data) X-Ref |
Always returns '' and doesn't write anything return: string Always returns '' |
is_related($query) X-Ref |
Search to find if Query is related to auth plugin param: string $query The string to search for return: bool true for related false for not |
output_html($data, $query='') X-Ref |
Return XHTML to display control param: mixed $data Unused param: string $query return: string highlight |
Class: admin_setting_manageantiviruses - X-Ref
Special class for antiviruses administration.__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true, does nothing return: true |
write_setting($data) X-Ref |
Always returns '', does not write anything param: string $data Unused return: string Always returns '' |
is_related($query) X-Ref |
Checks if $query is one of the available editors param: string $query The string to search for return: bool Returns true if found, false if not |
output_html($data, $query='') X-Ref |
Builds the XHTML to display the control param: string $data Unused param: string $query return: string |
Class: admin_setting_manageformats - X-Ref
Course formats manager. Allows to enable/disable formats and jump to settings__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true return: true |
get_defaultsetting() X-Ref |
Always returns true return: true |
write_setting($data) X-Ref |
Always returns '' and doesn't write anything param: mixed $data string or array, must not be NULL return: string Always returns '' |
is_related($query) X-Ref |
Search to find if Query is related to format plugin param: string $query The string to search for return: bool true for related false for not |
output_html($data, $query='') X-Ref |
Return XHTML to display control param: mixed $data Unused param: string $query return: string highlight |
Class: admin_setting_managecustomfields - X-Ref
Custom fields manager. Allows to enable/disable custom fields and jump to settings.__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true return: true |
get_defaultsetting() X-Ref |
Always returns true return: true |
write_setting($data) X-Ref |
Always returns '' and doesn't write anything param: mixed $data string or array, must not be NULL return: string Always returns '' |
is_related($query) X-Ref |
Search to find if Query is related to format plugin param: string $query The string to search for return: bool true for related false for not |
output_html($data, $query='') X-Ref |
Return XHTML to display control param: mixed $data Unused param: string $query return: string highlight |
Class: admin_setting_managedataformats - X-Ref
Data formats manager. Allow reorder and to enable/disable data formats and jump to settings__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true return: true |
get_defaultsetting() X-Ref |
Always returns true return: true |
write_setting($data) X-Ref |
Always returns '' and doesn't write anything param: mixed $data string or array, must not be NULL return: string Always returns '' |
is_related($query) X-Ref |
Search to find if Query is related to format plugin param: string $query The string to search for return: bool true for related false for not |
output_html($data, $query='') X-Ref |
Return XHTML to display control param: mixed $data Unused param: string $query return: string highlight |
Class: admin_page_managefilters - X-Ref
Special class for filter administration.__construct() X-Ref |
Calls parent::__construct with specific arguments |
search($query) X-Ref |
Searches all installed filters for specified filter param: string $query The filter(string) to search for param: string $query |
Class: admin_setting_manage_plugins - X-Ref
Generic class for managing plugins in a table that allows re-ordering and enable/disable of each plugin.get_section_name() X-Ref |
Get the admin settings section name (just a unique string) return: string |
get_info_column_name() X-Ref |
Get the name of the second column. return: string |
__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true, does nothing return: true |
write_setting($data) X-Ref |
Always returns '', does not write anything param: mixed $data return: string Always returns '' |
is_related($query) X-Ref |
Checks if $query is one of the available plugins of this type param: string $query The string to search for return: bool Returns true if found, false if not |
get_manage_url() X-Ref |
The URL for the management page for this plugintype. return: moodle_url |
output_html($data, $query = '') X-Ref |
Builds the HTML to display the control. param: string $data Unused param: string $query return: string |
Class: admin_setting_manage_fileconverter_plugins - X-Ref
Generic class for managing plugins in a table that allows re-ordering and enable/disable of each plugin.get_section_title() X-Ref |
No description |
get_plugin_type() X-Ref |
No description |
get_info_column_name() X-Ref |
No description |
get_info_column($plugininfo) X-Ref |
No description |
Class: admin_setting_managemediaplayers - X-Ref
Special class for media player plugins management.__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true, does nothing return: true |
write_setting($data) X-Ref |
Always returns '', does not write anything param: mixed $data return: string Always returns '' |
is_related($query) X-Ref |
Checks if $query is one of the available enrol plugins param: string $query The string to search for return: bool Returns true if found, false if not |
get_sorted_plugins() X-Ref |
Sort plugins so enabled plugins are displayed first and all others are displayed in the end sorted by rank. return: \core\plugininfo\media[] |
output_html($data, $query='') X-Ref |
Builds the XHTML to display the control param: string $data Unused param: string $query return: string |
Class: admin_setting_managecontentbankcontenttypes - X-Ref
Content bank content types manager. Allow reorder and to enable/disable content bank content types and jump to settings__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true return: true |
get_defaultsetting() X-Ref |
Always returns true return: true |
write_setting($data) X-Ref |
Always returns '' and doesn't write anything param: mixed $data string or array, must not be NULL return: string Always returns '' |
is_related($query) X-Ref |
Search to find if Query is related to content bank plugin param: string $query The string to search for return: bool true for related false for not |
output_html($data, $query='') X-Ref |
Return XHTML to display control param: mixed $data Unused param: string $query return: string highlight |
admin_externalpage_setup($section, $extrabutton = '', array $extraurlparams = null, $actualurl = '', array $options = array() X-Ref |
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. param: string $section name of page param: string $extrabutton extra HTML that is added after the blocks editing on/off button. param: array $extraurlparams an array paramname => paramvalue, or parameters that need to be param: string $actualurl if the actual page being viewed is not the normal one for this param: array $options Additional options that can be specified for page setup. |
admin_get_root($reload=false, $requirefulltree=true) X-Ref |
Returns the reference to admin tree root return: object admin_root object |
admin_apply_default_settings($node=null, $unconditional=true, $admindefaultsettings=array() X-Ref |
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. param: object $node, NULL means complete tree, null by default param: bool $unconditional if true overrides all values with defaults, true by default param: array $admindefaultsettings default admin settings to apply. Used recursively param: array $settingsoutput The names and values of the changed settings. Used recursively return: array $settingsoutput The names and values of the changed settings |
admin_write_settings($formdata) X-Ref |
Store changed settings, this function updates the errors variable in $ADMIN param: object $formdata from form return: int number of changed settings |
admin_find_write_settings($node, $data) X-Ref |
Internal recursive function - finds all settings from submitted form param: object $node Instance of admin_category, or admin_settingpage param: array $data return: array |
admin_search_settings_html($query) X-Ref |
Internal function - prints the search results param: string $query String to search for return: string empty or XHTML |
admin_output_new_settings_by_page($node) X-Ref |
Internal function - returns arrays of html pages with uninitialised settings param: object $node Instance of admin_category or admin_settingpage return: array |
format_admin_setting($setting, $title='', $form='', $description='', $label=true, $warning='', $defaultinfo=NULL, $query='') X-Ref |
Format admin settings param: object $setting param: string $title label element param: string $form form fragment, html code - not highlighted automatically param: string $description param: mixed $label link label to id, true by default or string being the label to connect it to param: string $warning warning text param: sting $defaultinfo defaults info, null means nothing, '' is converted to "Empty" string, defaults to null param: string $query search query to be highlighted return: string XHTML |
any_new_admin_settings($node) X-Ref |
Based on find_new_settings{@link ()} in upgradesettings.php Looks to find any admin settings that have not been initialized. Returns 1 if it finds any. param: object $node Instance of admin_category, or admin_settingpage return: boolean true if any settings haven't been initialised, false if they all have |
db_should_replace($table, $column = '', $additionalskiptables = '') X-Ref |
Given a table and optionally a column name should replaces be done? param: string $table name param: string $column name return: bool success or fail |
db_replace($search, $replace, $additionalskiptables = '') X-Ref |
Moved from admin/replace.php so that we can use this in cron param: string $search string to look for param: string $replace string to replace return: bool success or fail |
Class: admin_setting_managerepository - X-Ref
Manage repository settings__construct() X-Ref |
calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true does nothing return: true |
get_full_name() X-Ref |
Always returns s_managerepository return: string Always return 's_managerepository' |
write_setting($data) X-Ref |
Always returns '' doesn't do anything |
is_related($query) X-Ref |
Searches repository plugins for one that matches $query param: string $query The string to search for return: bool true if found, false if not |
repository_action_url($repository) X-Ref |
Helper function that generates a moodle_url object relevant to the repository |
output_html($data, $query='') X-Ref |
Builds XHTML to display the control param: string $data Unused param: string $query return: string XHTML |
Class: admin_setting_enablemobileservice - X-Ref
Special checkbox for enable mobile web serviceis_protocol_cap_allowed() X-Ref |
Return true if Authenticated user role has the capability 'webservice/rest:use', otherwise false. return: boolean |
set_protocol_cap($status) X-Ref |
Set the 'webservice/rest:use' to the Authenticated user role (allow or not) param: type $status true to allow, false to not set |
output_html($data, $query='') X-Ref |
Builds XHTML to display the control. The main purpose of this overloading is to display a warning when https is not supported by the server param: string $data Unused param: string $query return: string XHTML |
get_setting() X-Ref |
Retrieves the current setting using the objects name return: string |
write_setting($data) X-Ref |
Save the selected setting param: string $data The selected site return: string empty string or error message |
Class: admin_setting_manageexternalservices - X-Ref
Special class for management of external services__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true, does nothing return: true |
write_setting($data) X-Ref |
Always returns '', does not write anything return: string Always returns '' |
is_related($query) X-Ref |
Checks if $query is one of the available external services param: string $query The string to search for return: bool Returns true if found, false if not |
output_html($data, $query='') X-Ref |
Builds the XHTML to display the control param: string $data Unused param: string $query return: string |
Class: admin_setting_webservicesoverview - X-Ref
Special class for overview of external services__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true, does nothing return: true |
write_setting($data) X-Ref |
Always returns '', does not write anything return: string Always returns '' |
output_html($data, $query='') X-Ref |
Builds the XHTML to display the control param: string $data Unused param: string $query return: string |
Class: admin_setting_managewebserviceprotocols - X-Ref
Special class for web service protocol administration.__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true, does nothing return: true |
write_setting($data) X-Ref |
Always returns '', does not write anything return: string Always returns '' |
is_related($query) X-Ref |
Checks if $query is one of the available webservices param: string $query The string to search for return: bool Returns true if found, false if not |
output_html($data, $query='') X-Ref |
Builds the XHTML to display the control param: string $data Unused param: string $query return: string |
Class: admin_setting_configcolourpicker - X-Ref
Colour picker__construct($name, $visiblename, $description, $defaultsetting, array $previewconfig = null,$usedefaultwhenempty = true) X-Ref |
param: string $name param: string $visiblename param: string $description param: string $defaultsetting param: array $previewconfig Array('selector'=>'.some .css .selector','style'=>'backgroundColor'); |
get_setting() X-Ref |
Return the setting return: mixed returns config if successful else null |
write_setting($data) X-Ref |
Saves the setting param: string $data return: bool |
validate($data) X-Ref |
Validates the colour that was entered by the user param: string $data return: string|false |
output_html($data, $query = '') X-Ref |
Generates the HTML for the setting param: string $data param: string $query |
Class: admin_setting_configstoredfile - X-Ref
Class used for uploading of one file into file storage,__construct($name, $visiblename, $description, $filearea, $itemid = 0, array $options = null) X-Ref |
Create new stored file setting. param: string $name low level setting name param: string $visiblename human readable setting name param: string $description description of setting param: mixed $filearea file area for file storage param: int $itemid itemid for file storage param: array $options file area options |
get_options() X-Ref |
Applies defaults and returns all options. return: array |
get_setting() X-Ref |
No description |
write_setting($data) X-Ref |
No description |
post_write_settings($original) X-Ref |
No description |
output_html($data, $query = '') X-Ref |
No description |
Class: admin_setting_devicedetectregex - X-Ref
Administration interface for user specified regular expressions for device detection.__construct($name, $visiblename, $description, $defaultsetting = '') X-Ref |
Calls parent::__construct with specific args param: string $name param: string $visiblename param: string $description param: mixed $defaultsetting |
get_setting() X-Ref |
Return the current setting(s) return: array Current settings array |
write_setting($data) X-Ref |
Save selected settings param: array $data Array of settings to save return: bool |
output_html($data, $query='') X-Ref |
Return XHTML field(s) for regexes param: array $data Array of options to set in HTML return: string XHTML string for the fields and wrapping div(s) |
prepare_form_data($regexes) X-Ref |
Converts the string of regexes param: $regexes string of regexes return: array of form fields and their values |
process_form_data(array $form) X-Ref |
Converts the data from admin settings form into a string of regexes param: array $data array of admin form fields and values return: false|string of regexes |
Class: admin_setting_configmultiselect_modules - X-Ref
Multiselect for current modules__construct($name, $visiblename, $description, $defaultsetting = array() X-Ref |
Calls parent::__construct - note array $choices is not required param: string $name setting name param: string $visiblename localised setting name param: string $description setting description param: array $defaultsetting a plain array of default module ids param: bool $excludesystem If true, excludes modules with 'system' archetype |
load_choices() X-Ref |
Loads an array of current module choices return: bool always return true |
Class: admin_setting_php_extension_enabled - X-Ref
Admin setting to show if a php extension is enabled or not.__construct($name, $visiblename, $description, $extension) X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true, does nothing return: true |
write_setting($data) X-Ref |
Always returns '', does not write anything return: string Always returns '' |
output_html($data, $query='') X-Ref |
Outputs the html for this setting. return: string Returns an XHTML string |
Class: admin_setting_servertimezone - X-Ref
Server timezone setting.__construct() X-Ref |
Constructor. |
load_choices() X-Ref |
Lazy load timezone options. return: bool true if loaded, false if error |
Class: admin_setting_forcetimezone - X-Ref
Forced user timezone setting.__construct() X-Ref |
Constructor. |
load_choices() X-Ref |
Lazy load timezone options. return: bool true if loaded, false if error |
Class: admin_setting_searchsetupinfo - X-Ref
Search setup steps info.__construct() X-Ref |
Calls parent::__construct with specific arguments |
get_setting() X-Ref |
Always returns true, does nothing return: true |
get_defaultsetting() X-Ref |
Always returns true, does nothing return: true |
write_setting($data) X-Ref |
Always returns '', does not write anything param: array $data return: string Always returns '' |
output_html($data, $query='') X-Ref |
Builds the HTML to display the control param: string $data Unused param: string $query return: string |
Class: admin_setting_scsscode - X-Ref
Used to validate the contents of SCSS code and ensuring they are parsable.Class: admin_setting_filetypes - X-Ref
Administration setting to define a list of file types.__construct($name, $visiblename, $description, $defaultsetting = '', array $options = []) X-Ref |
Constructor. param: string $name Unique ascii name like 'mycoresetting' or 'myplugin/mysetting' param: string $visiblename Localised label of the setting param: string $description Localised description of the setting param: string $defaultsetting Default setting value. param: array $options Setting widget options, an array with optional keys: |
write_setting($data) X-Ref |
Normalize the user's input and write it to the database as comma separated list. Comma separated list as a text representation of the array was chosen to make this compatible with how the $CFG->courseoverviewfilesext values are stored. param: string $data Value submitted by the admin. return: string Epty string if all good, error message otherwise. |
validate($data) X-Ref |
Validate data before storage param: string $data The setting values provided by the admin return: bool|string True if ok, the string if error found |
output_html($data, $query='') X-Ref |
Return an HTML string for the setting element. param: string $data The current setting value param: string $query Admin search query to be highlighted return: string HTML to be displayed |
get_force_ltr() X-Ref |
Should the values be always displayed in LTR mode? We always return true here because these values are not RTL compatible. return: bool True because these values are not RTL compatible. |
Class: admin_setting_agedigitalconsentmap - X-Ref
Used to validate the content and format of the age of digital consent map and ensuring it is parsable.__construct($name, $visiblename, $description, $defaultsetting, $paramtype = PARAM_RAW,$cols = '60', $rows = '8') X-Ref |
Constructor. param: string $name param: string $visiblename param: string $description param: mixed $defaultsetting string or array param: mixed $paramtype param: string $cols param: string $rows |
validate($data) X-Ref |
Validate the content and format of the age of digital consent map to ensure it is parsable. param: string $data The age of digital consent map from text field. return: mixed bool true for success or string:error on failure. |
Class: admin_settings_sitepolicy_handler_select - X-Ref
Selection of plugins that can work as site policy handlers__construct($name, $visiblename, $description, $defaultsetting = '') X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' param: string $visiblename localised param: string $description long localised info param: string $defaultsetting |
load_choices() X-Ref |
Lazy-load the available choices for the select box |
Class: admin_setting_configthemepreset - X-Ref
Used to validate theme presets code and ensuring they compile well.__construct($name, $visiblename, $description, $defaultsetting, $choices, $themename) X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, param: string $visiblename localised param: string $description long localised info param: string|int $defaultsetting param: array $choices array of $value=>$label for each selection param: string $themename name of theme to check presets for. |
write_setting($data) X-Ref |
Write settings if validated param: string $data return: string |
validate($data) X-Ref |
Validate the preset file to ensure its parsable. param: string $data The preset file chosen. return: mixed bool true for success or string:error on failure. |
Class: admin_settings_h5plib_handler_select - X-Ref
Selection of plugins that can work as H5P libraries handlers__construct($name, $visiblename, $description, $defaultsetting = '') X-Ref |
Constructor param: string $name unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' param: string $visiblename localised param: string $description long localised info param: string $defaultsetting |
load_choices() X-Ref |
Lazy-load the available choices for the select box |
uninstall_plugin($type, $name) X-Ref |
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! param: string $type The plugin type, eg. 'mod', 'qtype', 'workshopgrading' etc. param: string $name The plugin name, eg. 'forum', 'multichoice', 'accumulative' etc. return: void |
get_component_version($component, $source='installed') X-Ref |
Returns the version of installed component param: string $component component name param: string $source either 'disk' or 'installed' - where to get the version information from return: string|bool version number or false if the component is not found |
drop_plugin_tables($name, $file, $feedback=true) X-Ref |
Delete all plugin tables param: string $name Name of plugin, used as table prefix param: string $file Path to install.xml file param: bool $feedback defaults to true return: bool Always returns true |
get_used_table_names() X-Ref |
Returns names of all known tables == tables that moodle knows about. return: array Array of lowercase table names |
get_db_directories() X-Ref |
Returns list of all directories where we expect install.xml files return: array Array of paths |
set_cron_lock($name, $until, $ignorecurrent=false) X-Ref |
Try to obtain or release the cron lock. param: string $name name of lock param: int $until timestamp when this lock considered stale, null means remove lock unconditionally param: bool $ignorecurrent ignore current lock state, usually extend previous lock, defaults to false return: bool true if lock obtained |
admin_critical_warnings_present() X-Ref |
Test if and critical warnings are present return: bool |
is_float_problem() X-Ref |
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. return: bool true if problem found |
is_dataroot_insecure($fetchtest=false) X-Ref |
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. param: bool $fetchtest try to test public access by fetching file, default false return: mixed empty means secure, INSECURE_DATAROOT_ERROR found a critical problem, INSECURE_DATAROOT_WARNING might be problematic |
enable_cli_maintenance_mode() X-Ref |
Enables CLI maintenance mode by creating new dataroot/climaintenance.html file. |