本文整理汇总了PHP中CourseManager::course_item_html方法的典型用法代码示例。如果您正苦于以下问题:PHP CourseManager::course_item_html方法的具体用法?PHP CourseManager::course_item_html怎么用?PHP CourseManager::course_item_html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CourseManager
的用法示例。
在下文中一共展示了CourseManager::course_item_html方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: return_courses_and_sessions
//.........这里部分代码省略.........
$extra_info .= isset($session_box['duration']) ? ' '.$session_box['duration'] : null;
if (api_is_drh()) {
$session_link = $session_box['title'];
$params['link'] = null;
} else {
$session_link = Display::tag(
'a',
$session_box['title'],
array(
'href' => api_get_path(
WEB_CODE_PATH
) . 'session/index.php?session_id=' . $session_id
)
);
$params['link'] = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$session_id;
}
$params['title'] = $session_link;
$params['subtitle'] = $extra_info;
$params['right_actions'] = '';
if (api_is_platform_admin()) {
$params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'admin/resume_session.php?id_session='.$session_id.'">';
$params['right_actions'] .= Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>';
}
if (api_get_setting('hide_courses_in_sessions') == 'false') {
// $params['extra'] .= $html_courses_session;
}
$params['description'] = isset($session_box['description']) ? $session_box['description'] : null;
$parentInfo = CourseManager::course_item_html($params, true);
if (isset($_configuration['show_simple_session_info']) &&
$_configuration['show_simple_session_info']
) {
$params['title'] = $session_box['title'];
$parentInfo = CourseManager::course_item_html_no_icon($params);
}
$sessions_with_no_category .= CourseManager::course_item_parent(
$parentInfo,
$html_courses_session
);
}
}
} else {
// All sessions included in
$count_courses_session = 0;
$html_sessions = '';
if (isset($session_category['sessions'])) {
foreach ($session_category['sessions'] as $session) {
$session_id = $session['session_id'];
// Don't show empty sessions.
if (count($session['courses']) < 1) {
continue;
}
$date_session_start = $session['date_start'];
$date_session_end = $session['date_end'];
$days_access_before_beginning = $session['nb_days_access_before_beginning'];
$days_access_after_end = $session['nb_days_access_after_end'];
$session_now = time();
$html_courses_session = '';
示例2: returnSessions
/**
* @param int $user_id
* @param string $filter current|history
* @param int $page
* @return bool|null|string
*/
public function returnSessions($user_id, $filter, $page)
{
if (empty($user_id)) {
return false;
}
$app = $this->app;
$loadHistory = isset($filter) && $filter == 'history' ? true : false;
$app['session_menu'] = function ($app) use($loadHistory) {
$menu = $app['knp_menu.factory']->createItem('root', array('childrenAttributes' => array('class' => 'nav nav-tabs', 'currentClass' => 'active')));
$current = $menu->addChild(get_lang('Current'), array('route' => 'userportal', 'routeParameters' => array('filter' => 'current', 'type' => 'sessions')));
$history = $menu->addChild(get_lang('HistoryTrainingSession'), array('route' => 'userportal', 'routeParameters' => array('filter' => 'history', 'type' => 'sessions')));
//@todo use URIVoter
if ($loadHistory) {
$history->setCurrent(true);
} else {
$current->setCurrent(true);
}
return $menu;
};
//@todo move this in template
$app['knp_menu.menus'] = array('actions_menu' => 'session_menu');
$start = ($page - 1) * $this->maxPerPage;
if ($loadHistory) {
// Load sessions in category in *history*.
$nbResults = (int) UserManager::get_sessions_by_category($user_id, true, true, true, null, null, 'no_category');
$session_categories = UserManager::get_sessions_by_category($user_id, true, false, true, $start, $this->maxPerPage, 'no_category');
} else {
// Load sessions in category.
$nbResults = (int) UserManager::get_sessions_by_category($user_id, false, true, false, null, null, 'no_category');
$session_categories = UserManager::get_sessions_by_category($user_id, false, false, false, $start, $this->maxPerPage, 'no_category');
}
$html = null;
// Showing history title
if ($loadHistory) {
// $html .= Display::page_subheader(get_lang('HistoryTrainingSession'));
if (empty($session_categories)) {
$html .= get_lang('YouDoNotHaveAnySessionInItsHistory');
}
}
$load_directories_preview = api_get_setting('show_documents_preview') == 'true' ? true : false;
$sessions_with_no_category = $html;
if (isset($session_categories) && !empty($session_categories)) {
foreach ($session_categories as $session_category) {
$session_category_id = $session_category['session_category']['id'];
// Sessions does not belong to a session category
if ($session_category_id == 0) {
// Independent sessions
if (isset($session_category['sessions'])) {
foreach ($session_category['sessions'] as $session) {
$session_id = $session['session_id'];
// Don't show empty sessions.
if (count($session['courses']) < 1) {
continue;
}
$html_courses_session = '';
$count_courses_session = 0;
foreach ($session['courses'] as $course) {
//Read only and accessible
if (api_get_setting('hide_courses_in_sessions') == 'false') {
$html_courses_session .= CourseManager::get_logged_user_course_html($course, $session_id, $load_directories_preview);
}
$count_courses_session++;
}
if ($count_courses_session > 0) {
$params = array();
$params['icon'] = Display::return_icon('window_list.png', $session['session_name'], array('id' => 'session_img_' . $session_id), ICON_SIZE_LARGE);
$params['is_session'] = true;
//Default session name
$session_link = $session['session_name'];
$params['link'] = null;
if (api_get_setting('session_page_enabled') == 'true' && !api_is_drh()) {
//session name with link
$session_link = Display::tag('a', $session['session_name'], array('href' => api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . $session_id));
$params['link'] = api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . $session_id;
}
$params['title'] = $session_link;
$moved_status = SessionManager::get_session_change_user_reason($session['moved_status']);
$moved_status = isset($moved_status) && !empty($moved_status) ? ' (' . $moved_status . ')' : null;
$params['subtitle'] = isset($session['coach_info']) ? $session['coach_info']['complete_name'] : null . $moved_status;
$params['dates'] = $session['date_message'];
$params['right_actions'] = '';
if (api_is_platform_admin()) {
$params['right_actions'] .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'admin/resume_session.php?id_session=' . $session_id . '">';
$params['right_actions'] .= Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>';
}
if (api_get_setting('hide_courses_in_sessions') == 'false') {
// $params['extra'] .= $html_courses_session;
}
$sessions_with_no_category .= CourseManager::course_item_parent(CourseManager::course_item_html($params, true), $html_courses_session);
}
}
}
}
}
//.........这里部分代码省略.........
示例3: getHtmlNamedSessionCourseForCoach
/**
* Return HTML code for displaying session_course_for_coach
* @param $userId
* @return string
*/
public static function getHtmlNamedSessionCourseForCoach($userId)
{
$htmlRes = '';
$listInfo = self::getNamedSessionCourseForCoach($userId);
foreach ($listInfo as $i => $listCoursesInfo) {
$courseInfo = $listCoursesInfo['course'];
$courseCode = $listCoursesInfo['course']['code'];
$listParamsCourse = array();
$listParamsCourse['icon'] = '<div style="float:left">
<input style="border:none;" type="button" onclick="$(\'#course-' . $courseCode . '\').toggle(\'fast\')" value="+" /></div>' . Display::return_icon('blackboard.png', $courseInfo['title'], array(), ICON_SIZE_LARGE);
$listParamsCourse['link'] = '';
$listParamsCourse['title'] = Display::tag('a', $courseInfo['title'], array('href' => $listParamsCourse['link']));
$htmlCourse = '<div class="well" style="border-color:#27587D">' . CourseManager::course_item_html($listParamsCourse, true);
// for each category of session
$htmlCatSessions = '';
foreach ($listCoursesInfo['sessionCatList'] as $j => $listCatSessionsInfo) {
// we got an array of session categories
$catSessionId = $listCoursesInfo['sessionCatList'][$j]['catSessionId'];
$catSessionName = $listCoursesInfo['sessionCatList'][$j]['catSessionName'];
$listParamsCatSession['icon'] = Display::return_icon('folder_blue.png', $catSessionName, array(), ICON_SIZE_LARGE);
$listParamsCatSession['link'] = '';
$listParamsCatSession['title'] = $catSessionName;
$marginShift = 20;
if ($catSessionName != '') {
$htmlCatSessions .= '<div style="margin-left:' . $marginShift . 'px;">' . CourseManager::course_item_html($listParamsCatSession, true) . '</div>';
$marginShift = 40;
}
// for each sessions
$listCatSessionSessionList = $listCoursesInfo['sessionCatList'][$j]['sessionList'];
$htmlSession = '';
foreach ($listCatSessionSessionList as $k => $listSessionInfo) {
// we got an array of session info
$sessionId = $listSessionInfo['sessionId'];
$sessionName = $listSessionInfo['sessionName'];
$listParamsSession['icon'] = Display::return_icon('blackboard_blue.png', $sessionName, array(), ICON_SIZE_LARGE);
$listParamsSession['link'] = '';
$linkToCourseSession = $courseInfo['course_public_url'] . '?id_session=' . $sessionId;
$listParamsSession['title'] = $sessionName . '<div style="font-weight:normal; font-style:italic">
<a href="' . $linkToCourseSession . '">' . get_lang('GoToCourseInsideSession') . '</a>
</div>';
$htmlSession .= '<div style="margin-left:' . $marginShift . 'px;">' . CourseManager::course_item_html($listParamsSession, true) . '</div>';
}
$htmlCatSessions .= $htmlSession;
}
$htmlRes .= $htmlCourse . '<div style="display:none" id="course-' . $courseCode . '">' . $htmlCatSessions . '</div></div>';
}
return $htmlRes;
}