Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$.each(allSelectors, function (module, selectors) {
// only add the default "All X Modules" selector
if (selectors === true) {
selectors = [];
}
// use id as initial moduleName
var moduleName = module;
// customize module name
if (module === 'other') {
moduleName = i18n['selector.other'];
} else {
// fetch module name, if module is an moduleId
var moduleInfo = CMS.getModule(module);
if (moduleInfo) {
moduleName = moduleInfo.name;
}
// add All Modules selector
var allXModulesTitle = JSON.parse(JSON.stringify(i18n['selector.allXModules'])) || ['{moduleName}'];
Object.keys(allXModulesTitle).forEach(function (key) {
allXModulesTitle[key] = allXModulesTitle[key].replace('{moduleName}', moduleName);
});
var allXModulesSelector = '.' + module; // TODO: legacy modules added &.moduleId
selectors.unshift({title: allXModulesTitle, selector: allXModulesSelector});
}