Blame view

sources/apps/files_trashbin/templates/part.list.php 3.18 KB
03e52840d   Kload   Init
1
2
3
4
5
  <?php foreach($_['files'] as $file):
  	$relative_deleted_date = OCP\relative_modified_date($file['timestamp']);
  	// the older the file, the brighter the shade of grey; days*14
  	$relative_date_color = round((time()-$file['date'])/60/60/24*14);
  	if($relative_date_color>200) $relative_date_color = 200;
31b7f2792   Kload   Upgrade to ownclo...
6
7
  	$name = \OCP\Util::encodePath($file['name']);
  	$directory = \OCP\Util::encodePath($file['directory']); ?>
03e52840d   Kload   Init
8
  	<tr data-filename="<?php p($file['name']);?>"
31b7f2792   Kload   Upgrade to ownclo...
9
  		data-type="<?php ($file['type'] === 'dir')?p('dir'):p('file')?>"
03e52840d   Kload   Init
10
11
12
13
  		data-mime="<?php p($file['mimetype'])?>"
  		data-permissions='<?php p($file['permissions']); ?>'
  		<?php if ( $_['dirlisting'] ): ?>
  		id="<?php p($file['directory'].'/'.$file['name']);?>"
31b7f2792   Kload   Upgrade to ownclo...
14
  		data-file="<?php p($name);?>"
03e52840d   Kload   Init
15
16
17
18
19
20
21
22
  		data-timestamp=''
  		data-dirlisting=1
  		<?php  else: ?>
  		id="<?php p($file['name'].'.d'.$file['timestamp']);?>"
  		data-file="<?php p($file['name'].'.d'.$file['timestamp']);?>"
  		data-timestamp='<?php p($file['timestamp']);?>'
  		data-dirlisting=0
  		<?php endif; ?>>
31b7f2792   Kload   Upgrade to ownclo...
23
24
25
  		<?php if($file['isPreviewAvailable']): ?>
  		<td class="filename svg preview-icon"
  		<?php else: ?>
03e52840d   Kload   Init
26
  		<td class="filename svg"
31b7f2792   Kload   Upgrade to ownclo...
27
28
  		<?php endif; ?>
  		<?php if($file['type'] === 'dir'): ?>
03e52840d   Kload   Init
29
30
  			style="background-image:url(<?php print_unescaped(OCP\mimetype_icon('dir')); ?>)"
  		<?php else: ?>
31b7f2792   Kload   Upgrade to ownclo...
31
32
33
34
35
  				<?php if($file['isPreviewAvailable']): ?>
  				style="background-image:url(<?php print_unescaped(OCA\Files_Trashbin\Trashbin::preview_icon(!$_['dirlisting'] ? ($file['name'].'.d'.$file['timestamp']) : ($file['directory'].'/'.$file['name']))); ?>)"
  				<?php else: ?>
  				style="background-image:url(<?php print_unescaped(OCP\mimetype_icon($file['mimetype'])); ?>)"
  				<?php endif; ?>
03e52840d   Kload   Init
36
37
  		<?php endif; ?>
  			>
31b7f2792   Kload   Upgrade to ownclo...
38
39
40
41
42
  		<?php if(!isset($_['readonly']) || !$_['readonly']): ?>
  			<input id="select-<?php p($file['id']); ?>" type="checkbox" />
  			<label for="select-<?php p($file['id']); ?>"></label>
  		<?php endif; ?>
  		<?php if($file['type'] === 'dir'): ?>
03e52840d   Kload   Init
43
  			<?php if( $_['dirlisting'] ): ?>
31b7f2792   Kload   Upgrade to ownclo...
44
  				<a class="name dir" href="<?php p($_['baseURL'].'/'.$name); ?>" title="">
03e52840d   Kload   Init
45
  			<?php else: ?>
31b7f2792   Kload   Upgrade to ownclo...
46
  				<a class="name dir" href="<?php p($_['baseURL'].'/'.$name.'.d'.$file['timestamp']); ?>" title="">
03e52840d   Kload   Init
47
48
49
  			<?php endif; ?>
  		<?php else: ?>
  			<?php if( $_['dirlisting'] ): ?>
31b7f2792   Kload   Upgrade to ownclo...
50
  				<a class="name file" href="<?php p($_['downloadURL'].'/'.$name); ?>" title="">
03e52840d   Kload   Init
51
  			<?php else: ?>
31b7f2792   Kload   Upgrade to ownclo...
52
  				<a class="name file" href="<?php p($_['downloadURL'].'/'.$name.'.d'.$file['timestamp']);?>" title="">
03e52840d   Kload   Init
53
54
55
  			<?php endif; ?>
  		<?php endif; ?>
  			<span class="nametext">
31b7f2792   Kload   Upgrade to ownclo...
56
  				<?php if($file['type'] === 'dir'):?>
03e52840d   Kload   Init
57
58
59
60
61
62
  					<?php print_unescaped(htmlspecialchars($file['name']));?>
  				<?php else:?>
  					<?php print_unescaped(htmlspecialchars($file['basename']));?><span
  						class='extension'><?php p($file['extension']);?></span>
  				<?php endif;?>
  			</span>
31b7f2792   Kload   Upgrade to ownclo...
63
  			<?php if($file['type'] === 'dir'):?>
03e52840d   Kload   Init
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
  				<span class="uploadtext" currentUploads="0">
  				</span>
  			<?php endif;?>
  			</a>
  		</td>
  		<td class="date">
  			<span class="modified"
  				  title="<?php p($file['date']); ?>"
  				  style="color:rgb(<?php p($relative_date_color.','
  												.$relative_date_color.','
  												.$relative_date_color) ?>)">
  				<?php p($relative_deleted_date); ?>
  			</span>
  		</td>
  	</tr>
  <?php endforeach;