MDL-77793 lib: Deprecated device specific theme functions

This commit is contained in:
David Woloszyn
2023-06-19 16:32:51 +10:00
parent b20503c0ff
commit 49ee428dca
4 changed files with 58 additions and 27 deletions
+41
View File
@@ -3905,3 +3905,44 @@ function badges_get_oauth2_service_options() {
return $options;
}
/**
* Checks if the given device has a theme defined in config.php.
*
* @param string $device The device
* @deprecated since 4.3.
* @return bool
*/
function theme_is_device_locked($device) {
debugging(
__FUNCTION__ . '() is deprecated.' .
'All functions associated with device specific themes are being removed.',
DEBUG_DEVELOPER
);
global $CFG;
$themeconfigname = core_useragent::get_device_type_cfg_var_name($device);
return isset($CFG->config_php_settings[$themeconfigname]);
}
/**
* Returns the theme named defined in config.php for the given device.
*
* @param string $device The device
* @deprecated since 4.3.
* @return string or null
*/
function theme_get_locked_theme_for_device($device) {
debugging(
__FUNCTION__ . '() is deprecated.' .
'All functions associated with device specific themes are being removed.',
DEBUG_DEVELOPER
);
global $CFG;
if (!theme_is_device_locked($device)) {
return null;
}
$themeconfigname = core_useragent::get_device_type_cfg_var_name($device);
return $CFG->config_php_settings[$themeconfigname];
}