本文整理汇总了PHP中GroupManager::getTutors方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupManager::getTutors方法的具体用法?PHP GroupManager::getTutors怎么用?PHP GroupManager::getTutors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GroupManager
的用法示例。
在下文中一共展示了GroupManager::getTutors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOverview
/**
* @param int $courseId
* @param string $keyword
* @return string
*/
public static function getOverview($courseId, $keyword = null)
{
$content = null;
$categories = GroupManager::get_categories();
if (!empty($categories)) {
foreach ($categories as $category) {
if (api_get_setting('allow_group_categories') == 'true') {
$content .= '<h2>' . $category['title'] . '</h2>';
}
if (!empty($keyword)) {
$groups = GroupManager::getGroupListFilterByName($keyword, $category['id'], $courseId);
} else {
$groups = GroupManager::get_group_list($category['id']);
}
$content .= '<ul>';
if (!empty($groups)) {
foreach ($groups as $group) {
$content .= '<li>';
$content .= Display::tag('h3', Security::remove_XSS($group['name']));
$users = GroupManager::getTutors($group['id']);
if (!empty($users)) {
$content .= '<ul>';
$content .= "<li>" . Display::tag('h4', get_lang('Tutors')) . "</li><ul>";
foreach ($users as $user) {
$user_info = api_get_user_info($user['user_id']);
$content .= '<li title="' . $user_info['username'] . '">' . $user_info['complete_name_with_username'] . '</li>';
}
$content .= '</ul>';
$content .= '</ul>';
}
$users = GroupManager::getStudents($group['id']);
if (!empty($users)) {
$content .= '<ul>';
$content .= "<li>" . Display::tag('h4', get_lang('Students')) . "</li><ul>";
foreach ($users as $user) {
$user_info = api_get_user_info($user['user_id']);
$content .= '<li title="' . $user_info['username'] . '">' . $user_info['complete_name_with_username'] . '</li>';
}
$content .= '</ul>';
$content .= '</ul>';
}
$content .= '</li>';
}
}
$content .= '</ul>';
}
}
return $content;
}