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


PHP CourseManager::get_course_list_as_coach方法代码示例

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


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

示例1: get_user_list_from_courses_as_coach

 /**
  * @param int $user_id
  * @param bool $include_sessions
  * @return array
  */
 public static function get_user_list_from_courses_as_coach($user_id, $include_sessions = true)
 {
     $students_in_courses = array();
     $sessions = CourseManager::get_course_list_as_coach($user_id, true);
     if (!empty($sessions)) {
         foreach ($sessions as $session_id => $courses) {
             if (!$include_sessions) {
                 if (!empty($session_id)) {
                     continue;
                 }
             }
             if (empty($session_id)) {
                 foreach ($courses as $course_code) {
                     $students_in_course = CourseManager::get_user_list_from_course_code($course_code);
                     foreach ($students_in_course as $user_item) {
                         //Only students
                         if ($user_item['status_rel'] == STUDENT) {
                             $students_in_courses[$user_item['user_id']] = $user_item['user_id'];
                         }
                     }
                 }
             } else {
                 $students_in_course = SessionManager::get_users_by_session($session_id, '0');
                 if (is_array($students_in_course)) {
                     foreach ($students_in_course as $user_item) {
                         $students_in_courses[$user_item['user_id']] = $user_item['user_id'];
                     }
                 }
             }
         }
     }
     $students = Tracking::get_student_followed_by_coach($user_id);
     if (!empty($students_in_courses)) {
         if (!empty($students)) {
             $students = array_merge($students, $students_in_courses);
         } else {
             $students = $students_in_courses;
         }
     }
     if (!empty($students)) {
         $students = array_unique($students);
     }
     return $students;
 }
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:49,代码来源:course.lib.php

示例2: get_lang

    echo Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "auth/my_progress.php");
}
// Actions menu
$nb_menu_items = count($menu_items);
if (empty($session_id)) {
    if ($nb_menu_items > 1) {
        foreach ($menu_items as $key => $item) {
            echo $item;
        }
    }
}
echo '</div>';
$sessions = array();
if (empty($session_id)) {
    // Getting courses followed by a coach (No session courses)
    $courses = CourseManager::get_course_list_as_coach($user_id, false);
    if (isset($courses[0])) {
        $courses = $courses[0];
    }
    //Getting students from courses and courses in sessions (To show the total students that the user follows)
    $students = CourseManager::get_user_list_from_courses_as_coach($user_id);
    // Sessions for the coach
    $sessions = SessionManager::get_sessions_coached_by_user($user_id);
    //If is drh
    if ($is_drh) {
        $students = array_keys(UserManager::get_users_followed_by_drh($user_id, STUDENT));
        $courses_of_the_platform = CourseManager::get_courses_followed_by_drh($user_id);
        foreach ($courses_of_the_platform as $course) {
            $courses[$course['real_id']] = $course['real_id'];
        }
        $sessions = SessionManager::get_sessions_followed_by_drh($user_id);
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:index.php


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