本文整理汇总了PHP中UserGroup::get_courses_by_usergroup方法的典型用法代码示例。如果您正苦于以下问题:PHP UserGroup::get_courses_by_usergroup方法的具体用法?PHP UserGroup::get_courses_by_usergroup怎么用?PHP UserGroup::get_courses_by_usergroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserGroup
的用法示例。
在下文中一共展示了UserGroup::get_courses_by_usergroup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
$result = Database::select('*', "{$obj->table} ", array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
$new_result = array();
foreach ($result as $item) {
$new_result[] = $item;
}
$result = $new_result;
break;
case 'get_usergroups':
$columns = array('name', 'users', 'courses', 'sessions', 'group_type', 'actions');
$result = Database::select('*', $obj->table, array('order' => "name {$sord}", 'LIMIT' => "{$start} , {$limit}"));
$new_result = array();
if (!empty($result)) {
foreach ($result as $group) {
$group['sessions'] = count($obj->get_sessions_by_usergroup($group['id']));
$group['courses'] = count($obj->get_courses_by_usergroup($group['id']));
$group['users'] = count($obj->get_users_by_usergroup($group['id']));
switch ($group['group_type']) {
case '0':
$group['group_type'] = Display::label(get_lang('Class'), 'info');
break;
case '1':
$group['group_type'] = Display::label(get_lang('Social'), 'success');
break;
}
$new_result[] = $group;
}
$result = $new_result;
}
$columns = array('name', 'users', 'courses', 'sessions', 'group_type');
if (!in_array($sidx, $columns)) {
示例2: search
if ($searchForm->validate()) {
$filterData = $searchForm->getSubmitValues();
}
$conditions = array();
if (!empty($filters) && !empty($filterData)) {
foreach ($filters as $filter) {
if (isset($filter['name']) && isset($filterData[$filter['name']])) {
$value = $filterData[$filter['name']];
if (!empty($value)) {
$conditions[$filter['name']] = $value;
}
}
}
}
$data = $usergroup->get($id);
$course_list_in = $usergroup->get_courses_by_usergroup($id, true);
$course_list = CourseManager::get_courses_list(0, 0, 'title', 'asc', -1, null, api_get_current_access_url_id(), false, $conditions);
$elements_not_in = $elements_in = array();
foreach ($course_list_in as $course) {
$elements_in[$course['id']] = $course['title'] . " (" . $course['visual_code'] . ")";
}
if (!empty($course_list)) {
foreach ($course_list as $item) {
$elements_not_in[$item['id']] = $item['title'] . " (" . $item['visual_code'] . ")";
}
}
$ajax_search = $add_type == 'unique' ? true : false;
//checking for extra field with filter on
function search($needle, $type)
{
global $elements_in;
示例3: indexAction
//.........这里部分代码省略.........
$columns = array('name', 'career', 'description', 'actions');
if (!in_array($sidx, $columns)) {
$sidx = 'name';
}
$result = Database::select('p.id,p.name, p.description, c.name as career, p.status', "{$obj->table} p LEFT JOIN " . Database::get_main_table(TABLE_CAREER) . " c ON c.id = p.career_id ", array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
$new_result = array();
foreach ($result as $item) {
if (!$item['status']) {
$item['name'] = '<font style="color:#AAA">' . $item['name'] . '</font>';
}
$new_result[] = $item;
}
$result = $new_result;
break;
case 'get_grade_models':
$columns = array('name', 'description', 'actions');
if (!in_array($sidx, $columns)) {
$sidx = 'name';
}
$result = Database::select('*', "{$obj->table} ", array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
$new_result = array();
foreach ($result as $item) {
$new_result[] = $item;
}
$result = $new_result;
break;
case 'get_usergroups':
$columns = array('name', 'users', 'courses', 'sessions', 'group_type', 'actions');
$result = Database::select('*', $obj->table, array('order' => "name {$sord}", 'LIMIT' => "{$start} , {$limit}"));
$new_result = array();
if (!empty($result)) {
foreach ($result as $group) {
$group['sessions'] = count($obj->get_sessions_by_usergroup($group['id']));
$group['courses'] = count($obj->get_courses_by_usergroup($group['id']));
$group['users'] = count($obj->get_users_by_usergroup($group['id']));
switch ($group['group_type']) {
case '0':
$group['group_type'] = Display::label(get_lang('Class'), 'info');
break;
case '1':
$group['group_type'] = Display::label(get_lang('Social'), 'success');
break;
}
$new_result[] = $group;
}
$result = $new_result;
}
$columns = array('name', 'users', 'courses', 'sessions', 'group_type');
if (!in_array($sidx, $columns)) {
$sidx = 'name';
}
//Multidimensional sort
ArrayClass::msort($result, $sidx);
break;
case 'get_extra_fields':
$obj = new \ExtraField($type);
$columns = array('field_display_text', 'field_variable', 'field_type', 'field_changeable', 'field_visible', 'field_filter', 'field_order');
$result = \Database::select('*', $obj->table, array('order' => "{$sidx} {$sord}", 'LIMIT' => "{$start} , {$limit}"));
$new_result = array();
if (!empty($result)) {
foreach ($result as $item) {
$item['field_type'] = $obj->get_field_type_by_id($item['field_type']);
$item['field_changeable'] = $item['field_changeable'] ? Display::return_icon('right.gif') : Display::return_icon('wrong.gif');
$item['field_visible'] = $item['field_visible'] ? Display::return_icon('right.gif') : Display::return_icon('wrong.gif');
$item['field_filter'] = $item['field_filter'] ? Display::return_icon('right.gif') : Display::return_icon('wrong.gif');
$new_result[] = $item;