Beispiel #1
0
function local_role_processing($course, $roleid)
{
    global $CFG;
    $shortname = get_field('role', 'shortname', 'id', $roleid);
    // if we are in rafl mode and updating contributors, update the rafl module
    if ($course->learning_path_mode == LEARNING_PATH_MODE_RAFL && $shortname == ROLE_LPCONTRIBUTOR) {
        require_once $CFG->dirroot . '/mod/rafl/locallib.php';
        $rafl = new localLibRafl();
        // get a list of the contributors
        $users = tao_get_lpcontributors(get_context_instance(CONTEXT_COURSE, $course->id));
        $idarray = array();
        if (!empty($users)) {
            foreach ($users as $user) {
                array_push($idarray, $user->id);
            }
            $rafl->update_share_contributors($course->id, $idarray);
        }
    }
}