Skip to content

Commit

Permalink
Fix use of course info 'real_id' index when 'id' is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ywarnier committed Jan 10, 2016
1 parent e2da9d2 commit c1ddde5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions main/inc/lib/course.lib.php
Expand Up @@ -3394,7 +3394,7 @@ public static function display_special_courses($user_id, $load_dirs = false)
$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'),
Expand All @@ -3409,7 +3409,7 @@ public static function display_special_courses($user_id, $load_dirs = false)
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 {
Expand All @@ -3423,15 +3423,15 @@ public static function display_special_courses($user_id, $load_dirs = false)
} 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'),
array('align' => 'absmiddle'),
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'
));
}
Expand Down
2 changes: 1 addition & 1 deletion user_portal.php
Expand Up @@ -48,7 +48,7 @@
$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() {
Expand Down

0 comments on commit c1ddde5

Please sign in to comment.