fixed - postit must be shown only inside course home, added link to thematic advance from user portal - partial CT#580

skala
Cristian Fasanando 16 years ago
parent b5f37d188c
commit e1fd5261da
  1. 53
      main/inc/introductionSection.inc.php
  2. 11
      user_portal.php

@ -162,31 +162,42 @@ if ($intro_dispForm) {
echo '</div>';
}
$course_description = new CourseDescription();
$course_description->set_session_id(api_get_session_id());
$thematic_description = $course_description->get_data_by_description_type(8);
$style_introduction_section = '';
$thematic_description_html = '';
if (!empty($thematic_description)) {
$thematic_advance = get_lang('ThematicAdvance').'&nbsp;'.$course_description->get_progress_porcent(false,8);
if (api_is_allowed_to_edit(null,true)) {
$thematic_advance = '<a href="'.api_get_path(WEB_CODE_PATH).'course_description/index.php?action=edit&'.api_get_cidreq().'&description_type=8'.'">'.get_lang('ThematicAdvance').'&nbsp;'.$course_description->get_progress_porcent(false,8).'</a>';
}
$thematic_description_html = '<td valign="top" width="260px"><div class="thematic-postit">
<div class="thematic-postit-top"><a class="thematic-postit-head" style="" href="#">'.Display::return_icon('postit_top.png').'</a></div>
<div class="thematic-postit-center">
<h3>'.$thematic_advance.'</h3>
'.$thematic_description['description_title'].'
<p>'.$thematic_description['description_content'].'</p>
</div>
<div class="thematic-postit-bottom">'.Display::return_icon('postit_bottom.png').'</div>
</div></td>';
if ($tool==TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$course_description = new CourseDescription();
$course_description->set_session_id(api_get_session_id());
$thematic_description = $course_description->get_data_by_description_type(8);
if (!empty($thematic_description)) {
$style_introduction_section = 'style="width:70%;float:left;margin-left:80px;"';
$thematic_advance = get_lang('ThematicAdvance').'&nbsp;'.$course_description->get_progress_porcent(false,8);
if (api_is_allowed_to_edit(null,true)) {
$thematic_advance = '<a href="'.api_get_path(WEB_CODE_PATH).'course_description/index.php?action=edit&'.api_get_cidreq().'&description_type=8'.'">'.get_lang('ThematicAdvance').'&nbsp;'.$course_description->get_progress_porcent(false,8).'</a>';
}
$thematic_description_html = '<div style="width:20%;float:left;font-size:10pt;"><div class="thematic-postit">
<div class="thematic-postit-top"><a class="thematic-postit-head" style="" href="#">'.Display::return_icon('postit_top.png').'</a></div>
<div class="thematic-postit-center">
<h3>'.$thematic_advance.'</h3>
'.$thematic_description['description_title'].'
<p>'.$thematic_description['description_content'].'</p>
</div>
<div class="thematic-postit-bottom">'.Display::return_icon('postit_bottom.png').'</div>
</div></div>';
}
}
echo '<div '.$style_introduction_section.'>';
if ($intro_dispDefault) {
//$intro_content = make_clickable($intro_content); // make url in text clickable
$intro_content = text_filter($intro_content); // parse [tex] codes
if (!empty($intro_content) || !empty($thematic_description_html)) {
echo "<table align='center' style='width: 80%;'><tr><td>$intro_content</td>$thematic_description_html</tr></table>";
echo "<table><tr><td>$intro_content</td></tr></table>";
}
}
@ -219,4 +230,10 @@ if ($intro_dispCommand) {
}
}
echo '</div>';
echo $thematic_description_html;
echo '<div class="clear"></div>';
?>

@ -268,6 +268,7 @@ function get_personal_course_list($user_id) {
function display_special_courses ($user_id) {
$user_id = intval($user_id);
$user_info = api_get_user_info($user_id);
$special_course_list = array();
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
@ -326,7 +327,7 @@ function display_special_courses ($user_id) {
if (($course['status'] == 5 && !api_is_coach()) || empty($course['status'])) {
$status_icon=Display::return_icon('course.gif', get_lang('Course')).' '.Display::return_icon('students.gif', get_lang('Status').': '.get_lang('Student'),array('style'=>'width:11px; height:11px'));
}
$progress_thematic_icon = get_thematic_progress_icon($course['db_name']);
$progress_thematic_icon = '<a href="'.api_get_path(WEB_CODE_PATH).'course_description/index.php?action=edit&cidReq='.$course['code'].'&description_type=8'.'">'.get_thematic_progress_icon($course['db_name']).'</a>';
echo "\t<tr>\n";
echo "\t\t<td>\n";
@ -462,7 +463,7 @@ function display_courses_in_category($user_category_id) {
if (($course['status'] == STUDENT && !api_is_coach()) || empty($course['status'])) {
$status_icon=Display::return_icon('course.gif', get_lang('Course')).' '.Display::return_icon('students.gif', get_lang('Status').': '.get_lang('Student'),array('style'=>'width:11px; height:11px'));
}
$progress_thematic_icon = get_thematic_progress_icon($course['db_name']);
$progress_thematic_icon = '<a href="'.api_get_path(WEB_CODE_PATH).'course_description/index.php?action=edit&cidReq='.$course['code'].'&description_type=8'.'">'.get_thematic_progress_icon($course['db_name']).'</a>';
echo "\t<tr>\n";
echo "\t\t<td>\n";
@ -543,8 +544,8 @@ function display_courses_in_category($user_category_id) {
$progress = $row['progress'];
$image = 'level_'.$progress.'.png';
$title = $row['progress'].'%';
}
$img = Display::return_icon($image,get_lang('ThematicAdvance'),array('style'=>'vertical-align:middle')).'&nbsp;'.$title;
$img = Display::return_icon($image,get_lang('ThematicAdvance'),array('style'=>'vertical-align:middle')).'&nbsp;<span>'.$title.'</span>';
}
return $img;
}
@ -784,7 +785,7 @@ function get_logged_user_course_html($course, $session_id = 0, $class='courses')
} else {
$result .= $course_display_title." "." ".get_lang('CourseClosed')."";
}
$progress_thematic_icon = get_thematic_progress_icon($course_database,$session_id);
$progress_thematic_icon = '<a href="'.api_get_path(WEB_CODE_PATH).'course_description/index.php?action=edit&cidReq='.$course['code'].'&description_type=8'.'">'.get_thematic_progress_icon($course_database, $session_id).'</a>';
$result .= '&nbsp;&nbsp;<span>'.$progress_thematic_icon.'</span>';
// show the course_code and teacher if chosen to display this
if (api_get_setting('display_coursecode_in_courselist') == 'true' || api_get_setting('display_teacher_in_courselist') == 'true') {

Loading…
Cancel
Save