/usr/local/jetapps/var/www/jetbackup5/docroot/app/showcase/115_wordpressIntegration
'use strict'; define(['app'], function(app) { app.controller("wordpressIntegration115", ["$rootScope", "$scope", "api", "consts", function ($rootScope, $scope, api, consts) { var name = 'wordpressIntegration'; var order = 115; var feature = { _id: order + "_" + name, feature: name, order: order, }; $scope.vendors = angular.copy(window.PAGE.wp_integrations); $scope.permission = 1; $scope.mass = 0; $scope.integrations = window.PAGE.wp_integrations; $scope.toggleVendor = function(vendor) { var index = $scope.vendors.indexOf(vendor); if (index > -1) $scope.vendors.splice(index, 1); else $scope.vendors.push(vendor); }; $scope.isVendorEnabled = function (vendor) { return $scope.vendors.indexOf(vendor) >= 0; }; $scope.togglePermissions = function(callback) { if(callback === undefined || typeof callback !== 'function') callback = function(){}; api.managePermissions({ data: { permissions: { [consts.PERMISSIONS_CAN_ACCESS_SOCKET_API]: $scope.permission } }, success: callback, failed: function (message) { alert.error(message); } }); }; $scope.massDeploy = function(callback) { if(callback === undefined || typeof callback !== 'function') callback = function(){}; api.runExtensionDeployment({ success: callback, failed: function (message) { alert.error(message); } }); }; $scope.$on('save', function () { api.manageSettings({ data: { section: 'extension', vendors: $scope.vendors }, success: function () { $scope.togglePermissions(function () { if($scope.mass == 1) { $scope.massDeploy(function () { $rootScope.$emit("approve", feature); }); } else { $rootScope.$emit("approve", feature); } }); }, failed: function (message) { alert.error(message); } }); }); } ] ); });
.
Edit
..
Edit
controller.js
Edit
view.htm
Edit