From c6c688af9203daea7e672069d4979ffd623174e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Wed, 25 Jan 2012 00:05:56 +0100 Subject: [PATCH] improve navigation when copying files from a course to platform portfolio --- main/document/document.php | 10 +++++++--- main/social/myfiles.php | 14 ++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/main/document/document.php b/main/document/document.php index 6f6a61b41f..4d097c8911 100644 --- a/main/document/document.php +++ b/main/document/document.php @@ -203,11 +203,15 @@ switch ($action) { $perm = api_get_permissions_for_new_directories(); @mkdir($user_folder, $perm, true); } - + $file = $sys_course_path.$_course['path'].'/document'.$document_info['path']; $copyfile = $user_folder.basename($document_info['path']); - $file_link = Display::url(get_lang('SeeFile'), api_get_path(WEB_CODE_PATH).'social/myfiles.php'); - + $cidReq = Security::remove_XSS($_GET['cidReq']); + $id_session= Security::remove_XSS($_GET['id_session']); + $gidReq= Security::remove_XSS($_GET['gidReq']); + $id= Security::remove_XSS($_GET['id']); + $file_link = Display::url(get_lang('SeeFile'), api_get_path(WEB_CODE_PATH).'social/myfiles.php?cidReq='.$cidReq.'&id_session='.$id_session.'&gidReq='.$gidReq.'&parent_id='.$parent_id); + if (file_exists($copyfile)) { $message = get_lang('CopyAlreadyDone').'

'; $message .= ''.get_lang("No").'  |   diff --git a/main/social/myfiles.php b/main/social/myfiles.php index 605529f0e3..ce5841cfc2 100644 --- a/main/social/myfiles.php +++ b/main/social/myfiles.php @@ -94,14 +94,20 @@ if (is_array($_GET) && count($_GET)>0) { } $social_left_content = SocialManager::show_social_menu('myfiles'); - $social_right_content .= '';//TODO: hack and delete this line - $social_right_content .= '
'; - $social_right_content .= '
'; +if (isset($_GET['cidReq'])){ + $social_right_content .='

'; + $social_right_content .= ''.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('Documents').' ('.get_lang('Course').')').get_lang('BackTo').' '.get_lang('Documents').' ('.get_lang('Course').')'; $social_right_content .= '
'; +} +else{ + $social_right_content .= '';//TODO: hack and delete this line + $social_right_content .= '
'; +} +$social_right_content .= '
'; +$social_right_content .= ''; $social_right_content .= ''; - $tpl = new Template(get_lang('Social')); $tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_menu', $social_left_menu);