Ejemplo n.º 1
0
 public static function get_course_code($user, $courseid)
 {
     $params = self::validate_parameters(self::get_course_code_parameters(), array('user' => $user, 'courseid' => $courseid));
     $coursecode = equella_get_coursecode($params['courseid']);
     return array('coursecode' => $coursecode);
 }
Ejemplo n.º 2
0
function equella_build_integration_url($args, $appendtoken = true)
{
    global $USER, $CFG, $DB;
    $callbackurlparams = array('course' => $args->course, 'section' => $args->section);
    if (!empty($args->cmid)) {
        $callbackurlparams['coursemodule'] = $args->cmid;
    }
    if (!empty($args->module)) {
        $callbackurlparams['module'] = $args->module;
    }
    if (!empty($args->instance)) {
        $callbackurlparams['instance'] = $args->instance;
    }
    if (!empty($args->module)) {
        $callbackurlparams['modulename'] = $args->modulename;
    } else {
        $callbackurlparams['modulename'] = 'equella';
    }
    $callbackurl = new moodle_url('/mod/equella/callbackmulti.php', $callbackurlparams);
    $cancelurl = new moodle_url('/mod/equella/cancel.php', array('course' => $args->course));
    $coursecode = equella_get_coursecode($args->course);
    $equrlparams = array('method' => 'lms', 'attachmentUuidUrls' => 'true', 'returnprefix' => 'tle', 'template' => 'standard', 'courseId' => $args->course, 'courseCode' => $coursecode, 'action' => $CFG->equella_action, 'selectMultiple' => 'true', 'cancelDisabled' => 'true', 'returnurl' => $callbackurl->out(false), 'cancelurl' => $cancelurl->out(false));
    if ($appendtoken) {
        $course = $DB->get_record('course', array('id' => $args->course), '*', MUST_EXIST);
        $equrlparams['token'] = equella_getssotoken($course);
    }
    if (!empty($CFG->equella_options)) {
        $equrlparams['options'] = $CFG->equella_options;
    }
    if ($CFG->equella_select_restriction && $CFG->equella_select_restriction != EQUELLA_CONFIG_SELECT_RESTRICT_NONE) {
        $equrlparams[$CFG->equella_select_restriction] = 'true';
    }
    return new moodle_url($CFG->equella_url, $equrlparams);
}