Beispiel #1
0
/**
 * Return course informations in <dt> and <dd> html tags.
 * Use it in a <dl> tag (description list).
 *
 * @param $course
 * @param $hot
 * @param $displayIconAccess
 * @return string
 * @deprecated use UserCourseList and CourseTreeView instead
 */
function render_course_in_dl_list($course, $hot = false, $displayIconAccess = true)
{
    $out = '';
    $classItem = $hot ? 'hot' : '';
    $langNameOfLang = get_locale('langNameOfLang');
    // Display a manager icon if the user is manager of the course
    $userStatusImg = isset($course['isCourseManager']) && $course['isCourseManager'] == 1 ? '&nbsp;&nbsp;<img class="qtip role" src="' . get_icon_url('manager') . '" alt="' . get_lang('You are manager of this course') . '" />' : '';
    // Show course language if not the same of the platform
    if (get_conf('platformLanguage') != $course['language'] || get_conf('showAlwaysLanguageInCourseList', false)) {
        $courseLanguageTxt = !empty($langNameOfLang[$course['language']]) ? ' &ndash; ' . claro_htmlspecialchars(ucfirst($langNameOfLang[$course['language']])) : ' &ndash; ' . claro_htmlspecialchars(ucfirst($course['language']));
    } else {
        $courseLanguageTxt = '';
    }
    // Display the course title following the platform configuration requirements
    $courseTitle = get_conf('course_order_by') == 'official_code' ? $course['officialCode'] . ' - ' . $course['title'] : $course['title'] . ' (' . $course['officialCode'] . ')';
    $url = get_path('url') . '/claroline/course/index.php?cid=' . claro_htmlspecialchars($course['sysCode']);
    // Display an icon following the course's access settings
    $iconUrl = $displayIconAccess ? get_course_access_icon($course['access']) : get_icon_url('course');
    // Display course's manager email
    $managerString = isset($course['email']) && claro_is_user_authenticated() ? '<a href="mailto:' . $course['email'] . '">' . $course['titular'] . '</a>' : $course['titular'] . $courseLanguageTxt;
    // Don't give a link to the course if the user is in pending state
    $isUserPending = isset($course['isPending']) && $course['isPending'] == 1 ? true : false;
    $courseLink = '<a href="' . claro_htmlspecialchars($url) . '">' . claro_htmlspecialchars($courseTitle) . '</a>' . $userStatusImg . "\n";
    if ($isUserPending) {
        $courseLink .= ' [' . get_lang('Pending registration') . ']' . "\n";
    }
    // Make a nice explicit sentence about the course's access
    if ($course['access'] == 'public') {
        $courseAccess = get_lang('Access allowed to anybody (even without login)');
    } elseif ($course['access'] == 'platform') {
        $courseAccess = get_lang('Access allowed only to platform members (user registered to the platform)');
    } elseif ($course['access'] == 'private') {
        $courseAccess = get_lang('Access allowed only to course members (people on the course user list)');
    } else {
        $courseAccess = $course['access'];
    }
    $out .= '<dt>' . "\n" . '<img class="qtip iconDefinitionList" src="' . $iconUrl . '" alt="' . $courseAccess . '" /> ' . '<span' . (!empty($classItem) ? ' class="' . $classItem . '"' : '') . '>' . $courseLink . '</span>' . "\n" . '</dt>' . "\n" . '<dd>' . "\n" . '<span class="managerString">' . $managerString . "</span>\n";
    if (!empty($course['sessionCourses'])) {
        $out .= '<dl>' . "\n";
        foreach ($course['sessionCourses'] as $sessionCourse) {
            $out .= render_course_in_dl_list($sessionCourse, $sessionCourse['hot']) . "\n";
        }
        $out .= '</dl>' . "\n";
    }
    $out .= '</dd>' . "\n\n";
    return $out;
}
Beispiel #2
0
<!-- $Id: user_course_list.tpl.php 14314 2012-11-07 09:09:19Z zefredz $ -->

<?php 
if (!empty($this->courseList)) {
    ?>
<dl class="courseList">
    <?php 
    foreach ($this->courseList as $course) {
        ?>
    <dt>
        <img
            class="access qtip"
            src="<?php 
        echo get_course_access_icon($course->access);
        ?>
"
            alt="<?php 
        echo claro_htmlspecialchars(get_course_access_mode_caption($course->access));
        ?>
" />
        
        <a href="<?php 
        echo claro_htmlspecialchars(get_path('url') . '/claroline/course/index.php?cid=' . $course->sysCode);
        ?>
">
            <?php 
        echo claro_htmlspecialchars($course->officialCode);
        ?>
            &ndash;
            <?php 
        echo claro_htmlspecialchars($course->name);
Beispiel #3
0
                $dialogBox->error(get_lang('Course manager cannot unsubscribe himself'));
                break;
            default:
                $dialogBox->error(get_lang('Unknow error during unsubscribing'));
        }
    }
}
$addToUrl = 'ulist' == $cfrom ? '&amp;cfrom=ulist' : '';
$sqlUserCourseList = prepare_sql_get_courses_of_a_user($uidToEdit);
$myPager = new claro_sql_pager($sqlUserCourseList, $offset, get_conf('coursePerPage', 20));
$myPager->set_sort_key($pagerSortKey, $pagerSortDir);
$userCourseList = $myPager->get_result_list();
$userCourseGrid = array();
foreach ($userCourseList as $courseKey => $course) {
    $userCourseGrid[$courseKey]['officialCode'] = $course['officialCode'];
    $iconUrl = get_course_access_icon($course['access']);
    $userCourseGrid[$courseKey]['name'] = '<img class="iconDefinitionList" src="' . $iconUrl . '" alt="" />' . '<a href="' . get_path('clarolineRepositoryWeb') . 'course/index.php?cid=' . claro_htmlspecialchars($course['sysCode']) . '">' . $course['name'] . '</a><br />' . $course['titular'];
    $userCourseGrid[$courseKey]['profileId'] = claro_get_profile_name($course['profileId']);
    if ($course['isCourseManager']) {
        $userCourseGrid[$courseKey]['isCourseManager'] = '<img class="qtip" src="' . get_icon_url('manager') . '" alt="' . get_lang('Course manager') . '" />';
    } else {
        $userCourseGrid[$courseKey]['isCourseManager'] = '<img class="qtip" src="' . get_icon_url('user') . '" alt="' . get_lang('Student') . '" />';
    }
    $userCourseGrid[$courseKey]['edit_course_user'] = '******' . $course['sysCode'] . '&amp;uidToEdit=' . $uidToEdit . '&amp;ccfrom=uclist">' . '<img src="' . get_icon_url('edit') . '" alt="' . get_lang('Course manager') . '" title="' . get_lang('User\'s course settings') . '" />' . '</a>';
    $userCourseGrid[$courseKey]['delete'] = '<a href="' . $_SERVER['PHP_SELF'] . '?uidToEdit=' . $uidToEdit . '&amp;cmd=unsubscribe' . $addToUrl . '&amp;courseId=' . claro_htmlspecialchars($course['sysCode']) . '&amp;sort=' . $pagerSortKey . '&amp;dir=' . $pagerSortDir . '&amp;offset=' . $offset . '"' . ' onclick="return ADMIN.confirmationUnReg(\'' . clean_str_for_javascript($userData['firstname'] . ' ' . $userData['lastname']) . '\');">' . "\n" . '<img src="' . get_icon_url('unenroll') . '" alt="' . get_lang('Delete') . '" />' . "\n" . '</a>' . "\n";
}
$sortUrlList = $myPager->get_sort_url_list($_SERVER['PHP_SELF'] . '?uidToEdit=' . $uidToEdit);
$userCourseDataGrid = new claro_datagrid();
$userCourseDataGrid->set_grid($userCourseGrid);
// extended setting for this datagrid
$userCourseDataGrid->set_colTitleList(array('officialCode' => '<a href="' . $sortUrlList['officialCode'] . '">' . get_lang('Course code') . '</a>', 'name' => '<a href="' . $sortUrlList['name'] . '">' . get_lang('Course title') . '</a>', 'profileId' => '<a href="' . $sortUrlList['profileId'] . '">' . get_lang('User profile') . '</a>', 'isCourseManager' => '<a href="' . $sortUrlList['isCourseManager'] . '">' . get_lang('Role') . '</a>', 'edit_course_user' => get_lang('Edit settings') . '</a>', 'delete' => get_lang('Unregister user')));
<!-- $Id: course_tree_node_deactivated.tpl.php 14314 2012-11-07 09:09:19Z zefredz $ -->

<dt class="deactivated<?php 
if (!empty($this->notifiedCourseList) && $this->notifiedCourseList->isCourseNotified($this->node->getCourse()->courseId)) {
    ?>
 hot<?php 
}
?>
">
    
    <!-- Access icon -->
    <img
        class="access qtip"
        src="<?php 
echo get_course_access_icon($this->node->getCourse()->access);
?>
"
        alt="<?php 
echo claro_htmlspecialchars(get_course_access_mode_caption($this->node->getCourse()->access));
?>
" />
    
    <?php 
if (!empty($this->courseUserPrivilegesList)) {
    ?>
        
        <!-- Enrolment/unenrolment icon -->
        <?php 
    /*
     * Display this link if: 
     * - The user isn't course member already
Beispiel #5
0
    ?>
<dl class="courseList">
    <?php 
    foreach ($this->courseList as $course) {
        ?>
    <dt<?php 
        if (isset($course['hot']) && $course['hot']) {
            ?>
 class="hot"<?php 
        }
        ?>
>
        <img
            class="access qtip"
            src="<?php 
        echo get_course_access_icon($course['access']);
        ?>
"
            alt="<?php 
        echo claro_htmlspecialchars(get_course_access_mode_caption($course['access']));
        ?>
" />
        
        <a href="<?php 
        echo claro_htmlspecialchars(get_path('url') . '/claroline/course/index.php?cid=' . $course['sysCode']);
        ?>
"
            <?php 
        if (!empty($course['hot']) && $course['hot']) {
            ?>
 class="hot"<?php