本文整理汇总了PHP中Display::tag方法的典型用法代码示例。如果您正苦于以下问题:PHP Display::tag方法的具体用法?PHP Display::tag怎么用?PHP Display::tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::tag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_thematic_plan_div
/**
* @param array $data
* @return array
*/
public function get_thematic_plan_div($data)
{
$final_return = array();
$uinfo = api_get_user_info();
foreach ($data as $thematic_id => $thematic_plan_data) {
$new_thematic_plan_data = array();
foreach ($thematic_plan_data as $thematic_item) {
$thematic_simple_list[] = $thematic_item['description_type'];
$new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item;
}
if (!empty($thematic_simple_list)) {
foreach ($thematic_simple_list as $item) {
$default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title'];
}
}
$no_data = true;
$session_star = '';
$return = '<div id="thematic_plan_' . $thematic_id . '">';
if (!empty($default_thematic_plan_title)) {
foreach ($default_thematic_plan_title as $id => $title) {
//avoid others
if ($title == 'Others' && empty($data[$thematic_id][$id]['description'])) {
continue;
}
if (!empty($data[$thematic_id][$id]['title']) && !empty($data[$thematic_id][$id]['description'])) {
if (api_is_allowed_to_edit(null, true)) {
if ($data[$thematic_id][$id]['session_id'] != 0) {
$session_star = api_get_session_image(api_get_session_id(), $uinfo['status']);
}
}
$return .= Display::tag('h3', Security::remove_XSS($data[$thematic_id][$id]['title'], STUDENT) . $session_star);
$return .= Security::remove_XSS($data[$thematic_id][$id]['description'], STUDENT);
$no_data = false;
}
}
}
if ($no_data) {
$return .= '<div><em>' . get_lang('StillDoNotHaveAThematicPlan') . '</em></div>';
}
$return .= '</div>';
$final_return[$thematic_id] = $return;
}
return $final_return;
}
示例2: get_question_type_for_question
/**
* Return the icon for the question type
* @author hubert.borderiou 13-10-2011
*/
function get_question_type_for_question($in_selectedcourse, $in_questionid)
{
$myObjQuestion = Question::read($in_questionid, $in_selectedcourse);
$questionType = null;
if (!empty($myObjQuestion)) {
list($typeImg, $typeExpl) = $myObjQuestion->get_type_icon_html();
$questionType = Display::tag('div', Display::return_icon($typeImg, $typeExpl, array(), 32), array());
unset($myObjQuestion);
}
return $questionType;
}
示例3: foreach
echo '</td>';
echo '</tr>';
if (!empty($sessions)) {
foreach ($sessions as $session) {
$course_list = $session['courses'];
$url = Display::url($session['data']['name'], '../session/resume_session.php?id_session=' . $session['data']['id']);
echo '<tr>';
//Session name
echo Display::tag('td', $url);
echo '<td>';
//Courses
echo '<table>';
if (!empty($course_list)) {
foreach ($course_list as $course) {
echo '<tr>';
$url = Display::url($course['title'], api_get_path(WEB_COURSE_PATH) . $course['directory'] . '/index.php?id_session=' . $session['data']['id']);
echo Display::tag('td', $url);
echo '</tr>';
}
echo '</table>';
echo '</td>';
echo '</tr>';
}
}
}
}
}
}
}
echo '</table>';
Display::display_footer();
示例4: getPageNumberItem
/**
* Get li HTML of page number
* @param $pageNumber
* @param $pageLength
* @param array $liAttributes
* @param string $content
* @return string
*/
function getPageNumberItem($pageNumber, $pageLength, $liAttributes = array(), $content = '')
{
// Get page URL
$url = self::getCourseCategoryUrl($pageNumber, $pageLength);
// If is current page ('active' class) clear URL
if (isset($liAttributes) && is_array($liAttributes) && isset($liAttributes['class'])) {
if (strpos('active', $liAttributes['class']) !== false) {
$url = '';
}
}
$content = !empty($content) ? $content : $pageNumber;
return Display::tag('li', Display::url($content, $url), $liAttributes);
}
示例5: getOverview
/**
* @param int $courseId
* @param string $keyword
* @return string
*/
public static function getOverview($courseId, $keyword = null)
{
$content = null;
$categories = GroupManager::get_categories();
if (!empty($categories)) {
foreach ($categories as $category) {
if (api_get_setting('allow_group_categories') == 'true') {
$content .= '<h2>' . $category['title'] . '</h2>';
}
if (!empty($keyword)) {
$groups = GroupManager::getGroupListFilterByName($keyword, $category['id'], $courseId);
} else {
$groups = GroupManager::get_group_list($category['id']);
}
$content .= '<ul>';
if (!empty($groups)) {
foreach ($groups as $group) {
$content .= '<li>';
$content .= Display::tag('h3', Security::remove_XSS($group['name']));
$users = GroupManager::getTutors($group['id']);
if (!empty($users)) {
$content .= '<ul>';
$content .= "<li>" . Display::tag('h4', get_lang('Tutors')) . "</li><ul>";
foreach ($users as $user) {
$user_info = api_get_user_info($user['user_id']);
$content .= '<li title="' . $user_info['username'] . '">' . $user_info['complete_name_with_username'] . '</li>';
}
$content .= '</ul>';
$content .= '</ul>';
}
$users = GroupManager::getStudents($group['id']);
if (!empty($users)) {
$content .= '<ul>';
$content .= "<li>" . Display::tag('h4', get_lang('Students')) . "</li><ul>";
foreach ($users as $user) {
$user_info = api_get_user_info($user['user_id']);
$content .= '<li title="' . $user_info['username'] . '">' . $user_info['complete_name_with_username'] . '</li>';
}
$content .= '</ul>';
$content .= '</ul>';
}
$content .= '</li>';
}
}
$content .= '</ul>';
}
}
return $content;
}
示例6: display_form_user_unsubscribe
/**
* Displays the form to register users in a blog (in a course)
* The listed users are users subcribed in the course.
* @author Toon Keppens
*
* @param Integer $blog_id
*
* @return Html Form with sortable table with users to unsubcribe from a blog.
*/
public static function display_form_user_unsubscribe($blog_id)
{
$_user = api_get_user_info();
$is_western_name_order = api_is_western_name_order();
// Init
$tbl_users = Database::get_main_table(TABLE_MAIN_USER);
$tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
echo '<legend>' . get_lang('UnsubscribeMembers') . '</legend>';
$properties["width"] = "100%";
//table column titles
$column_header[] = array('', false, '');
if ($is_western_name_order) {
$column_header[] = array(get_lang('FirstName'), true, '');
$column_header[] = array(get_lang('LastName'), true, '');
} else {
$column_header[] = array(get_lang('LastName'), true, '');
$column_header[] = array(get_lang('FirstName'), true, '');
}
$column_header[] = array(get_lang('Email'), false, '');
$column_header[] = array(get_lang('TaskManager'), true, '');
$column_header[] = array(get_lang('UnRegister'), false, '');
$course_id = api_get_course_int_id();
$sql = "SELECT user.user_id, user.lastname, user.firstname, user.email, user.username\n FROM {$tbl_users} user INNER JOIN {$tbl_blogs_rel_user} blogs_rel_user\n ON user.user_id = blogs_rel_user.user_id\n WHERE blogs_rel_user.c_id = {$course_id} AND blogs_rel_user.blog_id = '" . (int) $blog_id . "'";
if (!($sql_result = Database::query($sql))) {
return false;
}
$user_data = array();
while ($myrow = Database::fetch_array($sql_result)) {
$row = array();
$row[] = '<input type="checkbox" name="user[]" value="' . $myrow['user_id'] . '" ' . (isset($_GET['selectall']) && $_GET['selectall'] == "unsubscribe" ? ' checked="checked" ' : '') . '/>';
$username = api_htmlentities(sprintf(get_lang('LoginX'), $myrow["username"]), ENT_QUOTES);
if ($is_western_name_order) {
$row[] = $myrow["firstname"];
$row[] = Display::tag('span', $myrow["lastname"], array('title' => $username));
} else {
$row[] = Display::tag('span', $myrow["lastname"], array('title' => $username));
$row[] = $myrow["firstname"];
}
$row[] = Display::icon_mailto_link($myrow["email"]);
$sql = "SELECT bt.title task\n\t\t\t\t\tFROM " . Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER) . " btu\n\t\t\t\t\tINNER JOIN " . Database::get_course_table(TABLE_BLOGS_TASKS) . " bt\n\t\t\t\t\tON btu.task_id = bt.task_id\n\t\t\t\t\tWHERE \tbtu.c_id \t= {$course_id} AND\n\t\t\t\t\t\t\tbt.c_id \t= {$course_id} AND\n\t\t\t\t\t\t\tbtu.blog_id = {$blog_id} AND\n\t\t\t\t\t\t\tbtu.user_id = " . $myrow['user_id'];
$sql_res = Database::query($sql);
$task = '';
while ($r = Database::fetch_array($sql_res)) {
$task .= stripslashes($r['task']) . ', ';
}
//echo $task;
$task = api_strlen(trim($task)) != 0 ? api_substr($task, 0, api_strlen($task) - 2) : get_lang('Reader');
$row[] = $task;
//Link to register users
if ($myrow["user_id"] != $_user['user_id']) {
$row[] = "<a class=\"btn btn-primary\" href=\"" . api_get_self() . "?action=manage_members&blog_id={$blog_id}&unregister=yes&user_id=" . $myrow['user_id'] . "\">" . get_lang('UnRegister') . "</a>";
} else {
$row[] = '';
}
$user_data[] = $row;
}
$query_vars['action'] = 'manage_members';
$query_vars['blog_id'] = $blog_id;
echo '<form method="post" action="blog.php?action=manage_members&blog_id=' . $blog_id . '">';
Display::display_sortable_table($column_header, $user_data, null, null, $query_vars);
$link = '';
$link .= isset($_GET['action']) ? 'action=' . Security::remove_XSS($_GET['action']) . '&' : '';
$link .= "blog_id={$blog_id}&";
echo '<a href="blog.php?' . $link . 'selectall=unsubscribe">' . get_lang('SelectAll') . '</a> - ';
echo '<a href="blog.php?' . $link . '">' . get_lang('UnSelectAll') . '</a> ';
echo get_lang('WithSelected') . ' : ';
echo '<select name="action">';
echo '<option value="select_unsubscribe">' . get_lang('UnRegister') . '</option>';
echo '</select>';
echo '<input type="hidden" name="unregister" value="true" />';
echo '<button class="save" type="submit">' . get_lang('Ok') . '</button>';
echo '</form>';
}
示例7: list
list($typeImg, $typeExpl) = $objQuestionTmp->get_type_icon_html();
$questionType = Display::tag('div', Display::return_icon($typeImg, $typeExpl, array(), ICON_SIZE_MEDIUM), array('style' => $styleType));
// Question category
$txtQuestionCat = Security::remove_XSS(TestCategory::getCategoryNameForQuestion($objQuestionTmp->id));
if (empty($txtQuestionCat)) {
$txtQuestionCat = "-";
}
$questionCategory = Display::tag('div', '<a href="#" style="padding:0px; margin:0px;" title="' . $txtQuestionCat . '">' . cut($txtQuestionCat, 42) . '</a>', array('style' => $styleCat));
// Question level
$txtQuestionLevel = $objQuestionTmp->level;
if (empty($objQuestionTmp->level)) {
$txtQuestionLevel = '-';
}
$questionLevel = Display::tag('div', $txtQuestionLevel, array('style' => $styleLevel));
// Question score
$questionScore = Display::tag('div', $objQuestionTmp->selectWeighting(), array('style' => $styleScore));
echo '<div id="question_id_list_' . $id . '" >';
echo '<div class="header_operations">';
echo $questionName;
echo $questionType;
echo $questionCategory;
echo $questionLevel;
echo $questionScore;
echo $actions;
echo '</div>';
echo '<div class="question-list-description-block">';
echo '<p class="lead">' . get_lang($question_class) . '</p>';
//echo get_lang('Level').': '.$objQuestionTmp->selectLevel();
ExerciseLib::showQuestion($id, false, null, null, false, true, false, true, $objExercise->feedback_type, true);
echo '</div>';
echo '</div>';
示例8: api_get_path
* @package chamilo.plugin.buycourses
*/
/**
* Init
*/
require_once '../config.php';
require_once api_get_path(LIBRARY_PATH) . 'mail.lib.inc.php';
$language_file = array('course_description');
// Get the name of the database course.
$tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION);
$code = Database::escape_string($_GET['code']);
$course_info = api_get_course_info($code);
echo Display::tag('h2', $course_info['name']);
echo '<br />';
$sql = "SELECT * FROM $tbl_course_description
WHERE c_id = " . intval($course_info['real_id']) . "
AND session_id = 0 ORDER BY id";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
while ($description = Database::fetch_object($result)) {
$descriptions[$description->id] = $description;
}
// Function that displays the details of the course description in html.
echo CourseManager::get_details_course_description_html($descriptions, api_get_system_encoding(), false);
} else {
echo get_lang('NoDescription');
示例9: 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);
}
}
}
}
}
//.........这里部分代码省略.........
示例10: isset
echo $template->fetch('default/javascript/chat/start_video.tpl');
break;
case 'create_room':
$room = VideoChat::getChatRoomByUsers(api_get_user_id(), $to_user_id);
$createdRoom = false;
if ($room === false) {
$roomName = isset($_REQUEST['room_name']) ? Security::remove_XSS($_REQUEST['room_name']) : null;
if (VideoChat::nameExists($roomName)) {
echo Display::return_message(get_lang('TheVideoChatRoomXNameAlreadyExists'), 'error');
break;
}
$createdRoom = VideoChat::createRoom($roomName, api_get_user_id(), $to_user_id);
} else {
$roomName = $room['room_name'];
$createdRoom = true;
}
if ($createdRoom === false) {
echo Display::return_message(get_lang('ChatRoomNotCreated'), 'error');
break;
}
$videoChatLink = Display::url(Display::tag('i', null, ['class' => 'fa fa-video-camera']) . " " . get_lang('StartVideoChat'), api_get_path(WEB_LIBRARY_JS_PATH) . "chat/video.php?room={$roomName}");
$chat->send(api_get_user_id(), $to_user_id, $videoChatLink, false);
echo Display::tag('p', $videoChatLink, ['class' => 'lead']);
break;
case 'notify_not_support':
$chat->send(api_get_user_id(), $to_user_id, get_lang('TheXUserBrowserDoesNotSupportWebRTC'));
break;
default:
echo '';
}
exit;
示例11: array
}
$label_attributes = array();
$label_attributes['class'] = 'checkbox';
$label_attributes['for'] = $check_id;
$label_attributes['class'] = "checkbox";
$checkbox = Display::input('checkbox', 'remind_list[' . $questionId . ']', '', $attributes);
$url = 'exercise_submit.php?exerciseId=' . $objExercise->id . '&num=' . $counter . '&reminder=1';
$counter++;
if ($objExercise->type == ONE_PER_PAGE) {
$question_title = Display::url($counter . '. ' . cut($objQuestionTmp->selectTitle(), 40), $url);
$question_title = $counter . '. ' . cut($objQuestionTmp->selectTitle(), 40);
} else {
$question_title = $counter . '. ' . cut($objQuestionTmp->selectTitle(), 40);
}
//Check if the question doesn't have an answer
if (!in_array($questionId, $exercise_result)) {
$question_title = Display::label($question_title, 'warning');
}
$question_title = Display::tag('label', $checkbox . $question_title, $label_attributes);
$table .= Display::div($question_title, array('class' => 'exercise_reminder_item'));
}
// end foreach() block that loops over all questions
echo Display::div($table, array('class' => 'span10'));
$exercise_actions = Display::url(get_lang('EndTest'), 'javascript://', array('onclick' => 'final_submit();', 'class' => 'btn btn-warning'));
$exercise_actions .= ' ' . Display::url(get_lang('ReviewQuestions'), 'javascript://', array('onclick' => 'review_questions();', 'class' => 'btn btn-success'));
echo Display::div('', array('class' => 'clear'));
echo Display::div($exercise_actions, array('class' => 'form-actions'));
if ($origin != 'learnpath') {
// We are not in learnpath tool
Display::display_footer();
}
示例12: array
$result['id'],
$result['picture_uri'],
80
);
$result['picture_uri'] = '<img class="social-groups-image" src="' . $picture['file'] . '" hspace="4" height="50" border="2" align="left" width="50" />';
$item_0 = Display::div(
$result['picture_uri'],
array('class' => 'box_description_group_image')
);
$members = Display::span(
$count_users_group,
array('class' => 'box_description_group_member')
);
$item_1 = Display::div(
Display::tag('h3', $url_open . $name . $url_close) . $members,
array('class' => 'box_description_group_title')
);
if ($result['description'] != '') {
$item_3 = '<div class="box_description_group_content" >' . cut(
$result['description'],
100,
true
) . '</div>';
} else {
$item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2"></span></div>';
$item_3 = '<div class="box_description_group_content" ></div>';
}
$join_url = '';
示例13: displayCourses
/**
* @param int $user_id
* @param $filter
* @param bool $load_dirs
* @param int $getCount
* @param int $start
* @param null $maxPerPage
* @return null|string
*/
public static function displayCourses($user_id, $filter, $load_dirs, $getCount, $start = null, $maxPerPage = null)
{
// Table definitions
$TABLECOURS = Database::get_main_table(TABLE_MAIN_COURSE);
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLE_ACCESS_URL_REL_COURSE = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$current_url_id = api_get_current_access_url_id();
// Get course list auto-register
$special_course_list = self::get_special_course_list();
$without_special_courses = '';
if (!empty($special_course_list)) {
//$without_special_courses = ' AND course.code NOT IN ("'.implode('","',$special_course_list).'")';
}
$select = " SELECT DISTINCT\n course.id,\n course.title,\n course.code,\n course.subscribe subscr,\n course.unsubscribe unsubscr,\n course_rel_user.status status,\n course_rel_user.sort sort,\n course_rel_user.user_course_cat user_course_cat,\n course.id as real_id\n ";
$from = "{$TABLECOURS} course, {$TABLECOURSUSER} course_rel_user, {$TABLE_ACCESS_URL_REL_COURSE} url ";
$where = " course.id = course_rel_user.c_id AND\n url.c_id = course.id AND\n course_rel_user.user_id = '" . $user_id . "' AND\n course_rel_user.user_course_cat = 0\n ";
$order = " ORDER BY course_rel_user.user_course_cat, course_rel_user.sort ASC";
if ($getCount) {
$select = "SELECT count(course.id) as total";
}
$sql = "{$select} FROM {$from} WHERE {$where} {$without_special_courses} ";
// corresponding to the current URL.
if (api_get_multiple_access_url() && $current_url_id != -1) {
$sql .= " AND url.c_id = course.id AND access_url_id='" . $current_url_id . "'";
}
$sql .= $order;
if (isset($start) && isset($maxPerPage)) {
$start = intval($start);
$maxPerPage = intval($maxPerPage);
$limitCondition = " LIMIT {$start}, {$maxPerPage}";
$sql .= $limitCondition;
}
if ($getCount) {
$result = Database::query($sql);
$row = Database::fetch_array($result);
return $row['total'];
}
$result = Database::query($sql);
$html = null;
$course_list = array();
// Browse through all courses.
while ($course = Database::fetch_array($result)) {
$course_info = api_get_course_info($course['code']);
$course_info['id_session'] = null;
$course_info['status'] = $course['status'];
//In order to avoid doubles
if (in_array($course_info['real_id'], $course_list)) {
continue;
} else {
$course_list[] = $course_info['real_id'];
}
// For each course, get if there is any notification icon to show
// (something that would have changed since the user's last visit).
$show_notification = Display::show_notification($course_info);
// New code displaying the user's status in respect to this course.
$status_icon = Display::return_icon('blackboard.png', $course_info['title'], array(), ICON_SIZE_LARGE);
$params = array();
$params['right_actions'] = '';
if (api_is_platform_admin()) {
if ($load_dirs) {
$params['right_actions'] .= '<a id="document_preview_' . $course_info['real_id'] . '_0" 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'] .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>';
$params['right_actions'] .= Display::div('', array('id' => 'document_result_' . $course_info['real_id'] . '_0', 'class' => 'document_preview_container'));
} else {
$params['right_actions'] .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>';
}
if ($course_info['status'] == COURSEMANAGER) {
//echo Display::return_icon('teachers.gif', get_lang('Status').': '.get_lang('Teacher'), array('style'=>'width: 11px; height: 11px;'));
}
} else {
if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
if ($load_dirs) {
$params['right_actions'] .= '<a id="document_preview_' . $course_info['real_id'] . '_0" 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'] . '_0', 'class' => 'document_preview_container'));
} else {
if ($course_info['status'] == COURSEMANAGER) {
$params['right_actions'] .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>';
}
}
}
}
$course_title_url = '';
if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED || $course['status'] == COURSEMANAGER) {
//$course_title_url = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php?id_session=0';
$course_title_url = api_get_path(WEB_COURSE_PATH) . $course_info['code'] . '/index.php?id_session=0';
$course_title = Display::url($course_info['title'], $course_title_url);
} else {
$course_title = $course_info['title'] . " " . Display::tag('span', get_lang('CourseClosed'), array('class' => 'item_closed'));
}
// Start displaying the course block itself
if (api_get_setting('course.display_coursecode_in_courselist') == 'true') {
//.........这里部分代码省略.........
示例14: foreach
foreach ($thematic_plan_data as $thematic_item) {
$thematic_simple_list[] = $thematic_item['description_type'];
$new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item;
}
}
$new_id = ADD_THEMATIC_PLAN;
if (!empty($thematic_simple_list)) {
foreach ($thematic_simple_list as $item) {
if ($item >= ADD_THEMATIC_PLAN) {
$new_id = $item + 1;
$default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title'];
}
}
}
$i = 1;
echo Display::tag('h2', $thematic_data['title']);
echo $thematic_data['content'];
if ($message == 'ok') {
Display::display_normal_message(get_lang('ThematicSectionHasBeenCreatedSuccessfull'));
}
if ($action == 'thematic_plan_list') {
$form = new FormValidator('thematic_plan_add', 'POST', 'index.php?action=thematic_plan_list&thematic_id=' . $thematic_id . '&' . api_get_cidreq() . $param_gradebook, '', 'style="width: 100%;"');
$form->addElement('hidden', 'action', 'thematic_plan_add');
$form->addElement('hidden', 'thematic_plan_token', $token);
$form->addElement('hidden', 'thematic_id', $thematic_id);
foreach ($default_thematic_plan_title as $id => $title) {
$form->addElement('hidden', 'description_type[' . $id . ']', $id);
$form->add_textfield('title[' . $id . ']', get_lang('Title'), false, array('size' => '50'));
$form->add_html_editor('description[' . $id . ']', get_lang('Description'), false, false, array('ToolbarStartExpanded' => 'false', 'ToolbarSet' => 'TrainingDescription', 'Width' => '80%', 'Height' => '150'));
//$form->addElement('textarea', 'description['.$id.']', get_lang('Description'));
if (!empty($thematic_simple_list) && in_array($id, $thematic_simple_list)) {
示例15: print_recursive
function print_recursive($elements, $default_data, $default_content)
{
$return = '';
foreach ($elements as $key => $item) {
if (isset($item['load_data']) || empty($item['data'])) {
$item['data'] = $default_data[$item['load_data']];
$item['type'] = $default_content[$item['load_data']]['item_type'];
}
$sub_list = '';
if (isset($item['type']) && $item['type'] == 'dokeos_chapter') {
$sub_list = Display::tag('li', '', array('class' => 'sub_item empty'));
// empty value
}
if (empty($item['children'])) {
$sub_list = Display::tag('ul', $sub_list, array('id' => 'UL_' . $key, 'class' => 'record li_container'));
$active = null;
if (isset($_REQUEST['id']) && $key == $_REQUEST['id']) {
$active = 'active';
}
$return .= Display::tag('li', Display::div($item['data'], array('class' => "item_data {$active}")) . $sub_list, array('id' => $key, 'class' => 'record li_container'));
} else {
//sections
if (isset($item['children'])) {
$data = self::print_recursive($item['children'], $default_data, $default_content);
}
$sub_list = Display::tag('ul', $sub_list . $data, array('id' => 'UL_' . $key, 'class' => 'record li_container'));
$return .= Display::tag('li', Display::div($item['data'], array('class' => 'item_data')) . $sub_list, array('id' => $key, 'class' => 'record li_container'));
}
}
return $return;
}