Show lp video items in iframe - refs BT#11021

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 615a1224e9
commit ecf16fb37b
  1. 6
      main/document/showinframes.php
  2. 23
      main/newscorm/resourcelinker.inc.php

@ -331,7 +331,11 @@ if (!$jplayer_supported && $execute_iframe) {
</script>';
}
Display::display_header('');
if (isset($_GET['origin']) && $_GET['origin'] === 'learnpathitem') {
Display::display_reduced_header();
} else {
Display::display_header('');
}
echo '<div align="center">';

@ -1701,12 +1701,23 @@ function rl_get_resource_link_for_learnpath($course_id, $learnpath_id, $id_in_pa
'&lp=true';
break;
case TOOL_DOCUMENT:
$tbl_doc = Database::get_course_table(TABLE_DOCUMENT);
$sql = "SELECT * FROM $tbl_doc WHERE c_id = $course_id AND id = $id";
$result = Database::query($sql);
$myrow = Database::fetch_array($result);
$docurl = str_replace('%2F', '/', urlencode($myrow['path']));
$link .= $main_course_path.'document'.$docurl.'?cidReq='.$course_code.'&id_session='.$session_id;
$documentInfo = DocumentManager::get_document_data_by_id(
$id,
$course_code,
true,
$session_id
);
$documentPathInfo = pathinfo($documentInfo['absolute_path']);
$jplayer_supported_files = ['mp4', 'ogv', 'flv', 'm4v'];
$showDirectUrl = !in_array($documentPathInfo['extension'], $jplayer_supported_files);
if ($showDirectUrl) {
$link = $documentInfo['direct_url'] . '?';
$link .= http_build_query(['cidReq' => $course_code, 'id_session' => $session_id]);
} else {
$link = $documentInfo['url'] . '&' . http_build_query(['origin' => 'learnpathitem']);
}
$openmethod = 2;
$officedoc = false;
Session::write('openmethod',$openmethod);

Loading…
Cancel
Save