course)) { error("Course is misconfigured"); } if (! $lams = get_record("lams", "id", $cm->instance)) { error("Course module is incorrect"); } require_login($course, true, $cm); $context = get_context_instance(CONTEXT_MODULE, $cm->id); add_to_log($course->id, "lams", "view", "view.php?id=$cm->id", "$lams->id"); /// Print the page header $navigation = build_navigation('', $cm); print_header_simple(format_string($lams->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, get_string("lesson","lams")), navmenu($course, $cm)); echo '
'; print_heading(format_string($lams->name)); //$strlamss = get_string("modulenameplural", "lams"); //$strlams = get_string("modulename", "lams"); //print_header("$course->shortname: $lams->name", "$course->fullname", // "$navigation id>$strlamss -> $lams->name", // "", "", true, update_module_button($cm->id, $course->id, $strlams), // navmenu($course, $cm)); /// Print the main part of the page if(has_capability('mod/lams:manage', $context)){ $datetime = date("F d,Y g:i a"); $plaintext = trim($datetime).trim($USER->username).trim($LAMSCONSTANTS->monitor_method).trim($CFG->lams_serverid).trim($CFG->lams_serverkey); $hash = sha1(strtolower($plaintext)); $url = $CFG->lams_serverurl.$LAMSCONSTANTS->login_request. '?'.$LAMSCONSTANTS->param_uid.'='.$USER->username. '&'.$LAMSCONSTANTS->param_method.'='.$LAMSCONSTANTS->monitor_method. '&'.$LAMSCONSTANTS->param_timestamp.'='.urlencode($datetime). '&'.$LAMSCONSTANTS->param_serverid.'='.$CFG->lams_serverid. '&'.$LAMSCONSTANTS->param_hash.'='.$hash. '&'.$LAMSCONSTANTS->param_lsid.'='.$lams->learning_session_id. '&'.$LAMSCONSTANTS->param_courseid.'='.$lams->course; print_simple_box_start('center'); echo ''.get_string("openmonitor", "lams").''; print_simple_box_end(); $plaintext = trim($datetime).trim($USER->username).trim($LAMSCONSTANTS->learner_method).trim($CFG->lams_serverid).trim($CFG->lams_serverkey); $hash = sha1(strtolower($plaintext)); $url = $CFG->lams_serverurl.$LAMSCONSTANTS->login_request. '?'.$LAMSCONSTANTS->param_uid.'='.$USER->username. '&'.$LAMSCONSTANTS->param_method.'='.$LAMSCONSTANTS->learner_method. '&'.$LAMSCONSTANTS->param_timestamp.'='.urlencode($datetime). '&'.$LAMSCONSTANTS->param_serverid.'='.$CFG->lams_serverid. '&'.$LAMSCONSTANTS->param_hash.'='.$hash. '&'.$LAMSCONSTANTS->param_lsid.'='.$lams->learning_session_id. '&'.$LAMSCONSTANTS->param_courseid.'='.$lams->course; print_simple_box_start('center'); echo ''.get_string("openlearner", "lams").''; print_simple_box_end(); }else if(has_capability('mod/lams:participate', $context)){ $datetime = date("F d,Y g:i a"); $plaintext = trim($datetime).trim($USER->username).trim($LAMSCONSTANTS->learner_method).trim($CFG->lams_serverid).trim($CFG->lams_serverkey); $hash = sha1(strtolower($plaintext)); $url = $CFG->lams_serverurl.$LAMSCONSTANTS->login_request. '?'.$LAMSCONSTANTS->param_uid.'='.$USER->username. '&'.$LAMSCONSTANTS->param_method.'='.$LAMSCONSTANTS->learner_method. '&'.$LAMSCONSTANTS->param_timestamp.'='.urlencode($datetime). '&'.$LAMSCONSTANTS->param_serverid.'='.$CFG->lams_serverid. '&'.$LAMSCONSTANTS->param_hash.'='.$hash. '&'.$LAMSCONSTANTS->param_lsid.'='.$lams->learning_session_id. '&'.$LAMSCONSTANTS->param_courseid.'='.$lams->course; print_simple_box_start('center'); echo ''.get_string("openlearner", "lams").''; print_simple_box_end(); } if ($lams->introduction) { print_box(format_text($lams->introduction), 'generalbox', 'intro'); } /// Finish the page echo ' |