Code totaly rewritted + added pad(url:) support

This commit is contained in:
Ventricule 2018-03-16 15:05:56 +01:00
commit baf91773ec
114 changed files with 4192 additions and 429 deletions

View file

@ -1,42 +1,26 @@
<?php
include('snippets/functions.php');
$user_language = get_user_language();
$translation = load_translation_file();
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', __DIR__);
if(isset($_POST['new_name'])):
if($new_name = $_POST['new_name']) :
header('Location: ' . 'http://' . $_SERVER["SERVER_NAME"] . '/' . urlencode($new_name) );
endif;
endif;
?>
<!doctype html>
<html>
// load all dependencies
require __DIR__ . DS . 'libreto' . DS . 'vendor' . DS . 'load.php';
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
// load all helpers functions
require __DIR__ . DS . 'libreto' . DS . 'helpers.php';
<title>Libreto</title>
// load all core classes
function loadClass($classe) {
require __DIR__ . DS . 'libreto' . DS . $classe . '.php';
}
spl_autoload_register('loadClass');
<link rel="stylesheet" href="/assets/style-index.css">
</head>
// load options
require __DIR__ . DS . 'config.php';
<body class="current-lang-<?= get_user_language() ?>">
<article>
<?php
$markdown = file_get_contents("assets/texts/homepage.md");
$Parsedown = new ParsedownExtra();
$html = $Parsedown->setBreaksEnabled(true)->text($markdown);
echo $html;
?>
<div class="create_libreto">
<form action="" method="POST">
<input type="input" autofocus="autofocus" onfocus="this.select()" name="new_name" />
<button type="submit" /><?= localize("create-libreto") ?></button>
</form>
</div>
</article>
</body>
// create Libreto
$libreto = new Libreto($options);
</html>
// launch
$libreto->launch();
// var_dump($libreto);