|
@@ -42,13 +42,24 @@ if (empty($course_info)) {
|
|
|
|
|
|
$show_web_odf = false;
|
|
|
|
|
|
-//Generate path
|
|
|
+// Generate path
|
|
|
if (!$document_id) {
|
|
|
$document_id = DocumentManager::get_document_id($course_info, $header_file);
|
|
|
}
|
|
|
-$document_data = DocumentManager::get_document_data_by_id($document_id, $course_code, true, $session_id);
|
|
|
+$document_data = DocumentManager::get_document_data_by_id(
|
|
|
+ $document_id,
|
|
|
+ $course_code,
|
|
|
+ true,
|
|
|
+ $session_id
|
|
|
+);
|
|
|
+
|
|
|
if ($session_id != 0 and !$document_data) {
|
|
|
- $document_data = DocumentManager::get_document_data_by_id($document_id, $course_code, true, 0);
|
|
|
+ $document_data = DocumentManager::get_document_data_by_id(
|
|
|
+ $document_id,
|
|
|
+ $course_code,
|
|
|
+ true,
|
|
|
+ 0
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
if (empty($document_data)) {
|
|
@@ -82,7 +93,6 @@ if ($is_allowed_in_course == false) {
|
|
|
}
|
|
|
|
|
|
// Check user visibility.
|
|
|
-//$is_visible = DocumentManager::is_visible_by_id($document_id, $course_info, api_get_session_id(), api_get_user_id());
|
|
|
$is_visible = DocumentManager::check_visibility_tree(
|
|
|
$document_id,
|
|
|
api_get_course_id(),
|
|
@@ -96,7 +106,6 @@ if (!api_is_allowed_to_edit() && !$is_visible) {
|
|
|
}
|
|
|
|
|
|
$pathinfo = pathinfo($header_file);
|
|
|
-
|
|
|
$jplayer_supported_files = array('mp4', 'ogv','flv');
|
|
|
$jplayer_supported = false;
|
|
|
|
|
@@ -120,18 +129,18 @@ if (isset($group_id) && $group_id != '') {
|
|
|
$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']);
|
|
|
- }
|
|
|
+ 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']);
|
|
|
- }
|
|
|
+ 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;
|
|
@@ -186,7 +195,6 @@ if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
|
|
|
// });';
|
|
|
}
|
|
|
|
|
|
-
|
|
|
$web_odf_supported_files = DocumentManager::get_web_odf_extension_list();
|
|
|
// PDF should be displayed with viewerJS
|
|
|
$web_odf_supported_files[] = 'pdf';
|
|
@@ -210,10 +218,10 @@ if (in_array(strtolower($pathinfo['extension']), $web_odf_supported_files)) {
|
|
|
$htmlHeadXtra[] = '
|
|
|
<script charset="utf-8">
|
|
|
resizeIframe = function() {
|
|
|
- var bodyHeight = $("body").height();
|
|
|
- var topbarHeight = $("#topbar").height();
|
|
|
- $("#viewerJSContent").height((bodyHeight - topbarHeight));
|
|
|
- }
|
|
|
+ var bodyHeight = $("body").height();
|
|
|
+ var topbarHeight = $("#topbar").height();
|
|
|
+ $("#viewerJSContent").height((bodyHeight - topbarHeight));
|
|
|
+ }
|
|
|
$(document).ready(function() {
|
|
|
$(window).resize(resizeIframe());
|
|
|
});
|
|
@@ -224,10 +232,8 @@ if (in_array(strtolower($pathinfo['extension']), $web_odf_supported_files)) {
|
|
|
$execute_iframe = true;
|
|
|
|
|
|
if ($jplayer_supported) {
|
|
|
-
|
|
|
$extension = api_strtolower($pathinfo['extension']);
|
|
|
-
|
|
|
- $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
|
|
|
+ $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
|
|
|
$htmlHeadXtra[] = '<link rel="stylesheet" href="'.$js_path.'jquery-jplayer/skins/blue/jplayer.blue.monday.css" type="text/css">';
|
|
|
$htmlHeadXtra[] = '<script type="text/javascript" src="'.$js_path.'jquery-jplayer/jquery.jplayer.min.js"></script>';
|
|
|
|
|
@@ -256,17 +262,18 @@ if ($jplayer_supported) {
|
|
|
</script>';
|
|
|
$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){
|
|
|
+if ($is_freemind_available) {
|
|
|
$execute_iframe = false;
|
|
|
}
|
|
|
|
|
|
$is_nanogong_available = $pathinfo['extension']=='wav' && preg_match('/_chnano_.wav/i', $file_url_web) && api_get_setting('enable_nanogong') == 'true';
|
|
|
-if ($is_nanogong_available){
|
|
|
+if ($is_nanogong_available) {
|
|
|
$execute_iframe = false;
|
|
|
}
|
|
|
|
|
@@ -279,7 +286,6 @@ if (!$jplayer_supported && $execute_iframe) {
|
|
|
</script>';
|
|
|
$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.frameready.js"></script>';
|
|
|
$htmlHeadXtra[] = '<script>
|
|
|
- <!--
|
|
|
var updateContentHeight = function() {
|
|
|
my_iframe = document.getElementById("mainFrame");
|
|
|
//this doesnt seem to work in IE 7,8,9
|
|
@@ -292,7 +298,6 @@ if (!$jplayer_supported && $execute_iframe) {
|
|
|
updateContentHeight();
|
|
|
'.$js_glossary_in_documents.'
|
|
|
}
|
|
|
- -->
|
|
|
</script>';
|
|
|
}
|
|
|
|
|
@@ -310,7 +315,6 @@ if (!$is_nanogong_available) {
|
|
|
}
|
|
|
|
|
|
if ($show_web_odf) {
|
|
|
- //echo Display::url(get_lang('Show'), api_get_path(WEB_CODE_PATH).'document/edit_odf.php?id='.$document_data['id'], array('class' => 'btn'));
|
|
|
echo '<div id="viewerJS">';
|
|
|
echo '<iframe id="viewerJSContent" frameborder="0" allowfullscreen="allowfullscreen" style="width:100%;"
|
|
|
src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/ViewerJS/index.html#'.$file_url.'">
|
|
@@ -330,83 +334,78 @@ if ($jplayer_supported) {
|
|
|
}
|
|
|
|
|
|
if ($is_freemind_available) {
|
|
|
- ?>
|
|
|
- <script type="text/javascript" src="<?php echo api_get_path(WEB_LIBRARY_PATH) ?>swfobject/swfobject.js"></script>
|
|
|
- <style type="text/css">
|
|
|
- #flashcontent {
|
|
|
- height: 500px;
|
|
|
- padding-top:10px;
|
|
|
- }
|
|
|
- </style>
|
|
|
- <div id="flashcontent" onmouseover="giveFocus();">
|
|
|
- Flash plugin or Javascript are turned off.
|
|
|
- Activate both and reload to view the mindmap
|
|
|
- </div>
|
|
|
- <script>
|
|
|
+ ?>
|
|
|
+ <script type="text/javascript" src="<?php echo api_get_path(WEB_LIBRARY_PATH) ?>swfobject/swfobject.js"></script>
|
|
|
+ <style type="text/css">
|
|
|
+ #flashcontent {
|
|
|
+ height: 500px;
|
|
|
+ padding-top:10px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <div id="flashcontent" onmouseover="giveFocus();">
|
|
|
+ Flash plugin or Javascript are turned off.
|
|
|
+ Activate both and reload to view the mindmap
|
|
|
+ </div>
|
|
|
+ <script>
|
|
|
function giveFocus() {
|
|
|
- document.visorFreeMind.focus();
|
|
|
- }
|
|
|
-
|
|
|
- document.onload=giveFocus;
|
|
|
- // <![CDATA[
|
|
|
- // for allowing using http://.....?mindmap.mm mode
|
|
|
- function getMap(map){
|
|
|
- var result=map;
|
|
|
- var loc=document.location+'';
|
|
|
- if(loc.indexOf(".mm")>0 && loc.indexOf("?")>0){
|
|
|
- result=loc.substring(loc.indexOf("?")+1);
|
|
|
- }
|
|
|
- return result;
|
|
|
- }
|
|
|
- var fo = new FlashObject("<?php echo api_get_path(WEB_LIBRARY_PATH); ?>freeMindFlashBrowser/visorFreemind.swf", "visorFreeMind", "100%", "100%", 6, "#ffffff");
|
|
|
- fo.addParam("quality", "high");
|
|
|
- //fo.addParam("bgcolor", "#a0a0f0");
|
|
|
- fo.addVariable("openUrl", "_blank");//Default value "_self"
|
|
|
- fo.addVariable("startCollapsedToLevel","3");//Default value = "-1", meaning do nothing, the mindmap will open as it was saved. The root node, or central node, of your mindmap is level zero. You could force the browser to open (unfold) your mind map to an expanded level using this variable.
|
|
|
- fo.addVariable("maxNodeWidth","200");
|
|
|
- //
|
|
|
- fo.addVariable("mainNodeShape","elipse");//"rectangle", "elipse", "none". None hide the main node. Default is "elipse"
|
|
|
- fo.addVariable("justMap","false");
|
|
|
- fo.addVariable("initLoadFile",getMap("<?php echo $file_url_web; ?>"));
|
|
|
- fo.addVariable("defaultToolTipWordWrap",200);//max width for tooltips. Default "600" pixels
|
|
|
- fo.addVariable("offsetX","left");//for the center of the mindmap. Admit also "left" and "right"
|
|
|
- fo.addVariable("offsetY","top");//for the center of the mindmap. Admit also "top" and "bottom"
|
|
|
- fo.addVariable("buttonsPos","top");//"top" or "bottom"
|
|
|
- fo.addVariable("min_alpha_buttons",20);//for dynamic view of buttons
|
|
|
- fo.addVariable("max_alpha_buttons",100);//for dynamic view of buttons
|
|
|
- fo.addVariable("scaleTooltips","false");
|
|
|
- //
|
|
|
- //extra
|
|
|
- //fo.addVariable("CSSFile","<?php // echo api_get_path(WEB_LIBRARY_PATH); ?>freeMindFlashBrowser/flashfreemind.css");//
|
|
|
- //fo.addVariable("baseImagePath","<?php // echo api_get_path(WEB_LIBRARY_PATH); ?>freeMindFlashBrowser/");//
|
|
|
- //fo.addVariable("justMap","false");//Hides all the upper control options. Default value "false"
|
|
|
- //fo.addVariable("noElipseMode","anyvalue");//for changing to old elipseNode edges. Default = not set
|
|
|
- //fo.addVariable("ShotsWidth","200");//The width of snapshots, in pixels.
|
|
|
- //fo.addVariable("genAllShots","true");//Preview shots (like the samples on the Shots Width page) will be generated for all linked maps when your main map loads. If you have a lot of linked maps, this could take some time to complete
|
|
|
- //fo.addVariable("unfoldAll","true"); //For each mindmap loaded start the display with all nodes unfolded. Another variable to be wary of!
|
|
|
- //fo.addVariable("toolTipsBgColor","0xaaeeaa");: bgcolor for tooltips ej;"0xaaeeaa"
|
|
|
- //fo.addVariable("defaultWordWrap","300"); //default 600
|
|
|
- //
|
|
|
-
|
|
|
- fo.write("flashcontent");
|
|
|
- // ]]>
|
|
|
- </script>
|
|
|
- <?php
|
|
|
-}
|
|
|
+ document.visorFreeMind.focus();
|
|
|
+ }
|
|
|
|
|
|
+ document.onload=giveFocus;
|
|
|
+ // <![CDATA[
|
|
|
+ // for allowing using http://.....?mindmap.mm mode
|
|
|
+ function getMap(map){
|
|
|
+ var result=map;
|
|
|
+ var loc=document.location+'';
|
|
|
+ if(loc.indexOf(".mm")>0 && loc.indexOf("?")>0){
|
|
|
+ result=loc.substring(loc.indexOf("?")+1);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ var fo = new FlashObject("<?php echo api_get_path(WEB_LIBRARY_PATH); ?>freeMindFlashBrowser/visorFreemind.swf", "visorFreeMind", "100%", "100%", 6, "#ffffff");
|
|
|
+ fo.addParam("quality", "high");
|
|
|
+ //fo.addParam("bgcolor", "#a0a0f0");
|
|
|
+ fo.addVariable("openUrl", "_blank");//Default value "_self"
|
|
|
+ fo.addVariable("startCollapsedToLevel","3");//Default value = "-1", meaning do nothing, the mindmap will open as it was saved. The root node, or central node, of your mindmap is level zero. You could force the browser to open (unfold) your mind map to an expanded level using this variable.
|
|
|
+ fo.addVariable("maxNodeWidth","200");
|
|
|
+ //
|
|
|
+ fo.addVariable("mainNodeShape","elipse");//"rectangle", "elipse", "none". None hide the main node. Default is "elipse"
|
|
|
+ fo.addVariable("justMap","false");
|
|
|
+ fo.addVariable("initLoadFile",getMap("<?php echo $file_url_web; ?>"));
|
|
|
+ fo.addVariable("defaultToolTipWordWrap",200);//max width for tooltips. Default "600" pixels
|
|
|
+ fo.addVariable("offsetX","left");//for the center of the mindmap. Admit also "left" and "right"
|
|
|
+ fo.addVariable("offsetY","top");//for the center of the mindmap. Admit also "top" and "bottom"
|
|
|
+ fo.addVariable("buttonsPos","top");//"top" or "bottom"
|
|
|
+ fo.addVariable("min_alpha_buttons",20);//for dynamic view of buttons
|
|
|
+ fo.addVariable("max_alpha_buttons",100);//for dynamic view of buttons
|
|
|
+ fo.addVariable("scaleTooltips","false");
|
|
|
+ //
|
|
|
+ //extra
|
|
|
+ //fo.addVariable("CSSFile","<?php // echo api_get_path(WEB_LIBRARY_PATH); ?>freeMindFlashBrowser/flashfreemind.css");//
|
|
|
+ //fo.addVariable("baseImagePath","<?php // echo api_get_path(WEB_LIBRARY_PATH); ?>freeMindFlashBrowser/");//
|
|
|
+ //fo.addVariable("justMap","false");//Hides all the upper control options. Default value "false"
|
|
|
+ //fo.addVariable("noElipseMode","anyvalue");//for changing to old elipseNode edges. Default = not set
|
|
|
+ //fo.addVariable("ShotsWidth","200");//The width of snapshots, in pixels.
|
|
|
+ //fo.addVariable("genAllShots","true");//Preview shots (like the samples on the Shots Width page) will be generated for all linked maps when your main map loads. If you have a lot of linked maps, this could take some time to complete
|
|
|
+ //fo.addVariable("unfoldAll","true"); //For each mindmap loaded start the display with all nodes unfolded. Another variable to be wary of!
|
|
|
+ //fo.addVariable("toolTipsBgColor","0xaaeeaa");: bgcolor for tooltips ej;"0xaaeeaa"
|
|
|
+ //fo.addVariable("defaultWordWrap","300"); //default 600
|
|
|
+ //
|
|
|
+
|
|
|
+ fo.write("flashcontent");
|
|
|
+ // ]]>
|
|
|
+ </script>
|
|
|
+<?php
|
|
|
+}
|
|
|
|
|
|
if ($is_nanogong_available) {
|
|
|
-
|
|
|
$file_url_web = DocumentManager::generateAudioTempFolder($file_url_sys);
|
|
|
-
|
|
|
echo '<div align="center">';
|
|
|
echo '<a class="btn" href="'.$file_url_web.'" target="_blank">'.get_lang('Download').'</a>';
|
|
|
echo '<br/>';
|
|
|
echo '<br/>';
|
|
|
-
|
|
|
echo DocumentManager::readNanogongFile($to_url);
|
|
|
-
|
|
|
- //erase temp file in tmp directory when return to documents
|
|
|
+ // Erase temp file in tmp directory when return to documents
|
|
|
echo '</div>';
|
|
|
}
|
|
|
|