本文整理汇总了PHP中CourseManager::get_coachs_from_course_to_string方法的典型用法代码示例。如果您正苦于以下问题:PHP CourseManager::get_coachs_from_course_to_string方法的具体用法?PHP CourseManager::get_coachs_from_course_to_string怎么用?PHP CourseManager::get_coachs_from_course_to_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CourseManager
的用法示例。
在下文中一共展示了CourseManager::get_coachs_from_course_to_string方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_lang
echo Display::page_subheader(
Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name']
);
}
$teacherList = CourseManager::get_teacher_list_from_course_code_to_string(
$courseInfo['code'],
',',
false
);
$coaches = null;
if (!empty($session_id)) {
$coaches = CourseManager::get_coachs_from_course_to_string(
$session_id,
$courseInfo['code'],
',',
false
);
}
if (!empty($teacherList)) {
echo Display::page_subheader2(get_lang('Teachers'));
echo $teacherList;
}
if (!empty($coaches)) {
echo Display::page_subheader2(get_lang('Coaches'));
echo $coaches;
}
$sessionList = SessionManager::get_session_by_course($courseInfo['code']);
示例2: get_logged_user_course_html
/**
* Display code for one specific course a logged in user is subscribed to.
* Shows a link to the course, what's new icons...
*
* $my_course['d'] - course directory
* $my_course['i'] - course title
* $my_course['c'] - visual course code
* $my_course['k'] - system course code
*
* @param array Course details
* @param integer Session ID
* @param string CSS class to apply to course entry
* @param boolean Whether the session is supposedly accessible now (not in the case it has passed and is in invisible/unaccessible mode)
* @param bool Whether to show the document quick-loader or not
* @return string The HTML to be printed for the course entry
*
* @version 1.0.3
* @todo refactor into different functions for database calls | logic | display
* @todo replace single-character $my_course['d'] indices
* @todo move code for what's new icons to a separate function to clear things up
* @todo add a parameter user_id so that it is possible to show the courselist of other users (=generalisation). This will prevent having to write a new function for this.
*/
public static function get_logged_user_course_html($course, $session_id = 0, $load_dirs = false)
{
$course_info = api_get_course_info_by_id($course['id']);
$course_info['id_session'] = $session_id;
// Display course entry.
// Show a link to the course, unless the course is closed and user is not course admin.
$session_url = '';
if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED || $course_info['user_status_in_course'] == COURSEMANAGER) {
$session_url = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?id_session=' . $course_info['id_session'];
$session_title = '<a href="' . api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?id_session=' . $course_info['id_session'] . '">' . $course_info['name'] . '</a>';
} else {
$session_title = $course_info['name'] . ' ' . Display::tag('span', get_lang('CourseClosed'), array('class' => 'item_closed'));
}
$params = array();
$params['icon'] = Display::return_icon('blackboard_blue.png', $course_info['name'], array(), ICON_SIZE_LARGE);
$params['link'] = $session_url;
$params['title'] = $session_title;
$params['right_actions'] = '';
if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
if ($load_dirs) {
$params['right_actions'] .= '<a id="document_preview_' . $course_info['real_id'] . '_' . $course_info['id_session'] . '" class="document_preview" href="javascript:void(0);">' . Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>';
$params['right_actions'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_' . $course_info['id_session'], 'class' => 'document_preview_container'));
}
}
if (api_get_setting('course.display_coursecode_in_courselist') == 'true') {
$session_title .= ' (' . $course_info['visual_code'] . ') ';
}
if (api_get_setting('course.display_teacher_in_courselist') == 'true') {
$teacher_list = CourseManager::get_teacher_list_from_course_code_to_string($course_info['real_id'], self::USER_SEPARATOR, true);
$course_coachs = CourseManager::get_coachs_from_course_to_string($course_info['id_session'], $course_info['real_id'], self::USER_SEPARATOR, true);
$params['teachers'] = $teacher_list;
$params['coaches'] = $course_coachs;
}
$session_title .= isset($course['special_course']) ? ' ' . Display::return_icon('klipper.png', get_lang('CourseAutoRegister')) : '';
// Display the "what's new" icons
if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
$session_title .= Display::show_notification($course_info);
}
$params['title'] = $session_title;
$params['extra'] = '';
$html = self::course_item_html($params, true);
return $html;
}
示例3: array
$form_search->addElement('hidden', 'session_id', $sessionId);
$form_search->addElement('hidden', 'id_session', $sessionId);
$form_search->addElement('text', 'user_keyword');
$form_search->addButtonSearch(get_lang('SearchUsers'));
echo Display::toolbarAction('toolbar-courselog', array(0 => $actionsLeft, 1 => $form_search->returnForm(), 2 => $actionsRight), 3);
$course_name = get_lang('Course') . ' ' . $courseInfo['name'];
if ($session_id) {
$titleSession = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL) . ' ' . api_get_session_name($session_id);
$titleCourse = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL) . ' ' . $course_name;
} else {
$titleSession = Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL) . ' ' . $courseInfo['name'];
}
$teacherList = CourseManager::getTeacherListFromCourseToString($courseInfo['real_id'], ',', false, true);
$coaches = null;
if (!empty($session_id)) {
$coaches = CourseManager::get_coachs_from_course_to_string($session_id, $courseInfo['real_id'], ',', false, true);
}
$html = '';
if (!empty($teacherList)) {
$html .= Display::page_subheader2(get_lang('Teachers'));
$html .= $teacherList;
}
if (!empty($coaches)) {
$html .= Display::page_subheader2(get_lang('Coaches'));
$html .= $coaches;
}
$sessionList = SessionManager::get_session_by_course($courseInfo['real_id']);
if (!empty($sessionList)) {
$html .= Display::page_subheader2(get_lang('SessionList'));
$iconCourse = Display::return_icon('course.png', null, null, ICON_SIZE_TINY);
$html .= '<ul class="session-list">';
示例4: get_logged_user_course_html
//.........这里部分代码省略.........
$session_title = '<a href="' . api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/?id_session=' . $course_info['id_session'] . '">' . $course_info['name'] . '</a>';
} else {
$session_title = $course_info['name'];
}
} else {
$session_url = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/';
$session_title = '<a href="' . api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/">' . $course_info['name'] . '</a>';
}
} else {
$session_title = $course_info['name'] . ' ' . Display::tag('span', get_lang('CourseClosed'), array('class' => 'item_closed'));
}
} else {
$session_title = $course_info['name'];
}
$params = array();
$params['icon'] = Display::return_icon('blackboard_blue.png', api_htmlentities($course_info['name']), array(), ICON_SIZE_LARGE);
$showCustomIcon = api_get_configuration_value('course_images_in_courses_list');
$iconName = basename($course_info['course_image']);
if ($showCustomIcon && $iconName != 'course.png') {
$params['icon'] = Display::img($course_info['course_image'], api_htmlentities($course_info['name']), array());
}
$params['link'] = $session_url;
$params['title'] = $session_title;
$params['right_actions'] = '';
if ($course_visibility != COURSE_VISIBILITY_CLOSED && $course_visibility != COURSE_VISIBILITY_HIDDEN) {
if ($load_dirs) {
$params['right_actions'] .= '<a id="document_preview_' . $course_info['real_id'] . '_' . $course_info['id_session'] . '" class="document_preview" href="javascript:void(0);">' . Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>';
$params['right_actions'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_' . $course_info['id_session'], 'class' => 'document_preview_container'));
}
}
if (api_get_setting('display_coursecode_in_courselist') == 'true') {
$session_title .= ' (' . $course_info['visual_code'] . ') ';
}
if (api_get_setting('display_teacher_in_courselist') == 'true') {
$teacher_list = null;
if (!$nosession) {
$teacher_list = CourseManager::get_teacher_list_from_course_code_to_string($course_info['code'], self::USER_SEPARATOR, true);
$course_coachs = CourseManager::get_coachs_from_course_to_string($course_info['id_session'], $course['code'], self::USER_SEPARATOR, true);
if ($course_info['status'] == COURSEMANAGER || $course_info['status'] == STUDENT && empty($course_info['id_session']) || empty($course_info['status'])) {
$params['teachers'] = $teacher_list;
}
if ($course_info['status'] == STUDENT && !empty($course_info['id_session']) || $is_coach && $course_info['status'] != COURSEMANAGER) {
$params['coaches'] = $course_coachs;
}
} else {
$params['teachers'] = $teacher_list;
}
}
$session_title .= isset($course['special_course']) ? ' ' . Display::return_icon('klipper.png', get_lang('CourseAutoRegister')) : '';
// Display the "what's new" icons
if ($course_visibility != COURSE_VISIBILITY_CLOSED && $course_visibility != COURSE_VISIBILITY_HIDDEN) {
$session_title .= Display::show_notification($course_info);
}
$params['title'] = $session_title;
$params['extra'] = '';
$html = self::course_item_html($params, true);
$session_category_id = null;
if (!$nosession) {
$session = '';
$active = false;
if (!empty($course_info['session_name'])) {
// Request for the name of the general coach
$sql = 'SELECT lastname, firstname,sc.name
FROM ' . $tbl_session . ' ts
LEFT JOIN ' . $main_user_table . ' tu
ON ts.id_coach = tu.user_id
INNER JOIN ' . $tbl_session_category . ' sc ON ts.session_category_id = sc.id
WHERE ts.id=' . (int) $course_info['id_session'] . ' LIMIT 1';
$rs = Database::query($sql);
$sessioncoach = Database::store_result($rs);
$sessioncoach = $sessioncoach[0];
$session = array();
$session['title'] = $course_info['session_name'];
$session_category_id = CourseManager::get_session_category_id_by_session_id($course_info['id_session']);
$session['category'] = $sessioncoach['name'];
if ($course_info['date_start'] == '0000-00-00') {
//$session['dates'] = get_lang('WithoutTimeLimits');
$session['dates'] = '';
if (api_get_setting('show_session_coach') === 'true') {
$session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name($sessioncoach['firstname'], $sessioncoach['lastname']);
}
$active = true;
} else {
$session['dates'] = ' - ' . get_lang('From') . ' ' . $course_info['date_start'] . ' ' . get_lang('To') . ' ' . $course_info['date_end'];
if (api_get_setting('show_session_coach') === 'true') {
$session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name($sessioncoach['firstname'], $sessioncoach['lastname']);
}
$active = $date_start <= $now && $date_end >= $now;
}
}
$user_course_category = '';
if (isset($course_info['user_course_cat'])) {
$user_course_category = $course_info['user_course_cat'];
}
$output = array($user_course_category, $html, $course_info['id_session'], $session, 'active' => $active, 'session_category_id' => $session_category_id);
} else {
$output = array($course_info['user_course_cat'], $html);
}
return $output;
}