mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-24 15:39:28 +00:00
Merge branch 'cis40_2026-05_ma_rc' into demo-cis40
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Compat extends Auth_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'ci' => ['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']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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',
|
||||
|
||||
@@ -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: `
|
||||
|
||||
@@ -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: `
|
||||
<div class="w-100">
|
||||
<iframe
|
||||
ref="compatiframe"
|
||||
v-if="srcUrl"
|
||||
:src="srcUrl"
|
||||
@load="loadHandler"
|
||||
style="width:100%; height:90vh; border:0; display:block;"
|
||||
></iframe>
|
||||
<div v-else class="alert alert-warning">Keine URL gefunden.</div>
|
||||
</div>
|
||||
`
|
||||
};
|
||||
Reference in New Issue
Block a user