Moodle

patch: display course category name (link) inside the navigation bar

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.2
  • Fix Version/s: None
  • Component/s: Course
  • Labels:
    None
  • Environment:
    php 5, mysql 5, apache2 , moodle 1.9.2
  • Database:
    MySQL
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE

Description

a lot of teachers asked me to add the course's "category name" to the navigation bar
just after the HOME link and just before the COURSE name link.

i am not sure if it was left off for some unknown reason ?
but i placed it up by adding the following lines to lib/weblib.php {lines ~3740}
inside the function "build_navigation" after the lines...
//Site name
if ($site = get_site()) { $navlinks[] = array( 'name' => format_string($site->shortname), 'link' => "$CFG->wwwroot/", 'type' => 'home'); }

///////////// new code follows...

// Course Category name, if appropriate.
if (!$category = get_record("course_categories", "id", $COURSE->category)) { //error("Category not known!"); }
$navlinks[] = array('name' => $category->name,
'link' => "$CFG->wwwroot/course/category.php?id=$category->id",
'type' => 'misc');

///////////// old code follows...

// Course name, if appropriate.

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: