diff --git a/.upgradenotes/MDL-78375-2025021311242423.yml b/.upgradenotes/MDL-78375-2025021311242423.yml new file mode 100644 index 00000000000..7305738ecdb --- /dev/null +++ b/.upgradenotes/MDL-78375-2025021311242423.yml @@ -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 diff --git a/lib/classes/useragent.php b/lib/classes/useragent.php index 1e8cc91ec14..97a8861f052 100644 --- a/lib/classes/useragent.php +++ b/lib/classes/useragent.php @@ -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__]); } /** diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 9ced39fa000..00408da725e 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -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',