Browse files

MDL-34205 Activity chooser default setting

  • Loading branch information...
micaherne committed Jul 6, 2012
1 parent 2cbdaa7 commit 945a81a943556fb353309fa6179215ea6fa602d3
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
@@ -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
@@ -1863,7 +1863,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'));
@@ -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';
@@ -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 945a81a

Please sign in to comment.