api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'), ); $interbreadcrumb[] = array( 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' '.$current_group_name, ); $name_to_show = explode('/', $name_to_show); unset($name_to_show[1]); $name_to_show = implode('/', $name_to_show); } $interbreadcrumb[] = array( 'url' => './document.php?curdirpath='.dirname($header_file).'&'.api_get_cidreq(), 'name' => get_lang('Documents'), ); if (empty($document_data['parents'])) { if (isset($_GET['createdir'])) { $interbreadcrumb[] = array( 'url' => $document_data['document_url'], 'name' => $document_data['title'], ); } else { $interbreadcrumb[] = array( 'url' => '#', 'name' => $document_data['title'], ); } } else { foreach ($document_data['parents'] as $document_sub_data) { if (!isset($_GET['createdir']) && $document_sub_data['id'] == $document_data['id']) { $document_sub_data['document_url'] = '#'; } $interbreadcrumb[] = array( 'url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title'], ); } } $this_section = SECTION_COURSES; $nameTools = get_lang('Documents'); /** * Main code section */ header('Expires: Wed, 01 Jan 1990 00:00:00 GMT'); //header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); header('Last-Modified: Wed, 01 Jan 2100 00:00:00 GMT'); header('Cache-Control: no-cache, must-revalidate'); header('Pragma: no-cache'); $browser_display_title = 'Documents - '.Security::remove_XSS($_GET['cidReq']).' - '.$file; // Only admins get to see the "no frames" link in pageheader.php, so students get a header that's not so high $frameheight = 135; if ($is_courseAdmin) { $frameheight = 165; } $js_glossary_in_documents = ' $.frameReady(function(){ // $("
I am a div courses
").prependTo("body"); }, "top.mainFrame", { load: [ { type:"script", id:"_fr1", src:"'.api_get_jquery_web_path().'"}, { type:"script", id:"_fr7", src:"'.api_get_asset('MathJax/MathJax.js', true).'?config=AM_HTMLorMML"}, { type:"script", id:"_fr4", src:"'.api_get_asset('jquery-ui/jquery-ui.min.js', true).'"}, { type:"stylesheet", id:"_fr5", src:"'.api_get_asset('jquery-ui/themes/smoothness/jquery-ui.min.css', true).'"}, { type:"stylesheet", id:"_fr6", src:"'.api_get_asset('jquery-ui/themes/smoothness/theme.css', true).'"}, { type:"script", id:"_fr2", src:"'.api_get_js('js/jquery.highlight.js', true).'"}, { type:"script", id:"_fr3", src:"'.api_get_path(WEB_CODE_PATH).'glossary/glossary.js.php"} ] });'; $web_odf_supported_files = DocumentManager::get_web_odf_extension_list(); // PDF should be displayed with viewerJS $web_odf_supported_files[] = 'pdf'; if (in_array(strtolower($pathinfo['extension']), $web_odf_supported_files)) { $show_web_odf = true; /* $htmlHeadXtra[] = api_get_js('webodf/webodf.js'); $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/webodf/webodf.css'); $htmlHeadXtra[] = ' '; */ $htmlHeadXtra[] = ' ' ; } // Activate code highlight. $isChatFolder = false; if (isset($document_data['parents']) && isset($document_data['parents'][0])) { $chatFolder = $document_data['parents'][0]; if (isset($chatFolder['path']) && $chatFolder['path'] == '/chat_files') { $isChatFolder = true; } } if ($isChatFolder) { $htmlHeadXtra[] = api_get_asset('highlight.js.origin/src/highlight.js'); $htmlHeadXtra[] = api_get_css('css/chat.css'); $htmlHeadXtra[] = api_get_css_asset('highlight.js.origin/src/styles/github.css'); $htmlHeadXtra[] = ' '; } $execute_iframe = true; if ($jplayer_supported) { $extension = api_strtolower($pathinfo['extension']); if ($extension == 'mp4') { $extension = 'm4v'; } $htmlHeadXtra[] = api_get_css('js/jquery-jplayer/skin/chamilo/jplayer.blue.monday.css'); $htmlHeadXtra[] = api_get_js('js/jquery-jplayer/jplayer/jquery.jplayer.min.js'); $jquery = ' $("#jquery_jplayer_1").jPlayer({ ready: function() { $(this).jPlayer("setMedia", { '.$extension.' : "'.$document_data['direct_url'].'" }); }, cssSelectorAncestor: "#jp_container_1", swfPath: "'.api_get_js('jquery-jplayer/jplayer/', true).'", supplied: "'.$extension.'", useStateClassSkin: true, autoBlur: false, keyEnabled: false, remainingDuration: true, toggleDuration: true, solution: "html, flash", errorAlerts: false, warningAlerts: false }); '; $htmlHeadXtra[] = ''; $execute_iframe = false; } if ($show_web_odf) { $execute_iframe = false; } $is_freemind_available = $pathinfo['extension'] == 'mm' && api_get_setting('enable_freemind') == 'true'; if ($is_freemind_available) { $execute_iframe = false; } if (!$jplayer_supported && $execute_iframe) { $htmlHeadXtra[] = ''; $htmlHeadXtra[] = api_get_js('js/jquery.frameready.js'); $htmlHeadXtra[] = ''; } if ($originIsLearnpath) { Display::display_reduced_header(); } else { Display::display_header(''); } echo '
'; $file_url = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$header_file; $file_url_web = $file_url.'?'.api_get_cidreq(); if (in_array(strtolower($pathinfo['extension']), array('html', "htm"))) { echo '' . get_lang('CutPasteLink') . ''; } if ($show_web_odf) { $browser = api_get_navigator(); $pdfUrl = api_get_path(WEB_LIBRARY_JS_PATH) . 'ViewerJS/index.html#' . $file_url; if ($browser['name'] == 'Mozilla' && preg_match('|.*\.pdf|i', $header_file)) { $pdfUrl = $file_url; } echo '
'; echo ''; echo '
'; } elseif (!$originIsLearnpath) { // ViewerJS already have download button echo '

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

'; } echo '
'; if ($jplayer_supported) { echo DocumentManager::generate_video_preview($document_data); // media_element blocks jplayer disable it Display::$global_template->assign('show_media_element', 0); } if ($is_freemind_available) { ?>
Flash plugin or Javascript are turned off. Activate both and reload to view the mindmap
'; } } Display::display_footer();