moves the label switch a bit up the controller
This commit is contained in:
@@ -8,12 +8,24 @@
|
||||
*/
|
||||
function ContentEditController($scope, $routeParams, $q, $timeout, $window, contentResource, navigationService, localizationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, formHelper) {
|
||||
|
||||
contentResource.checkPermission("P", $routeParams.id).then(function(hasPermission){
|
||||
var key = "buttons_sendToPublish"
|
||||
if(hasPermission){
|
||||
key = "buttons_saveAndPublish";
|
||||
}
|
||||
|
||||
localizationService.localize(key).then(function(label){
|
||||
$scope.publishButtonLabel = label;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
if ($routeParams.create) {
|
||||
//we are creating so get an empty content item
|
||||
contentResource.getScaffold($routeParams.id, $routeParams.doctype)
|
||||
.then(function(data) {
|
||||
$scope.loaded = true;
|
||||
$scope.content = data;
|
||||
$scope.content = data;
|
||||
});
|
||||
}
|
||||
else {
|
||||
@@ -33,17 +45,6 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont
|
||||
serverValidationManager.executeAndClearAllSubscriptions();
|
||||
|
||||
|
||||
contentResource.checkPermission("P", $routeParams.id).then(function(hasPermission){
|
||||
var key = "buttons_sendToPublish"
|
||||
if(hasPermission){
|
||||
key = "buttons_saveAndPublish";
|
||||
}
|
||||
|
||||
localizationService.localize(key).then(function(label){
|
||||
$scope.publishButtonLabel = label;
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user