MDL-87544 core: add enablemycourses config and upgrade step
This commit is contained in:
@@ -155,6 +155,13 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
1
|
||||
));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox(
|
||||
'enablemycourses',
|
||||
new lang_string('enablemycourses', 'admin'),
|
||||
new lang_string('enablemycourses_help', 'admin'),
|
||||
0
|
||||
));
|
||||
|
||||
$choices = [];
|
||||
if (!isset($CFG->enablemyhome) || $CFG->enablemyhome) {
|
||||
$choices[HOMEPAGE_SITE] = new lang_string('home');
|
||||
@@ -162,7 +169,9 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
if (!isset($CFG->enabledashboard) || $CFG->enabledashboard) {
|
||||
$choices[HOMEPAGE_MY] = new lang_string('mymoodle', 'admin');
|
||||
}
|
||||
$choices[HOMEPAGE_MYCOURSES] = new lang_string('mycourses', 'admin');
|
||||
if (!isset($CFG->enablemycourses) || $CFG->enablemycourses) {
|
||||
$choices[HOMEPAGE_MYCOURSES] = new lang_string('mycourses', 'admin');
|
||||
}
|
||||
$choices[HOMEPAGE_USER] = new lang_string('userpreference', 'admin');
|
||||
|
||||
// Allow hook callbacks to extend options.
|
||||
|
||||
@@ -614,6 +614,8 @@ $string['enableglobalsearch_desc'] = 'If enabled, data will be indexed and synch
|
||||
$string['enablegravatar'] = 'Enable Gravatar';
|
||||
$string['enablegravatar_help'] = 'When enabled Moodle will attempt to fetch a user profile picture from Gravatar if the user has not uploaded an image.';
|
||||
$string['enablemobilewebservice'] = 'Enable web services for mobile devices';
|
||||
$string['enablemycourses'] = 'Enable My Courses';
|
||||
$string['enablemycourses_help'] = 'If enabled, the My Courses page and its navigation link are available. If disabled, users are redirected to the configured \'Start page for users\'.';
|
||||
$string['enablemyhome'] = 'Enable Home';
|
||||
$string['enablemyhome_help'] = 'If enabled, the Home page and its navigation link are available. If disabled, users are redirected to the configured \'Start page for users\'.';
|
||||
$string['enablepdfexportfont'] = 'Enable PDF fonts';
|
||||
|
||||
+11
-10
@@ -22,26 +22,27 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['addpage'] = 'Add page';
|
||||
$string['alldashboardswerereset'] = 'All Dashboard pages have been reset to default.';
|
||||
$string['allprofileswerereset'] = 'All profile pages have been reset to default.';
|
||||
$string['defaultpage'] = 'Default My Moodle page';
|
||||
$string['defaultprofilepage'] = 'Default profile page';
|
||||
$string['delpage'] = 'Delete page';
|
||||
$string['error:dashboardisdisabled'] = 'The Dashboard has been disabled by an administrator.';
|
||||
$string['error:mycoursesisdisabled'] = 'My courses has been disabled by an administrator.';
|
||||
$string['managepages'] = 'Manage pages';
|
||||
$string['mymoodle'] = 'Dashboard';
|
||||
$string['nocourses'] = 'No course information to show.';
|
||||
$string['noguest'] = 'The Dashboard page is not available to guest users';
|
||||
$string['pinblocks'] = 'Configure pinned blocks for my moodle';
|
||||
$string['pinblocksexplan'] = 'Any block settings you configure here will be visible (and non-editable) for any user of moodle on their \'My Moodle\' overview page.';
|
||||
$string['defaultpage'] = 'Default My Moodle page';
|
||||
$string['defaultprofilepage'] = 'Default profile page';
|
||||
$string['addpage'] = 'Add page';
|
||||
$string['alldashboardswerereset'] = 'All Dashboard pages have been reset to default.';
|
||||
$string['resettingdashboards'] = 'Resetting user dashboards to default...';
|
||||
$string['allprofileswerereset'] = 'All profile pages have been reset to default.';
|
||||
$string['delpage'] = 'Delete page';
|
||||
$string['managepages'] = 'Manage pages';
|
||||
$string['privacy:metadata:core_my:preference:user_home_page_preference'] = 'The user home page preference.';
|
||||
$string['reseterror'] = 'There was an error resetting your page';
|
||||
$string['reseteveryonesdashboard'] = 'Reset Dashboard for all users';
|
||||
$string['reseteveryonesprofile'] = 'Reset profile for all users';
|
||||
$string['resetpage'] = 'Reset page to default';
|
||||
$string['resetpageconfirm'] = 'Are you sure you want to reset the page to default?';
|
||||
$string['reseterror'] = 'There was an error resetting your page';
|
||||
$string['privacy:metadata:core_my:preference:user_home_page_preference'] = 'The user home page preference.';
|
||||
$string['resettingdashboards'] = 'Resetting user dashboards to default...';
|
||||
|
||||
// Deprecated since Moodle 4.5.
|
||||
$string['coursemanagementoptions'] = 'Course management options';
|
||||
|
||||
@@ -1760,5 +1760,16 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2026022700.02);
|
||||
}
|
||||
|
||||
if ($oldversion < 2026030600.01) {
|
||||
// For existing sites, enable My Courses by default to maintain current behavior.
|
||||
// New installs will have it disabled (default 0 in settings).
|
||||
$enablemycourses = get_config('core', 'enablemycourses');
|
||||
if ($enablemycourses === false) {
|
||||
set_config('enablemycourses', 1);
|
||||
}
|
||||
|
||||
upgrade_main_savepoint(true, 2026030600.01);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2026030600.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2026030600.01; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '5.2dev (Build: 20260306)'; // Human-friendly version name
|
||||
|
||||
Reference in New Issue
Block a user