These have been meaningless metrics for most of the time and also do not play nicely with the efficient distribution of files.
import { generateThumbnails } from "WoltLabSuite/Core/Api/Files/GenerateThumbnails";
import ImageResizer from "WoltLabSuite/Core/Image/Resizer";
import { AttachmentData } from "../Ckeditor/Attachment";
+import { innerError } from "WoltLabSuite/Core/Dom/Util";
export type CkeditorDropEvent = {
file: File;
}
}
- // TODO: show an error message
+ innerError(element, `TODO: the file extension of '${file.name}' is not allowed`);
return false;
}
<th class="columnTitle columnFilename{if $sortField == 'filename'} active {@$sortOrder}{/if}"><a href="{link controller='AttachmentList'}pageNo={@$pageNo}&sortField=filename&sortOrder={if $sortField == 'filename' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@$linkParameters}{/link}">{lang}wcf.attachment.filename{/lang}</a></th>
<th class="columnDate columnUploadTime{if $sortField == 'uploadTime'} active {@$sortOrder}{/if}"><a href="{link controller='AttachmentList'}pageNo={@$pageNo}&sortField=uploadTime&sortOrder={if $sortField == 'uploadTime' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@$linkParameters}{/link}">{lang}wcf.attachment.uploadTime{/lang}</a></th>
<th class="columnDigits columnFilesize{if $sortField == 'filesize'} active {@$sortOrder}{/if}"><a href="{link controller='AttachmentList'}pageNo={@$pageNo}&sortField=filesize&sortOrder={if $sortField == 'filesize' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@$linkParameters}{/link}">{lang}wcf.attachment.filesize{/lang}</a></th>
- <th class="columnDigits columnDownloads{if $sortField == 'downloads'} active {@$sortOrder}{/if}"><a href="{link controller='AttachmentList'}pageNo={@$pageNo}&sortField=downloads&sortOrder={if $sortField == 'downloads' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@$linkParameters}{/link}">{lang}wcf.attachment.downloads{/lang}</a></th>
- <th class="columnDate columnLastDownloadTime{if $sortField == 'lastDownloadTime'} active {@$sortOrder}{/if}"><a href="{link controller='AttachmentList'}pageNo={@$pageNo}&sortField=lastDownloadTime&sortOrder={if $sortField == 'lastDownloadTime' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@$linkParameters}{/link}">{lang}wcf.attachment.lastDownloadTime{/lang}</a></th>
{event name='columnHeads'}
</tr>
</td>
<td class="columnDate columnUploadTime">{@$attachment->uploadTime|time}</td>
<td class="columnDigits columnFilesize">{@$attachment->filesize|filesize}</td>
- <td class="columnDigits columnDownloads">{#$attachment->downloads}</td>
- <td class="columnDate columnLastDownloadTime">{if $attachment->lastDownloadTime}{@$attachment->lastDownloadTime|time}{/if}</td>
{event name='columns'}
</tr>
-define(["require", "exports", "tslib", "WoltLabSuite/Core/Helper/Selector", "WoltLabSuite/Core/Api/Files/Upload", "WoltLabSuite/Core/Api/Files/Chunk/Chunk", "WoltLabSuite/Core/Api/Files/GenerateThumbnails", "WoltLabSuite/Core/Image/Resizer"], function (require, exports, tslib_1, Selector_1, Upload_1, Chunk_1, GenerateThumbnails_1, Resizer_1) {
+define(["require", "exports", "tslib", "WoltLabSuite/Core/Helper/Selector", "WoltLabSuite/Core/Api/Files/Upload", "WoltLabSuite/Core/Api/Files/Chunk/Chunk", "WoltLabSuite/Core/Api/Files/GenerateThumbnails", "WoltLabSuite/Core/Image/Resizer", "WoltLabSuite/Core/Dom/Util"], function (require, exports, tslib_1, Selector_1, Upload_1, Chunk_1, GenerateThumbnails_1, Resizer_1, Util_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setup = void 0;
return true;
}
}
- // TODO: show an error message
+ (0, Util_1.innerError)(element, `TODO: the file extension of '${file.name}' is not allowed`);
return false;
}
function setup() {
/**
* @inheritDoc
*/
- public $validSortFields = ['attachmentID', 'filename', 'filesize', 'downloads', 'uploadTime', 'lastDownloadTime'];
+ public $validSortFields = ['attachmentID', 'filename', 'filesize', 'uploadTime'];
/**
* @inheritDoc
* @property-read int $thumbnailSize size of the thumbnail file for the attachment if `$isImage` is `1`, otherwise `0`
* @property-read int $thumbnailWidth width of the thumbnail file for the attachment if `$isImage` is `1`, otherwise `0`
* @property-read int $thumbnailHeight height of the thumbnail file for the attachment if `$isImage` is `1`, otherwise `0`
- * @property-read int $downloads number of times the attachment has been downloaded
- * @property-read int $lastDownloadTime timestamp at which the attachment has been downloaded the last time
* @property-read int $uploadTime timestamp at which the attachment has been uploaded
* @property-read int $showOrder position of the attachment in relation to the other attachment to the same message
* @property-read int|null $fileID
#[\Override]
public function __get($name)
{
+ // Deprecated attributes that are no longer supported.
+ $value = match ($name) {
+ 'downloads' => 0,
+ 'lastDownloadTime' => 0,
+ default => null,
+ };
+ if ($value !== null) {
+ return $value;
+ }
+
$file = $this->getFile();
if ($file === null) {
return parent::__get($name);
<item name="wcf.attachment.filename"><![CDATA[Dateiname]]></item>
<item name="wcf.attachment.uploadTime"><![CDATA[Hochgeladen]]></item>
<item name="wcf.attachment.filesize"><![CDATA[Größe]]></item>
- <item name="wcf.attachment.downloads"><![CDATA[Downloads]]></item>
- <item name="wcf.attachment.lastDownloadTime"><![CDATA[Letzter Download]]></item>
<item name="wcf.attachment.fileType"><![CDATA[Dateityp]]></item>
<item name="wcf.attachment.dragAndDrop.dropHere"><![CDATA[Hierhin ziehen und loslassen, um Dateien hochzuladen]]></item>
<item name="wcf.attachment.dragAndDrop.dropNow"><![CDATA[Jetzt loslassen, um Dateien hochzuladen]]></item>
<item name="wcf.attachment.filename"><![CDATA[Filename]]></item>
<item name="wcf.attachment.uploadTime"><![CDATA[Upload Time]]></item>
<item name="wcf.attachment.filesize"><![CDATA[File Size]]></item>
- <item name="wcf.attachment.downloads"><![CDATA[Downloads]]></item>
- <item name="wcf.attachment.lastDownloadTime"><![CDATA[Last Download]]></item>
<item name="wcf.attachment.fileType"><![CDATA[Type]]></item>
<item name="wcf.attachment.dragAndDrop.dropHere"><![CDATA[Drag and Drop here to upload]]></item>
<item name="wcf.attachment.dragAndDrop.dropNow"><![CDATA[Drop now to upload]]></item>