2024-07-05 10:32:43 +00:00
|
|
|
<?php
|
2024-07-05 10:18:34 +00:00
|
|
|
|
|
|
|
namespace mod_exp360\output;
|
|
|
|
|
|
|
|
defined('MOODLE_INTERNAL') || die();
|
|
|
|
|
|
|
|
use plugin_renderer_base;
|
|
|
|
|
2024-09-23 07:05:20 +00:00
|
|
|
class renderer extends plugin_renderer_base
|
|
|
|
{
|
2024-07-05 10:18:34 +00:00
|
|
|
|
2024-09-23 07:05:20 +00:00
|
|
|
private static $modals_rendered = false;
|
2024-07-05 10:18:34 +00:00
|
|
|
|
2024-09-23 07:05:20 +00:00
|
|
|
public function render_activity($activity_id, $activity_name)
|
|
|
|
{
|
|
|
|
$script = "<script data-activity-id='$activity_id' data-activity-name='$activity_name' src='/mod/exp360/script.js'></script>";
|
|
|
|
return $script;
|
|
|
|
}
|
2024-07-05 10:18:34 +00:00
|
|
|
|
2024-09-23 07:05:20 +00:00
|
|
|
public function render_modals()
|
|
|
|
{
|
|
|
|
if (self::$modals_rendered) {
|
|
|
|
return '';
|
|
|
|
}
|
2024-07-05 10:18:34 +00:00
|
|
|
|
2024-09-23 07:05:20 +00:00
|
|
|
self::$modals_rendered = true;
|
2024-07-05 10:18:34 +00:00
|
|
|
|
2024-09-23 07:05:20 +00:00
|
|
|
$modalHTML = '
|
2024-07-05 10:18:34 +00:00
|
|
|
<div id="fullScreenModal" class="modal" tabindex="-1"
|
|
|
|
aria-labelledby="modalLabel" aria-hidden="true">
|
|
|
|
<div style="background-color:#294084;" class="modal-dialog modal-fullscreen">
|
|
|
|
<div style="background-color:#294084;" class="modal-content">
|
|
|
|
<div style="background-color:#294084;" class="modal-body"><iframe style="background-color:#294084;" id="modal-iframe"></iframe></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="regularModal" style="background: rgb(255,255,255,.7);" class="modal" tabindex="-2"
|
|
|
|
aria-labelledby="modalLabel" aria-hidden="true">
|
|
|
|
<div style="background-color:#294084;height:90%;" class="modal-dialog modal-lg">
|
|
|
|
<div style="background-color:#294084;height:100%;" class="modal-content">
|
|
|
|
<div style="background-color:#294084;" class="modal-body"><iframe style="background-color:#294084;width:100%;height:100%;" id="regular-modal-iframe"></iframe></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
';
|
2024-09-23 07:05:20 +00:00
|
|
|
return $modalHTML;
|
|
|
|
}
|
|
|
|
}
|