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

Hide list of Available Courses/Categories from Users

    XMLWordPrintable

Details

    • MOODLE_26_STABLE

    Description

      The goal of this operation is to hide the listing of all available courses, not just the "All Courses" link. The list can be extensive and our institution wants to limit the view.

      I have accomplished this in our instance by making the following modifications. The request is to have it generalized and added into the administration GUI.

      Modifications

      In the administration:
      Site Administration -> Plugins -> Blocks -> Courses
      Check "Hide 'All courses' link

      Site Administration -> Front page -> Front page settings
      In "Front page items when logged in" have only "Enrolled Courses" selected

      Hide Search Box
      core.css (Theme)
      #coursesearch, #coursesearch2

      { display: none; }

      Remove "All Courses" Link
      index.php (Main)
      Under the case statement remove the all courses link from the html variable. I'm sure there is a better place/way for this, but I was not able to find it.

      case FRONTPAGEENROLLEDCOURSELIST:
      $mycourseshtml = str_replace('<div class="paging paging-morelink"><a href="https://my.moodle.edu/course/index.php">All courses</a></div>', '', $mycourseshtml);

      Added break statement above the "No break" comment to prevent all available courses from being displayed.
      break;
      // No "break" here. If there are no enrolled courses - continue to 'Available courses'.

      Remove the "Courses" link from the navigation block.
      lib/navigationlib.php
      $this->rootnodes['courses']->isexpandable = false;//true;

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rjmats Randy Morrow
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona), David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: