Made input interface multilingual.
Set proper default for CSS file in password_protect.php.
This commit is contained in:
parent
9158b2eec4
commit
0eab8391dd
|
@ -9,10 +9,10 @@
|
|||
|
||||
require_once __DIR__ . "/inc/functions.php";
|
||||
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage(); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage($settings['defaultLang']); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
|
||||
/*
|
||||
* Load contents
|
||||
|
|
|
@ -55,16 +55,18 @@ function loadHttpToGlobals(array $vars) {
|
|||
/**
|
||||
* Function for loading the language.
|
||||
*
|
||||
* @param string $default The default language to use.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
function loadLanguage():array {
|
||||
function loadLanguage($default):array {
|
||||
|
||||
if (isset($_GET['lan'])) $_SESSION['lan'] = $lan = $_GET['lan'];
|
||||
else if (isset($_SESSION['lan'])) $lan = $_SESSION['lan'];
|
||||
|
||||
// Default to English
|
||||
if (!isset($lan) or !file_exists(__DIR__ . "/translations/$lan.php")) {
|
||||
$lan = "en";
|
||||
$lan = $default;
|
||||
}
|
||||
|
||||
include __DIR__ . "/../translations/$lan.php";
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
function printBackendHead(array $settings, string $page = "home", string $title = "Home", string $icon = ""):string {
|
||||
|
||||
$output = '<!DOCTYPE html>
|
||||
<html lang="en" id="' . $page . '">
|
||||
<html lang="' . $settings['defaultLang'] . '" id="' . $page . '">
|
||||
<head>
|
||||
|
||||
<!-- Content Security policies -->
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
require_once __DIR__ . "/inc/functions.php";
|
||||
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage(); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage($settings['defaultLang']); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
|
||||
/*
|
||||
* Load data.
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
require_once __DIR__ . "/inc/functions.php";
|
||||
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage(); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage($settings['defaultLang']); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
|
||||
/*
|
||||
* Load contents
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
require_once __DIR__ . "/inc/functions.php";
|
||||
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage(); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage($settings['defaultLang']); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
|
||||
/*
|
||||
* Load data.
|
||||
|
|
|
@ -23,7 +23,7 @@ define("loginLogFile", __DIR__ . "/../data/logins.csv");
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function showLoginPasswordProtect($error_msg = "", $cssFile = "themes/default/default.css") {
|
||||
function showLoginPasswordProtect($error_msg = "", $cssFile = "themes/default/theme.css") {
|
||||
|
||||
echo '<!DOCTYPE html>
|
||||
<html id="loginPage">
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
require_once __DIR__ . "/inc/functions.php";
|
||||
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage(); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage($settings['defaultLang']); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
|
||||
if (!$_SESSION['admin']) {
|
||||
echo printErrorPage($translations['accessDenied']); return;
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
require_once __DIR__ . "/inc/functions.php";
|
||||
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage(); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
ensureEnvironment(); // Ensure existence of system files.
|
||||
$translations = loadLanguage($settings['defaultLang']); // Load translations.
|
||||
ensureBackendEnv(); // Ensure session is started etc.
|
||||
$pages = loadPages(); // Load overview of pages.
|
||||
|
||||
if (!$_SESSION['admin']) {
|
||||
echo printErrorPage($translations['accessDenied']); return;
|
||||
|
|
Reference in New Issue
Block a user