mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-69002 core_badges: performance update to set default sitebackpack
This commit is contained in:
parent
92219c8ffd
commit
5c0d795bce
@ -59,8 +59,12 @@ if (($hassiteconfig || has_any_capability(array(
|
||||
|
||||
$backpacks = badges_get_site_backpacks();
|
||||
$choices = array();
|
||||
$defaultchoice = 0;
|
||||
foreach ($backpacks as $backpack) {
|
||||
$choices[$backpack->id] = $backpack->backpackweburl;
|
||||
if ($backpack->backpackweburl == BADGRIO_BACKPACKWEBURL) {
|
||||
$defaultchoice = $backpack->id;
|
||||
}
|
||||
}
|
||||
|
||||
$globalsettings->add(new admin_setting_configcheckbox('badges_allowcoursebadges',
|
||||
@ -100,11 +104,10 @@ if (($hassiteconfig || has_any_capability(array(
|
||||
new lang_string('allowexternalbackpack', 'badges'),
|
||||
new lang_string('allowexternalbackpack_desc', 'badges'), 1));
|
||||
|
||||
$bp = $DB->get_record('badge_external_backpack', ['backpackweburl' => BADGRIO_BACKPACKWEBURL]);
|
||||
$backpacksettings->add(new admin_setting_configselect('badges_site_backpack',
|
||||
new lang_string('sitebackpack', 'badges'),
|
||||
new lang_string('sitebackpack_help', 'badges'),
|
||||
$bp->id, $choices));
|
||||
$defaultchoice, $choices));
|
||||
|
||||
$ADMIN->add('badges', $backpacksettings);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user