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


PHP course_enrolment_manager::get_users_enrolments方法代码示例

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


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

示例1: array

require_login($course);
require_capability('moodle/course:enrolreview', $context);
$PAGE->set_pagelayout('admin');
$manager = new course_enrolment_manager($PAGE, $course, $filter);
$table = new course_enrolment_users_table($manager, $PAGE);
$returnurl = new moodle_url('/enrol/users.php', $table->get_combined_url_params());
$actionurl = new moodle_url('/enrol/bulkchange.php', $table->get_combined_url_params() + array('bulkuserop' => $bulkuserop));
$PAGE->set_url($actionurl);
navigation_node::override_active_url(new moodle_url('/enrol/users.php', array('id' => $id)));
$ops = $table->get_bulk_user_enrolment_operations();
if (!array_key_exists($bulkuserop, $ops)) {
    throw new moodle_exception('invalidbulkenrolop');
}
$operation = $ops[$bulkuserop];
// Prepare the properties of the form
$users = $manager->get_users_enrolments($userids);
// Get the form for the bulk operation
$mform = $operation->get_form($actionurl, array('users' => $users));
// If the mform is false then attempt an immediate process. This may be an immediate action that
// doesn't require user input OR confirmation.... who know what but maybe one day
if ($mform === false) {
    if ($operation->process($manager, $users, new stdClass())) {
        redirect($returnurl);
    } else {
        print_error('errorwithbulkoperation', 'enrol');
    }
}
// Check if the bulk operation has been cancelled
if ($mform->is_cancelled()) {
    redirect($returnurl);
}
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:31,代码来源:bulkchange.php


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