MDL-87545 core: add enablemyhome config and upgrade step
This commit is contained in:
@@ -141,6 +141,13 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
|
||||
// Navigation settings
|
||||
$temp = new admin_settingpage('navigation', new lang_string('navigation'));
|
||||
$temp->add(new admin_setting_configcheckbox(
|
||||
'enablemyhome',
|
||||
new lang_string('enablemyhome', 'admin'),
|
||||
new lang_string('enablemyhome_help', 'admin'),
|
||||
0
|
||||
));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox(
|
||||
'enabledashboard',
|
||||
new lang_string('enabledashboard', 'admin'),
|
||||
@@ -148,7 +155,10 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||
1
|
||||
));
|
||||
|
||||
$choices = [HOMEPAGE_SITE => new lang_string('home')];
|
||||
$choices = [];
|
||||
if (!isset($CFG->enablemyhome) || $CFG->enablemyhome) {
|
||||
$choices[HOMEPAGE_SITE] = new lang_string('home');
|
||||
}
|
||||
if (!isset($CFG->enabledashboard) || $CFG->enabledashboard) {
|
||||
$choices[HOMEPAGE_MY] = new lang_string('mymoodle', 'admin');
|
||||
}
|
||||
|
||||
@@ -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['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';
|
||||
$string['enablepdfexportfont_desc'] = 'If your site has courses in different languages which need other fonts in generated PDF files, you can provide the option to set the font in the course settings. You need to specify available fonts in $CFG->pdfexportfont in config.php.';
|
||||
$string['enableplugin'] = 'Enable {$a}';
|
||||
|
||||
@@ -1740,5 +1740,16 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2026021000.01);
|
||||
}
|
||||
|
||||
if ($oldversion < 2026022700.01) {
|
||||
// For existing sites, enable My Home by default to maintain current behavior.
|
||||
// New installs will have it disabled (default 0 in settings).
|
||||
$enablemyhome = get_config('core', 'enablemyhome');
|
||||
if ($enablemyhome === false) {
|
||||
set_config('enablemyhome', 1);
|
||||
}
|
||||
|
||||
upgrade_main_savepoint(true, 2026022700.01);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2026022700.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2026022700.01; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '5.2dev (Build: 20260227)'; // Human-friendly version name
|
||||
|
||||
Reference in New Issue
Block a user