From b21f01f45a66ee279ce57785a89534d62f184b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Tue, 24 Aug 2010 22:48:40 +0200 Subject: [PATCH] a last round for copy messages --- main/document/document.php | 15 +++++++-------- main/lang/english/document.inc.php | 7 ++++++- main/lang/spanish/document.inc.php | 6 +++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/main/document/document.php b/main/document/document.php index 422f9b2ffc..82327f3fa0 100755 --- a/main/document/document.php +++ b/main/document/document.php @@ -395,17 +395,16 @@ if (isset($_GET['action']) && $_GET['action'] == 'copytomyfiles' && api_get_sett $file = $sys_course_path.$_course['path'].'/document'.$clean_get_id; $copyfile = $user_folder.basename($clean_get_id); - if (file_exists($copyfile) && !isset ($_GET['copy'])) { - $message = get_lang('AlreadyCopy').' '.get_lang('ConfirmCopyDoc').'

'.'

'.''.get_lang("No").''.'  |  '.''.get_lang("Yes").''.'

'; - - Display::display_warning_message($message,false); - - if (Security::remove_XSS($_GET['copy']) == 'yes') - { + if (file_exists($copyfile)) { + $message = get_lang('AlreadyCopy').'

'.''.get_lang("No").'  |  '.get_lang("Yes").'

'; + if (!isset($_GET['copy'])){ + Display::display_warning_message($message,false); + } + if (Security::remove_XSS($_GET['copy']) == 'yes'){ if (!copy($file, $copyfile)) { Display::display_error_message(get_lang('CopyFailled')); }else{ - Display::display_confirmation_message(get_lang('CopyReleased')); + Display::display_confirmation_message(get_lang('FileOverwrited')); } } }else{ diff --git a/main/lang/english/document.inc.php b/main/lang/english/document.inc.php index fef44060d0..32a37ccff8 100644 --- a/main/lang/english/document.inc.php +++ b/main/lang/english/document.inc.php @@ -216,7 +216,12 @@ $HelpSharedFolder = "This directory contains the files that other learners (or y $TemplateImage = "Template's icon"; $MoveElement = "Move element"; $CertificateName = "Name"; -$CopyToMyFiles = "Copy to personal platform area my files"; +$CopyToMyFiles = "Copy to my personal area files"; $Export2PDF = "Export to PDF format"; $ResourceShared ="Resource shared"; +$AlreadyCopy="There is a file with the same name in your user area. Do you want replace it?"; +$CopyFailled="Copy failled"; +$CopyReleased="Copy released"; +$FileOverwrited="File replaced"; + ?> \ No newline at end of file diff --git a/main/lang/spanish/document.inc.php b/main/lang/spanish/document.inc.php index 8195987389..abbf792db2 100644 --- a/main/lang/spanish/document.inc.php +++ b/main/lang/spanish/document.inc.php @@ -216,7 +216,11 @@ $HelpSharedFolder = "Este directorio contiene los archivos que los estudiantes ( $TemplateImage = "Imagen de la plantilla"; $MoveElement = "Mover elemento"; $CertificateName = "Nombre del certificado"; -$CopyToMyFiles = "Copiar en mi área personal de archivos de la plataforma"; +$CopyToMyFiles = "Copiar en mi área personal de archivos"; $Export2PDF = "Exportar a formato PDF"; $ResourceShared ="Recurso compartido"; +$AlreadyCopy="Hay un archivo con el mismo nombre en su area de usuario. ¿Desea reemplazarlo?"; +$CopyFailled="Copia fallida"; +$CopyReleased="Copia realizada"; +$FileOverwrited="Archivo reemplazado"; ?> \ No newline at end of file