Index: main/kernel/resources/js/org/ametys/Utility.js =================================================================== --- main/kernel/resources/js/org/ametys/Utility.js (revision 20590) +++ main/kernel/resources/js/org/ametys/Utility.js (working copy) @@ -124,3 +124,32 @@ return Ext.data.SortTypes.asUCString(s); } + +Utils.getObjectByName = function(name, context) +{ + if (!name) return null; + + if (context === undefined) context = window; + + var ns = name.split("."), + nsl = ns.length, + obj = context, + p; + + for (var i = 0; i < nsl; i++) + { + p = ns[i]; + + if (p in obj) + { + obj = obj[p]; + } + else + { + // Object not found; + return null; + } + } + + return obj; +}