} wimba_add_log(WIMBA_DEBUG, voicepresentation_LOGS, "manageAction : parameters \n" . print_r($params, true)); require_login($params["enc_course_id"]); $session = new WimbaMoodleSession($params); $redirectionUrl = 'welcome.php?id=' . $params["enc_course_id"] . '&' . voicepresentation_get_url_params($params["enc_course_id"]) . '&time=' . $session->timeOfLoad; $urlModuleForm = $CFG->wwwroot . '/course/mod.php?section=0&sesskey=' . sesskey() . '&id=' . $session->getCourseId() . '&add=voicepresentation&rid='; $messageType = ""; if ($session->error === false && $session != NULL) { $vtAction = new vtAction($session->getEmail(), $params); if ($params['action'] == 'launch') { $session->setCurrentVtUSer($params["type"]); if ($params["studentView"] == "true") { $session->setVtUserRigths($params["type"], "student"); } $resource = voicetools_api_get_resource($params["resource_id"]); $result = $vtAction->getVtSession($resource, $session->getVtUser(), $session->getVtUserRigths()); if ($result != NULL) { wimba_add_log(WIMBA_DEBUG, voicepresentation_LOGS, "launch the " . $params["type"] . ", nid =" . $result->getNid()); if (!empty($params["filter_screen_name"])) { redirection($CFG->voicetools_servername . '/' . $params["type"] . '?action=display_popup&nid=' . $result->getNid() . "&filter_screen_name=" . $params["filter_screen_name"]); } else { redirection($CFG->voicetools_servername . '/' . $params["type"] . '?action=display_popup&nid=' . $result->getNid()); } } else { redirection($redirectionUrl . '&error=problem_vt'); } } elseif ($params['action'] == 'create' || $params['action'] == "createDefault") { if ($params['type'] == "board") { $result = $vtAction->createBoard(); //create the resource on the vt $messageAction = "created";
$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(); foreach ($navigation as $text => $href) { if (empty($href)) { $urls[] = $text;
$result = $vtAction->createRecorder("Voice Authoring associated to the course " . $course_id); //create the resource on the vt if ($result != NULL && $result->error != "error") { if (!storeResource($result->getRid(), $course_id, "recorder", $course_id . "_recorder")) { $rid = $result->getRid(); //problem to insert the record in db } } } $resource = voicetools_api_get_resource($rid); if ($resource) { //echo "<script language='javascript'>window.location.replace('error.php?error=problem_vt')</script>"; //exit(); $message = new vtMessage(null); $message->setMid($block_id); $result = $vtAction->getVtSession($resource, $vtUser, $vtUserRigths, $message); if ($result === false) { $error = "There is a problem to display the voice authoring"; // echo "<script language='javascript'>window.location.replace('error.php?error=problem_vt')</script>"; // exit(); } $recorderInformations = voiceauthoring_get_block_informations($block_id); } ?> <div> <p> <span class="general_font"> <?php echo format_string($recorderInformations->comment);