From b4863c74e87c47ac496c739ca1eca2af836e07ff Mon Sep 17 00:00:00 2001 From: Daniel Barreto Date: Wed, 30 Jul 2014 20:48:56 -0500 Subject: [PATCH] Implement ViewerJS in showinframes.php -refs BT#8274 --- main/document/showinframes.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/main/document/showinframes.php b/main/document/showinframes.php index 41585957a4..027e04678e 100755 --- a/main/document/showinframes.php +++ b/main/document/showinframes.php @@ -191,6 +191,7 @@ if (api_get_setting('show_glossary_in_documents') == 'ismanual') { $web_odf_supported_files = DocumentManager::get_web_odf_extension_list(); 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[] = ' @@ -204,6 +205,16 @@ if (in_array(strtolower($pathinfo['extension']), $web_odf_supported_files)) { window.setTimeout(init, 0); }); '; + */ + $htmlHeadXtra[] = ' + '; } $execute_iframe = true; @@ -285,19 +296,26 @@ Display::display_header(''); echo '
'; -$file_url_web = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file.'?'.api_get_cidreq(); +$file_url = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file; +$file_url_web = $file_url.'?'.api_get_cidreq(); if (!$is_nanogong_available) { if (in_array(strtolower($pathinfo['extension']) , array('html', "htm"))) { echo ''.get_lang('CutPasteLink').''; - } else { - echo ''.get_lang('Download').''; } } 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 '
'; + + echo '
'; + echo ''; + echo '
'; +} else { + // ViewerJS already have download button + echo ''.get_lang('Download').''; } echo '
';