You are here

function _support_mail_list_attachments in Support Ticketing System 6

Same name and namespace in other branches
  1. 7 support.module \_support_mail_list_attachments()

List all ticket attachments associated with this update, if any.

1 call to _support_mail_list_attachments()
support_mail_tokens in ./support.module
Return an array of token to value mappings for support e-mail messages.

File

./support.module, line 1251
support.module

Code

function _support_mail_list_attachments($node, $comment) {
  $attachments = array();
  if (empty($comment) && is_object($node) && is_array($node->files)) {
    foreach ($node->files as $fid => $file) {
      $attachments[] = file_create_url($file->filepath);
    }
  }
  else {
    if (isset($comment['files']) && is_array($comment['files'])) {
      foreach ($comment['files'] as $fid => $file) {
        $attachments[] = file_create_url($file['filepath']);
      }
    }
  }
  return !empty($attachments) ? "<br />" . t('Attachments:') . "<br />" . implode("<br />", $attachments) : '';
}