Skip to content

Commit 8317cf0

Browse files
authored
fix layouts for studip >= 5.3 (#676)
* fix layouts for studip >= 5.3 * Correct version format
1 parent 6250e6c commit 8317cf0

File tree

6 files changed

+34
-6
lines changed

6 files changed

+34
-6
lines changed

app/controllers/admin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ function before_filter(&$action, &$args)
2323

2424
public function index_action()
2525
{
26+
$this->studip_version = $this->getStudIPVersion();
27+
2628
Navigation::activateItem('/admin/config/oc-config');
2729
PageLayout::setBodyElementId('opencast-plugin');
2830

lib/Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function render_json($data)
105105

106106
public function getStudIPVersion()
107107
{
108-
$studip_version = \StudipVersion::getStudipVersion();
108+
$studip_version = \StudipVersion::getStudipVersion(true);
109109
if (empty($studip_version)) {
110110
$manifest = OpenCast::getPluginManifestInfo();
111111
$studip_version = isset($manifest["studipMinVersion"]) ? $manifest["studipMinVersion"] : 4.6;

vueapp/components/Studip/StudipSelect.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ export default {
8383
document.documentElement.scrollHeight,
8484
document.documentElement.offsetHeight
8585
);
86-
let footerHeight = document.getElementById('layout_footer').offsetHeight;
86+
let footerHeight = 0;
87+
if (window.OpencastPlugin.STUDIP_VERSION >= 5.3) {
88+
footerHeight = document.getElementById('main-footer').offsetHeight;
89+
}
90+
else {
91+
footerHeight = document.getElementById('layout_footer').offsetHeight;
92+
}
93+
8794
let functionalAreaHeight = totalDocHeight - footerHeight;
8895
return totalExpandedList >= functionalAreaHeight ? 'top' : 'bottom';
8996
},

vueapp/templates/admin_index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
REDIRECT_URL: '<?= PluginEngine::getURL('opencast', [], 'redirect/perform', true) ?>',
1313
AUTH_URL : '<?= PluginEngine::getURL('opencast', [], 'redirect/authenticate', true) ?>'
1414
};
15+
<?= isset($studip_version) ? "window.OpencastPlugin.STUDIP_VERSION = $studip_version;" : '' ?>;
1516
</script>
1617

1718
<!-- load bundles -->

vueapp/views/Contents.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<Teleport to="#layout-sidebar > section.sidebar">
3+
<Teleport :to="toLayoutName">
44
<VideosSidebar
55
@uploadVideo="uploadDialog = true"
66
@allowDownloadForPlaylist="allowDownload"
@@ -41,7 +41,16 @@ export default {
4141
computed: {
4242
...mapGetters([
4343
'currentUser'
44-
])
44+
]),
45+
46+
toLayoutName() {
47+
if (window.OpencastPlugin.STUDIP_VERSION >= 5.3) {
48+
return "#sidebar";
49+
}
50+
else {
51+
return "#layout-sidebar > section.sidebar";
52+
}
53+
}
4554
},
4655
4756
data() {

vueapp/views/Course.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="container" id="app-episodes">
3-
<Teleport to="#layout-sidebar > section.sidebar">
3+
<Teleport :to="toLayoutName">
44
<CoursesSidebar
55
@uploadVideo="uploadDialog = true"
66
@copyAll="copyAll">
@@ -44,7 +44,16 @@ export default {
4444
...mapGetters([
4545
'currentUser',
4646
'showCourseCopyDialog'
47-
])
47+
]),
48+
49+
toLayoutName() {
50+
if (window.OpencastPlugin.STUDIP_VERSION >= 5.3) {
51+
return "#sidebar";
52+
}
53+
else {
54+
return "#layout-sidebar > section.sidebar";
55+
}
56+
}
4857
},
4958
5059
data() {

0 commit comments

Comments
 (0)