Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
The most flexible setting, the user enters text. More...
Public Member Functions | |
__construct ($name, $visiblename, $description, $defaultsetting, $paramtype=PARAM_RAW, $size=null) | |
Config text constructor. More... | |
add_dependent_on ($dependenton) | |
Add a setting to the list of those that could cause this one to be hidden. More... | |
config_read ($name) | |
Returns the config if possible. More... | |
config_write ($name, $value) | |
Used to set a config pair and log change. More... | |
get_defaultsetting () | |
Returns default setting if exists. More... | |
get_dependent_on () | |
Get a list of the settings that could cause this one to be hidden. More... | |
get_force_ltr () | |
Get whether this should be displayed in LTR mode. More... | |
get_full_name () | |
Returns the fullname prefixed by the plugin. More... | |
get_id () | |
Returns the ID string based on plugin and name. More... | |
get_setting () | |
Return the setting. More... | |
get_setting_flag_defaults (& $defaults) | |
Get the list of defaults for the flags on this setting. More... | |
get_setting_flag_value (admin_setting_flag $flag) | |
Get the currently saved value for a setting flag. More... | |
has_custom_form_control () | |
Whether this setting uses a custom form control. More... | |
is_readonly () | |
Is this option forced in config.php? More... | |
is_related ($query) | |
Is setting related to query text - used when searching. More... | |
output_html ($data, $query='') | |
Return an XHTML string for the setting. More... | |
output_setting_flags () | |
Output the input fields for the advanced and locked flags on this setting. More... | |
post_write_settings ($original) | |
Execute postupdatecallback if necessary. More... | |
set_advanced_flag_options ($enabled, $default) | |
Set the advanced options flag on this admin setting. More... | |
set_affects_modinfo ($affectsmodinfo) | |
set_enabled_flag_options ($enabled, $default) | |
Set the enabled options flag on this admin setting. More... | |
set_force_ltr ($value) | |
Set whether to force LTR or not. More... | |
set_locked_flag_options ($enabled, $default) | |
Set the locked options flag on this admin setting. More... | |
set_required_flag_options ($enabled, $default) | |
Set the required options flag on this admin setting. More... | |
set_updatedcallback ($functionname) | |
Function called if setting updated - cleanup, cache reset, etc. More... | |
validate ($data) | |
Validate data before storage. More... | |
write_setting ($data) | |
Store new setting. More... | |
write_setting_flags ($data) | |
Write the values of the flags for this admin setting. More... | |
Public Attributes | |
bool | $affectsmodinfo = false |
if set, indicates that a change to this setting requires rebuild course cache | |
mixed | $defaultsetting |
Can be string or array of string. | |
string | $description |
localised long description in Markdown format | |
string | $name |
unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. | |
bool | $nosave = false |
true indicates this setting does not actually save anything, just information | |
mixed | $paramtype |
int means PARAM_XXX type, string is a allowed format in regex | |
mixed | $plugin |
can be String or Null. More... | |
int | $size |
default field size | |
string | $updatedcallback |
string | $visiblename |
localised name | |
Protected Member Functions | |
add_to_config_log ($name, $oldvalue, $value) | |
Log config changes if necessary. More... | |
set_flag_options ($enabled, $default, $shortname, $displayname) | |
Generic function to add a flag to this admin setting. More... | |
Protected Attributes | |
bool | $customcontrol = false |
Whether this setting uses a custom form control. | |
The most flexible setting, the user enters text.
This type of field should be used for config settings which are using English words and are not localised (passwords, database name, list of values, ...).
admin_setting_configtext::__construct | ( | $name, | |
$visiblename, | |||
$description, | |||
$defaultsetting, | |||
$paramtype = PARAM_RAW , |
|||
$size = null |
|||
) |
Config text constructor.
string | $name | unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. |
string | $visiblename | localised |
string | $description | long localised info |
string | $defaultsetting | |
mixed | $paramtype | int means PARAM_XXX type, string is a allowed format in regex |
int | $size | default field size |
Reimplemented in admin_setting_special_gradepointmax, admin_setting_special_gradepointdefault, admin_setting_configtext_with_advanced, and admin_setting_configtext_trim_lower.
|
inherited |
Add a setting to the list of those that could cause this one to be hidden.
string | $dependenton |
|
protectedinherited |
Log config changes if necessary.
string | $name | |
string | $oldvalue | |
string | $value |
Reimplemented in admin_setting_configpasswordunmask.
|
inherited |
Returns the config if possible.
mixed | returns config if successful else null |
Reimplemented in enrol_flatfile_role_setting.
|
inherited |
Used to set a config pair and log change.
string | $name | |
mixed | $value | Gets converted to string if not null |
bool | Write setting to config table |
Reimplemented in enrol_flatfile_role_setting.
|
inherited |
Returns default setting if exists.
mixed | array or string depending on instance; NULL means no default, user must supply |
Reimplemented in tiynce_subplugins_settings, editor_atto_subplugins_setting, admin_setting_searchsetupinfo, admin_setting_php_extension_enabled, admin_setting_managewebservicetokens, admin_setting_managewebserviceprotocols, admin_setting_webservicesoverview, admin_setting_manageexternalservices, admin_setting_managerepository, admin_setting_managemediaplayers, admin_setting_manage_plugins, admin_setting_managedataformats, admin_setting_managecustomfields, admin_setting_manageformats, admin_setting_managelicenses, admin_setting_manageantiviruses, admin_setting_manageeditors, admin_setting_manageauths, admin_setting_manageenrols, admin_setting_special_registerauth, admin_setting_pickroles, admin_setting_users_with_capability, admin_setting_description, admin_setting_heading, and tool_log_setting_managestores.
|
inherited |
Get a list of the settings that could cause this one to be hidden.
array |
admin_setting_configtext::get_force_ltr | ( | ) |
Get whether this should be displayed in LTR mode.
Try to guess from the PARAM type unless specifically set.
Reimplemented from admin_setting.
Reimplemented in admin_setting_filetypes.
|
inherited |
Returns the fullname prefixed by the plugin.
string |
Reimplemented in admin_setting_managerepository.
|
inherited |
Returns the ID string based on plugin and name.
string |
admin_setting_configtext::get_setting | ( | ) |
Return the setting.
mixed | returns config if successful else null |
Reimplemented from admin_setting.
Reimplemented in admin_setting_special_frontpagedesc, admin_setting_sitesettext, and admin_setting_configmixedhostiplist.
|
inherited |
Get the list of defaults for the flags on this setting.
array | of strings describing the defaults for this setting. This is appended to by this function. |
|
inherited |
Get the currently saved value for a setting flag.
admin_setting_flag | $flag | - One of the admin_setting_flag for this admin_setting. |
bool |
|
inherited |
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.
bool |
|
inherited |
Is this option forced in config.php?
bool |
|
inherited |
Is setting related to query text - used when searching.
string | $query |
bool |
Reimplemented in tiynce_subplugins_settings, editor_atto_subplugins_setting, admin_setting_managewebserviceprotocols, admin_setting_manageexternalservices, admin_setting_managerepository, admin_setting_managemediaplayers, admin_setting_manage_plugins, admin_setting_managedataformats, admin_setting_managecustomfields, admin_setting_manageformats, admin_setting_manageantiviruses, admin_setting_manageeditors, admin_setting_manageauths, admin_setting_manageenrols, admin_setting_configmultiselect, admin_setting_configselect, admin_setting_configmulticheckbox, and tool_log_setting_managestores.
admin_setting_configtext::output_html | ( | $data, | |
$query = '' |
|||
) |
Return an XHTML string for the setting.
string | Returns an XHTML string |
Reimplemented from admin_setting.
Reimplemented in editor_tinymce_json_setting_textarea, admin_setting_filetypes, admin_setting_special_gradepointmax, admin_setting_configdirectory, admin_setting_configexecutable, admin_setting_configfile, admin_setting_configempty, admin_setting_configpasswordunmask, admin_setting_confightmleditor, and admin_setting_configtextarea.
|
inherited |
Output the input fields for the advanced and locked flags on this setting.
bool | $adv | - The current value of the advanced flag. |
bool | $locked | - The current value of the locked flag. |
string::$output | - The html for the flags. |
|
inherited |
Execute postupdatecallback if necessary.
mixed | $original | original value before write_setting() |
bool | true if changed, false if not. |
Reimplemented in admin_setting_configstoredfile.
|
inherited |
Set the advanced options flag on this admin setting.
bool | $enabled | - One of self::OPTION_ENABLED or self::OPTION_DISABLED |
bool | $default | - The default for the flag |
|
inherited |
bool | $affectsmodinfo | If true, changes to this setting will cause the course cache to be rebuilt |
|
inherited |
Set the enabled options flag on this admin setting.
bool | $enabled | - One of self::OPTION_ENABLED or self::OPTION_DISABLED |
bool | $default | - The default for the flag |
|
protectedinherited |
Generic function to add a flag to this admin setting.
bool | $enabled | - One of self::OPTION_ENABLED or self::OPTION_DISABLED |
bool | $default | - The default for the flag |
string | $shortname | - The shortname for this flag. Used as a suffix for the setting name. |
string | $displayname | - The display name for this flag. Used as a label next to the checkbox. |
|
inherited |
Set whether to force LTR or not.
bool | $value | True when forced, false when not force, null when unknown. |
|
inherited |
Set the locked options flag on this admin setting.
bool | $enabled | - One of self::OPTION_ENABLED or self::OPTION_DISABLED |
bool | $default | - The default for the flag |
|
inherited |
Set the required options flag on this admin setting.
bool | $enabled | - One of self::OPTION_ENABLED or self::OPTION_DISABLED. |
bool | $default | - The default for the flag. |
|
inherited |
Function called if setting updated - cleanup, cache reset, etc.
string | $functionname | Sets the function name |
void |
admin_setting_configtext::validate | ( | $data | ) |
Validate data before storage.
string | data |
mixed | true if ok string if error found |
Reimplemented in editor_atto_toolbar_setting, antivirus_clamav_pathtounixsocket_setting, admin_setting_agedigitalconsentmap, admin_setting_filetypes, admin_setting_scsscode, admin_setting_special_gradepointmax, admin_setting_special_gradepointdefault, admin_setting_countrycodes, admin_setting_langlist, admin_setting_sitesettext, admin_setting_configportlist, admin_setting_configmixedhostiplist, admin_setting_configiplist, admin_setting_configtext_with_maxlength, and auth_ldap_admin_setting_special_ntlm_configtext.
admin_setting_configtext::write_setting | ( | $data | ) |
Store new setting.
mixed | $data | string or array, must not be NULL |
string | empty string if ok, string error message otherwise |
Reimplemented from admin_setting.
Reimplemented in admin_setting_filetypes, admin_setting_special_gradepointmax, admin_setting_special_backup_auto_destination, admin_setting_langlist, admin_setting_special_frontpagedesc, admin_setting_sitesettext, admin_setting_configmixedhostiplist, admin_setting_configfile, admin_setting_confightmleditor, admin_setting_configtext_trim_lower, auth_shibboleth_admin_setting_special_idp_configtextarea, auth_ldap_admin_setting_special_lowercase_configtext, auth_ldap_admin_setting_special_contexts_configtext, and auth_db_admin_setting_special_auth_configtext.
|
inherited |
Write the values of the flags for this admin setting.
array | $data | - The data submitted from the form or null to set the default value for new installs. |
bool | - true if successful. |
|
inherited |
can be String or Null.
Null means main config table