From 524f2b0f03b42b51da3750d57e9317a9c9d28fdc Mon Sep 17 00:00:00 2001
From: Nathan Gray <nathangray.bsc@gmail.com>
Date: Thu, 18 Jul 2013 09:13:15 +0000
Subject: [PATCH] Use an etemplate / top template level prefix to avoid DOM ID
 collisions

---
 etemplate/js/etemplate2.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js
index 7c77ed3999..146e9adfa7 100644
--- a/etemplate/js/etemplate2.js
+++ b/etemplate/js/etemplate2.js
@@ -82,7 +82,10 @@ function etemplate2(_container, _menuaction)
 	// Copy the given parameters
 	this.DOMContainer = _container;
 	this.menuaction = _menuaction;
-
+	
+	// Unique ID to prevent DOM collisions across multiple templates
+	this.uniqueId = egw().uid() + "-" + _container.getAttribute("id");
+	
 	// Preset the object variable
 	this.widgetContainer = null;