Добавляем все файлы
This commit is contained in:
25
main_plugin/dgrm/plug.php
Executable file
25
main_plugin/dgrm/plug.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?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">';
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user