Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-23731

Add Category information to the $navlinks array for the navigation breadcrumbs.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.9
    • Fix Version/s: 2.0
    • Component/s: Navigation
    • Labels:
      None

      Description

      When courses are organised in to categories, one the user selects the course the category is no longer present in the breadcrumb links. This makes returning to the category level to select another course less intuitive.

      To counter this issue, I have inserted the following code in the lib/weblib.php file in the function build_navigation section between the site info and course name:

      // Categrory Name, if appropriate.
      if (isset($COURSE->category) && $COURSE->id != SITEID) {
      $categoryid = trim(get_string($COURSE->category),"[]");
      $sql = "SELECT `name` FROM `mdl_course_categories` WHERE `id` = $categoryid";
      $categoryname = get_record_sql($sql);
      $navlinks[] = array(
      'name' => format_string($categoryname->name),
      'link' => "$CFG->wwwroot/course/category.php?id=$COURSE->category",
      'type' => 'category');
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              samhemelryk Sam Hemelryk
              Reporter:
              fwdixon Frank Dixon
              Tester:
              Nobody
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10