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


PHP course_enrolment_manager::get_other_users_for_display方法代码示例

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


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

示例1: array

$PAGE->set_url('/enrol/otherusers.php', $manager->get_url_params() + $table->get_url_params());
$userdetails = array('picture' => false, 'firstname' => get_string('firstname'), 'lastname' => get_string('lastname'));
$extrafields = get_extra_user_fields($context);
foreach ($extrafields as $field) {
    $userdetails[$field] = get_user_field_name($field);
}
$fields = array('userdetails' => $userdetails, 'lastseen' => get_string('lastaccess'), 'role' => get_string('roles', 'role'));
// Remove hidden fields if the user has no access
if (!has_capability('moodle/course:viewhiddenuserfields', $context)) {
    $hiddenfields = array_flip(explode(',', $CFG->hiddenuserfields));
    if (isset($hiddenfields['lastaccess'])) {
        unset($fields['lastseen']);
    }
}
$table->set_fields($fields, $OUTPUT);
//$users = $manager->get_other_users($table->sort, $table->sortdirection, $table->page, $table->perpage);
$renderer = $PAGE->get_renderer('core_enrol');
$canassign = has_capability('moodle/role:assign', $manager->get_context());
$users = $manager->get_other_users_for_display($renderer, $PAGE->url, $table->sort, $table->sortdirection, $table->page, $table->perpage);
$assignableroles = $manager->get_assignable_roles(true);
foreach ($users as $userid => &$user) {
    $user['picture'] = $OUTPUT->render($user['picture']);
    $user['role'] = $renderer->user_roles_and_actions($userid, $user['roles'], $assignableroles, $canassign, $PAGE->url);
}
$table->set_total_users($manager->get_total_other_users());
$table->set_users($users);
$PAGE->set_title($course->fullname . ': ' . get_string('totalotherusers', 'enrol', $manager->get_total_other_users()));
$PAGE->set_heading($PAGE->title);
echo $OUTPUT->header();
echo $renderer->render($table);
echo $OUTPUT->footer();
开发者ID:nmicha,项目名称:moodle,代码行数:31,代码来源:otherusers.php


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