MDL-78375 core: Final deprecation of device related theme functions

Signed-off-by: Daniel Ziegenberg <[email protected]>
This commit is contained in:
Daniel Ziegenberg
2025-06-18 12:16:56 +02:00
parent 9223e346c3
commit 678c949d3f
3 changed files with 27 additions and 34 deletions
@@ -0,0 +1,9 @@
issueNumber: MDL-78375
notes:
core:
- message: >
Final deprecation of device related theme methods. The following two methods have been
removed from the core_useragent class:
- core_useragent::get_device_type_theme
- core_useragent::get_device_type_cfg_var_name
type: removed
+16 -34
View File
@@ -230,49 +230,31 @@ class core_useragent {
}
/**
* Returns the theme to use for the given device type.
*
* This used to be get_selected_theme_for_device_type.
* @param null|string $devicetype The device type to find out for. Defaults to the device the user is using,
* @deprecated since 4.3.
* @return bool
*/
#[\core\attribute\deprecated(
null,
since: '4.3',
reason: 'All functions associated with device specific themes are being removed',
mdl: 'MDL-77793',
final: true
)]
public static function get_device_type_theme($devicetype = null) {
debugging(
__FUNCTION__ . '() is deprecated.' .
'All functions associated with device specific themes are being removed.',
DEBUG_DEVELOPER
);
global $CFG;
if ($devicetype === null) {
$devicetype = self::get_device_type();
}
$themevarname = self::get_device_type_cfg_var_name($devicetype);
if (empty($CFG->$themevarname)) {
return false;
}
return $CFG->$themevarname;
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
}
/**
* Returns the CFG var used to find the theme to use for the given device.
*
* Used to be get_device_cfg_var_name.
*
* @param null|string $devicetype The device type to find out for. Defaults to the device the user is using,
* @deprecated since 4.3.
* @return string
*/
#[\core\attribute\deprecated(
null,
since: '4.3',
reason: 'All functions associated with device specific themes are being removed',
mdl: 'MDL-77793',
final: true
)]
public static function get_device_type_cfg_var_name($devicetype = null) {
debugging(
__FUNCTION__ . '() is deprecated.' .
'All functions associated with device specific themes are being removed.',
DEBUG_DEVELOPER
);
if ($devicetype == self::DEVICETYPE_DEFAULT || empty($devicetype)) {
return 'theme';
}
return 'theme' . $devicetype;
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
}
/**
+2
View File
@@ -314,6 +314,7 @@ function badges_get_oauth2_service_options() {
* @deprecated since 4.3.
*/
#[\core\attribute\deprecated(
null,
since: '4.3',
reason: 'All functions associated with device specific themes are being removed',
mdl: 'MDL-77793',
@@ -327,6 +328,7 @@ function theme_is_device_locked() {
* @deprecated since 4.3.
*/
#[\core\attribute\deprecated(
null,
since: '4.3',
reason: 'All functions associated with device specific themes are being removed',
mdl: 'MDL-77793',