Files

27 lines
979 B
PHP
Executable File

<?php
/**
* @file plug.php
* @brief Подключает плагин редактора для администраторов
*/
global $path, $_SESSION, $configAdmins;
/** @brief Языковой массив для плагина редактора */
$lang = include $path . 'main_plugin/editor/lang.php';
/** @brief Текущий язык пользователя, по умолчанию 'en' */
$lng = $_SESSION['lng'] ?? 'en';
if (in_array($_SESSION['username'], $configAdmins, true)) {
include_once $path . 'main_plugin/editor/func.editor.php';
$Html = file_get_contents($path . 'main_plugin/editor/editor.php');
foreach ($lang[$lng] as $key => $value) {
$Html = str_replace('{{' . $key . '}}', $value, $Html);
}
echo $Html;
echo '<link rel="stylesheet" type="text/css" href="/main_plugin/editor/editor.css">';
echo '<script type="text/javascript" src="/main_plugin/editor/lang.js.php?lng=' . $lng . '"></script>';
}
?>