From 8958174c48de3d69442df38309c816d6cc81e43d Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 5 Nov 2009 09:31:55 +0000 Subject: [PATCH] navigation MDL-20651 Changed setting from hide to show --- admin/settings/appearance.php | 2 +- .../global_navigation_tree/block_global_navigation_tree.php | 2 +- lang/en_utf8/admin.php | 4 ++-- lib/navigationlib.php | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 77db028770..9675963461 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -67,7 +67,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page // Navigation settings $temp = new admin_settingpage('navigation', get_string('navigation')); - $temp->add(new admin_setting_configcheckbox('navhidecategories', get_string('navhidecategories', 'admin'), get_string('confignavhidecategories', 'admin'), 0)); + $temp->add(new admin_setting_configcheckbox('navshowcategories', get_string('navshowcategories', 'admin'), get_string('confignavshowcategories', 'admin'), 1)); $temp->add(new admin_setting_configcheckbox('navshowallcourses', get_string('navshowallcourses', 'admin'), get_string('confignavshowallcourses', 'admin'), 0)); $ADMIN->add('appearance', $temp); diff --git a/blocks/global_navigation_tree/block_global_navigation_tree.php b/blocks/global_navigation_tree/block_global_navigation_tree.php index a2ed03cabd..e4a0d2b5a3 100644 --- a/blocks/global_navigation_tree/block_global_navigation_tree.php +++ b/blocks/global_navigation_tree/block_global_navigation_tree.php @@ -127,7 +127,7 @@ class block_global_navigation_tree extends block_tree { } // Load the my courses branch if the user has selected to - if (!empty($CFG->navhidecategories)) { + if (isset($CFG->navshowcategories) && empty($CFG->navshowcategories)) { $this->page->navigation->collapse_course_categories(); } diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index 330f0065b6..cc8af818b4 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -241,7 +241,7 @@ $string['configminpasswordupper'] = 'Passwords must have at least these many upp $string['condifmodeditdefaults'] = 'The values you set here define the default values that are used in the activity settings form when you create a new activity. You can also configure which activity settings are considered advanced.'; $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['confignavhidecategories'] = 'Do not show course categories in the navigation bar or navigation blocks'; +$string['confignavshowcategories'] = 'Show course categories in the navigation bar and navigation blocks'; $string['confignavshowallcourses'] = 'Setting this ensures that all courses a user is registered in are shown on the navigation at all times. By default once a user browses to a course only that course is shown on the navigation.'; $string['confignodefaultuserrolelists'] = 'This setting prevents all users from being returned from the database from deprecated calls of get_course_user, etc., for the site course if the default role provides that access. Check this, if you suffer a performance hit.'; $string['confignonmetacoursesyncroleids'] = 'By default all role assignments from child courses are synchronised to metacourses. Roles that are selected here will not be included in the synchronisation process.'; @@ -647,7 +647,7 @@ $string['mysql416required'] = 'MySQL 4.1.16 is the minimum version required for $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.

You should also "Shift-Refresh" your browser to load the new styles, otherwise the new blocks will not work correctly.'; -$string['navhidecategories'] = 'Hide course categories'; +$string['navshowcategories'] = 'Show course categories'; $string['navshowallcourses'] = 'Show all users courses'; $string['nobookmarksforuser'] = 'You do not have any bookmarks.'; $string['nochanges'] = 'No changes'; diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 206c37ee3f..46d8349b9f 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2261,9 +2261,9 @@ class navbar extends navigation_node { $oldaction = $child->action; $child->action = null; } - if (empty($CFG->navhidecategories) || $child->type !== navigation_node::TYPE_CATEGORY) { - // Now display the node - $output .= '
  • '.$separator.' '.$child->content(true).'
  • '; + if ($child->type !== navigation_node::TYPE_CATEGORY || !isset($CFG->navshowcategories) || !empty($CFG->navshowcategories)) { + // Now display the node + $output .= '
  • '.$separator.' '.$child->content(true).'
  • '; } if (isset($oldaction)) { $child->action = $oldaction; -- 2.39.5