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


PHP groups_get_members_by_role函数代码示例

本文整理汇总了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);
 }
开发者ID:nmicha,项目名称:moodle,代码行数:6,代码来源:lib.php

示例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>&nbsp;</option>';
}
echo '</select>' . "\n";
开发者ID:JP-Git,项目名称:moodle,代码行数:31,代码来源:index.php

示例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);
    }
开发者ID:Burick,项目名称:moodle,代码行数:11,代码来源:lib.php

示例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>&nbsp;</option>';
}
echo '</select>' . "\n";
开发者ID:edmiranda,项目名称:group,代码行数:31,代码来源:index.php

示例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);
开发者ID:kevin-bruton,项目名称:marsupial,代码行数:31,代码来源:credentials_bulk.php


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