pass cultures to publish method

This commit is contained in:
Mads Rasmussen
2018-11-02 13:11:48 +01:00
parent a2f4c317e9
commit b3e5f59fe4

View File

@@ -417,7 +417,16 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
view: "views/propertyeditors/listview/overlays/listviewpublish.html",
submitButtonLabelKey: "actions_publish",
submit: function (model) {
performPublish();
// create a comma seperated array of selected cultures
let selectedCultures = [];
if(model.languages && model.languages.length > 0) {
model.languages.forEach(language => {
if(language.publish) {
selectedCultures.push(language.culture);
}
});
}
performPublish(selectedCultures);
overlayService.close();
},
close: function () {
@@ -441,9 +450,9 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
};
function performPublish() {
function performPublish(cultures) {
applySelected(
function (selected, index) { return contentResource.publishById(getIdCallback(selected[index])); },
function (selected, index) { return contentResource.publishById(getIdCallback(selected[index]), cultures); },
function (count, total) {
var key = (total === 1 ? "bulk_publishedItemOfItem" : "bulk_publishedItemOfItems");
return localizationService.localize(key, [count, total]);