$(function() { $().timelinr({ containerDiv: '#my_timeline', autoPlayPause: 2000 }) }); "; $pluginCalendar = api_get_plugin_setting('learning_calendar', 'enabled') === 'true'; if ($pluginCalendar) { $plugin = LearningCalendarPlugin::create(); $plugin->setJavaScript($htmlHeadXtra); } $user_id = api_get_user_id(); $courseUserList = CourseManager::get_courses_list_by_user_id($user_id); $dates = $issues = ''; $sessionId = isset($_GET['session_id']) ? (int) $_GET['session_id'] : 0; $courseCode = isset($_GET['course']) ? Security::remove_XSS($_GET['course']) : null; if (!empty($courseUserList)) { $items = MySpace::get_connections_from_course_list( $user_id, $courseUserList ); $first = null; $last = null; $last_item = count($items); $count = 1; foreach ($items as $result) { $login = $result['login']; $courseId = $result['c_id']; $courseInfo = api_get_course_info_by_id($courseId); if ($count == 1) { $first = ''.get_lang('First').''; } if ($count == $last_item) { $last = ''.get_lang('Last').''; } $course_info = api_get_course_info_by_id($result['c_id']); $course_image = ''; $dates .= '
  • '.api_convert_and_format_date($login, DATE_FORMAT_SHORT).'
  • '; $issues .= '
  • '; $issues .= '
    '.$course_image.'
    '; $issues .= '
    '; $issues .= '

    '.sprintf( get_lang('YouHaveEnteredTheCourseXInY'), '" '.$courseInfo['name'].' "', api_convert_and_format_date($login, DATE_TIME_FORMAT_LONG) ).'

    '; $issues .= '
    '; $issues .= '
  • '; $count++; } } $content = Tracking::show_user_progress($user_id, $sessionId); $content .= Tracking::show_course_detail($user_id, $courseCode, $sessionId); if (!empty($dates)) { if (!empty($content)) { $content .= ''; } $content .= Display::page_subheader(get_lang('Timeline')); $content .= '
    '; $content .= '
    '; $content .= '
    '; $content .= '
      '.$dates.'
    '; $content .= '
      '.$issues.'
    '; $content .= '
    '; $content .= '
    '; $content .= ''; $content .= ''; $content .= '
    '; } if (api_get_configuration_value('private_messages_about_user_visible_to_user') === true) { $allowMessages = api_get_configuration_value('private_messages_about_user'); if ($allowMessages === true) { // Messages $content .= Display::page_subheader2(get_lang('Messages')); $content .= MessageManager::getMessagesAboutUserToString(api_get_user_info()); } } $message = null; if (empty($content)) { $message = Display::return_message(get_lang('NoDataAvailable'), 'warning'); } $show = api_get_configuration_value('allow_career_users'); if ($show) { $careers = UserManager::getUserCareers($user_id); if (!empty($careers)) { $title = Display::page_subheader(get_lang('Careers'), null, 'h3', ['class' => 'section-title']); $table = new HTML_Table(['class' => 'data_table']); $table->setHeaderContents(0, 0, get_lang('Career')); $table->setHeaderContents(0, 1, get_lang('Diagram')); $row = 1; foreach ($careers as $careerData) { $table->setCellContents($row, 0, $careerData['name']); $url = api_get_path(WEB_CODE_PATH).'user/career_diagram.php?career_id='.$careerData['id']; $diagram = Display::url(get_lang('Diagram'), $url); $table->setCellContents($row, 1, $diagram); $row++; } $content = $title.$table->toHtml().$content; } } $tpl = new Template($nameTools); $tpl->assign('message', $message); $tpl->assign('content', $content); $tpl->display_one_col_template();