| Server IP : 213.186.33.4 / Your IP : 216.73.216.193 Web Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : awebpaca ( 35430) PHP Version : 8.5.0 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/awebpaca/piwik/plugins/TagManager/angularjs/manageVariable/ |
Upload File : |
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
(function () {
angular.module('piwikApp').controller('VariableListController', VariableListController);
VariableListController.$inject = ['$scope', 'tagManagerVariableModel', 'piwik', 'piwikApi', '$location'];
function VariableListController($scope, tagManagerVariableModel, piwik, piwikApi, $location) {
this.model = tagManagerVariableModel;
this.hasWriteAccess = piwik.hasUserCapability('tagmanager_write');
var self = this;
this.idContainer = $scope.idContainer;
this.idContainerVersion = $scope.idContainerVersion;
this.variableReferences = [];
this.createVariable = function () {
this.editVariable(0);
};
this.editVariable = function (idVariable) {
var $search = $location.search();
$search.idVariable = idVariable;
$location.search($search);
};
this.deleteVariable = function (variable) {
piwikApi.fetch({method: 'TagManager.getContainerVariableReferences', idContainer: this.idContainer,
idContainerVersion: this.idContainerVersion, idVariable: variable.idvariable}).then(function (references) {
if (!references || !references.length) {
self.variableReferences = [];
function doDelete() {
tagManagerVariableModel.deleteVariable(self.idContainer, self.idContainerVersion, variable.idvariable).then(function () {
tagManagerVariableModel.reload(self.idContainer, self.idContainerVersion);
});
}
piwik.helper.modalConfirm('#confirmDeleteVariable', {yes: doDelete});
} else {
self.variableReferences = references;
piwik.helper.modalConfirm('#confirmDeleteVariableNotPossible', {});
}
});
};
this.model.fetchVariables(this.idContainer, this.idContainerVersion);
this.model.fetchAvailableContainerVariables(this.idContainer, this.idContainerVersion).then(function (variables) {
self.containerVariables = variables;
});
}
})();