26 lines
835 B
PHP
26 lines
835 B
PHP
<?php
|
|
/**
|
|
* @file plug.php
|
|
* @brief Подключает плагин dgrm для администраторов и выводит соответствующий HTML и JS
|
|
*/
|
|
|
|
global $path, $_SESSION, $configAdmins;
|
|
if (in_array($_SESSION['username'], $configAdmins, true)) {
|
|
echo file_get_contents($path . 'main_plugin/dgrm/index.php');
|
|
echo "<script type='module'>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const c = document.querySelector('.center-float');
|
|
const d = document.getElementById('dgrmDiv');
|
|
if (c && d) {
|
|
c.appendChild(document.createElement('br'));
|
|
c.appendChild(d);
|
|
import('/main_plugin/dgrm/index.js');
|
|
} else if (d) {
|
|
d.remove();
|
|
}
|
|
});
|
|
</script>";
|
|
echo '<link rel="stylesheet" type="text/css" href="/main_plugin/dgrm/dgrm.css">';
|
|
}
|
|
?>
|