本文整理汇总了PHP中groups_get_members_by_role函数的典型用法代码示例。如果您正苦于以下问题:PHP groups_get_members_by_role函数的具体用法?PHP groups_get_members_by_role怎么用?PHP groups_get_members_by_role使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了groups_get_members_by_role函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find_users
public function find_users($search)
{
list($wherecondition, $params) = $this->search_sql($search, 'u');
$roles = groups_get_members_by_role($this->groupid, $this->courseid, $this->required_fields_sql('u'), 'u.lastname, u.firstname', $wherecondition, $params);
return $this->convert_array_format($roles, $search);
}
示例2: get_string
echo '<p><input type="submit" name="act_updatemembers" id="updatemembers" value="' . get_string('showmembersforgroup', 'group') . '" /></p>' . "\n";
echo '<p><input type="submit" ' . $showeditgroupsettingsform_disabled . ' name="act_showgroupsettingsform" id="showeditgroupsettingsform" value="' . get_string('editgroupsettings', 'group') . '" /></p>' . "\n";
echo '<p><input type="submit" ' . $deletegroup_disabled . ' name="act_deletegroup" id="deletegroup" value="' . get_string('deleteselectedgroup', 'group') . '" /></p>' . "\n";
echo '<p><input type="submit" name="act_showcreateorphangroupform" id="showcreateorphangroupform" value="' . get_string('creategroup', 'group') . '" /></p>' . "\n";
echo '<p><input type="submit" name="act_showautocreategroupsform" id="showautocreategroupsform" value="' . get_string('autocreategroups', 'group') . '" /></p>' . "\n";
echo '<p><input type="submit" name="act_showimportgroups" id="showimportgroups" value="' . get_string('importgroups', 'core_group') . '" /></p>' . "\n";
echo '</td>' . "\n";
echo '<td>' . "\n";
echo '<p><label for="members"><span id="memberslabel">' . get_string('membersofselectedgroup', 'group') . ' </span><span id="thegroup">' . $selectedname . '</span></label></p>' . "\n";
//NOTE: the SELECT was, multiple="multiple" name="user[]" - not used and breaks onclick.
echo '<select name="user" id="members" size="15" class="select"' . "\n";
echo ' onclick="window.status=this.options[this.selectedIndex].title;" onmouseout="window.status=\'\';">' . "\n";
$member_names = array();
$atleastonemember = false;
if ($singlegroup) {
if ($groupmemberroles = groups_get_members_by_role($groupids[0], $courseid, 'u.id,u.firstname,u.lastname')) {
foreach ($groupmemberroles as $roleid => $roledata) {
echo '<optgroup label="' . s($roledata->name) . '">';
foreach ($roledata->users as $member) {
echo '<option value="' . $member->id . '">' . fullname($member, true) . '</option>';
$atleastonemember = true;
}
echo '</optgroup>';
}
}
}
if (!$atleastonemember) {
// Print an empty option to avoid the XHTML error of having an empty select element
echo '<option> </option>';
}
echo '</select>' . "\n";
示例3: find_users
public function find_users($search) {
list($wherecondition, $params) = $this->search_sql($search, 'u');
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
$roles = groups_get_members_by_role($this->groupid, $this->courseid,
$this->required_fields_sql('u') . ', gm.component',
$sort, $wherecondition, array_merge($params, $sortparams));
return $this->convert_array_format($roles, $search);
}
示例4: get_string
}
//UAIOPEN - tiene los permisos necesarios para ver todos los grupos
if (has_capability('moodle/site:accessallgroups', $context)) {
echo '<p><input type="submit" name="act_showautocreategroupsform" id="showautocreategroupsform" value="' . get_string('autocreategroups', 'group') . '" /></p>' . "\n";
echo '<p><input type="submit" name="act_showimportgroups" id="showimportgroups" value="' . get_string('importgroups', 'core_group') . '" /></p>' . "\n";
}
echo '</td>' . "\n";
echo '<td>' . "\n";
echo '<p><label for="members"><span id="memberslabel">' . get_string('membersofselectedgroup', 'group') . ' </span><span id="thegroup">' . $selectedname . '</span></label></p>' . "\n";
//NOTE: the SELECT was, multiple="multiple" name="user[]" - not used and breaks onclick.
echo '<select name="user" id="members" size="15" class="select"' . "\n";
echo ' onclick="window.status=this.options[this.selectedIndex].title;" onmouseout="window.status=\'\';">' . "\n";
$member_names = array();
$atleastonemember = false;
if ($singlegroup) {
if ($groupmemberroles = groups_get_members_by_role($groupids[0], $courseid, 'u.id, ' . get_all_user_name_fields(true, 'u'))) {
foreach ($groupmemberroles as $roleid => $roledata) {
echo '<optgroup label="' . s($roledata->name) . '">';
foreach ($roledata->users as $member) {
echo '<option value="' . $member->id . '">' . fullname($member, true) . '</option>';
$atleastonemember = true;
}
echo '</optgroup>';
}
}
}
if (!$atleastonemember) {
// Print an empty option to avoid the XHTML error of having an empty select element
echo '<option> </option>';
}
echo '</select>' . "\n";
示例5: get_current_group
if ($course->groupmode) {
$selectedgroup = get_current_group($course->id);
$showgroups = true;
} else {
$selectedgroup = 0;
$showgroups = false;
}
}
// Get all the possible users
if ($course->id != SITEID) {
if ($selectedgroup) {
// If using a group, only get users in that group.
// MARSUPIAL ************ MODIFICAT -> Deprecated code in Moodle 2.x
// 2012.12.14 @abertranb
require_once $CFG->dirroot . '/group/lib.php';
$users_to_show_role = groups_get_members_by_role($selectedgroup, $course->id, 'u.id,u.firstname,u.lastname,u.email', 'u.lastname ASC', 'u.id not in (SELECT DISTINCT euserid FROM ' . $CFG->prefix . 'rcommon_user_credentials WHERE isbn = \'' . $book->isbn . '\')');
$users_to_show = array();
if ($users_to_show_role && count($users_to_show_role) > 0) {
foreach ($users_to_show_role as $role) {
foreach ($role->users as $u) {
$users_to_show[] = $u;
}
}
}
// ************ MODIFICAT
//$users_to_show = get_group_users($selectedgroup, 'u.lastname ASC', "SELECT DISTINCT euserid FROM {$CFG->prefix}rcommon_user_credentials WHERE isbn = '{$book->isbn}'", 'u.id, u.firstname, u.lastname, u.idnumber, u.email');
// ************ FI
} else {
// MARSUPIAL ************ MODIFICAT -> Deprecated code in Moodle 2.x
// 2012.12.14 @abertranb
$context_course = context_course::instance($course->id);