diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php
index 5673d1721a..91c0c12e3c 100644
--- a/main/newscorm/learnpath.class.php
+++ b/main/newscorm/learnpath.class.php
@@ -4439,16 +4439,27 @@ class learnpath {
$return .= '
';
- if($msg != '')
- $return .= $msg;
-
- $return .= '
' . stripslashes($row['title']) . '
';
- //$return .= '
' . ((trim($row['description']) == '') ? 'no description' : stripslashes($row['description'])) . '
';
-
- //$return .= '
';
+ if($msg != '')
+ $return .= $msg;
+
+ $return .= '
' . stripslashes($row['title']) . '
';
+ //$return .= '
' . ((trim($row['description']) == '') ? 'no description' : stripslashes($row['description'])) . '
';
+
+ //$return .= '
';
+
+ if($row['item_type'] == TOOL_DOCUMENT)
+ {
+ $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
+ $sql_doc = "SELECT path FROM " . $tbl_doc . " WHERE id = " . $row['path'];
+ $result=api_sql_query($sql_doc);
+ $path_file=mysql_result($result,0,0);
+ $path_parts = pathinfo($path_file);
- if($row['item_type'] == TOOL_DOCUMENT)
+ if(in_array($path_parts['extension'],array('html','txt')))
+ {
$return .= $this->display_document($row['path'], true, true);
+ }
+ }
$return .= '
';
}
@@ -5591,14 +5602,14 @@ function display_thread_form($action = 'add', $id = 0, $extra_info = '')
$return .= '';
}
-
+ /*
if($no_display_add==true){
$return .= '