Esempio n. 1
0
    $urls = array();
    foreach ($navigation as $text => $href) {
        if (empty($href)) {
            $urls[] = $text;
        } else {
            $urls[] = '<a href="' . $href . '">' . $text . '</a>';
        }
    }
    $breadcrumb = implode(' -> ', $urls);
    print_header("{$course->shortname}: {$voicetool->name}", "{$course->fullname}", $breadcrumb . " {$voicetool->name}", "", "", true, update_module_button($cm->id, $course->id, $strvoicetool), navmenu($course, $cm));
}
$roleSwitch = isSwitch();
//the user have switched his role?
//determinate the role for the wimba tools
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$role = voicepodcaster_getRole($context);
//get the informations related to the Vt resource
$vtAction = new vtAction($USER->email);
$resource = $vtAction->getResource($voicetool->rid);
//check the availability of the resource
$vtpreview = isVtAvailable($voicetool->rid);
if ($resource->error == true) {
    wimba_add_log(WIMBA_ERROR, voicepodcaster_LOGS, "view.php : problem to get the resource(rid : " . $voicetool->rid . ") linked to this activity");
    error(get_string("problem_vt", "voicepodcaster"), "{$CFG->wwwroot}/course/view.php?id={$course->id}");
}
$currentUser = $vtAction->createUser($USER->firstname . "_" . $USER->lastname, $USER->email);
$currentUserRights = $vtAction->createUserRights($resource->getType(), $role);
//get the vt session
$vtSession = $vtAction->getVtSession($resource, $currentUser, $currentUserRights);
?>
Esempio n. 2
0
function voicepodcaster_get_url_params($courseid)
{
    global $USER;
    global $CFG;
    $context = get_context_instance(CONTEXT_COURSE, $courseid);
    $role = voicepodcaster_getRole($context);
    $signature = md5($courseid . $USER->email . $USER->firstname . $USER->lastname . $role);
    $url_params = "enc_course_id=" . rawurlencode($courseid) . "&enc_email=" . rawurlencode($USER->email) . "&enc_firstname=" . rawurlencode($USER->firstname) . "&enc_lastname=" . rawurlencode($USER->lastname) . "&enc_role=" . rawurlencode($role) . "&signature=" . rawurlencode($signature);
    return $url_params;
}