diff --git a/airtime_mvc/application/services/PublishService.php b/airtime_mvc/application/services/PublishService.php
index 5f21b4ddd..8673efafe 100644
--- a/airtime_mvc/application/services/PublishService.php
+++ b/airtime_mvc/application/services/PublishService.php
@@ -29,7 +29,7 @@ class Application_Service_PublishService {
public static function publish($fileId, $data) {
foreach ($data as $k => $v) {
$service = PublishServiceFactory::getService($k);
- if ($v) $service->publish($fileId);
+ $service->$v($fileId);
}
}
diff --git a/airtime_mvc/application/views/scripts/library/publish-dialog.phtml b/airtime_mvc/application/views/scripts/library/publish-dialog.phtml
index 15911a68a..fc5f6df43 100644
--- a/airtime_mvc/application/views/scripts/library/publish-dialog.phtml
+++ b/airtime_mvc/application/views/scripts/library/publish-dialog.phtml
@@ -21,8 +21,8 @@
- "
- . "Published tracks can be removed or updated below.") ?>
+ "
+ . _("Published tracks can be removed or updated below.") ?>
diff --git a/airtime_mvc/public/js/airtime/library/publish.js b/airtime_mvc/public/js/airtime/library/publish.js
index 021e5d7bc..19986c540 100644
--- a/airtime_mvc/public/js/airtime/library/publish.js
+++ b/airtime_mvc/public/js/airtime/library/publish.js
@@ -41,17 +41,28 @@ var AIRTIME = (function (AIRTIME) {
}
$scope.publish = function () {
- $http.put(endpoint + mediaId + '/publish',
- {
- csrf_token: jQuery("#csrf").val(),
- sources: $scope.publishData
- }).success(function () {
- init();
- });
+ var data = {};
+ jQuery.each($scope.publishData, function(k, v) {
+ if (v) {
+ data[k] = 'publish'; // FIXME: should be more robust
+ }
+ });
+
+ if (Object.keys(data).length > 0) {
+ $http.put(endpoint + mediaId + '/publish', { csrf_token: jQuery("#csrf").val(), sources: data})
+ .success(function () {
+ init();
+ });
+ }
};
$scope.remove = function (source) {
- // TODO
+ var data = {};
+ data[source] = 'unpublish'; // FIXME: should be more robust
+ $http.put(endpoint + mediaId + '/publish', { csrf_token: jQuery("#csrf").val(), sources: data })
+ .success(function () {
+ init();
+ });
};
$scope.discard = function () {