コード例 #1
0
                $message->contexturl = $CFG->wwwroot . "/blocks/ilp/actions/view_main.php?user_id={$entry->user_id}{$reportstaburl}";
                $message->contexturlname = get_string('viewreport', 'block_ilp');
                if (stripos($CFG->release, "2.") !== false) {
                    message_send($message);
                } else {
                    require_once $CFG->dirroot . '/message/lib.php';
                    message_post_message($message->userfrom, $message->userto, $message->fullmessage, $message->fullmessageformat, 'direct');
                }
            }
            $return_url = $CFG->wwwroot . "/blocks/ilp/actions/view_main.php?user_id={$user_id}&selectedtab={$selectedtab}&tabitem={$tabitem}&course_id={$course_id}";
            redirect($return_url, get_string("commentcreationsuc", 'block_ilp'), ILP_REDIRECT_DELAY);
        }
    }
}
if (!empty($comment_id)) {
    $comment = $dbc->get_comment_by_id($comment_id);
    if (!empty($comment)) {
        //only the creator has the right to edit
        if ($comment->creator_id == $USER->id) {
            //set the form values to the current comment
            $mform->set_data($comment);
        } else {
            print_error('commentmayonlybeeditedbyowner', 'block_ilp');
        }
    } else {
        print_error('commentnotfound', 'block_ilp');
    }
}
$plpuser = $dbc->get_user_by_id($user_id);
$dashboardurl = $CFG->wwwroot . "/blocks/ilp/actions/view_main.php?user_id={$user_id}&course_id={$course_id}";
$userprofileurl = stripos($CFG->release, "2.") === false ? $CFG->wwwroot . "/user/view.php?id={$user_id}" : $CFG->wwwroot . "/user/profile.php?id={$user_id}";