Ветка 07_11_25
This commit is contained in:
25
main_plugin/SvgEditorM/plug.php
Normal file
25
main_plugin/SvgEditorM/plug.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* @file plug.php
|
||||
* @brief Подключает плагин SvgEditorM для администраторов, перемещает sidebar и подгружает JS-модуль
|
||||
*/
|
||||
|
||||
global $path, $_SESSION, $configAdmins;
|
||||
if (in_array($_SESSION['username'], $configAdmins, true)) {
|
||||
include $path . 'main_plugin/SvgEditorM/index.php';
|
||||
echo '<link rel="stylesheet" type="text/css" href="/main_plugin/SvgEditorM/SvgEditorM.css">';
|
||||
echo "<script type='module'>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const c = document.querySelector('.center-float');
|
||||
const d = document.getElementById('sidebar');
|
||||
if (c && d) {
|
||||
c.appendChild(document.createElement('br'));
|
||||
c.appendChild(d);
|
||||
import('/main_plugin/SvgEditorM/SvgEditorM.js');
|
||||
} else if (d) {
|
||||
d.remove();
|
||||
}
|
||||
});
|
||||
</script>";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user