当前位置: 首页>>代码示例>>PHP>>正文


PHP course_enrolment_manager::edit_enrolment方法代码示例

本文整理汇总了PHP中course_enrolment_manager::edit_enrolment方法的典型用法代码示例。如果您正苦于以下问题:PHP course_enrolment_manager::edit_enrolment方法的具体用法?PHP course_enrolment_manager::edit_enrolment怎么用?PHP course_enrolment_manager::edit_enrolment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在course_enrolment_manager的用法示例。


在下文中一共展示了course_enrolment_manager::edit_enrolment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');
navigation_node::override_active_url($usersurl);
list($instance, $plugin) = $manager->get_user_enrolment_components($ue);
if (!$plugin->allow_manage($instance) || $instance->enrol != 'invitation' || !$plugin instanceof enrol_invitation_plugin) {
    print_error('erroreditenrolment', 'enrol');
}
$mform = new enrol_invitation_user_enrolment_form($url, array('user' => $user, 'course' => $course, 'ue' => $ue));
$mform->set_data($PAGE->url->params());
// Check the form hasn't been cancelled.
if ($mform->is_cancelled()) {
    redirect($returnurl);
} else {
    if ($mform->is_submitted() && $mform->is_validated() && confirm_sesskey()) {
        // The forms been submit, validated and the sesskey has been checked ... edit the enrolment.
        $data = $mform->get_data();
        if ($manager->edit_enrolment($ue, $data)) {
            redirect($returnurl);
        }
    }
}
$fullname = fullname($user);
$title = get_string('editenrolment', 'enrol_invitation');
$PAGE->set_title($title);
$PAGE->set_heading($title);
$PAGE->navbar->add($title);
$PAGE->navbar->add($fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading($fullname);
$mform->display();
echo $OUTPUT->footer();
开发者ID:GaoxinHuang,项目名称:moodle-enrol_invitation,代码行数:31,代码来源:editenrolment.php

示例2: array

         /**
          * Edits the details of a users enrolment in the course
          */
     /**
      * Edits the details of a users enrolment in the course
      */
     case 'edit':
         $ue = $DB->get_record('user_enrolments', array('id' => required_param('ue', PARAM_INT)), '*', MUST_EXIST);
         //Only show the edit form if the user has the appropriate capability
         list($instance, $plugin) = $manager->get_user_enrolment_components($ue);
         if ($instance && $plugin && $plugin->allow_manage($instance) && has_capability("enrol/{$instance->enrol}:manage", $manager->get_context())) {
             $user = $DB->get_record('user', array('id' => $ue->userid), '*', MUST_EXIST);
             $mform = new enrol_users_edit_form(NULL, array('user' => $user, 'course' => $course, 'ue' => $ue));
             $mform->set_data($PAGE->url->params());
             $data = $mform->get_data();
             if ($mform->is_cancelled() || $data && $manager->edit_enrolment($ue, $data)) {
                 redirect($PAGE->url);
             } else {
                 $pagetitle = fullname($user);
             }
             $actiontaken = true;
         }
         break;
 }
 // If we took an action display we need to display something special.
 if ($actiontaken) {
     if (empty($pageheading)) {
         $pageheading = $pagetitle;
     }
     $PAGE->set_title($pagetitle);
     $PAGE->set_heading($pageheading);
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:31,代码来源:users.php


注:本文中的course_enrolment_manager::edit_enrolment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。