本文整理汇总了PHP中CourseManager::is_course_teacher方法的典型用法代码示例。如果您正苦于以下问题:PHP CourseManager::is_course_teacher方法的具体用法?PHP CourseManager::is_course_teacher怎么用?PHP CourseManager::is_course_teacher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CourseManager
的用法示例。
在下文中一共展示了CourseManager::is_course_teacher方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_visibility_tree
/**
* @param int $doc_id
* @param string $course_code
* @param int $session_id
* @param int $user_id
* @param int $groupId
* @return bool
*/
public static function check_visibility_tree($doc_id, $course_code, $session_id, $user_id, $groupId = 0)
{
$document_data = self::get_document_data_by_id($doc_id, $course_code, null, $session_id);
if ($session_id != 0 && !$document_data) {
$document_data = self::get_document_data_by_id($doc_id, $course_code, null, 0);
}
if (!empty($document_data)) {
// If admin or course teacher, allow anyway
if (api_is_platform_admin() || CourseManager::is_course_teacher($user_id, $course_code)) {
return true;
}
$course_info = api_get_course_info($course_code);
if ($document_data['parent_id'] == false || empty($document_data['parent_id'])) {
if (!empty($groupId)) {
return true;
}
$visible = self::is_visible_by_id($doc_id, $course_info, $session_id, $user_id);
return $visible;
} else {
$visible = self::is_visible_by_id($doc_id, $course_info, $session_id, $user_id);
if (!$visible) {
return false;
} else {
return self::check_visibility_tree($document_data['parent_id'], $course_code, $session_id, $user_id, $groupId);
}
}
} else {
return false;
}
}
示例2: get_lang
<div class="title"><?php
echo get_lang('Users');
?>
<?php
echo get_lang('Connected');
?>
</div>
<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
<div class="viewport"><div id="hidden" class="overview">
<ul class="profile list-group">
<?php
foreach ($users as &$user) {
if (empty($session_id)) {
$status = $user['status'];
} else {
$status = CourseManager::is_course_teacher($user['user_id'], api_get_course_id()) ? 1 : 5;
}
$fileUrl = UserManager::getUserPicture($user['user_id'], USER_IMAGE_SIZE_MEDIUM);
$url_user_profile = api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $user['user_id'] . '&';
?>
<li class="list-group-item">
<img src="<?php
echo $fileUrl;
?>
" border="0" width="50" alt="" class="user-image-chat" />
<div class="user-name">
<a href="<?php
echo $url_user_profile;
?>
" target="_blank">
<?php
示例3: get_lang
if (!empty($content)) {
echo $content;
}
if (!empty($search_term)) {
echo "<p><strong>" . get_lang('SearchResultsFor') . " " . Security::remove_XSS($_POST['search_term']) . "</strong><br />";
}
$ajax_url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=add_course_vote';
$user_id = api_get_user_id();
if (!empty($browse_courses_in_category)) {
foreach ($browse_courses_in_category as $course) {
$course_hidden = $course['visibility'] == COURSE_VISIBILITY_HIDDEN;
if ($course_hidden) {
continue;
}
$user_registerd_in_course = CourseManager::is_user_subscribed_in_course($user_id, $course['code']);
$user_registerd_in_course_as_teacher = CourseManager::is_course_teacher($user_id, $course['code']);
$user_registerd_in_course_as_student = $user_registerd_in_course && !$user_registerd_in_course_as_teacher;
$course_public = $course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD;
$course_open = $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM;
$course_private = $course['visibility'] == COURSE_VISIBILITY_REGISTERED;
$course_closed = $course['visibility'] == COURSE_VISIBILITY_CLOSED;
$course_subscribe_allowed = $course['subscribe'] == 1;
$course_unsubscribe_allowed = $course['unsubscribe'] == 1;
$count_connections = $course['count_connections'];
$creation_date = substr($course['creation_date'], 0, 10);
$icon_title = null;
$html = null;
// display the course bloc
$html .= '<div class="col-md-3"><div class="items-course">';
// display thumbnail
$html .= return_thumbnail($course, $icon_title);
示例4: get_lang
$clean_users[] = $user_id;
} else {
$invalid_users[] = $user_data;
}
}
if (empty($invalid_users)) {
$type = 'confirmation';
$message = get_lang('ListOfUsersSubscribedToCourse');
if ($unsubscribe_users) {
$current_user_list = CourseManager::get_user_list_from_course_code($course_code, $session_id);
if (!empty($current_user_list)) {
$user_ids = array();
foreach ($current_user_list as $user) {
if (!CourseManager::is_course_teacher($user['user_id'], $course_code)) {
$user_ids[]= $user['user_id'];
}
}
CourseManager::unsubscribe_user($user_ids, $course_code, $session_id);
}
}
foreach ($clean_users as $userId) {
$userInfo = api_get_user_info($userId);
CourseManager::subscribe_user($userId, $course_code, STUDENT, $session_id);
if (empty($session_id)) {
//just to make sure
if (CourseManager :: is_user_subscribed_in_course($userId, $course_code)) {
$user_to_show[]= $userInfo['complete_name'];
}
示例5: 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;
}
示例6: api_get_path
include_once api_get_path(LIBRARY_PATH) . 'course.lib.php';
include_once api_get_path(LIBRARY_PATH) . 'usermanager.lib.php';
require_once 'scorm_cloud.lib.php';
$this_section = "session_my_space";
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
if ($export_csv) {
ob_start();
}
$csv_content = array();
$user_id = intval($_GET['student_id']);
if (isset($_GET['course'])) {
$cidReq = Security::remove_XSS($_GET['course']);
}
$user_infos = UserManager::get_user_info_by_id($user_id);
$name = $user_infos['firstname'] . ' ' . $user_infos['lastname'];
if (!api_is_platform_admin(true) && !CourseManager::is_course_teacher($_user['user_id'], $cidReq) && !Tracking::is_allowed_to_coach_student($_user['user_id'], $_GET['student_id']) && $user_infos['hr_dept_id'] !== $_user['user_id']) {
Display::display_header('');
api_not_allowed();
Display::display_footer();
}
$course_exits = CourseManager::course_exists($cidReq);
if (!empty($course_exits)) {
$_course = CourseManager::get_course_information($cidReq);
} else {
api_not_allowed();
}
$_course['dbNameGlu'] = $_configuration['table_prefix'] . $_course['db_name'] . $_configuration['db_glue'];
$lp_id = intval($_GET['lp_id']);
$lp_view_id = cloud_getLpViewId($cidReq, $lp_id, $user_id);
$regid = cloud_getRegId($cidReq, $lp_view_id);
$interbreadcrumb[] = array("url" => api_get_path(WEB_COURSE_PATH) . $_course['directory'], 'name' => $_course['title']);
示例7: get_lang
<div class="title"><?php
echo get_lang('Users');
?>
<?php
echo get_lang('Connected');
?>
</div>
<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
<div class="viewport"><div id="hidden" class="overview">
<ul class="profile list-group">
<?php
foreach ($users as &$user) {
if (empty($session_id)) {
$status = $user['status'];
} else {
$status = CourseManager::is_course_teacher($user['user_id'], $_SESSION['_course']['id']) ? 1 : 5;
}
$userImage = UserManager::get_user_picture_path_by_id($user['user_id'], 'web', false, true);
if (substr($userImage['file'], 0, 7) != 'unknown') {
$fileUrl = $userImage['dir'] . 'medium_' . $userImage['file'];
} else {
$fileUrl = $userImage['dir'] . $userImage['file'];
}
$email = $user['email'];
$url_user_profile = api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $user['user_id'] . '&';
?>
<li class="list-group-item">
<img src="<?php
echo $fileUrl;
?>
" border="0" width="50" alt="" class="user-image-chat" />
示例8: isset
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
$user_id = isset($_GET['student_id']) ? intval($_GET['student_id']) : api_get_user_id();
$courseCode = isset($_GET['course']) ? Security::remove_XSS($_GET['course']) : api_get_course_id();
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null;
$lp_id = intval($_GET['lp_id']);
$csv_content = array();
$course_info = api_get_course_info($courseCode);
if (empty($course_info) || empty($lp_id)) {
api_not_allowed();
}
$userInfo = api_get_user_info($user_id);
$name = $userInfo['complete_name'];
if (!api_is_platform_admin(true) &&
!CourseManager :: is_course_teacher(api_get_user_id(), $courseCode) &&
!Tracking :: is_allowed_to_coach_student(api_get_user_id(), $user_id) && !api_is_drh() && !api_is_course_tutor()) {
api_not_allowed();
}
if ($origin == 'user_course') {
$interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_info['directory'], 'name' => $course_info['name']);
$interbreadcrumb[] = array ("url" => "../user/user.php?cidReq=".$courseCode, "name" => get_lang("Users"));
} else if($origin == 'tracking_course') {
$interbreadcrumb[] = array ("url" => "../tracking/courseLog.php?cidReq=".$courseCode.'&id_session='.$session_id, "name" => get_lang("Tracking"));
} else {
$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
$interbreadcrumb[] = array ("url" => "student.php", "name" => get_lang("MyStudents"));
$interbreadcrumb[] = array ("url" => "myStudents.php?student=".$user_id, "name" => get_lang("StudentDetails"));
$nameTools=get_lang("DetailsStudentInCourse");
}
示例9: api_get_path
}
require_once api_get_path(SYS_CODE_PATH) . 'newscorm/learnpath.class.php';
require_once api_get_path(SYS_CODE_PATH) . 'newscorm/learnpathItem.class.php';
$session_id = isset($_REQUEST['id_session']) && !empty($_REQUEST['id_session']) ? intval($_REQUEST['id_session']) : api_get_session_id();
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
if ($export_csv) {
ob_start();
}
$csv_content = array();
$user_id = intval($_GET['student_id']);
if (isset($_GET['course'])) {
$cidReq = Security::remove_XSS($_GET['course']);
}
$user_infos = UserManager::get_user_info_by_id($user_id);
$name = api_get_person_name($user_infos['firstname'], $user_infos['lastname']);
if (!api_is_platform_admin(true) && !CourseManager::is_course_teacher(api_get_user_id(), api_get_course_int_id()) && !Tracking::is_allowed_to_coach_student(api_get_user_id(), $_GET['student_id']) && !api_is_drh() && !api_is_course_tutor()) {
api_not_allowed();
}
$course_exits = CourseManager::course_exists($cidReq);
if (!empty($course_exits)) {
$course_info = api_get_course_info($cidReq);
} else {
api_not_allowed();
}
if (!empty($_GET['origin']) && $_GET['origin'] == 'user_course') {
$interbreadcrumb[] = array("url" => api_get_path(WEB_COURSE_PATH) . $course_info['directory'], 'name' => $course_info['name']);
$interbreadcrumb[] = array("url" => "../user/user.php?cidReq=" . $cidReq, "name" => get_lang("Users"));
} else {
if (!empty($_GET['origin']) && $_GET['origin'] == 'tracking_course') {
$interbreadcrumb[] = array("url" => "../tracking/courseLog.php?cidReq=" . $cidReq . '&id_session=' . $session_id, "name" => get_lang("Tracking"));
} else {
示例10: isset
$this_section = SECTION_COURSES;
}
$session_id = isset($_REQUEST['id_session']) && !empty($_REQUEST['id_session']) ? intval($_REQUEST['id_session']) : api_get_session_id();
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
$user_id = isset($_GET['student_id']) ? intval($_GET['student_id']) : api_get_user_id();
$courseCode = isset($_GET['course']) ? Security::remove_XSS($_GET['course']) : api_get_course_id();
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null;
$lp_id = intval($_GET['lp_id']);
$csv_content = array();
$course_info = api_get_course_info($courseCode);
if (empty($course_info) || empty($lp_id)) {
api_not_allowed();
}
$userInfo = api_get_user_info($user_id);
$name = $userInfo['complete_name'];
if (!api_is_platform_admin(true) && !CourseManager::is_course_teacher(api_get_user_id(), $courseCode) && !Tracking::is_allowed_to_coach_student(api_get_user_id(), $user_id) && !api_is_drh() && !api_is_course_tutor()) {
api_not_allowed();
}
if ($origin == 'user_course') {
$interbreadcrumb[] = array("url" => api_get_path(WEB_COURSE_PATH) . $course_info['directory'], 'name' => $course_info['name']);
$interbreadcrumb[] = array("url" => "../user/user.php?cidReq=" . $courseCode, "name" => get_lang("Users"));
} else {
if ($origin == 'tracking_course') {
$interbreadcrumb[] = array("url" => "../tracking/courseLog.php?cidReq=" . $courseCode . '&id_session=' . $session_id, "name" => get_lang("Tracking"));
} else {
$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace'));
$interbreadcrumb[] = array("url" => "student.php", "name" => get_lang("MyStudents"));
$interbreadcrumb[] = array("url" => "myStudents.php?student=" . $user_id, "name" => get_lang("StudentDetails"));
$nameTools = get_lang("DetailsStudentInCourse");
}
}