moodle-expcontent/view.php

134 lines
2.5 KiB
PHP
Raw Normal View History

2021-07-06 14:08:32 +00:00
<?php
require('../../config.php');
2021-12-07 10:02:33 +00:00
require_once($CFG->dirroot.'/mod/expcontent/lib.php');
require_once($CFG->libdir.'/completionlib.php');
2021-07-06 14:08:32 +00:00
$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;
2021-12-07 10:02:33 +00:00
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
2021-07-06 14:08:32 +00:00
if ($baseurl[-1] != "/") $baseurl += "/";
?>
<html>
<head>
2022-01-11 13:56:43 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
2021-07-06 14:08:32 +00:00
<style>
ul {
list-style-type: none;
2022-01-11 13:56:43 +00:00
height: 52px;
2021-07-06 14:08:32 +00:00
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
flex: 0 0 auto;
2022-01-11 13:56:43 +00:00
pointer-events: none;
2021-07-06 14:08:32 +00:00
}
li {
height: auto;
2022-01-11 13:56:43 +00:00
position: absolute;
2021-07-06 14:08:32 +00:00
font-family: "sans-serif";
2022-01-11 13:56:43 +00:00
box-sizing: border-box;
2021-07-06 14:08:32 +00:00
}
2022-01-11 13:56:43 +00:00
li.logo {
left: 0;
margin-left: 1em;
margin-right: 1em;
padding-top: 6px;
padding-bottom: 6px;
height: 52px;
box-sizing: border-box;
2021-07-06 14:08:32 +00:00
}
2022-01-11 13:56:43 +00:00
li.title {
position: relative;
width: 100%;
padding-left: 72px;
padding-right: 52px;
height: 52px;
}
li.title .container {
position:relative;
height:52px;
}
li.title .text {
position: absolute;
top: 50%;
transform: translateY(-50%);
margin-top: auto;
margin-bottom: auto;
}
li.right {
top: 0;
right: 0;
margin: 4px;
pointer-events: all;
2021-09-27 08:00:34 +00:00
}
li.logo img {
display: block;
height: 100%;
width: auto;
height: 40px;
2021-07-06 14:08:32 +00:00
}
2022-01-11 13:56:43 +00:00
li a,.text {
2021-07-06 14:08:32 +00:00
display: block;
color: white;
text-decoration: none;
2021-09-27 08:00:34 +00:00
font-family: sans-serif;
}
li a {
padding: 14px 16px;
2021-07-06 14:08:32 +00:00
}
li a.hover:hover {
background-color: #111;
}
body {
display: flex;
flex-flow: column;
margin: 0;
}
2022-01-11 13:56:43 +00:00
/* prevent overscroll */
html,body {
position: fixed;
overflow: hidden;
width: 100vw;
height: 100vh;
}
2021-07-06 14:08:32 +00:00
iframe {
flex: 1 1 auto;
2021-09-27 08:00:34 +00:00
border: 0;
2021-07-06 14:08:32 +00:00
}
</style>
2021-12-07 10:19:39 +00:00
<link rel="stylesheet" type="text/css" href="/mod/expcontent/vendor/fa/css/all.css">
2021-07-06 14:08:32 +00:00
<title><?php echo($expcontent->name); ?></title>
</head>
<body>
<ul>
2021-09-27 08:00:34 +00:00
<li class="logo"><img src="pix/icon.png"></li>
2022-01-11 13:56:43 +00:00
<li class="title"><div class="container"><div class="text"><?php echo($expcontent->name); ?></div></div></li>
2021-07-06 14:08:32 +00:00
<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>
2021-07-06 14:08:32 +00:00
</body>
</html>