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


PHP CourseManager::get_tutor_in_course_status方法代码示例

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


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

示例1: api_detect_user_roles

/**
 * @param int $user_id
 * @param int $courseId
 * @param int $session_id
 * @return array
 */
function api_detect_user_roles($user_id, $courseId, $session_id = 0)
{
    $user_roles = array();
    /*$user_info = api_get_user_info($user_id);
      $user_roles[] = $user_info['status'];*/
    $courseInfo = api_get_course_info_by_id($courseId);
    $course_code = $courseInfo['code'];
    $url_id = api_get_current_access_url_id();
    if (api_is_platform_admin_by_id($user_id, $url_id)) {
        $user_roles[] = PLATFORM_ADMIN;
    }
    /*if (api_is_drh()) {
          $user_roles[] = DRH;
      }*/
    if (!empty($session_id)) {
        if (SessionManager::user_is_general_coach($user_id, $session_id)) {
            $user_roles[] = SESSION_GENERAL_COACH;
        }
    }
    if (!empty($course_code)) {
        if (empty($session_id)) {
            if (CourseManager::is_course_teacher($user_id, $course_code)) {
                $user_roles[] = COURSEMANAGER;
            }
            if (CourseManager::get_tutor_in_course_status($user_id, $course_code)) {
                $user_roles[] = COURSE_TUTOR;
            }
            if (CourseManager::is_user_subscribed_in_course($user_id, $course_code)) {
                $user_roles[] = COURSE_STUDENT;
            }
        } else {
            $user_status_in_session = SessionManager::get_user_status_in_course_session($user_id, $courseId, $session_id);
            if (!empty($user_status_in_session)) {
                if ($user_status_in_session == 0) {
                    $user_roles[] = SESSION_STUDENT;
                }
                if ($user_status_in_session == 2) {
                    $user_roles[] = SESSION_COURSE_COACH;
                }
            }
            /*if (api_is_course_session_coach($user_id, $course_code, $session_id)) {
                 $user_roles[] = SESSION_COURSE_COACH;
              }*/
        }
    }
    return $user_roles;
}
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:53,代码来源:api.lib.php

示例2: api_block_anonymous_users

<?php

/* For licensing terms, see /license.txt */
/**
 * Implements the tracking of students in the Reporting pages
 * @package chamilo.reporting
 */
//require_once '../inc/global.inc.php';
api_block_anonymous_users();
if (!api_is_allowed_to_create_course() && !api_is_session_admin() && !api_is_drh() && !api_is_student_boss()) {
    // Check if the user is tutor of the course
    $user_course_status = CourseManager::get_tutor_in_course_status(api_get_user_id(), api_get_course_id());
    if ($user_course_status != 1) {
        api_not_allowed(true);
    }
}
$alloAssignSkill = api_is_platform_admin(false, true);
$htmlHeadXtra[] = '<script>
function show_image(image,width,height) {
	width = parseInt(width) + 20;
	height = parseInt(height) + 20;
	window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
}
</script>';
$export = isset($_GET['export']) ? $_GET['export'] : false;
$sessionId = isset($_GET['id_session']) ? intval($_GET['id_session']) : 0;
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
if (empty($sessionId)) {
    $sessionId = api_get_session_id();
}
if ($export) {
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:myStudents.php


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