From 0dbadd4a43653d5186658cae1245ad226f3ac731 Mon Sep 17 00:00:00 2001
From: gnaegi <none@none>
Date: Wed, 30 Sep 2015 14:50:01 +0200
Subject: [PATCH] OO-1711 make iframe internal URL detection recognize all
 sites resources

---
 src/main/webapp/static/js/openolat/iframe.js | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/static/js/openolat/iframe.js b/src/main/webapp/static/js/openolat/iframe.js
index 1a059c4d293..6e089570b80 100644
--- a/src/main/webapp/static/js/openolat/iframe.js
+++ b/src/main/webapp/static/js/openolat/iframe.js
@@ -302,8 +302,19 @@ function b_changeLinkTargets() {
 		if (anchor.getAttribute('href')) {
 			var target = anchor.getAttribute('target');
 			var href = anchor.getAttribute("href");
-			if (href.indexOf("/auth/repo/go?rid=") != -1 || href.indexOf("/url/RepositoryEntry/") != -1
-					|| href.indexOf("/url/BusinessGroup/") != -1 || href.indexOf("/url/CatalogEntry/") != -1) {
+			if (href.indexOf("/auth/repo/go?rid=") != -1 
+					|| (href.indexOf("/url/") != -1 && (
+							href.indexOf("/RepositoryEntry/") != -1 
+							|| href.indexOf("/BusinessGroup/") != -1 
+							|| href.indexOf("Site/", href.indexOf("/url/")) != -1
+							|| href.indexOf("/CatalogEntry/") != -1										
+							|| href.indexOf("/Portal/") != -1
+							|| href.indexOf("/CatalogAdmin/") != -1
+							|| href.indexOf("/CoachSite/") != -1
+							|| href.indexOf("/GMCMenuTree/") != -1
+						)
+					)
+			) {
 				// absolute links to repository entries have to by opened in the parent frame
 				// /auth/repo/ is legacy format, /url/RepositoryEntry/ is new format
 				anchor.target = "_parent";
-- 
GitLab