Fix use of course info 'real_id' index when 'id' is needed

1.10.x
Yannick Warnier 9 years ago
parent e2da9d2483
commit c1ddde57d4
  1. 8
      main/inc/lib/course.lib.php
  2. 2
      user_portal.php

@ -3394,7 +3394,7 @@ class CourseManager
$params['right_actions'] = '';
if (api_is_platform_admin()) {
if ($load_dirs) {
$params['right_actions'] .= '<a id="document_preview_' . $course['real_id'] . '_0" class="document_preview" href="javascript:void(0);">' .
$params['right_actions'] .= '<a id="document_preview_' . $course['id'] . '_0" class="document_preview" href="javascript:void(0);">' .
Display::return_icon(
'folder.png',
get_lang('Documents'),
@ -3409,7 +3409,7 @@ class CourseManager
ICON_SIZE_SMALL
).'</a>';
$params['right_actions'] .= Display::div('', array(
'id' => 'document_result_' . $course['real_id'] . '_0',
'id' => 'document_result_' . $course['id'] . '_0',
'class' => 'document_preview_container'
));
} else {
@ -3423,7 +3423,7 @@ class CourseManager
} else {
if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
if ($load_dirs) {
$params['right_actions'] .= '<a id="document_preview_' . $course['real_id'] . '_0" class="document_preview" href="javascript:void(0);">' .
$params['right_actions'] .= '<a id="document_preview_' . $course['id'] . '_0" class="document_preview" href="javascript:void(0);">' .
Display::return_icon(
'folder.png',
get_lang('Documents'),
@ -3431,7 +3431,7 @@ class CourseManager
ICON_SIZE_SMALL
).'</a>';
$params['right_actions'] .= Display::div('', array(
'id' => 'document_result_' . $course['real_id'] . '_0',
'id' => 'document_result_' . $course['id'] . '_0',
'class' => 'document_preview_container'
));
}

@ -48,7 +48,7 @@ if ($load_dirs) {
$folder_icon = api_get_path(WEB_IMG_PATH).'icons/22/folder.png';
$close_icon = api_get_path(WEB_IMG_PATH).'loading1.gif';
$htmlHeadXtra[] = '<script>
$htmlHeadXtra[] = '<script type="text/javascript">
$(document).ready(function() {
$(".document_preview_container").hide();
$(".document_preview").click(function() {

Loading…
Cancel
Save