Show category name and description in tpl - refs BT#13094

pull/2487/head
Alex Aragon 8 years ago
parent f1dd1466a5
commit f655fca5fe
  1. 5
      main/inc/lib/userportal.lib.php
  2. 11
      main/template/default/layout/page_body.tpl
  3. 2
      user_portal.php

@ -1164,7 +1164,7 @@ class IndexManager
// Load sessions in category
$session_categories = UserManager::get_sessions_by_category($user_id, false);
}
$sessionCount = 0;
$courseCount = 0;
@ -1366,7 +1366,7 @@ class IndexManager
$coursesWithoutCategoryTemplate = '/user_portal/grid_courses_without_category.tpl';
$coursesWithCategoryTemplate = '/user_portal/grid_courses_with_category.tpl';
}
if ($specialCourses) {
if ($categoryCodeFilter) {
$specialCourses = self::filterByCategory(
@ -1374,7 +1374,6 @@ class IndexManager
$categoryCodeFilter
);
}
$this->tpl->assign('courses', $specialCourses);
$specialCourseList = $this->tpl->fetch(
$this->tpl->get_template($coursesWithoutCategoryTemplate)

@ -9,6 +9,17 @@
</div>
</div>
{% endif %}
{% if category != '' %}
<div class="section-category">
<div class="page-header">
<h3>{{ category.name }}</h3>
</div>
<div class="description">
{{ category.description }}
</div>
</div>
{% endif %}
{% if message != '' %}
<section id="messages">
{{ message}}

@ -172,6 +172,8 @@ if (!$myCourseListAsCategory) {
$courseAndSessions = $controller->returnCourseCategoryListFromUser($userId);
} else {
$courseAndSessions = $controller->returnCoursesAndSessions($userId, false, $categoryCode);
$getCategory = CourseCategory::getCategory($categoryCode);
$controller->tpl->assign('category', $getCategory);
}
}

Loading…
Cancel
Save