|
@@ -137,6 +137,8 @@ function create_document_link($document_data, $show_as_icon = false, $counter =
|
|
|
}
|
|
|
|
|
|
$target = '_self';
|
|
|
+ $is_browser_viewable_file = false;
|
|
|
+
|
|
|
if ($filetype == 'file') {
|
|
|
// Check the extension
|
|
|
$ext = explode('.', $path);
|
|
@@ -144,6 +146,7 @@ function create_document_link($document_data, $show_as_icon = false, $counter =
|
|
|
|
|
|
// HTML-files an some other types are shown in a frameset by default.
|
|
|
$is_browser_viewable_file = is_browser_viewable($ext);
|
|
|
+
|
|
|
if ($is_browser_viewable_file) {
|
|
|
//$url = 'showinframes.php?'.api_get_cidreq().'&file='.$url_path.$req_gid;
|
|
|
$url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'].$req_gid;
|
|
@@ -195,13 +198,13 @@ function create_document_link($document_data, $show_as_icon = false, $counter =
|
|
|
} elseif($path == '/images/gallery') {
|
|
|
$tooltip_title_alt = get_lang('DefaultCourseImages');
|
|
|
}
|
|
|
- $current_session_id=api_get_session_id();
|
|
|
-
|
|
|
+ $current_session_id = api_get_session_id();
|
|
|
+ $copy_to_myfiles = $open_in_new_window_link = null;
|
|
|
if (!$show_as_icon) {
|
|
|
if ($filetype == 'folder') {
|
|
|
if (api_is_allowed_to_edit() || api_is_platform_admin() || api_get_setting('students_download_folders') == 'true') {
|
|
|
//filter when I am into shared folder, I can show for donwload only my shared folder
|
|
|
- if (is_shared_folder($_GET['curdirpath'],$current_session_id)) {
|
|
|
+ if (isset($_GET['curdirpath']) && is_shared_folder($_GET['curdirpath'], $current_session_id)) {
|
|
|
if (preg_match('/shared_folder\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link))|| preg_match('/shared_folder_session_'.$current_session_id.'\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) || api_is_allowed_to_edit() || api_is_platform_admin()) {
|
|
|
$force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon($forcedownload_icon, get_lang('Download'), array(),22).'</a>';
|
|
|
}
|
|
@@ -218,7 +221,7 @@ function create_document_link($document_data, $show_as_icon = false, $counter =
|
|
|
$copy_myfiles_link = ($filetype == 'file') ? api_get_self().'?'.api_get_cidreq().'&curdirpath='.Security::remove_XSS($_GET['curdirpath']).'&action=copytomyfiles&id='.$url_path.$req_gid :api_get_self().'?'.api_get_cidreq();
|
|
|
|
|
|
if ($filetype == 'file') {
|
|
|
- $copy_to_myfiles='<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(),22).' </a>';
|
|
|
+ $copy_to_myfiles = '<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(),22).' </a>';
|
|
|
}
|
|
|
}
|
|
|
|