Source

gd-websites / issuetracker / templates / common.attachments.tpl

  <?php
  if ($attachments && $user->can_view_task($task_details)): ?>
  <div class="attachments">
  <?php foreach ($attachments as $attachment): ?>
    <?php if (file_exists(BASEDIR . '/attachments/' . $attachment['file_name'])): ?>
    <a title="{$attachment['orig_name']}" href="?getfile={$attachment['attachment_id']}">
    <?php else: ?>
    <del>
    <?php endif; ?>
      <?php
      // Strip the mimetype to get the icon image name
      list($main) = explode('/', $attachment['file_type']);
      $imgdir = BASEDIR . "/themes/{$proj->prefs['theme_style']}/mime/";
      $imgpath = "{$baseurl}themes/{$proj->prefs['theme_style']}/mime/";
      if (file_exists($imgdir.$attachment['file_type'] . '.png')):
      ?>
      <img src="{$imgpath}{$attachment['file_type']}.png" alt="({$attachment['file_type']})" title="{$attachment['file_type']}" />
      <?php else: ?>
      <img src="{$imgpath}{$main}.png" alt="" title="{$attachment['file_type']}" />
      <?php endif; ?>
      &nbsp;&nbsp;
      <?php if (utf8_strlen($attachment['orig_name']) > 30): ?>
      {utf8_substr($attachment['orig_name'], 0, 29)}...
      <?php else: ?>
      {$attachment['orig_name']}
      <?php endif; ?>
      <?php if (file_exists(BASEDIR . '/attachments/' . $attachment['file_name'])): ?>
      </a>
      <?php else: ?>
      </del>
      <?php endif; ?>
      <?php if ($attachment['file_size'] < 1000000): ?>
      ({round($attachment['file_size']/1024,1)} {L('KiB')})
      <?php else: ?>
      ({round($attachment['file_size']/1024/1024,2)} {L('MiB')})
      <?php endif; ?>
    <br />
  <?php endforeach; ?>
  </div>
  <?php elseif (count($attachments)): ?>
  <div class="attachments">{L('attachnoperms')}</div>
  <?php endif; ?>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.