You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

part.list.php 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <input type="hidden" id="disableSharing" data-status="<?php echo $_['disableSharing']; ?>">
  2. <?php foreach($_['files'] as $file):
  3. $simple_file_size = OCP\simple_file_size($file['size']);
  4. // the bigger the file, the darker the shade of grey; megabytes*2
  5. $simple_size_color = intval(200-$file['size']/(1024*1024)*2);
  6. if($simple_size_color<0) $simple_size_color = 0;
  7. $relative_modified_date = OCP\relative_modified_date($file['mtime']);
  8. // the older the file, the brighter the shade of grey; days*14
  9. $relative_date_color = round((time()-$file['mtime'])/60/60/24*14);
  10. if($relative_date_color>200) $relative_date_color = 200;
  11. $name = str_replace('+', '%20', urlencode($file['name']));
  12. $name = str_replace('%2F', '/', $name);
  13. $directory = str_replace('+', '%20', urlencode($file['directory']));
  14. $directory = str_replace('%2F', '/', $directory); ?>
  15. <tr data-id="<?php echo $file['id']; ?>"
  16. data-file="<?php echo $name;?>"
  17. data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>"
  18. data-mime="<?php echo $file['mimetype']?>"
  19. data-size='<?php echo $file['size'];?>'
  20. data-permissions='<?php echo $file['permissions']; ?>'>
  21. <td class="filename svg"
  22. <?php if($file['type'] == 'dir'): ?>
  23. style="background-image:url(<?php echo OCP\mimetype_icon('dir'); ?>)"
  24. <?php else: ?>
  25. style="background-image:url(<?php echo OCP\mimetype_icon($file['mimetype']); ?>)"
  26. <?php endif; ?>
  27. >
  28. <?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?>
  29. <?php if($file['type'] == 'dir'): ?>
  30. <a class="name" href="<?php $_['baseURL'].$directory.'/'.$name; ?>)" title="">
  31. <?php else: ?>
  32. <a class="name" href="<?php echo $_['downloadURL'].$directory.'/'.$name; ?>" title="">
  33. <?php endif; ?>
  34. <span class="nametext">
  35. <?php if($file['type'] == 'dir'):?>
  36. <?php echo htmlspecialchars($file['name']);?>
  37. <?php else:?>
  38. <?php echo htmlspecialchars($file['basename']);?><span
  39. class='extension'><?php echo $file['extension'];?></span>
  40. <?php endif;?>
  41. </span>
  42. <?php if($file['type'] == 'dir'):?>
  43. <span class="uploadtext" currentUploads="0">
  44. </span>
  45. <?php endif;?>
  46. </a>
  47. </td>
  48. <td class="filesize"
  49. title="<?php echo OCP\human_file_size($file['size']); ?>"
  50. style="color:rgb(<?php echo $simple_size_color.','.$simple_size_color.','.$simple_size_color ?>)">
  51. <?php echo $simple_file_size; ?>
  52. </td>
  53. <td class="date">
  54. <span class="modified"
  55. title="<?php echo $file['date']; ?>"
  56. style="color:rgb(<?php echo $relative_date_color.','
  57. .$relative_date_color.','
  58. .$relative_date_color ?>)">
  59. <?php echo $relative_modified_date; ?>
  60. </span>
  61. </td>
  62. </tr>
  63. <?php endforeach;