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


PHP CourseManager::is_user_subscribed_in_real_or_linked_course方法代码示例

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


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

示例1: api_get_path

$is_allowed = true;
/* Libraries */
require_once api_get_path(SYS_CODE_PATH) . 'resourcelinker/resourcelinker.inc.php';
require_once api_get_path(SYS_CODE_PATH) . 'exercice/hotpotatoes.lib.php';
/* Header */
/*
$interbreadcrumb[]= array ("url"=>"../group/group.php", "name"=> get_lang('BredCrumpGroups'));
$interbreadcrumb[]= array ("url"=>"../group/group_space.php?gidReq=$_gid", "name"=> get_lang('BredCrumpGroupSpace'));
*/
if ($uInfo) {
    $interbreadcrumb[] = array("url" => "../user/userInfo.php?uInfo={$uInfo}", "name" => get_lang('BredCrumpUsers'));
}
$nameTools = get_lang('ToolName');
/*	Constants and variables */
$is_allowedToTrack = $is_courseAdmin;
$is_course_member = CourseManager::is_user_subscribed_in_real_or_linked_course($user_id, $courseId);
// Database Table Definitions
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER);
$now = api_get_utc_datetime();
$sql = "SELECT 1\n        FROM {$tbl_session_course_user} AS session_course_user\n        INNER JOIN {$tbl_session} AS session\n            ON session_course_user.session_id = session.id\n            AND ((access_start_date <= '{$now}'\n            AND access_end_date >= '{$now}')\n            OR (access_start_date='0000-00-00' AND access_end_date='0000-00-00'))\n        WHERE session_id='" . $_SESSION['id_session'] . "' AND c_id = {$courseId}";
//echo $sql;
$result = Database::query($sql);
if (!Database::num_rows($result)) {
    $disabled = true;
}
$tbl_learnpath_main = Database::get_course_table(TABLE_LP_MAIN);
$tbl_learnpath_item = Database::get_course_table(TABLE_LP_ITEM);
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:userlogCSV.php

示例2: switch

 * User wants to unregister from this group
 */
if (!empty($_GET['selfUnReg']) && GroupManager::is_self_unregistration_allowed($user_id, $current_group['id'])) {
    GroupManager::unsubscribe_users($user_id, $current_group['id']);
    Display::display_normal_message(get_lang('StudentDeletesHimself'));
}
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case 'show_msg':
            Display::display_normal_message(Security::remove_XSS($_GET['msg']));
            break;
    }
}
/*	Main Display Area */
$course_code = api_get_course_id();
$is_course_member = CourseManager::is_user_subscribed_in_real_or_linked_course(api_get_user_id(), $course_code);
// Edit the group.
if (!empty($current_group['description'])) {
    echo '<p>' . Security::remove_XSS($current_group['description']) . '</p>';
}
/*
 * Group Tools
 */
// If the user is subscribed to the group or the user is a tutor of the group then
if (api_is_allowed_to_edit(false, true) or GroupManager::is_user_in_group(api_get_user_id(), $current_group['id'])) {
    $actions_array = array();
    // Link to the forum of this group
    $forums_of_groups = get_forums_of_group($current_group['id']);
    if (is_array($forums_of_groups)) {
        if ($current_group['forum_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
            foreach ($forums_of_groups as $key => $value) {
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:group_space.php


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