From e2e6283edc577d9786927da841174f7985a3da8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Sun, 24 Apr 2011 20:45:42 +0200 Subject: [PATCH] Bug #2719 solved several bugs with yoxview --- main/document/document.inc.php | 22 +++- main/document/document.php | 6 +- main/document/showinframesmin.php | 163 ++++++++++++++++++++++++++++++ 3 files changed, 185 insertions(+), 6 deletions(-) create mode 100644 main/document/showinframesmin.php diff --git a/main/document/document.inc.php b/main/document/document.inc.php index 0a9b819523..3758ee9d62 100755 --- a/main/document/document.inc.php +++ b/main/document/document.inc.php @@ -231,17 +231,33 @@ function create_document_link($document_data, $show_as_icon = false) { } //target="'.$target.'" if ($filetype == 'file') { - return ''.$title.''.$force_download_html.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon; + if(preg_match('/swf$/', urldecode($url)) || (preg_match('/wav$/', urldecode($url)) && api_get_setting('enable_nanogong') == 'true')){ + $url = 'showinframesmin.php?'.api_get_cidreq().'&id='.$document_data['id'].$req_gid; + return ''.$title.''.$force_download_html.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon; + }else{ + return ''.$title.''.$force_download_html.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon; + } } else { return ''.$title.''.$force_download_html.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon; } //end copy files to users myfiles } else { + //icons colum if(preg_match('/shared_folder/', urldecode($url)) && preg_match('/shared_folder$/', urldecode($url))==false && preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url))==false){ return ''.build_document_icon_tag($filetype, $path).Display::return_icon('shared.png', get_lang('ResourceShared'), array('hspace' => '5', 'align' => 'middle', 'height' => 22, 'width' => 22)).''; } else { - return ''.build_document_icon_tag($filetype, $path).''; - } + if($filetype == 'file') { + if(preg_match('/swf$/', urldecode($url)) || (preg_match('/wav$/', urldecode($url)) && api_get_setting('enable_nanogong') == 'true')){ + $url = 'showinframesmin.php?'.api_get_cidreq().'&id='.$document_data['id'].$req_gid; + return ''.build_document_icon_tag($filetype, $path).''; + }else{ + return ''.build_document_icon_tag($filetype, $path).''; + } + } + else { + return ''.build_document_icon_tag($filetype, $path).''; + } + } } } diff --git a/main/document/document.php b/main/document/document.php index f267e092a1..8c63c3d3e2 100755 --- a/main/document/document.php +++ b/main/document/document.php @@ -72,7 +72,7 @@ $(document).ready( function() { $(".yoxview").yoxview({ lang: "'.$lang_yoxview.'", flashVideoPlayerPath: "'.$mediaplayer_path.'", - skin: "top_menu", + renderMenu: "false", titleAttribute:"alt" }); for (i=0;i<$(".actions").length;i++) { @@ -1100,9 +1100,9 @@ if (count($docs_and_folders) > 1) { $table->set_form_actions($form_action, 'path'); } } -echo '
'; +//echo '
'; $table->display(); -echo '
'; +//echo '
'; if (count($docs_and_folders) > 1) { if ($is_allowed_to_edit || $group_member_with_upload_rights) { diff --git a/main/document/showinframesmin.php b/main/document/showinframesmin.php new file mode 100644 index 0000000000..ffdd902e18 --- /dev/null +++ b/main/document/showinframesmin.php @@ -0,0 +1,163 @@ +I am a div courses").prependTo("body"); + }, "top.mainFrame", + { load: [ + {type:"script", id:"_fr1", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js"}, + {type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"}, + {type:"script", id:"_fr3", src:"'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_manual.js"} + ] + } + ); + //});'; +} elseif (api_get_setting('show_glossary_in_documents') == 'isautomatic') { + $js_glossary_in_documents = '// $(document).ready(function() { + $.frameReady(function(){ + // $("
I am a div courses
").prependTo("body"); + + }, "top.mainFrame", + { load: [ + {type:"script", id:"_fr1", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js"}, + {type:"script", id:"_fr2", src:"'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.highlight.js"}, + {type:"script", id:"_fr3", src:"'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary_automatic.js"} + ] + } + ); + // });'; +} + +$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; + +$htmlHeadXtra[] = ' + +'; + +//// +echo "
"; +$file_url_web = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file.'?'.api_get_cidreq(); + +$pathinfo =pathinfo($header_file); +if ($pathinfo['extension']=='wav' && api_get_setting('enable_nanogong') == 'true'){ + echo '
'; + echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'; +} +else{ + echo ''; +} \ No newline at end of file