Fixing default course text alignment see #3900

skala
Julio Montoya 14 years ago
parent 98331b748b
commit 77fe82c713
  1. 40
      main/inc/introductionSection.inc.php
  2. 8
      main/inc/lib/add_course.lib.inc.php

@ -178,16 +178,6 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
if (!empty($thematic_advance_info)) {
if ($is_allowed_to_edit) {
$style_introduction_section = 'style="margin-left:10%;margin-right:10%; margin-top:30px;" ';
} else {
if (empty($intro_content)) {
$style_introduction_section = 'style="margin-left:10%;margin-right:10%; "';
} else {
$style_introduction_section = 'style="margin-left:10%;margin-right:10%;" margin-top:30px;';
}
}
$thematic_advance = get_lang('CourseThematicAdvance').' '.$thematic->get_total_average_of_thematic_advances().'%';
if (api_is_allowed_to_edit(null, true)) {
//$thematic_advance = '<a href="'.api_get_path(WEB_CODE_PATH).'course_progress/index.php?action=thematic_details&'.api_get_cidreq().'">'.get_lang('CourseThematicAdvance').'&nbsp;'.$thematic->get_total_average_of_thematic_advances().'%</a>';
@ -197,7 +187,7 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$thematic_advance_info['start_date'] = api_get_local_time($thematic_advance_info['start_date']);
$thematic_advance_info['start_date'] = api_format_date($thematic_advance_info['start_date'], DATE_TIME_FORMAT_LONG);
$thematic_description_html = '<div '.$style_introduction_section.'>
$thematic_description_html = '
<div class="thematic-postit">
<div class="thematic-postit-top"><h3><a class="thematic-postit-head" style="" href="#"> '.$thematic_advance.'</h3></a></div>
<div class="thematic-postit-center" style="display:none">';
@ -205,7 +195,7 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$thematic_description_html .= '<div style="font-size:8pt;"><strong>'.$thematic_advance_info['start_date'].'</strong></div>';
$thematic_description_html .= '<div>'.$thematic_advance_info['content'].'</div>';
$thematic_description_html .= '<div>'.get_lang('DurationInHours').' : '.$thematic_advance_info['duration'].'</div>';
$thematic_description_html .= '<br />';
if (!empty($thematic_advance_info2)){
$thematic_info2 = $thematic->get_thematic_list($thematic_advance_info2['thematic_id']);
@ -221,24 +211,27 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
}
$thematic_description_html .= '</div>
<div class="thematic-postit-bottom"></div>
</div></div>';
</div>';
}
}
$style_introduction_section = 'style="margin-left:10%; margin-right:10%;"';
$introduction_section .= '<div '.$style_introduction_section.'>';
if ($intro_dispDefault) {
//$intro_content = make_clickable($intro_content); // make url in text clickable
$introduction_section .= '<div class="row"><div class="span12">';
$introduction_section .= $thematic_description_html;
$introduction_section .= '</div>';
$introduction_section .= '<div class="span12">';
if ($intro_dispDefault) {
$intro_content = text_filter($intro_content); // parse [tex] codes
if (!empty($intro_content)) {
$introduction_section .= "<table align=\"center\"><tr><td>$intro_content</td></tr></table>";
$introduction_section .= $intro_content;
}
}
$introduction_section .= '</div>';
if ($intro_dispCommand) {
if (empty($intro_content)) {
// Displays "Add intro" commands
$introduction_section .= "<div id=\"courseintro_empty\">";
$introduction_section .= '<div id="courseintro_empty">';
if (!empty ($GLOBALS['_cid'])) {
$introduction_section .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;intro_cmdAdd=1\">";
$introduction_section .= Display::return_icon('introduction_add.gif', get_lang('AddIntro')).' ';
@ -250,7 +243,7 @@ if ($intro_dispCommand) {
} else {
// Displays "edit intro && delete intro" commands
$introduction_section .= "<div id=\"courseintro_icons\"><p>";
$introduction_section .= '<div id="courseintro_empty">';
if (!empty ($GLOBALS['_cid'])) {
$introduction_section .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;intro_cmdEdit=1\">".Display::return_icon('edit.png',get_lang('Modify'),'',ICON_SIZE_SMALL)."</a>";
$introduction_section .= "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;intro_cmdDel=1\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset))."')) return false;\">".Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL)."</a>";
@ -258,10 +251,7 @@ if ($intro_dispCommand) {
$introduction_section .= "<a href=\"".api_get_self()."?intro_cmdEdit=1\">".Display::return_icon('edit.png',get_lang('Modify'),'',ICON_SIZE_SMALL)."</a>";
$introduction_section .= "<a href=\"".api_get_self()."?intro_cmdDel=1\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset))."')) return false;\">".Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL)."</a>";
}
$introduction_section .= "</p></div>";
$introduction_section .= "</div>";
}
}
$introduction_section .= '</div>';
$introduction_section .= $thematic_description_html;
$introduction_section .= '<div class="clear"></div>';

@ -2489,12 +2489,10 @@ function fill_Db_course($course_id, $course_repository, $language, $default_docu
/* Introduction text */
$intro_text='<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="110" valign="middle" align="left">
$intro_text='<p style="text-align: center;">
<img src="'.api_get_path(REL_CODE_PATH).'img/mascot.png" alt="Mr. Chamilo" title="Mr. Chamilo" /></td>
<td valign="middle" align="left">'.lang2db(get_lang('IntroductionText')).'</td></tr>
</table>';
<h2>'.lang2db(get_lang('IntroductionText')).'</h2>
</p>';
Database::query("INSERT INTO $TABLEINTROS VALUES ($course_id, '" . TOOL_COURSE_HOMEPAGE . "','".$intro_text. "', 0)");
Database::query("INSERT INTO $TABLEINTROS VALUES ($course_id, '" . TOOL_STUDENTPUBLICATION . "','".lang2db(get_lang('IntroductionTwo')) . "', 0)");

Loading…
Cancel
Save