moodle-expcontent/view.php
Kumi 3cd8a30a4a Implement shortcode URL resolver
Fix URL for 360 content view
2021-08-19 11:37:47 +02:00

83 lines
1.5 KiB
PHP

<?php
require('../../config.php');
require_once('lib.php');
$id = required_param('id', PARAM_INT);
list ($course, $cm) = get_course_and_cm_from_cmid($id, 'expcontent');
$expcontent = $DB->get_record('expcontent', array('id'=> $cm->instance), '*', MUST_EXIST);
$expconfig = get_config('mod_expcontent');
$baseurl = $expconfig->baseurl;
if ($baseurl[-1] != "/") $baseurl += "/";
?>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
flex: 0 0 auto;
}
li {
float: left;
height: auto;
position: relative;
font-family: "sans-serif";
}
li.right {
float: right;
}
li.logo {
margin-left: 2em;
margin-right: 2em;
}
li a,span {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a.hover:hover {
background-color: #111;
}
body {
display: flex;
flex-flow: column;
height: 100%;
margin: 0;
}
iframe {
flex: 1 1 auto;
}
img {
height: 100%;
width: auto;
}
</style>
<link rel="stylesheet" type="text/css" href="https://fa.kumi.systems/css/all.css">
<title><?php echo($expcontent->name); ?></title>
</head>
<body>
<ul>
<li class="logo"><img src="pix/icon.gif"></li>
<li><span><?php echo($expcontent->name); ?></span></li>
<li class="right"><a class="hover" href="javascript:history.back();"><i class="fas fa-times"></i></a></li>
</ul>
<iframe src='<?php echo($baseurl . "view-content/" . $expcontent->contentid . "?autoplay=true"); ?>' allow="autoplay; fullscreen"></iframe>
</body>
</html>