redondancy > redundancy
This commit is contained in:
parent
dd2afe6967
commit
c49e34b2c2
8 changed files with 29 additions and 29 deletions
2
inc.php
2
inc.php
|
@ -4,7 +4,7 @@
|
|||
|
||||
require "config.inc.php";
|
||||
|
||||
define("DEFAULT_REDONDANCY", "high");
|
||||
define("DEFAULT_REDUNDANCY", "high");
|
||||
define("DEFAULT_MARGIN", NULL);
|
||||
define("DEFAULT_SIZE", NULL);
|
||||
define("DEFAULT_BGCOLOR", "FFFFFF");
|
||||
|
|
28
index.php
28
index.php
|
@ -6,7 +6,7 @@ require "inc.php";
|
|||
|
||||
$params = array(
|
||||
"txt" => "",
|
||||
"redondancy" => DEFAULT_REDONDANCY,
|
||||
"redundancy" => DEFAULT_REDUNDANCY,
|
||||
"margin" => DEFAULT_MARGIN,
|
||||
"size" => DEFAULT_SIZE,
|
||||
"bgColor" => DEFAULT_BGCOLOR,
|
||||
|
@ -17,7 +17,7 @@ $validFormSubmitted = false;
|
|||
|
||||
if (
|
||||
isset($_POST['txt'])
|
||||
AND isset($_POST['redondancy'])
|
||||
AND isset($_POST['redundancy'])
|
||||
AND isset($_POST['margin'])
|
||||
AND isset($_POST['size'])
|
||||
AND isset($_POST['bgColor'])
|
||||
|
@ -29,10 +29,10 @@ if (
|
|||
else
|
||||
exit("Wrong value for txt");
|
||||
|
||||
if ($_POST['redondancy'] === "low" OR $_POST['redondancy'] === "medium" OR $_POST['redondancy'] === "quartile" OR $_POST['redondancy'] === "high")
|
||||
$params['redondancy'] = $_POST['redondancy'];
|
||||
if ($_POST['redundancy'] === "low" OR $_POST['redundancy'] === "medium" OR $_POST['redundancy'] === "quartile" OR $_POST['redundancy'] === "high")
|
||||
$params['redundancy'] = $_POST['redundancy'];
|
||||
else
|
||||
exit("Wrong value for redondancy");
|
||||
exit("Wrong value for redundancy");
|
||||
|
||||
if (is_numeric($_POST['margin']) AND $_POST['margin'] >= 0 AND $_POST['margin'] <= 1024)
|
||||
$params['margin'] = $_POST['margin'];
|
||||
|
@ -75,7 +75,7 @@ if (
|
|||
<meta name="referrer" content="no-referrer">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' data:; style-src 'self'; manifest-src 'self'; form-action 'self';">
|
||||
<link rel="manifest" href="manifest.php">
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="LibreQR" href="opensearch.php?redondancy=<?= $params['redondancy'] ?>&margin=<?= $params['margin'] ?>&size=<?= $params['size'] ?>&bgColor=<?= urlencode($params['bgColor']) ?>&mainColor=<?= urlencode($params['mainColor']) ?>">
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="LibreQR" href="opensearch.php?redundancy=<?= $params['redundancy'] ?>&margin=<?= $params['margin'] ?>&size=<?= $params['size'] ?>&bgColor=<?= urlencode($params['bgColor']) ?>&mainColor=<?= urlencode($params['mainColor']) ?>">
|
||||
<?php
|
||||
require_once "less.php/lib/Less/Autoloader.php";
|
||||
Less_Autoloader::register();
|
||||
|
@ -124,16 +124,16 @@ if (
|
|||
|
||||
<div class="param">
|
||||
<details>
|
||||
<summary><label for="redondancy"><?= $loc['label_redondancy'] ?></label></summary>
|
||||
<summary><label for="redundancy"><?= $loc['label_redundancy'] ?></label></summary>
|
||||
<p class="helpText">
|
||||
<?= $loc['help_redondancy'] ?>
|
||||
<?= $loc['help_redundancy'] ?>
|
||||
</p>
|
||||
</details>
|
||||
<select id="redondancy" name="redondancy">
|
||||
<option <?php if ($params['redondancy'] === "low") echo 'selected="" '; ?>value="low">L - 7%</option>
|
||||
<option <?php if ($params['redondancy'] === "medium") echo 'selected="" '; ?>value="medium">M - 15%</option>
|
||||
<option <?php if ($params['redondancy'] === "quartile") echo 'selected="" '; ?>value="quartile">Q - 25%</option>
|
||||
<option <?php if ($params['redondancy'] === "high") echo 'selected="" '; ?>value="high">H - 30%</option>
|
||||
<select id="redundancy" name="redundancy">
|
||||
<option <?php if ($params['redundancy'] === "low") echo 'selected="" '; ?>value="low">L - 7%</option>
|
||||
<option <?php if ($params['redundancy'] === "medium") echo 'selected="" '; ?>value="medium">M - 15%</option>
|
||||
<option <?php if ($params['redundancy'] === "quartile") echo 'selected="" '; ?>value="quartile">Q - 25%</option>
|
||||
<option <?php if ($params['redundancy'] === "high") echo 'selected="" '; ?>value="high">H - 30%</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
@ -213,7 +213,7 @@ if (
|
|||
$qrCode
|
||||
->setText($params['txt'])
|
||||
->setSize($params['size'])
|
||||
->setErrorCorrection($params['redondancy'])
|
||||
->setErrorCorrection($params['redundancy'])
|
||||
->setForegroundColor(array(
|
||||
'r' => hexdec(substr($params['mainColor'],0,2)),
|
||||
'g' => hexdec(substr($params['mainColor'],2,2)),
|
||||
|
|
|
@ -4,7 +4,7 @@ $loc = array(
|
|||
'description' => "Generate QR codes freely. Choose content, size, colors…",
|
||||
|
||||
'label_content' => "Text to encode",
|
||||
'label_redondancy' => "Redondancy rate",
|
||||
'label_redundancy' => "Redundancy rate",
|
||||
'label_margin' => "Margin size",
|
||||
'label_size' => "Image size",
|
||||
'label_bgColor' => "Background color",
|
||||
|
@ -20,7 +20,7 @@ $loc = array(
|
|||
<p>To send an email: <code>mailto:contact@email.example</code></p>
|
||||
<p>To share geographic coordinates: <code>geo:48.867564,2.364057</code></p>
|
||||
",
|
||||
'help_redondancy' => "Redundancy is the duplication of information in the QR code to correct errors during decoding. A higher rate will produce a bigger QR code, but will have a better chance of being decoded correctly.",
|
||||
'help_redundancy' => "Redundancy is the duplication of information in the QR code to correct errors during decoding. A higher rate will produce a bigger QR code, but will have a better chance of being decoded correctly.",
|
||||
'help_margin' => "Number of pixels in each white band around the QR code.",
|
||||
'help_size' => "Image width and height in pixels, without the margin.",
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ $loc = array(
|
|||
'description' => "Générer des codes QR librement. Choix du contenu, de la taille, des couleurs…",
|
||||
|
||||
'label_content' => "Texte à encoder",
|
||||
'label_redondancy' => "Taux de redondance",
|
||||
'label_redundancy' => "Taux de redondance",
|
||||
'label_margin' => "Taille de la marge",
|
||||
'label_size' => "Taille de l'image",
|
||||
'label_bgColor' => "Couleur de fond",
|
||||
|
@ -20,7 +20,7 @@ $loc = array(
|
|||
<p>Pour envoyer un mail : <code>mailto:contact@email.example</code></p>
|
||||
<p>Pour partager des coordonnées géographique : <code>geo:48.867564,2.364057</code></p>
|
||||
",
|
||||
'help_redondancy' => "La redondance est la duplication des informations dans le code QR afin de corriger les erreurs lors du décodage. Un taux plus élevé produira un code QR plus grand, mais aura plus de chance d'être décodé correctement.",
|
||||
'help_redundancy' => "La redondance est la duplication des informations dans le code QR afin de corriger les erreurs lors du décodage. Un taux plus élevé produira un code QR plus grand, mais aura plus de chance d'être décodé correctement.",
|
||||
'help_margin' => "Nombre de pixels de chaque bande blanche autour du code QR.",
|
||||
'help_size' => "Largeur et hauteur de l'image en pixels, sans la marge.",
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ $loc = array(
|
|||
'description' => "Generatz de còdis QR liurament. Causissètz lo contengut, la talha, las colors…",
|
||||
|
||||
'label_content' => "Tèxt de codar",
|
||||
'label_redondancy' => "Taus de redondància",
|
||||
'label_redundancy' => "Taus de redondància",
|
||||
'label_margin' => "Talha del marge",
|
||||
'label_size' => "Talha de l’imatge",
|
||||
'label_bgColor' => "Color de fons",
|
||||
|
@ -20,7 +20,7 @@ $loc = array(
|
|||
<p>Per enviar un corrièl : mailto:contact@email.example</p>
|
||||
<p>Per partejar de coordonadas geograficas : geo:48.867564,2.364057</p>
|
||||
",
|
||||
'help_redondancy' => "La redondància es la duplicacion de las informacions al còdi QR per dire de corregir las errors pendent lo deschiframent. Un taux mai naut produirà un còdi mai grand, mas serà de melhor deschifrar corrèctament.",
|
||||
'help_redundancy' => "La redondància es la duplicacion de las informacions al còdi QR per dire de corregir las errors pendent lo deschiframent. Un taux mai naut produirà un còdi mai grand, mas serà de melhor deschifrar corrèctament.",
|
||||
'help_margin' => "Nombre de pixèls de la banda blanca a l’entorn del còdi QR.",
|
||||
'help_size' => "Per quant deu la dimensions de l’imatge èsser multiplicada ?",
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ $loc = array(
|
|||
'description' => "description",
|
||||
|
||||
'label_content' => "label_content",
|
||||
'label_redondancy' => "label_redondancy",
|
||||
'label_redundancy' => "label_redundancy",
|
||||
'label_margin' => "label_margin",
|
||||
'label_size' => "label_size",
|
||||
'label_bgColor' => "label_bgColor",
|
||||
|
@ -15,7 +15,7 @@ $loc = array(
|
|||
'value_default' => "value_default",
|
||||
|
||||
'help_content' => "help_content",
|
||||
'help_redondancy' => "help_redondancy",
|
||||
'help_redundancy' => "help_redundancy",
|
||||
'help_margin' => "help_margin",
|
||||
'help_size' => "help_size",
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ require "inc.php"; ?>
|
|||
<Language>*</Language>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<?php
|
||||
$redondancy = htmlspecialchars((isset($_GET['redondancy'])) ? $_GET['redondancy'] : DEFAULT_REDONDANCY);
|
||||
$redundancy = htmlspecialchars((isset($_GET['redundancy'])) ? $_GET['redundancy'] : DEFAULT_REDUNDANCY);
|
||||
$margin = htmlspecialchars((isset($_GET['margin'])) ? $_GET['margin'] : DEFAULT_MARGIN);
|
||||
$size = htmlspecialchars((isset($_GET['size'])) ? $_GET['size'] : DEFAULT_SIZE);
|
||||
$bgColor = htmlspecialchars(urlencode((isset($_GET['bgColor'])) ? $_GET['bgColor'] : "%23" . DEFAULT_BGCOLOR));
|
||||
|
@ -19,14 +19,14 @@ require "inc.php"; ?>
|
|||
?>
|
||||
<Url type="text/html" method="post" template="<?= $rootPath ?>">
|
||||
<Param name="txt" value="{searchTerms}"/>
|
||||
<Param name="redondancy" value="<?= $redondancy ?>"/>
|
||||
<Param name="redundancy" value="<?= $redundancy ?>"/>
|
||||
<Param name="margin" value="<?= $margin ?>"/>
|
||||
<Param name="size" value="<?= $size ?>"/>
|
||||
<Param name="bgColor" value="<?= $bgColor ?>"/>
|
||||
<Param name="mainColor" value="<?= $mainColor ?>"/>
|
||||
</Url>
|
||||
<Url type="application/opensearchdescription+xml" rel="self" template="<?= $rootPath ?>opensearch.php">
|
||||
<Param name="redondancy" value="<?= $redondancy ?>"/>
|
||||
<Param name="redundancy" value="<?= $redundancy ?>"/>
|
||||
<Param name="margin" value="<?= $margin ?>"/>
|
||||
<Param name="size" value="<?= $size ?>"/>
|
||||
<Param name="bgColor" value="<?= $bgColor ?>"/>
|
||||
|
|
|
@ -314,7 +314,7 @@ footer {
|
|||
|
||||
/* Inputs */
|
||||
|
||||
#redondancy, #margin, #txt, #size, input[type=color], input[type=submit], .button {
|
||||
#redundancy, #margin, #txt, #size, input[type=color], input[type=submit], .button {
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-radius: 10px;
|
||||
|
@ -366,7 +366,7 @@ footer {
|
|||
}
|
||||
}
|
||||
|
||||
#redondancy {
|
||||
#redundancy {
|
||||
width: 250px;
|
||||
height: 44px;
|
||||
&:hover {
|
||||
|
@ -394,7 +394,7 @@ input[type=color] {
|
|||
height: 38px;
|
||||
}
|
||||
|
||||
#redondancy, #size, #margin {
|
||||
#redundancy, #size, #margin {
|
||||
|
||||
@media @light {
|
||||
background-color: @bgField-light;
|
||||
|
|
Loading…
Reference in a new issue