Esempio n. 1
0
//get the informations related to the Vt resource
$vtAction = new vtAction($USER->email);
$dbResource = get_record("voiceemail_resources", "id", $voicetool->rid);
$resource = $vtAction->getResource($dbResource->rid);
//check the availability of the resource
$roleSwitch = isSwitch();
//the user have switched his role?
//determinate the role for the wimba tools
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$role = voiceemail_getRole($context);
if ($resource->error == true) {
    wimba_add_log(WIMBA_ERROR, voiceemail_LOGS, "view.php : problem to get the resource(rid : " . $voicetool->rid . ") linked to this activity");
    error(get_string("problem_vt", "voiceemail"), "{$CFG->wwwroot}/course/view.php?id={$course->id}");
}
$currentUser = $vtAction->createUser($USER->firstname . "_" . $USER->lastname, $USER->email);
$currentUserRights = $vtAction->createUserRights($resource->getType(), $role);
$resource->setEmailFrom($USER->email);
//get the vt session
$vtSession = $vtAction->getVtSession($resource, $currentUser, $currentUserRights);
if (function_exists("build_navigation")) {
    $cm->modname = "voiceemail";
    $cm->name = $voicetool->name;
    $navigation = build_navigation('', $cm);
    print_header("{$course->shortname}: {$voicetool->name}", $course->fullname, $navigation, "", "", true, update_module_button($cm->id, $course->id, $strvoicetool . " " . get_string('activity', 'voiceemail')), navmenu($course));
} else {
    $navigation = array();
    if ($course->id != SITEID) {
        $navigation[$course->shortname] = "{$CFG->wwwroot}/course/view.php?id={$course->id}";
    }
    $navigation[$strvoicetools] = "{$CFG->wwwroot}/mod/voiceemail/index.php?id={$course->id}";
    $urls = array();