var captionError = (caption ? DomTraverse.childByClass(caption.parentNode.parentNode, 'innerError') : false);
var titleError = DomTraverse.childByClass(title.parentNode.parentNode, 'innerError');
+ // category
+ this._oldCategoryId = this._media.categoryID;
+ if (this._categoryIds.length) {
+ this._media.categoryID = ~~categoryId.value;
+
+ // if the selected category id not valid (manipulated DOM), ignore
+ if (this._categoryIds.indexOf(this._media.categoryID) === -1) {
+ this._media.categoryID = 0;
+ }
+ }
+
+ // language and multilingualism
if (this._availableLanguageCount > 1) {
this._media.isMultilingual = ~~elBySel('input[name=isMultilingual]', content).checked;
- this._media.languageID = this._media.isMultilingual ? null : LanguageChooser.getLanguageId('languageID');
+ this._media.languageID = this._media.isMultilingual ? null : LanguageChooser.getLanguageId('mediaEditor_' + this._media.mediaID + '_languageID');
}
else {
this._media.languageID = LANGUAGE_ID;
// make sure that the language chooser is initialized first
setTimeout(function() {
if (this._availableLanguageCount > 1) {
- LanguageChooser.setLanguageId('languageID', this._media.languageID || LANGUAGE_ID);
+ LanguageChooser.setLanguageId('mediaEditor_' + this._media.mediaID + '_languageID', this._media.languageID || LANGUAGE_ID);
}
+ if (this._categoryIds.length) {
+ elBySel('select[name=categoryID]', content).value = ~~this._media.categoryID;
+ }
+
var title = elBySel('input[name=title]', content);
var altText = elBySel('input[name=altText]', content);
var caption = elBySel('textarea[name=caption]', content);