You are here

function opigno_get_course_teachers in Opigno 7

1 call to opigno_get_course_teachers()
opigno_get_teacher_html in ./opigno.module

File

./opigno.module, line 836
Contains all hook_implementations and module specific API.

Code

function opigno_get_course_teachers($gid) {
  $users = opigno_get_users_in_group($gid, OG_STATE_ACTIVE);
  $teachers = array();
  foreach ($users as $user) {
    $roles = og_get_user_roles('node', $gid, $user->uid, $include = TRUE);
    foreach ($roles as $index => $role) {
      if ($role == "teacher") {
        $teachers[] = $user;
      }
    }
  }
  return $teachers;
}