Magellan Linux

Contents of /trunk/flyspray/themes/Magellan/templates/common.attachments.tpl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (show annotations) (download)
Thu Mar 24 13:33:23 2016 UTC (8 years, 2 months ago) by niro
File size: 2346 byte(s)
-import flyspray-1.0-beta Magellan theme
1 <?php
2 if ($attachments && $user->can_view_task($task_details)): ?>
3 <div class="attachments">
4 <?php foreach ($attachments as $attachment): ?>
5 <?php if (file_exists(BASEDIR . '/attachments/' . $attachment['file_name'])): ?>
6 <a title="<?php echo Filters::noXSS($attachment['orig_name']); ?>" href="?getfile=<?php echo Filters::noXSS($attachment['attachment_id']); ?>" <?php if (substr($attachment['file_type'], 0, 5) == 'image'): ?>rel="lightbox[bug]"<?php endif; ?>>
7 <?php else: ?>
8 <del>
9 <?php endif; ?>
10 <?php
11 // Strip the mimetype to get the icon image name
12 list($main) = explode('/', $attachment['file_type']);
13 $imgdir = BASEDIR . "/themes/".Filters::noXSS($proj->prefs['theme_style'])."/mime/";
14 $imgpath = Filters::noXSS($baseurl)."themes/".Filters::noXSS($proj->prefs['theme_style'])."/mime/";
15 if (file_exists($imgdir.$attachment['file_type'] . '.png')):
16 ?>
17 <img src="<?php echo Filters::noXSS($imgpath); ?><?php echo Filters::noXSS($attachment['file_type']); ?>.png" alt="(<?php echo Filters::noXSS($attachment['file_type']); ?>)" title="<?php echo Filters::noXSS($attachment['file_type']); ?>" />
18 <?php else: ?>
19 <img src="<?php echo Filters::noXSS($imgpath); ?><?php echo Filters::noXSS($main); ?>.png" alt="" title="<?php echo Filters::noXSS($attachment['file_type']); ?>" />
20 <?php endif; ?>
21 &nbsp;&nbsp;
22 <?php if (utf8_strlen($attachment['orig_name']) > 30): ?>
23 <?php echo Filters::noXSS(utf8_substr($attachment['orig_name'], 0, 29)); ?>...
24 <?php else: ?>
25 <?php echo Filters::noXSS($attachment['orig_name']); ?>
26
27 <?php endif; ?>
28 <?php if (file_exists(BASEDIR . '/attachments/' . $attachment['file_name'])): ?>
29 </a>
30 <?php else: ?>
31 </del>
32 <?php endif; ?>
33 <?php if ($attachment['file_size'] < 1000000): ?>
34 (<?php echo Filters::noXSS(round($attachment['file_size']/1024,1)); ?> <?php echo Filters::noXSS(L('KiB')); ?>)
35 <?php else: ?>
36 (<?php echo Filters::noXSS(round($attachment['file_size']/1024/1024,2)); ?> <?php echo Filters::noXSS(L('MiB')); ?>)
37 <?php endif; ?>
38 <br />
39 <?php endforeach; ?>
40 </div>
41 <?php elseif (count($attachments)): ?>
42 <div class="attachments"><?php echo Filters::noXSS(L('attachnoperms')); ?></div>
43 <?php endif; ?>