Skip to content
Browse files

MDL-34534 Backport activity chooser default setting to 2.3 stable

  • Loading branch information...
1 parent 8d9dd85 commit a11b507f507084716875fb377b6f752458e1b7be @micaherne micaherne committed Jul 6, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −0 admin/settings/appearance.php
  2. +1 −1 course/lib.php
  3. +2 −0 lang/en/admin.php
  4. +1 −1 lib/navigationlib.php
1 admin/settings/appearance.php
@@ -185,6 +185,7 @@
$setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1);
+ $temp->add(new admin_setting_configcheckbox('modchooserdefault', new lang_string('modchooserdefault', 'admin'), new lang_string('configmodchooserdefault', 'admin'), 1));
$ADMIN->add('appearance', $temp);
// link to tag management interface
2 course/lib.php
@@ -1869,7 +1869,7 @@ function print_section_add_menus($course, $section, $modnames, $vertical=false,
$modchooser.= html_writer::end_tag('div');
// Wrap the normal output in a noscript div
- $usemodchooser = get_user_preferences('usemodchooser', 1);
+ $usemodchooser = get_user_preferences('usemodchooser', $CFG->modchooserdefault);
if ($usemodchooser) {
$output = html_writer::tag('div', $output, array('class' => 'hiddenifjs addresourcedropdown'));
$modchooser = html_writer::tag('div', $modchooser, array('class' => 'visibleifjs addresourcemodchooser'));
2 lang/en/admin.php
@@ -253,6 +253,7 @@
$string['configminpasswordlower'] = 'Passwords must have at least these many lower case letters.';
$string['configminpasswordnonalphanum'] = 'Passwords must have at least these many non-alphanumeric characters.';
$string['configminpasswordupper'] = 'Passwords must have at least these many upper case letters.';
+$string['configmodchooserdefault'] = 'Should the activity chooser be presented to users by default?';
$string['configmycoursesperpage'] = 'Maximum number of courses to display in any list of a user\'s own courses';
$string['configmymoodleredirect'] = 'This setting forces redirects to /my on login for non-admins and replaces the top level site navigation with /my';
$string['configmypagelocked'] = 'This setting prevents the default page from being edited by any non-admins';
@@ -679,6 +680,7 @@
$string['mnetrestore_extusers_mismatch'] = '<strong>Note:</strong> This backup file apparently originates from a different Moodle installation and contains remote Moodle Network user accounts that may fail to restore. This operation is unsupported. If you are certain that it was created on this Moodle installation, or you can ensure that all the needed Moodle Network Hosts are configured, you may want to still try the restore.';
$string['mnetrestore_extusers_noadmin'] = '<strong>Note:</strong> This backup file seems to come from a different Moodle installation and contains remote Moodle Network user accounts. You are not allowed to execute this type of restore. Contact the administrator of the site or, alternatively, restore this course without any user information (modules, files...)';
$string['mnetrestore_extusers_switchuserauth'] = 'Remote Moodle Network user {$a->username} (coming from {$a->mnethosturl}) switched to local {$a->auth} authenticated user.';
+$string['modchooserdefault'] = 'Activity chooser default';
$string['modeditdefaults'] = 'Default values for activity settings';
$string['modsettings'] = 'Manage activities';
$string['modulesecurity'] = 'Module security';
2 lib/navigationlib.php
@@ -3573,7 +3573,7 @@ protected function load_course_settings($forceopen = false) {
// Add the module chooser toggle
$modchoosertoggleurl = clone($baseurl);
if ($this->page->user_is_editing() && course_ajax_enabled($course)) {
- if ($usemodchooser = get_user_preferences('usemodchooser', 1)) {
+ if ($usemodchooser = get_user_preferences('usemodchooser', $CFG->modchooserdefault)) {
$modchoosertogglestring = get_string('modchooserdisable', 'moodle');
$modchoosertoggleurl->param('modchooser', 'off');
} else {

0 comments on commit a11b507

Please sign in to comment.
Something went wrong with that request. Please try again.