[svn r11617] Fix a bug with deleted document (FS#1344)

skala
Julian Prud'homme 19 years ago
parent b1404d170c
commit 5833450c56
  1. 23
      main/newscorm/blank.php
  2. 5
      main/newscorm/learnpath.class.php

@ -7,8 +7,31 @@
/** /**
* Script * Script
*/ */
if(isset($_GET['error']) && $_GET['error']=='document_deleted'){
$language_file[] = "learnpath";
require('../inc/global.inc.php');
}
?> ?>
<html> <html>
<head>
<style type="text/css">
<?php
$my_style = api_get_setting('stylesheets');
if(empty($my_style)){$my_style = 'default';}
echo '@import "'.api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/default.css";'."\n";
?>
</style>
</head>
<body> <body>
<?php
if(isset($_GET['error']) && $_GET['error']=='document_deleted'){
Display::display_error_message(get_lang('DocumentHasBeenDeleted'));
}
?>
</body> </body>
</html> </html>

@ -2674,6 +2674,11 @@ class learnpath {
}else{ }else{
require_once('resourcelinker.inc.php'); require_once('resourcelinker.inc.php');
$file = rl_get_resource_link_for_learnpath(api_get_course_id(),$this->get_id(),$item_id); $file = rl_get_resource_link_for_learnpath(api_get_course_id(),$this->get_id(),$item_id);
$tmp_array=explode("/",$file);
$document_name=$tmp_array[count($tmp_array)-1];
if(strpos($document_name,'_DELETED_')){
$file = 'blank.php?error=document_deleted';
}
} }
break; break;
case 2: case 2:

Loading…
Cancel
Save