From 34528bb01446fb9f522589a63b2e310d4037f3c5 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Fri, 29 Aug 2025 13:19:00 +0200 Subject: [PATCH 1/4] iframe content hinzugefuegt --- public/js/components/Cis/Cms/Content.js | 5 ++ system/dbupdate_3.4.php | 1 + .../63436_cis4_iframe_component.php | 81 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 system/dbupdate_3.4/63436_cis4_iframe_component.php diff --git a/public/js/components/Cis/Cms/Content.js b/public/js/components/Cis/Cms/Content.js index 470a0fa62..ec1bc8a76 100644 --- a/public/js/components/Cis/Cms/Content.js +++ b/public/js/components/Cis/Cms/Content.js @@ -2,6 +2,8 @@ import raum_contentmittitel from './Content_types/Raum_contentmittitel.js' import general from './Content_types/General.js' import BsConfirm from "../../Bootstrap/Confirm.js"; import news_content from './Content_types/News_content.js'; +import iframe_content from './Content_types/Iframe_content.js'; + import ApiCms from '../../../api/factory/cms.js'; export default { @@ -24,6 +26,7 @@ export default { raum_contentmittitel, news_content, general, + iframe_content }, data() { return { @@ -83,6 +86,8 @@ export default { return "raum_contentmittitel"; case "news": return "news_content"; + case "iframe": + return "iframe_content"; default: return "general"; }; diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index cf2f40ca8..23ad5ffcd 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -77,6 +77,7 @@ require_once('dbupdate_3.4/55614_perm_verwaltetoe.php'); require_once('dbupdate_3.4/25999_C4_dashboard.php'); require_once('dbupdate_3.4/61730_Dashboard_Anpassungen.php'); require_once('dbupdate_3.4/40128_search.php'); +require_once('dbupdate_3.4/63436_cis4_iframe_component.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; diff --git a/system/dbupdate_3.4/63436_cis4_iframe_component.php b/system/dbupdate_3.4/63436_cis4_iframe_component.php new file mode 100644 index 000000000..abff4b7e1 --- /dev/null +++ b/system/dbupdate_3.4/63436_cis4_iframe_component.php @@ -0,0 +1,81 @@ + + + + + + + + + +EOD; + +$xslt_xhtml= << + + + + + + + +
Keine URL im Inhalt gefunden.
+
+
+
+ +EOD; + +$xslt_xhtml_c4= << + + + + + + + +
Keine URL im Inhalt gefunden.
+
+
+
+ +EOD; + + +if ($result = @$db->db_query("SELECT * FROM campus.tbl_template WHERE template_kurzbz='iframe2'")) +{ + if ($db->db_num_rows($result) == 0) + { + $sql= <<db_query($sql)) + { + echo 'campus.tbl_template: ' . $db->db_last_error() . '
'; + } + else + { + echo ' campus.tbl_template: Template "iframe" hinzugefügt.
'; + } + + } +} \ No newline at end of file From 5efad50b62e4c27d18dd608f66f0c0a17efbee8f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 23 Sep 2025 08:31:00 +0200 Subject: [PATCH 2/4] added missing iframe component --- .../Cis/Cms/Content_types/Iframe_content.js | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 public/js/components/Cis/Cms/Content_types/Iframe_content.js diff --git a/public/js/components/Cis/Cms/Content_types/Iframe_content.js b/public/js/components/Cis/Cms/Content_types/Iframe_content.js new file mode 100644 index 000000000..568cfaf03 --- /dev/null +++ b/public/js/components/Cis/Cms/Content_types/Iframe_content.js @@ -0,0 +1,31 @@ +import { replaceRelativeLegacyLink } from "../../../../helpers/LegacyLinkReplaceHelper.js"; + +export default { + name: "iframe_content", + props: { + content: { type: String, required: true } + }, + computed: { + srcUrl() { + const parser = new DOMParser() + const doc = parser.parseFromString(`
${this.content}
`, "text/html"); + const iframe = doc.querySelector("iframe[src]"); + + if (!iframe) + return ""; + + let url = iframe.getAttribute("src") || ""; + return replaceRelativeLegacyLink(url); + } + }, + template: ` +
+ +
Keine URL gefunden.
+
+ ` +}; From 2ef2948a6e4bf2cbe32d547d18a5f7dacbf77397 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Thu, 25 Sep 2025 16:02:43 +0200 Subject: [PATCH 3/4] prevent strange effects when switching between content_types --- public/js/components/Cis/Cms/Content.js | 32 ++++--------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/public/js/components/Cis/Cms/Content.js b/public/js/components/Cis/Cms/Content.js index ec1bc8a76..355add08a 100644 --- a/public/js/components/Cis/Cms/Content.js +++ b/public/js/components/Cis/Cms/Content.js @@ -30,39 +30,19 @@ export default { }, data() { return { + content_type: null, content: null, content_id_internal: this.content_id }; }, methods: { fetchContent(){ - return this.$api + this.$api .call(ApiCms.content(this.content_id_internal, this.version, this.sprache, this.sichtbar)) .then(res => { - this.content = res.data.content; - this.content_type = res.data.type; - - document.querySelectorAll("#cms [data-confirm]").forEach((el) => { - el.addEventListener("click", (evt) => { - evt.preventDefault(); - BsConfirm.popup(el.dataset.confirm) - .then(() => { - Axios.get(el.href) - .then((res) => { - // TODO(chris): check for success then show message and/or reload - location = location; - }) - .catch((err) => console.error("ERROR:", err)); - }) - .catch(() => { - }); - }); - }); - document.querySelectorAll("#cms [data-href]").forEach((el) => { - el.href = el.dataset.href.replace( - /^ROOT\//, - FHC_JS_DATA_STORAGE_OBJECT.app_root - ); + this.$nextTick(function() { + this.content = res.data.content; + this.content_type = res.data.type; }); }); } @@ -96,8 +76,6 @@ export default { created() { this.fetchContent(); }, - mounted() { - }, template: /*html*/ `
From 58b942f0441aae268b784e7b3020b4e3f364f5eb Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Thu, 25 Sep 2025 16:14:09 +0200 Subject: [PATCH 4/4] fix typo in template_kurzbz --- system/dbupdate_3.4/63436_cis4_iframe_component.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/dbupdate_3.4/63436_cis4_iframe_component.php b/system/dbupdate_3.4/63436_cis4_iframe_component.php index abff4b7e1..a5b3bbf7c 100644 --- a/system/dbupdate_3.4/63436_cis4_iframe_component.php +++ b/system/dbupdate_3.4/63436_cis4_iframe_component.php @@ -57,7 +57,7 @@ $xslt_xhtml_c4= <<db_query("SELECT * FROM campus.tbl_template WHERE template_kurzbz='iframe2'")) +if ($result = @$db->db_query("SELECT * FROM campus.tbl_template WHERE template_kurzbz='iframe'")) { if ($db->db_num_rows($result) == 0) { @@ -78,4 +78,4 @@ EOD; } } -} \ No newline at end of file +}