mirror of
https://github.com/zamentur/libreto.git
synced 2025-11-07 14:55:00 +05:30
Code totaly rewritted + added pad(url:) support
This commit is contained in:
parent
a449f9f617
commit
baf91773ec
114 changed files with 4192 additions and 429 deletions
54
index.php
54
index.php
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue