Compare commits
No commits in common. "kt-dev" and "master" have entirely different histories.
16
index.php
16
index.php
|
@ -28,31 +28,31 @@ if (!RequestUtils::isPost()) {
|
|||
$primary = RequestUtils::parsePrimaryColor();
|
||||
$secondary = RequestUtils::parseSecondaryColor();
|
||||
$spaceBarSize = RequestUtils::parseSpacebarSize();
|
||||
|
||||
|
||||
// Setup configuration
|
||||
$cfg = new Configuration($seed, $pattern, $keyboardLayout, $spaceBarSize, $text, $primary, $secondary);
|
||||
$creator = new CardCreator($cfg);
|
||||
|
||||
|
||||
// Load SVG templates
|
||||
$front_template = $creator->getSvgTemplate('simple_back');
|
||||
$back_template = $creator->getSvgTemplate('simple_front');
|
||||
|
||||
|
||||
// Render SVG into tempfiles
|
||||
$front = $creator->renderIntoTempfile($front_template);
|
||||
$back = $creator->renderIntoTempfile($back_template);
|
||||
|
||||
|
||||
// Render the PDF
|
||||
$doc = PDFRenderer::render($front, $back);
|
||||
|
||||
|
||||
// Prepare response PDF file header
|
||||
RequestUtils::preparePdfHeader(strlen($doc));
|
||||
|
||||
|
||||
// Ignore user abort to cleanup afterwards
|
||||
ignore_user_abort(true);
|
||||
|
||||
|
||||
// Strem the PDF
|
||||
echo $doc;
|
||||
|
||||
|
||||
// Cleanup temporary SVG images
|
||||
unlink($back);
|
||||
unlink($front);
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
<div class="row" style="margin-top: 30px;">
|
||||
<p>What's your Keyboard layout?</p>
|
||||
<select type="text" name="keyboardlayout">
|
||||
<option value="azerty">AZERTY</option>
|
||||
<option value="qwerty">QWERTY</option>
|
||||
<option value="qwertz">QWERTZ</option>
|
||||
</select>
|
||||
|
@ -57,7 +56,7 @@
|
|||
|
||||
<div class="row" style="margin-top: 30px;">
|
||||
<p>This text goes on the back of your card</p>
|
||||
<input type="text" name="msg" placeholder="For Work" maxlength="30" autocomplete="off">
|
||||
<input type="text" name="msg" placeholder="For Work" maxlength="20" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top: 30px;">
|
||||
|
|
|
@ -80,10 +80,6 @@ class Configuration
|
|||
*/
|
||||
public static function evalKeys($keys)
|
||||
{
|
||||
// Return azerty
|
||||
if (strtolower($keys) === 'azerty') {
|
||||
return 'AZERTYUIOPQSDFGHJKLMWXCVBN';
|
||||
}
|
||||
// Return qwertz
|
||||
if (strtolower($keys) === 'qwertz') {
|
||||
return 'QWERTZUIOPASDFGHJKLYXCVBNM';
|
||||
|
|
|
@ -74,7 +74,7 @@ class RequestUtils
|
|||
public static function parseText()
|
||||
{
|
||||
if (isset($_POST['msg'])) {
|
||||
return substr($_POST['msg'], 0, 30);
|
||||
return substr($_POST['msg'], 0, 20);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ class RequestUtils
|
|||
{
|
||||
if (
|
||||
isset($_POST['keyboardlayout']) &&
|
||||
preg_match("/azerty|qwerty|qwertz/", $_POST['keyboardlayout'])
|
||||
preg_match("/qwerty|qwertz/", $_POST['keyboardlayout'])
|
||||
) {
|
||||
return strtolower($_POST['keyboardlayout']);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue