diff --git a/main/document/showinframes.php b/main/document/showinframes.php index 22778fd9e7..9c91a36ded 100755 --- a/main/document/showinframes.php +++ b/main/document/showinframes.php @@ -29,6 +29,7 @@ api_protect_course_script(); $noPHP_SELF = true; $header_file = isset($_GET['file']) ? Security::remove_XSS($_GET['file']) : null; $document_id = intval($_GET['id']); +$originIsLearnpath = isset($_GET['origin']) && $_GET['origin'] === 'learnpathitem'; $courseInfo = api_get_course_info(); $course_code = api_get_course_id(); @@ -331,7 +332,7 @@ if (!$jplayer_supported && $execute_iframe) { '; } -if (isset($_GET['origin']) && $_GET['origin'] === 'learnpathitem') { +if ($originIsLearnpath) { Display::display_reduced_header(); } else { Display::display_header(''); @@ -359,7 +360,7 @@ if ($show_web_odf) { src="' . $pdfUrl. '"> '; echo ''; -} else { +} elseif (!$originIsLearnpath) { // ViewerJS already have download button echo '

'; echo Display::toolbarButton(get_lang('Download'), $file_url_web, 'download', 'default', ['target' => '_blank']);