コード例 #1
0
ファイル: toolssettings.php プロジェクト: alanaipe2015/moodle
if ($action == 'accept') {
    lti_set_state_for_type($id, LTI_TOOL_STATE_CONFIGURED);
    redirect($redirect);
} else {
    if ($action == 'reject' || $action == 'delete') {
        lti_set_state_for_type($id, LTI_TOOL_STATE_REJECTED);
        redirect($redirect);
    }
}
if (lti_request_is_using_ssl() && !empty($type->lti_secureicon)) {
    $type->oldicon = $type->lti_secureicon;
} else {
    $type->oldicon = $type->lti_icon;
}
$form = new mod_lti_edit_types_form($pageurl, (object) array('isadmin' => true, 'istool' => true));
if ($data = $form->get_data()) {
    $type = new stdClass();
    if (!empty($id)) {
        $type->id = $id;
        lti_update_type($type, $data);
    } else {
        $type->state = LTI_TOOL_STATE_CONFIGURED;
        lti_add_type($type, $data);
    }
    redirect($redirect);
} else {
    if ($form->is_cancelled()) {
        redirect($redirect);
    }
}
$PAGE->set_title(format_string($SITE->shortname) . ': ' . get_string('toolsetup', 'lti'));