]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14978 removed obsoleted get_course_teachers()
authorskodak <skodak>
Sun, 25 May 2008 11:07:57 +0000 (11:07 +0000)
committerskodak <skodak>
Sun, 25 May 2008 11:07:57 +0000 (11:07 +0000)
lib/deprecatedlib.php

index ea3d28887db4fa27b1b1a62ebbab3f06b635e7db..078e7cdd0d337b9bc965cb580bafc06334f7a4e7 100644 (file)
@@ -203,56 +203,6 @@ function get_recent_enrolments($courseid, $timestart) {
                               ORDER BY l.time ASC");
 }
 
-/**
- * Returns list of all teachers in this course
- *
- * If $courseid matches the site id then this function
- * returns a list of all teachers for the site.
- *
- * @uses $CFG
- * @param int $courseid The course in question.
- * @param string $sort ?
- * @param string $exceptions ?
- * @return object
- * @todo Finish documenting this function
- */
-function get_course_teachers($courseid, $sort='t.authority ASC', array $exceptions=null) {
-
-    global $CFG;
-
-    $sort = 'ul.timeaccess DESC';
-
-    $context = get_context_instance(CONTEXT_COURSE, $courseid);
-
-    /// For the site course, if the $CFG->defaultuserroleid is set to the legacy teacher role, then all
-    /// users are teachers. This function should be replaced where it is used with something more
-    /// meaningful.
-    if (($courseid == SITEID) && !empty($CFG->defaultuserroleid) && empty($CFG->nodefaultuserrolelists)) {
-        if ($roles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW, $context)) {
-            $hascap = false;
-            foreach ($roles as $role) {
-                if ($role->id == $CFG->defaultuserroleid) {
-                    $hascap = true;
-                    break;
-                }
-            }
-            if ($hascap) {
-                if (empty($fields)) {
-                    $fields = '*';
-                }
-                return get_users(true, '', true, $exceptions, 'lastname ASC', '', '', '', '', $fields);
-            }
-        }
-    }
-
-    $users = get_users_by_capability($context, 'moodle/course:update',
-                                     'u.*, ul.timeaccess as lastaccess',
-                                     $sort, '','','',$exceptions, false);
-    return sort_by_roleassignment_authority($users, $context);
-
-    /// some fields will be missing, like authority, editall
-}
-
 /**
  * Returns all the users of a course: students and teachers
  *