diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php index ea50334add..cdc2986c3d 100755 --- a/main/inc/lib/document.lib.php +++ b/main/inc/lib/document.lib.php @@ -2575,8 +2575,9 @@ return 'application/octet-stream'; $resource['title'] = basename($resource['path']); } eval ('$resources_sorted'.$path_to_eval.'['.$resource['id'].'] = "'.$data.'" ; '); - } else { + } else { eval ('$resources_sorted'.$path_to_eval.'["'.$last_path.'"]["id"]='.$resource['id'].';'); + eval ('$resources_sorted'.$path_to_eval.'["'.$last_path.'"]["title"]= "'.$resource['title'].'";'); } } } @@ -2644,7 +2645,12 @@ return 'application/octet-stream'; $return = ''; if (count($resources_sorted) > 0) { - foreach ($resources_sorted as $key => $resource) { + foreach ($resources_sorted as $key => $resource) { + $title = $resource['title']; + if (empty($title)) { + $title = $key; + } + //echo '
'; print_r($resource);
if (isset($resource['id']) && is_int($resource['id'])) {
// It's a folder.
//hide some folders
@@ -2674,8 +2680,8 @@ return 'application/octet-stream';
$onclick = '';
if ($lp_id) {
$onclick = 'onclick="javascript: testResources(\'' . $resource['id'] . '\',\'img_' . $resource['id'] . '\')"';
- }
-
+ }
+
$return .= '';
$return .= '';
if ($lp_id) {
@@ -2684,7 +2690,7 @@ return 'application/octet-stream';
$return .= ' ';
}
$return .= '
';
- $return .= ''.$key.'';
+ $return .= ''.$title.'';
$return .= '