MDL-45884 navigation: changed to positive setting phrasing
authorSam Hemelryk <sam@moodle.com>
Wed, 11 Jun 2014 22:35:52 +0000 (10:35 +1200)
committerSam Hemelryk <sam@moodle.com>
Thu, 12 Jun 2014 22:16:25 +0000 (10:16 +1200)
admin/settings/appearance.php
blocks/navigation/tests/behat/expand_my_courses_setting.feature [moved from blocks/navigation/tests/behat/collapse_my_courses_setting.feature with 85% similarity]
lang/en/admin.php
lib/navigationlib.php

index 762d172..fd31903 100644 (file)
@@ -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'),
@@ -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"
index 5a2689d..4e9db3d 100644 (file)
@@ -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.';
index 0f9a0ba..0ea480b 100644 (file)
@@ -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;