add layout html aparence grid BT#11017

ofaj
Alex Aragon 9 years ago
parent 3a4db2861e
commit 6632068fec
  1. 6
      main/inc/lib/course.lib.php
  2. 10
      main/inc/lib/userportal.lib.php
  3. 29
      main/template/default/user_portal/main_courses.tpl

@ -3644,13 +3644,13 @@ class CourseManager
);
//$courseCount += $courseInCategory['course_count'];
$courseCount ++;
$listItems['course_in_category'][$courseCount] = $params;
$listItems['in_category'][$courseCount] = $params;
}
// Step 2: We display the course without a user category.
$courseInCategory = self::returnCoursesNotCategory(0, $load_dirs);
$listItems['course_not_category'] = $courseInCategory;
$listItems['not_category'] = $courseInCategory;
//$courseCount += $courseInCategory['course_count'];
@ -3881,6 +3881,8 @@ class CourseManager
if ($showCustomIcon === 'true' && $iconName != 'course.png') {
$thumbnails = $course_info['course_image'];
$image = $course_info['course_image_large'];
}else{
$image = Display::return_icon('session_default.png', null, null, null,null, true);
}
$params = array();

@ -1040,7 +1040,7 @@ class IndexManager
}
}
$courses_html = '';
$listCourse = '';
$special_courses = '';
$sessionCount = 0;
$courseCount = 0;
@ -1059,8 +1059,12 @@ class IndexManager
$this->load_directories_preview
);
$courses_html .= $courses['html'];
$this->tpl->assign('courses', $courses);
$listCourse = $this->tpl->fetch(
$this->tpl->get_template('/user_portal/main_courses.tpl'));
$courseCount = $specialCourses['course_count'] + $courses['course_count'];
}
$sessions_with_category = '';
@ -1362,7 +1366,7 @@ class IndexManager
}
return [
'html' => $sessions_with_category.$sessions_with_no_category.$courses_html.$special_courses,
'html' => $sessions_with_category.$sessions_with_no_category.$listCourse.$special_courses,
'session_count' => $sessionCount,
'course_count' => $courseCount
];

@ -1 +1,28 @@
{# empty Twig template #}
{% for course in courses %}
<div class="row">
{% for item in course %}
<div class="col-md-4">
<div class="items">
<div class="image">
<img src="{{ item.image }}" class="img-responsive">
</div>
<h4 class="title"><a href="{{ item.link }}">{{ item.title }}</a></h4>
<div class="teachers">
<ul>
{% for teacher in item.teachers %}
<li>{{ teacher.email }}</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
<pre>
{{ courses | var_dump }}
</pre>

Loading…
Cancel
Save