From 352e427520323e3ba4d952e3eb59bf07320ff3e2 Mon Sep 17 00:00:00 2001 From: Meirza Date: Fri, 18 Aug 2023 13:56:18 +0700 Subject: [PATCH] MDL-78468 admin: Removed enabledevicedetection theme setting --- admin/settings/appearance.php | 1 - admin/upgrade.txt | 1 + lang/en/admin.php | 4 ++-- lang/en/deprecated.txt | 2 ++ lib/classes/useragent.php | 5 ----- lib/upgrade.txt | 1 + 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 49e40c61358..0c21a5af480 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -46,7 +46,6 @@ reports,core_reportbuilder|/reportbuilder/index.php', '50', '10' )); - $temp->add(new admin_setting_configcheckbox('enabledevicedetection', new lang_string('enabledevicedetection', 'admin'), new lang_string('configenabledevicedetection', 'admin'), 1)); $temp->add(new admin_setting_devicedetectregex('devicedetectregex', new lang_string('devicedetectregex', 'admin'), new lang_string('devicedetectregex_desc', 'admin'), '')); $ADMIN->add('themes', $temp); $ADMIN->add('themes', new admin_externalpage('themeselector', new lang_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php')); diff --git a/admin/upgrade.txt b/admin/upgrade.txt index 3998799365f..a9036ec013c 100644 --- a/admin/upgrade.txt +++ b/admin/upgrade.txt @@ -9,6 +9,7 @@ This files describes API changes in /admin/*. Existing cookies will not be affected by this change, until they are expired or deleted. +* Theme setting "Enable device detection" (enabledevicedetection) and related to it has been removed. === 4.2 === diff --git a/lang/en/admin.php b/lang/en/admin.php index 1dbcbf31ad4..299f2d2da28 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -235,7 +235,6 @@ $string['configdeleteunconfirmed'] = 'For certain authentication methods, such a $string['configdenyemailaddresses'] = 'To deny email addresses from particular domains list them here in the same way. All other domains will be accepted. To deny subdomains add the domain with a preceding \'.\'. eg hotmail.com yahoo.co.uk .live.com'; $string['configenableanalytics'] = 'Analytics models, such as \'Students at risk of dropping out\' or \'Upcoming activities due\', can generate predictions, send insight notifications and offer further actions such as messaging users.'; $string['configenableblogs'] = 'This switch provides all site users with their own blog.'; -$string['configenabledevicedetection'] = 'Enables detection of mobiles, smartphones, tablets or default devices (desktop PCs, laptops, etc) for the application of themes and other features.'; $string['configdisableuserimages'] = 'Disable the ability for users to change user profile images.'; $string['configdisplayloginfailures'] = 'This will display information to users about previous failed logins.'; $string['configdndallowtextandlinks'] = 'Enable or disable the dragging and dropping of text and links onto a course page, alongside the dragging and dropping of files. Note that the dragging of text into Firefox or between different browsers is unreliable and may result in no data being uploaded, or corrupted text being uploaded.'; @@ -595,7 +594,6 @@ $string['enablecourserequests'] = 'Enable course requests'; $string['enabled'] = 'Enabled'; $string['enabledashboard'] = 'Enable Dashboard'; $string['enabledashboard_help'] = 'The Dashboard shows Timeline, Calendar and Recently accessed items by default. You can set a different default Dashboard for everyone and allow users to customise their own Dashboard. If disabled, you need to set \'Start page for users\' to a value other than Dashboard.'; -$string['enabledevicedetection'] = 'Enable device detection'; $string['enableglobalsearch'] = 'Enable global search'; $string['enableglobalsearch_desc'] = 'If enabled, data will be indexed and synchronised by a scheduled task.'; $string['enablegravatar'] = 'Enable Gravatar'; @@ -1624,6 +1622,8 @@ $string['multilangforceold'] = 'Force old multilang syntax: <span> without $string['blockunprotect'] = 'Unprotect'; // Deprecated since Moodle 4.3. +$string['configenabledevicedetection'] = 'Enables detection of mobiles, smartphones, tablets or default devices (desktop PCs, laptops, etc) for the application of themes and other features.'; +$string['enabledevicedetection'] = 'Enable device detection'; $string['selectdevice'] = 'Select device'; $string['selecttheme'] = 'Select theme for {$a} device'; $string['themenoselected'] = 'No theme selected'; diff --git a/lang/en/deprecated.txt b/lang/en/deprecated.txt index a030d457c9f..b7928e90496 100644 --- a/lang/en/deprecated.txt +++ b/lang/en/deprecated.txt @@ -84,3 +84,5 @@ backpackemail,core_badges backpackemail_help,core_badges editcoursecompletionsettings,core_completion clicktochangeinbrackets,core +configenabledevicedetection,core_admin +enabledevicedetection,core_admin diff --git a/lib/classes/useragent.php b/lib/classes/useragent.php index 0aa717d90fc..b984928180a 100644 --- a/lib/classes/useragent.php +++ b/lib/classes/useragent.php @@ -176,11 +176,6 @@ class core_useragent { * @return string */ protected function guess_device_type() { - global $CFG; - if (empty($CFG->enabledevicedetection)) { - $this->devicetype = self::DEVICETYPE_DEFAULT; - return $this->devicetype; - } foreach ($this->devicetypecustoms as $value => $regex) { if (preg_match($regex, $this->useragent)) { $this->devicetype = $value; diff --git a/lib/upgrade.txt b/lib/upgrade.txt index d99706fa030..d1c97007233 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -86,6 +86,7 @@ information provided here is intended especially for developers. * New behat behat_navigation::i_close_block_drawer_if_open() and behat_navigation::i_keep_block_drawer_closed() to ensure in some test that the block drawer is closed. This helps with random failures due to the block drawer being forced open in all behat tests. +* The core_useragent::get_device_type_list() function has been deprecated. Use core_useragent::devicetypes instead as a replacement. === 4.2 ===