Improve custom course description to show all custom blocks in session about - Refs BT#12222

remotes/angel/1.11.x
José Loguercio 8 years ago
parent 9ab07dd7d2
commit 8f68f876d5
  1. 8
      main/inc/lib/course_description.lib.php
  2. 7
      main/session/about.php
  3. 12
      main/template/default/session/about.tpl

@ -178,7 +178,13 @@ class CourseDescription
WHERE c_id = $course_id AND session_id='" . $this->session_id . "'";
$rs = Database::query($sql);
$max = Database::fetch_array($rs);
$description_type = $max['MAX'] + 1;
if ($max['MAX'] >= 8) {
$description_type = 8;
} else {
$description_type = $max['MAX'] + 1;
}
if ($description_type < ADD_BLOCK) {
$description_type = ADD_BLOCK;
}

@ -86,7 +86,8 @@ foreach ($sessionCourses as $sessionCourse) {
]
);
$courseDescription = $courseObjectives = $courseTopics = $courseMethodology = $courseMaterial = $courseResources = $courseAssesment = $courseCustom = null;
$courseDescription = $courseObjectives = $courseTopics = $courseMethodology = $courseMaterial = $courseResources = $courseAssesment = null;
$courseCustom = [];
foreach ($courseDescriptionTools as $descriptionTool) {
switch ($descriptionTool->getDescriptionType()) {
@ -112,7 +113,7 @@ foreach ($sessionCourses as $sessionCourse) {
$courseAssesment = $descriptionTool;
break;
case CCourseDescription::TYPE_CUSTOM:
$courseCustom = $descriptionTool;
$courseCustom[] = $descriptionTool;
break;
}
}
@ -127,7 +128,7 @@ foreach ($sessionCourses as $sessionCourse) {
'material' => $courseMaterial,
'resources' => $courseResources,
'assesment' => $courseAssesment,
'custom' => $courseCustom,
'custom' => array_reverse($courseCustom),
'coaches' => $coachesData,
'extra_fields' => $courseValues->getAllValuesForAnItem($sessionCourse->getId(), null, true)
];

@ -145,12 +145,14 @@
{% endif %}
{% if course_data.custom %}
<div class="topics">
<h4 class="title-info"><em class="fa fa-book"></em> {{ course_data.custom.getTitle }}</h4>
<div class="content-info">
{{ course_data.custom.getContent }}
{% for custom in course_data.custom %}
<div class="topics">
<h4 class="title-info"><em class="fa fa-book"></em> {{ custom.getTitle }}</h4>
<div class="content-info">
{{ custom.getContent }}
</div>
</div>
</div>
{% endfor %}
{% endif %}
</div>
</div>

Loading…
Cancel
Save