Sizerboard/Public/index.php

59 lines
3.1 KiB
PHP
Raw Permalink Normal View History

<?php
$default_language_code = "es";
$languages_dictionary = json_decode(file_get_contents(__DIR__ . "/../JSON/Sizerboard.languages_iso.json"), true);
$language_code = $default_language_code;
$languages = [$languages_dictionary[$language_code]];
preg_match('/^\/([a-z]{2})(\/([a-z0-9\-]+))?(\/([a-z0-9\-]+))?\/?$/i', $_SERVER["REQUEST_URI"], $matches, PREG_OFFSET_CAPTURE) &&
count($matches) > 1 &&
($language_code = $matches[1][0]);
if($language_code != $default_language_code && isset($languages_dictionary[$language_code]))
$languages[] = $languages_dictionary[$language_code];
else
$language_code = $default_language_code;
?><!DOCTYPE html>
<html lang="<?=$language_code;?>">
<head>
<title data-i18n="sizerboard">Sizerboard</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta charset="utf-8" />
<style data-type="text/css" data-language="CSS2" data-rel="stylesheet" charset="utf-8">
html,body{
height : 100%;
margin : 0em;
}
</style>
<link type="text/css" data-language="CSS3" rel="stylesheet" href="https://cdn.k3y.pw/css/fonts/local/Roboto.css" data-crossorigin="anonymous" charset="utf-8" />
<link type="text/css" data-language="CSS3" rel="stylesheet" href="https://cdn.k3y.pw/css/fonts/local/RobotoMono.css" data-crossorigin="anonymous" charset="utf-8" />
<link type="text/css" data-language="CSS3" rel="stylesheet" href="https://cdn.k3y.pw/css/fonts/local/FontAwesome5Free.css" data-crossorigin="anonymous" charset="utf-8" />
<link type="text/css" data-language="SASS/CSS3" rel="stylesheet" href="/scss/Sizerboard.css" data-scss="/scss/Sizerboard.scss" data-css-map="/scss/Sizerboard.css.map" data-crossorigin="anonymous" charset="utf-8" />
<link type="text/css" data-language="CSS3" rel="stylesheet" href="/css/Sizerboard.icons.css" data-crossorigin="anonymous" charset="utf-8" />
<script data-type="text/javascript" data-language="ECMAScript 2015" src="/ecma/Sizerboard.ecma.js" data-crossorigin="anonymous" charset="utf-8"></script>
<script data-type="text/javascript" data-language="ECMAScript 2015" src="/ecma/Sizerboard.Views.ecma.js" data-crossorigin="anonymous" charset="utf-8"></script>
<script data-type="text/javascript" data-language="ECMAScript 2015" src="/ecma/Sizerboard.Base.ecma.js" data-crossorigin="anonymous" charset="utf-8"></script>
<script data-type="text/javascript" data-language="ECMAScript 2015" src="/ecma/Sizerboard.Projects.ecma.js" data-crossorigin="anonymous" charset="utf-8"></script>
<script data-type="text/javascript" data-language="ECMAScript 2015" src="/ecma/Sizerboard.DrawBox.ecma.js" data-crossorigin="anonymous" charset="utf-8"></script>
<script data-type="text/javascript" data-language="ECMAScript 2015" charset="utf-8">
sizerboard = new Sizerboard({
default_language : "<?=$languages_dictionary[$language_code];?>",
language : "<?=$languages_dictionary[$language_code];?>",
default_i18n_files : [<?php foreach($languages as $i => $language){?><?=$i ? ", " : "";?>"/json/i18n/Sizerboard.i18n.<?=$language;?>.json"<?php }?>]
});
</script>
</head>
<body></body>
</html>