
6 changed files with 52 additions and 72 deletions
@ -1,31 +1,20 @@ |
|||
<?php // This file is part of LibreQR, which is distributed under the GNU AGPLv3+ license
|
|||
|
|||
// ----- Settings ----- |
|||
// ----- Paramètres ----- |
|||
// LIBREQR SETTINGS |
|||
|
|||
// EN: Time in seconds after which the QR code will be deleted when a page loads. |
|||
// Default: 60 * 60 * 24 * 2 (two days) |
|||
// FR : Temps en secondes après lequel le code QR sera supprimé lors du chargement d'une page. |
|||
// Par défaut : 60 * 60 * 24 * 2 (deux jours) |
|||
$timeBeforeDeletion = 60 * 60 * 24 * 2; |
|||
// Theme's directory name |
|||
define("THEME", "contrast"); |
|||
|
|||
// EN: Theme's name (must be in the themes directory) |
|||
// FR : Nom du thème (doit être dans le dossier themes) |
|||
$theme = "libreqr"; |
|||
// Language used if those requested by the user are not available |
|||
define("DEFAULT_LOCALE", "en"); |
|||
|
|||
// EN: Language used if those requested by the user are not available |
|||
// FR : Langue utilisée si celles demandées par l'utilisateurice ne sont pas disponibles |
|||
$locale = "en"; |
|||
// Will be printed at the bottom of the interface |
|||
define("CUSTOM_TEXT_ENABLED", false); |
|||
define("CUSTOM_TEXT", "This LibreQR instance is hosted by <a href='https://foo.example/'>foo</a>."); |
|||
|
|||
// EN: Should the locales requested by the user be ignored? |
|||
// FR : Faut-il ignorer les langues demandées par l'utilisateurice ? |
|||
$forceLocale = false; |
|||
|
|||
// EN: Lenght of the QR code filename |
|||
// FR : Longueur du nom du fichier du code QR |
|||
$fileNameLenght = 32; |
|||
|
|||
// EN: Will be printed at the bottom of the interface |
|||
// FR : Sera affiché en bas de l'interface |
|||
$customTextEnabled = false; |
|||
$customText = "This LibreQR instance is hosted by <a href='https://foo.example/'>foo</a>."; |
|||
// Default values |
|||
define("DEFAULT_REDUNDANCY", "high"); |
|||
define("DEFAULT_MARGIN", NULL); |
|||
define("DEFAULT_SIZE", NULL); |
|||
define("DEFAULT_BGCOLOR", "FFFFFF"); |
|||
define("DEFAULT_MAINCOLOR", "000000"); |
|||
|
@ -1,39 +0,0 @@ |
|||
<?php // This file is part of LibreQR, which is distributed under the GNU AGPLv3+ license
|
|||
|
|||
// ----- This file is included everywhere ----- |
|||
|
|||
require "config.inc.php"; |
|||
|
|||
define("DEFAULT_REDUNDANCY", "high"); |
|||
define("DEFAULT_MARGIN", NULL); |
|||
define("DEFAULT_SIZE", NULL); |
|||
define("DEFAULT_BGCOLOR", "FFFFFF"); |
|||
define("DEFAULT_MAINCOLOR", "000000"); |
|||
|
|||
$libreqrVersion = "1.4.0dev"; |
|||
|
|||
// Defines the locale to be used |
|||
if ($forceLocale == false AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|||
$clientLocales = $_SERVER['HTTP_ACCEPT_LANGUAGE']; |
|||
$clientLocales = preg_replace("#[A-Z0-9]|q=|;|-|\.#", "", $clientLocales); |
|||
$clientLocales = explode(',', $clientLocales); |
|||
$availableLocales = array('en', 'fr', 'oc', 'template'); |
|||
foreach ($clientLocales as $clientLocale) { |
|||
if (in_array($clientLocale, $availableLocales)) { |
|||
$locale = $clientLocale; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
require "locales/" . $locale . ".php"; |
|||
|
|||
// Defines the root URL |
|||
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') |
|||
$protocol = "https"; |
|||
else |
|||
$protocol = "http"; |
|||
$rootPath = $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
|||
$rootPath = preg_replace('#\?.*$#', '', $rootPath); |
|||
$rootPath = preg_replace('#(manifest|opensearch|index).php$#i', '', $rootPath); |
|||
|
|||
require "themes/" . $theme . "/theme.php"; // Load theme |
Loading…
Reference in new issue