From 99f041ebfa3ca3d21d8fd26009abddcee1813d0e Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 12 Jun 2014 10:35:52 +1200 Subject: [PATCH] MDL-45884 navigation: changed to positive setting phrasing --- admin/settings/appearance.php | 2 +- ...ting.feature => expand_my_courses_setting.feature} | 11 ++++++----- lang/en/admin.php | 4 ++-- lib/navigationlib.php | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) rename blocks/navigation/tests/behat/{collapse_my_courses_setting.feature => expand_my_courses_setting.feature} (87%) diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 762d1728a2c..fd31903a3f3 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -122,7 +122,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp $temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1)); $temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0)); - $temp->add(new admin_setting_configcheckbox('navcollapsemycourses', new lang_string('navcollapsemycourses', 'admin'), new lang_string('navcollapsemycourses_desc', 'admin'), 0)); + $temp->add(new admin_setting_configcheckbox('navexpandmycourses', new lang_string('navexpandmycourses', 'admin'), new lang_string('navexpandmycourses_desc', 'admin'), 1)); $sortoptions = array( 'sortorder' => new lang_string('sort_sortorder', 'admin'), 'fullname' => new lang_string('sort_fullname', 'admin'), diff --git a/blocks/navigation/tests/behat/collapse_my_courses_setting.feature b/blocks/navigation/tests/behat/expand_my_courses_setting.feature similarity index 87% rename from blocks/navigation/tests/behat/collapse_my_courses_setting.feature rename to blocks/navigation/tests/behat/expand_my_courses_setting.feature index bb79564944b..79eeb0eedb2 100644 --- a/blocks/navigation/tests/behat/collapse_my_courses_setting.feature +++ b/blocks/navigation/tests/behat/expand_my_courses_setting.feature @@ -1,5 +1,5 @@ @block @block_navigation -Feature: Test collapse my courses navigation setting +Feature: Test expand my courses navigation setting As a student I visit my My Moodle page and observe the the My Courses branch @@ -27,10 +27,11 @@ Feature: Test collapse my courses navigation setting And I should see "c2" in the "Navigation" "block" And I should not see "c3" in the "Navigation" "block" - Scenario: The My Courses branch is collapsed when collapse my courses is on + @javascript + Scenario: The My Courses branch is collapsed when expand my courses is off Given I log in as "admin" And I set the following administration settings values: - | Keep My Courses collapsed initially | 1 | + | Expand My Courses initially on My Moodle page | 0 | And I log out Given I log in as "student1" And I follow "My home" @@ -39,10 +40,10 @@ Feature: Test collapse my courses navigation setting And I should not see "c3" in the "Navigation" "block" @javascript - Scenario: My Courses can be expanded on the My Moodle page when collapse my courses is on + Scenario: My Courses can be expanded on the My Moodle page when expand my courses is off Given I log in as "admin" And I set the following administration settings values: - | Keep My Courses collapsed initially | 1 | + | Expand My Courses initially on My Moodle page | 0 | And I log out Given I log in as "student1" And I follow "My home" diff --git a/lang/en/admin.php b/lang/en/admin.php index 5a2689d0637..4e9db3dd647 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -732,6 +732,8 @@ $string['navadduserpostslinks'] = 'Add links to view user posts'; $string['navadduserpostslinks_help'] = 'If enabled two links will be added to each user in the navigation to view discussions the user has started and posts the user has made in forums throughout the site or in specific courses.'; $string['navigationupgrade'] = 'This upgrade introduces two new navigation blocks that will replace these blocks: Administration, Courses, Activities and Participants. If you had set any special permissions on those blocks you should check to make sure everything is behaving as you want it.'; $string['navcourselimit'] = 'Course limit'; +$string['navexpandmycourses'] = 'Expand My Courses initially on My Moodle page'; +$string['navexpandmycourses_desc'] = 'When enabled the My Courses branch will be expanded initially on the My Moodle page and any pages within the My Moodle area.'; $string['navshowfullcoursenames'] = 'Show course full names'; $string['navshowfullcoursenames_help'] = 'If enabled courses in the navigation will be shown with using their full name rather than their short name.'; $string['navshowfrontpagemods'] = 'Show front page activities in the navigation'; @@ -739,8 +741,6 @@ $string['navshowfrontpagemods_help'] = 'If enabled, front page activities will b $string['navshowallcourses'] = 'Show all courses'; $string['navshowcategories'] = 'Show course categories'; $string['navshowmycoursecategories'] = 'Show my course categories'; -$string['navcollapsemycourses'] = 'Keep My Courses collapsed initially'; -$string['navcollapsemycourses_desc'] = 'When enabled the My Courses branch will never be expanded initially. The user will need to click to expand it. At present the My Courses branch is only expanded initially when on the My Moodle page.'; $string['navshowmycoursecategories_help'] = 'If enabled courses in the users my courses branch will be shown in categories.'; $string['navsortmycoursessort'] = 'Sort my courses'; $string['navsortmycoursessort_help'] = 'This determines whether courses are listed under My courses according to the sort order (i.e. the order set in Site administration > Courses > Manage courses and categories) or alphabetically by course setting.'; diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 0f9a0ba3ae3..0ea480b22b8 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -1135,7 +1135,7 @@ class global_navigation extends navigation_node { // Load the users enrolled courses if they are viewing the My Moodle page AND the admin has not // set that they wish to keep the My Courses branch collapsed by default. - if (empty($CFG->navcollapsemycourses) && $this->rootnodes['mycourses']->isactive){ + if (!empty($CFG->navexpandmycourses) && $this->rootnodes['mycourses']->isactive){ $this->load_courses_enrolled(); } else { $this->rootnodes['mycourses']->collapse = true;