From 274262262aaef06691f87220853f4aa4886ece4c Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 24 Jun 2026 15:35:31 +0200 Subject: [PATCH 1/2] iframe_content: only replace ../ to be able to use index.ci.php in menu entry --- public/js/components/Cis/Cms/Content_types/Iframe_content.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/js/components/Cis/Cms/Content_types/Iframe_content.js b/public/js/components/Cis/Cms/Content_types/Iframe_content.js index 568cfaf03..d5a04410d 100644 --- a/public/js/components/Cis/Cms/Content_types/Iframe_content.js +++ b/public/js/components/Cis/Cms/Content_types/Iframe_content.js @@ -1,5 +1,3 @@ -import { replaceRelativeLegacyLink } from "../../../../helpers/LegacyLinkReplaceHelper.js"; - export default { name: "iframe_content", props: { @@ -15,7 +13,7 @@ export default { return ""; let url = iframe.getAttribute("src") || ""; - return replaceRelativeLegacyLink(url); + return url.replace(/\.\.\//, FHC_JS_DATA_STORAGE_OBJECT.app_root); } }, template: ` From 7f9dcc43ad7853a5e7064a05660f025d97cf4ef1 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 24 Jun 2026 15:41:47 +0200 Subject: [PATCH 2/2] add Compat iframe controller and component --- application/controllers/Cis/Compat.php | 44 +++++++++++ public/js/apps/Cis/Cis.js | 13 ++++ public/js/components/Cis/Compat.js | 101 +++++++++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 application/controllers/Cis/Compat.php create mode 100644 public/js/components/Cis/Compat.js diff --git a/application/controllers/Cis/Compat.php b/application/controllers/Cis/Compat.php new file mode 100644 index 000000000..5c99d8bfc --- /dev/null +++ b/application/controllers/Cis/Compat.php @@ -0,0 +1,44 @@ + ['basis/cis:r'], + 'legacy' => ['basis/cis:r'], + + ]); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + + /** + * @access public + * @return void + */ + public function ci() + { + $this->load->view('CisRouterView/CisRouterView.php',['route' => 'Compat']); + } + + /** + * @access public + * @return void + */ + public function legacy() + { + $this->load->view('CisRouterView/CisRouterView.php',['route' => 'Compat']); + } + +} diff --git a/public/js/apps/Cis/Cis.js b/public/js/apps/Cis/Cis.js index a3744515e..2896775b4 100644 --- a/public/js/apps/Cis/Cis.js +++ b/public/js/apps/Cis/Cis.js @@ -22,6 +22,7 @@ import OtherLvPlan from "../../components/Cis/LvPlan/OtherLvPlan.js"; import PaabgabeUebersicht from "../../components/Cis/ProjektabgabeUebersicht/ProjektabgabeUebersicht.js"; import Benotungstool from "../../components/Cis/Benotungstool/Benotungstool.js"; import Zeitsperren from "../../components/Cis/Zeitsperren/Zeitsperren.js"; +import Compat from "../../components/Cis/Compat.js"; import ApiRouteInfo from '../../api/factory/routeinfo.js'; import {capitalize} from "../../helpers/StringHelpers.js"; @@ -33,6 +34,18 @@ const isMobile = window.matchMedia("(max-width: 767px)").matches; const router = VueRouter.createRouter({ history: VueRouter.createWebHistory(`/${ciPath}`), routes: [ + { + path: `/Cis/Compat/:mode(ci|legacy)/:path(.*)`, + name: 'Compat', + component: Compat, + props: (route) => { + return { + mode: route.params.mode, + path: route.params.path, + query_string: VueRouter.stringifyQuery(route.query) + }; + } + }, { path: `/Cis/Studium`, name: 'Studium', diff --git a/public/js/components/Cis/Compat.js b/public/js/components/Cis/Compat.js new file mode 100644 index 000000000..853c83109 --- /dev/null +++ b/public/js/components/Cis/Compat.js @@ -0,0 +1,101 @@ +export default { + name: "Compat", + props: { + mode: { type: String, required: true }, + path: { type: String, required: true }, + query_string: { type: String, required: true, default: ''} + }, + data: function() { + return { + lastLoadediFrameURL: '', + srcUrl: '' + }; + }, + computed: { + propsWatchHelper: function() { + return this.mode + '#' + this.path + '#' + this.query_string; + } + }, + mounted: function() { + this.srcUrl = this.buildSrcUrl(); + }, + watch: { + propsWatchHelper: function() { + let currentiFrameURL = this.$refs.compatiframe ? this.$refs.compatiframe.src : ''; + + console.log('currentiFrameURL: ' + currentiFrameURL); + console.log('lastLoadediFrameURL: ' + this.lastLoadediFrameURL); + + let url = this.buildSrcUrl(); + if(this.lastLoadediFrameURL !== url) { + this.srcUrl = url; + } + } + }, + methods: { + buildSrcUrl: function() { + console.log('srcUrl begin: ' + this.path); + + let url = false; + switch(this.mode) { + case 'ci': + url = FHC_JS_DATA_STORAGE_OBJECT.app_root + 'index.ci.php/' + this.path; + break; + case 'legacy': + url = FHC_JS_DATA_STORAGE_OBJECT.app_root + this.path; + break; + default: + url = false; + } + if(this.query_string !== '' && url) { + url += '?' + this.query_string; + } + + console.log('srcUrl end: ' + url); + return url; + }, + loadHandler: function() { + console.log('loadHandler'); + console.log(JSON.stringify(this.$refs.compatiframe.contentWindow.location)); + + let iframe_href = this.$refs.compatiframe.contentWindow.location.href; + let ci_urlstart = FHC_JS_DATA_STORAGE_OBJECT.app_root + 'index.ci.php/'; + let legacy_urlstart = FHC_JS_DATA_STORAGE_OBJECT.app_root; + let routerpath = null; + + this.lastLoadediFrameURL = iframe_href; + + console.log('iframe_href: ' + iframe_href); + console.log('ci_urlstart: ' + ci_urlstart); + console.log('legacy_url_start: ' + legacy_urlstart); + + if(iframe_href.startsWith(ci_urlstart)) { + routerpath = iframe_href.replace( + ci_urlstart, '/Cis/Compat/ci/'); + } else if(iframe_href.startsWith(legacy_urlstart)) { + routerpath = iframe_href.replace( + legacy_urlstart, '/Cis/Compat/legacy/'); + } else { + return; + } + + console.log(routerpath); + + if(this.$route.fullPath !== routerpath) { + this.$router.push(routerpath); + } + } + }, + template: ` +
+ +
Keine URL gefunden.
+
+ ` +};