(function() {
  var XWiki = window.XWiki || {};
  XWiki.index = XWiki.index || {};
  XWiki.index.displayAttachmentEntry = function (row, i, table) {
    var tr = new Element('tr');
    if (row.acclev == true) {
      tr.appendChild(new Element('td').update(row.mimeType));
      var fileLink = new Element('a', {'href': row.fileurl}).update(row.filename.escapeHTML());
      tr.appendChild(new Element('td').update(fileLink));
      tr.appendChild(new Element('td', {'class': 'location'}).update(row.fullName));
      tr.appendChild(new Element('td').update(row.filesize));
      tr.appendChild(new Element('td').update(row.date.escapeHTML()));
      tr.appendChild(new Element('td').update(row.author));
    } else {
      tr.appendChild(new Element('td'));
      tr.appendChild(new Element('td'));
      tr.appendChild(new Element('td', {'class': 'location'}).update(row.fullName + '*'));
      tr.appendChild(new Element('td'));
      tr.appendChild(new Element('td'));
      tr.appendChild(new Element('td'));
      $('inaccessibleDocsMessage').removeClassName('hidden');
    }
    return tr;
  }
})();
