$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'),
@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
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"
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"
$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';
$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.';
// 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;