Implement shortcode URL resolver
Fix URL for 360 content view
This commit is contained in:
parent
75743e7c4d
commit
3cd8a30a4a
4 changed files with 32 additions and 1 deletions
22
classes/shortcodes.php
Normal file
22
classes/shortcodes.php
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace mod_expcontent;
|
||||||
|
|
||||||
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
|
require('../../config.php');
|
||||||
|
require_once('lib.php');
|
||||||
|
|
||||||
|
class shortcodes {
|
||||||
|
|
||||||
|
public static function expcontent($shortcode, $args) {
|
||||||
|
$expconfig = get_config('mod_expcontent');
|
||||||
|
$baseurl = $expconfig->baseurl;
|
||||||
|
if ($baseurl[-1] != "/") $baseurl += "/";
|
||||||
|
|
||||||
|
$ext = array_key_exists("ext", $args) ? "." . $args["ext"] : "";
|
||||||
|
|
||||||
|
return $baseurl . "meta_media/high/" . $args["id"] . $ext;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
8
db/shortcodes.php
Normal file
8
db/shortcodes.php
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
|
$shortcodes = [
|
||||||
|
'expcontent' => [
|
||||||
|
'callback' => 'mod_expcontent\shortcodes::expcontent'
|
||||||
|
]
|
||||||
|
];
|
|
@ -3,6 +3,7 @@
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
$string['modulename'] = 'EXP360 Content';
|
$string['modulename'] = 'EXP360 Content';
|
||||||
|
$string['modulename'] = 'EXP360 Contents';
|
||||||
|
|
||||||
$string['settings'] = 'Settings';
|
$string['settings'] = 'Settings';
|
||||||
|
|
||||||
|
|
2
view.php
2
view.php
|
@ -78,6 +78,6 @@ img {
|
||||||
<li><span><?php echo($expcontent->name); ?></span></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>
|
<li class="right"><a class="hover" href="javascript:history.back();"><i class="fas fa-times"></i></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<iframe src='<?php echo($baseurl . "/view-content/" . $expcontent->contentid . "?autoplay=true"); ?>' allow="autoplay; fullscreen"></iframe>
|
<iframe src='<?php echo($baseurl . "view-content/" . $expcontent->contentid . "?autoplay=true"); ?>' allow="autoplay; fullscreen"></iframe>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue