Files
slava.home/main_plugin/manager/plug.php

28 lines
1.0 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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