function MediaUpload(buttonContainerId, targetId, options) {
options = options || {};
+ this._elementTagSize = 144;
+ if (options.elementTagSize) {
+ this._elementTagSize = options.elementTagSize;
+ }
+
this._mediaManager = null;
if (options.mediaManager) {
this._mediaManager = options.mediaManager;
* @see WoltLabSuite/Core/Upload#_getParameters
*/
_getParameters: function() {
+ var parameters = {
+ elementTagSize: this._elementTagSize
+ };
if (this._mediaManager) {
- var parameters = {
- imagesOnly: this._mediaManager.getOption('imagesOnly')
- };
+ parameters.imagesOnly = this._mediaManager.getOption('imagesOnly');
var categoryId = this._mediaManager.getCategoryId();
if (categoryId) {
parameters.categoryID = categoryId;
}
-
- return Core.extend(MediaUpload._super.prototype._getParameters.call(this), parameters);
}
- return MediaUpload._super.prototype._getParameters.call(this);
+ return Core.extend(MediaUpload._super.prototype._getParameters.call(this), parameters);
},
/**
* @param {integer} size size of the file icon in pixels
*/
_replaceFileIcon: function(fileIcon, media, size) {
- if (media.tinyThumbnailType) {
+ if (media.elementTag) {
+ fileIcon.parentElement.innerHTML = media.elementTag;
+ }
+ else if (media.tinyThumbnailType) {
var img = elCreate('img');
elAttr(img, 'src', media.tinyThumbnailLink);
elAttr(img, 'alt', '');
}
// fetch media objects from database
- $mediaList = new MediaList();
+ $mediaList = new ViewableMediaList();
$mediaList->setObjectIDs($mediaIDs);
$mediaList->readObjects();
'caption' => $media instanceof ViewableMedia ? $media->caption : [],
'captionEnableHtml' => $media->captionEnableHtml,
'categoryID' => $media->categoryID,
+ 'elementTag' => $media instanceof ViewableMedia ? $media->getElementTag($this->parameters['elementTagSize'] ?? 144) : '',
'fileHash' => $media->fileHash,
'filename' => $media->filename,
'filesize' => $media->filesize,