Kumi
33f55824d8
Enhanced global.js and script.js to conditionally load jQuery and Bootstrap only if they are not already present. This change improves loading efficiency and reduces redundant script execution. Additionally, fixed a bug in renderer.php by removing duplicate Bootstrap loading, which also reduces external dependency. A new .gitignore file was added to ignore backup files with a .bak extension, helping to keep the repository clean. Ensured error logging only displays error messages for better clarity.
45 lines
No EOL
1.7 KiB
PHP
45 lines
No EOL
1.7 KiB
PHP
<?php
|
|
|
|
namespace mod_exp360\output;
|
|
|
|
defined('MOODLE_INTERNAL') || die();
|
|
|
|
use plugin_renderer_base;
|
|
|
|
class renderer extends plugin_renderer_base {
|
|
|
|
private static $modals_rendered = false;
|
|
|
|
public function render_activity($activity_id) {
|
|
$script = "<script data-activity-id='$activity_id' src='/mod/exp360/script.js'></>";
|
|
return $script;
|
|
}
|
|
|
|
public function render_modals() {
|
|
if (self::$modals_rendered) {
|
|
return '';
|
|
}
|
|
|
|
self::$modals_rendered = true;
|
|
|
|
$modalHTML = '
|
|
<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>
|
|
';
|
|
return $modalHTML;
|
|
}
|
|
} |