initial commit after server failure

This commit is contained in:
Léo 2017-12-20 21:49:11 +01:00
commit a14390f8f5
109 changed files with 27898 additions and 0 deletions

5
.gitignore vendored Executable file
View File

@ -0,0 +1,5 @@
/includes/config.php
/medias/*
*.sublime-project
*.sublime-workspace
*.log

9
.htaccess Executable file
View File

@ -0,0 +1,9 @@
AddDefaultCharset UTF-8
RewriteEngine On
# Everything uses the routing system
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . %{ENV:BASE}index.php [L]

58
controllers/d.admin.php Executable file
View File

@ -0,0 +1,58 @@
<?
if(isset($controller->splitted_url[1]) && $user->role >= 800) {
switch ($controller->splitted_url[1]) {
case '': case 'admin':
$head['title'] = "Administration";
include ($config['views_folder']."d.admin.html");
break;
case 'git-pull':
if ($user->role >= 1000) {
$head['title'] = "Mise à jour";
$output = array();
chdir($config['abs_root_folder']);
exec("git pull origin master", $output);
include ($config['views_folder']."d.admin.git-pull.html");
}
else {
$notfound = 1;
}
break;
case 'logs':
if ($user->role >= 800) {
$head['title'] = "Logs";
$files_list = scandir($config['logs_folder']);
if (isset($controller->splitted_url[2]) && is_numeric($controller->splitted_url[2]) && intval($controller->splitted_url[2]) < count($files_list)-2) {
$filenb = $controller->splitted_url[2];
}
else {
$filenb = 0;
}
chdir($config['logs_folder']);
exec("tail -n 200 ".$files_list[$filenb+2]." | tac", $output);
include ($config['views_folder']."d.admin.logs.html");
}
else {
$notfound = 1;
}
break;
default:
$notfound = 1;
break;
}
}
else if($user->role >= 800) {
$head['title'] = "Administration";
include ($config['views_folder']."d.admin.html");
}
else {
$notfound = 1;
}
?>

204
controllers/d.blog.php Executable file
View File

@ -0,0 +1,204 @@
<?
require_once($config['models_folder']."d.blog.php");
require_once($config['models_folder']."d.users.php");
$head['css'] = "d.index.css;d.blog.css";
$blogArticle = new BlogArticle();
// In case we are in the list of articles, we set url to switch with according parameters
if (!isset($controller->splitted_url[1]) OR $controller->splitted_url[1]=="" OR is_numeric($controller->splitted_url[1])) {
$head['title'] = "Blog";
// Get the correct page number
if (!isset($controller->splitted_url[1]) OR $controller->splitted_url[1]=="") {
$page = 0;
} else {
$page = $controller->splitted_url[1] - 1;
}
$controller->splitted_url[1] = "list";
$list = "html";
$articles_per_pages = 5;
}
switch ($controller->splitted_url[1]) {
case "rss":
$page = 0;
$list = "rss";
$articles_per_pages = 20;
case "list":
$blogArticles = new BlogArticles();
$blogArticles->number(($user->role >= 600));
// In case the wanted page is too big
if($articles_per_pages * $page >= $blogArticles->number)
$page = 0;
$blogArticles->listArticles($page*$articles_per_pages,$articles_per_pages,($user->role >= 600));
$i = 0;
$blogArticles_list = array();
foreach ($blogArticles->ids as $row) {
$blogArticles_list[$i] = new BlogArticle();
$blogArticles_list[$i]->id = $row;
$blogArticles_list[$i]->populate();
$blogArticles_list[$i]->md2txt();
$tempUser = new User();
$tempUser->id = $blogArticles_list[$i]->author;
$tempUser->populate();
$blogArticles_list[$i]->author_name = $tempUser->name;
unset($tempUser);
$i++;
}
$first = $page*$articles_per_pages+1;
$last = (($page+1)*$articles_per_pages > $blogArticles->number ? $blogArticles->number : ($page+1)*$articles_per_pages);
if ($list == "rss") {
include ($config['views_folder']."d.blog.list.rss");
} else {
include ($config['views_folder']."d.blog.list.html");
}
break;
case "new":
if($user->role >= 800) {
if(isset($_POST['submit'])) {
$blogArticle->content = $_POST['content'];
$blogArticle->locale = $_POST['locale'];
$blogArticle->title = $_POST['title'];
$blogArticle->comments = isset($_POST['comments'])?'t':'f';
$blogArticle->author = $user->id;
if(!$blogArticle->checkUrl($_POST['url'],1)) {
$blogArticle->insert();
header('Location: '.$config['rel_root_folder']."blog/".$blogArticle->url);
}
else {
$head['title'] = $blogArticle->title;
$error = "url";
$new = 1;
include ($config['views_folder']."d.blog.edit.html");
}
}
else {
$head['title'] = "Nouvel article";
$new = 1;
include ($config['views_folder']."d.blog.edit.html");
}
break;
}
default:
// If the page exists
if ($blogArticle->checkUrl($controller->splitted_url[1],$user->role >= 600)) {
if (isset($controller->splitted_url[2]) && $controller->splitted_url[2] == "delete" && $user->role >= 800) {
$blogArticle->delete();
header('Location: '.$config['rel_root_folder']."blog/".$blogArticle->url);
}
else if (isset($controller->splitted_url[2]) && $controller->splitted_url[2] == "edit" && $user->role >= 800) {
if(isset($_POST['submit'])) {
$blogArticle->content = $_POST['content'];
$blogArticle->locale = $_POST['locale'];
$blogArticle->title = $_POST['title'];
$blogArticle->comments = isset($_POST['comments'])?'t':'f';
$blogArticle->author = $user->id;
$blogArticle->update();
header('Location: '.$config['rel_root_folder']."blog/".$blogArticle->url);
}
else {
$blogArticle->populate();
$head['title'] = $blogArticle->title;
include ($config['views_folder']."d.blog.edit.html");
}
}
else {
// Manage history of an article
if($user->role >= 600) {
$blogArticles_history = new BlogArticles();
$blogArticles_history->getHistory($controller->splitted_url[1]);
$i = 0;
foreach ($blogArticles_history->ids as $row) {
$blogArticles_history_list[$i] = new BlogArticle();
$blogArticles_history_list[$i]->id = $row;
$blogArticles_history_list[$i]->populate();
$i++;
}
}
if (isset($controller->splitted_url[2]) && is_numeric($controller->splitted_url[2]))
$blogArticle->checkUrl($controller->splitted_url[1],$user->role>=600,$controller->splitted_url[2]);
// Manage comment creation
if (isset($controller->splitted_url[2]) && $controller->splitted_url[2]=="new_comment") {
if (isset($_POST['submit']) && $user->role > 0) {
$blogComment = new BlogComment();
$blogComment->locale = $user->locale;
$blogComment->author = $user->id;
$blogComment->article = $blogArticle->id;
$blogComment->content = $_POST['comment'];
$blogComment->insert();
}
}
// Manage comment deletion
if (isset($controller->splitted_url[2]) && $controller->splitted_url[2]=="delete_comment") {
if (isset($controller->splitted_url[3]) && is_numeric($controller->splitted_url[3])) {
$blogComment = new BlogComment();
$blogComment->id = $controller->splitted_url[3];
$blogComment->populate();
if ($user->role >= 800 || $user->id == $blogComment->author)
$blogComment->delete();
}
}
// Manage comment undeletion
if (isset($controller->splitted_url[2]) && $controller->splitted_url[2]=="undelete_comment") {
if (isset($controller->splitted_url[3]) && is_numeric($controller->splitted_url[3])) {
$blogComment = new BlogComment();
$blogComment->id = $controller->splitted_url[3];
$blogComment->populate();
if ($user->role >= 800 || $user->id == $blogComment->author)
$blogComment->undelete();
}
}
$blogArticle->populate();
$blogArticle->md2html();
// Manage comments
if ($blogArticle->comments == "t") {
$blogArticles_comments = new BlogComments();
$blogArticles_comments->listComments($blogArticle->id, ($user->role>400));
$i = 0;
foreach ($blogArticles_comments->ids as $row) {
$blogArticles_comments_list[$i] = new BlogComment();
$blogArticles_comments_list[$i]->id = $row;
$blogArticles_comments_list[$i]->populate();
$blogArticles_comments_list[$i]->md2html();
$blogArticles_comments_list[$i]->author_obj = new User();
$blogArticles_comments_list[$i]->author_obj->id = $blogArticles_comments_list[$i]->author;
$blogArticles_comments_list[$i]->author_obj->populate();
$i++;
}
}
$tempUser = new User();
$tempUser->id = $blogArticle->author;
$tempUser->populate();
$blogArticle->author_name = $tempUser->name;
unset($tempUser);
$head['title'] = $blogArticle->title;
include ($config['views_folder']."d.blog.view.html");
}
}
else {
$notfound = 1;
}
break;
}
?>

77
controllers/d.contact.php Executable file
View File

@ -0,0 +1,77 @@
<?
function post($index) {
return isset($_POST[$index]) ? $_POST[$index] : '';
}
$error = "no";
if(isset($_POST['submit'])) {
$message = "Message reçu depuis Kabano par ".post('name').".<br>\r\n";
$message .= "<hr>\r\n";
$message .= "<pre style='padding: 10px; background: #ccc;'>".strip_tags(post('message'))."</pre><br>\r\n";
$headers = 'From: '. post('mail') . "\r\n" .
'Reply-To: '. post('mail') . "\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=UTF-8' . "\r\n";
if(post('ns') == '' && $_POST['captcha'] == -2) {
$send = true;
if(post('name') == '') {
$error = "name";
$send = false;
}
if(post('subject') == '') {
$error = "subject";
$send = false;
}
if(post('mail') == '') {
$error = "mail";
$send = false;
}
if(post('message') == '') {
$error = "message";
$send = false;
}
if($send) {
if(mail($config['admin_mail'], "Kabano :: ".post('subject'), $message, $headers)) {
$error = "none";
} else {
$error = "unknown";
}
}
}
else {
$error = "spam";
}
}
if(post('name') != '')
$contact['name'] = post('name');
else if($user->role > 0)
$contact['name'] = $user->name;
else
$contact['name'] = '';
if(post('mail') != '')
$contact['mail'] = post('mail');
else if($user->role > 0)
$contact['mail'] = $user->mail;
else
$contact['mail'] = '';
$contact['subject'] = post('subject');
$contact['message'] = post('message');
$contact['ns'] = post('ns');
$head['css'] = "d.index.css;d.user.css";
$head['js'] = "d.captcha.js";
$head['title'] = "Contact";
include ($config['views_folder']."d.contact.html");
?>

20
controllers/d.map.php Executable file
View File

@ -0,0 +1,20 @@
<?
$head['css'] = "d.index.css";
if(isset($controller->splitted_url[1]) && $controller->splitted_url[1] != '') {
switch ($controller->splitted_url[1]) {
default:
$notfound = 1;
break;
}
}
else {
$head['title'] = "Carte";
$head['third'] = "leaflet/leaflet.js;leaflet-fullscreen/Leaflet.fullscreen.min.js;leaflet-easybutton/easy-button.js";
$head['css'] .= ";d.map.css;../third/leaflet/leaflet.css;../third/leaflet-fullscreen/leaflet.fullscreen.css;../third/leaflet-easybutton/easy-button.css";
$head['js'] = "d.map.js";
include ($config['views_folder']."d.map.html");
}
?>

237
controllers/d.users.php Executable file
View File

@ -0,0 +1,237 @@
<?
require_once($config['models_folder']."d.users.php");
$head['css'] = "d.index.css;d.user.css";
if(isset($controller->splitted_url[1])) {
switch ($controller->splitted_url[1]) {
case 'login':
$head['title'] = "Connexion";
if ($user->role == 0) {
if (isset($_POST['submit'])) {
// PROCESS DATA FROM FORM
$user = new User();
$user->login($_POST['login'], $_POST['password']);
if($user->id != 0) {
// SUCESSFULL LOGIN
$_SESSION['userid'] = $user->id;
header('Location: '.$_SERVER['HTTP_REFERER']);
}
else {
header('Location: '.$config['rel_root_folder'].'user/login?error=1');
}
}
include ($config['views_folder']."d.user.login.html");
} else {
header('Location: '.$config['rel_root_folder']);
}
break;
case 'logout':
session_destroy();
header('Location: '.$_SERVER['HTTP_REFERER']);
break;
case 'signin':
$head['js'] = "d.captcha.js";
$head['title'] = "Création de compte";
if ($user->role == 0) {
if (isset($_POST['submit'])) {
// PROCESS DATA FROM FORM
$user = new User();
$user->password = sha1($_POST['password']);
$user->name = $_POST['login'];
$user->mail = strtolower($_POST['mail']);
$user->role = 400;
$user->avatar = 'f';
$user->locale = "fr";
if($_POST['captcha'] == -2) {
if($user->availableName()) {
if($user->availableMail()) {
if($user->password != "" AND $user->name != "" AND $user->mail != "") {
$user->create();
header('Location: '.$config['rel_root_folder'].'user/login?status=created');
}
else {
header('Location: '.$config['rel_root_folder'].'user/signin?error=empty');
}
}
else {
header('Location: '.$config['rel_root_folder'].'user/signin?error=mail');
}
}
else {
header('Location: '.$config['rel_root_folder'].'user/signin?error=name');
}
}
else {
header('Location: '.$config['rel_root_folder'].'user/signin?error=captcha');
}
}
include ($config['views_folder']."d.user.signin.html");
} else {
header('Location: '.$config['rel_root_folder']);
}
break;
case 'password_lost':
$head['title'] = "Récupération de mot de passe";
if ($user->role == 0) {
if (isset($_POST['submit'])) {
// PROCESS DATA FROM FORM
$user = new User();
$user->mail = strtolower($_POST['mail']);
if($user->availableMail()) {
header('Location: '.$config['rel_root_folder'].'user/password_lost?error=1');
}
else {
$user->sendPassword();
header('Location: '.$config['rel_root_folder'].'user/login?status=password_sent');
}
}
include ($config['views_folder']."d.user.password_lost.html");
} else {
header('Location: '.$config['rel_root_folder']);
}
break;
case 'p':
if ($user->role >= 200) {
$userProfile = new User();
if (!isset($controller->splitted_url[2]) OR $controller->splitted_url[2]=="") {
// WE DISPLAY THE CONNECTED USER PROFILE
$userProfile = $user;
} else {
// WE DISPLAY THE SELECTED USER PROFILE FROM ID
$userProfile->checkID(intval($controller->splitted_url[2]));
}
$head['title'] = "Profil inexistant";
if($userProfile->id != 0) {
$userProfile->populate();
$head['title'] = "Profil de ".$userProfile->name;
}
// If we are editing the profile
if(isset($controller->splitted_url[3]) && $controller->splitted_url[3]=="edit" && ($user->role >= 800 || $user->id == $userProfile->id)) {
$head['js'] = "d.avatar.js";
if (isset($_POST['submit'])) {
$receivedUser = new User();
$receivedUser->name = $_POST['name'];
if($receivedUser->name != $userProfile->name && $receivedUser->availableName())
$userProfile->name = $receivedUser->name;
else if($receivedUser->name != $userProfile->name)
$nameError=1;
$receivedUser->mail = strtolower($_POST['mail']);
if($receivedUser->mail != $userProfile->mail && $receivedUser->availableMail())
$userProfile->mail = $receivedUser->mail;
else if ($receivedUser->mail != $userProfile->mail)
$mailError=1;
if($_POST['password']!='')
$userProfile->password=sha1($_POST['password']);
$userProfile->locale=$_POST['locale'];
if($user->role>=1000)
$userProfile->role = $_POST['role'];
$userProfile->website=$_POST['website'];
// Is the file correctly sent to the server ?
$pathToFile = $config['medias_folder']."avatars/".$userProfile->id;
if(isset($_FILES['avatarfile']['tmp_name']) && $_FILES['avatarfile']['tmp_name']!='' && $_FILES['avatarfile']['size'] < 16000000 && isset($_POST['avatar'])) {
require_once($config['includes_folder']."images.php");
if(file_exists($pathToFile)) unlink($pathToFile);
move_uploaded_file($_FILES['avatarfile']['tmp_name'], $pathToFile);
if(file_exists($pathToFile."_p.jpg")) unlink($pathToFile."_p.jpg");
generate_image_thumbnail($pathToFile, $pathToFile."_p.jpg", 220, 240);
if(file_exists($pathToFile."_s.jpg")) unlink($pathToFile."_s.jpg");
generate_image_thumbnail($pathToFile, $pathToFile."_s.jpg", 28, 28);
$userProfile->avatar = 't';
}
elseif (!isset($_POST['avatar'])) {
if(file_exists($pathToFile)) unlink($pathToFile);
if(file_exists($pathToFile."_p.jpg")) unlink($pathToFile."_p.jpg");
if(file_exists($pathToFile."_s.jpg")) unlink($pathToFile."_s.jpg");
$userProfile->avatar = 'f';
}
$userProfile->update();
$updated = 1;
}
include ($config['views_folder']."d.user.profile.edit.html");
}
// If we are displaying the profile
else {
if (isset($_POST['submit']) && $user->role >= 400) {
// PROCESS DATA FROM CONTACT FORM
$message = $_POST['message'];
$userProfile->sendMail($message, $user);
$mailsent = 1;
}
include ($config['views_folder']."d.user.profile.html");
}
}
else {
header('Location: '.$config['rel_root_folder']);
}
break;
case 'member_list':
if ($user->role >= 200) {
$rows_per_pages = 50;
// Get the correct page number
if (!isset($controller->splitted_url[2]) OR $controller->splitted_url[2]=="" OR $controller->splitted_url[2]=="0" OR !is_numeric($controller->splitted_url[2])) {
$page = 0;
} else {
$page = $controller->splitted_url[2] - 1;
}
$head['title'] = "Liste des membres";
$users = new Users();
$users->number();
// In case the wanted page is too big
if($rows_per_pages * $page >= $users->number)
$page = 0;
if(isset($_GET['order']))
$order = $_GET['order'];
else
$order = 'ASC';
if(isset($_GET['orderby']))
$orderby = $_GET['orderby'];
else
$orderby = 'id';
$users->list_users($page*$rows_per_pages,$rows_per_pages,$orderby,$order);
$i = 0;
foreach ($users->ids as $row) {
$user_list[$i] = new User();
$user_list[$i]->id = $row;
$user_list[$i]->populate();
$i++;
}
$first = $page*$rows_per_pages+1;
$last = (($page+1)*$rows_per_pages > $users->number ? $users->number : ($page+1)*$rows_per_pages);
include ($config['views_folder']."d.user.member_list.html");
}
else {
header('Location: '.$config['rel_root_folder']);
}
break;
default:
$notfound = 1;
break;
}
}
else {
$notfound = 1;
}
?>

77
controllers/d.wiki.php Executable file
View File

@ -0,0 +1,77 @@
<?
require_once($config['models_folder']."d.wiki.php");
$head['css'] = "d.index.css;d.wiki.css";
$wikiPage = new WikiPage();
// Page doesn't exists
if(isset($controller->splitted_url[1]) && !$wikiPage->checkUrl($controller->splitted_url[1],$user->role >= 600) && $controller->splitted_url[1]!="") {
if($user->role >= 800) {
// Create new page
if(isset($_POST['submit'])) {
$wikiPage->content = $_POST['content'];
$wikiPage->locale = $_POST['locale'];
$wikiPage->title = $_POST['title'];
$wikiPage->insert();
header('Location: '.$config['rel_root_folder']."wiki/".$wikiPage->url);
}
else {
$head['title'] = "Nouvelle page";
include ($config['views_folder']."d.wiki.edit.html");
}
}
else {
$notfound = 1;
}
}
// Page exists
else if(isset($controller->splitted_url[1]) && $wikiPage->checkUrl($controller->splitted_url[1],$user->role >= 600)) {
if (isset($controller->splitted_url[2]) && $controller->splitted_url[2]=="edit" && $user->role >= 800) {
// Edit page
if(isset($_POST['submit'])) {
$wikiPage->content = $_POST['content'];
$wikiPage->locale = $_POST['locale'];
$wikiPage->title = $_POST['title'];
$wikiPage->update();
header('Location: '.$config['rel_root_folder']."wiki/".$wikiPage->url);
}
else {
$wikiPage->populate();
$head['title'] = $wikiPage->title;
include ($config['views_folder']."d.wiki.edit.html");
}
} else if (isset($controller->splitted_url[2]) && $controller->splitted_url[2]=="delete" && $user->role >= 800) {
// Delete page
$wikiPage->delete();
header('Location: '.$config['rel_root_folder']."wiki/".$wikiPage->url);
} else {
// Display page
if($user->role >= 600) {
$wikiHistory = new WikiPages();
$wikiHistory->getHistory($controller->splitted_url[1]);
$i = 0;
foreach ($wikiHistory->ids as $row) {
$wikiHistory_list[$i] = new WikiPage();
$wikiHistory_list[$i]->id = $row;
$wikiHistory_list[$i]->populate();
$i++;
}
}
if (isset($controller->splitted_url[2]) && is_numeric($controller->splitted_url[2]))
$wikiPage->checkUrl($controller->splitted_url[1],$user->role>=600, $controller->splitted_url[2]);
$wikiPage->populate();
$wikiPage->md2html();
$head['title'] = $wikiPage->title;
include ($config['views_folder']."d.wiki.view.html");
}
}
else {
$notfound = 1;
}
?>

65
includes/config.example.php Executable file
View File

@ -0,0 +1,65 @@
<?
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
/*****
** Management of folder names
*****/
// It is the include folder name
$config['include_folder']=basename(__DIR__);
// This is the absolute folder to the root of the website
$config['abs_root_folder']=str_replace($config['include_folder'],"",__DIR__);
// This is the relative folder to the root of the website from the DocumentRoot (can also be called subfolder)
$config['rel_root_folder']=str_replace($_SERVER['DOCUMENT_ROOT'],"",$config['abs_root_folder']);
if($config['rel_root_folder']=="") $config['rel_root_folder']="/";
// Here all the absolute paths to specific folders
$config['views_folder'] = $config['abs_root_folder']."views/";
$config['controllers_folder'] = $config['abs_root_folder']."controllers/";
$config['models_folder'] = $config['abs_root_folder']."models/";
$config['medias_folder'] = $config['abs_root_folder']."medias/";
$config['includes_folder'] = $config['abs_root_folder']."includes/";
$config['third_folder'] = $config['abs_root_folder']."third/";
$config['logs_folder'] = $config['abs_root_folder']."logs/";
// Here all the relative url to specific folders
$config['views_url'] = $config['rel_root_folder']."views/";
/*****
** SQL Database configuration
*****/
$config['SQL_host'] = "localhost";
$config['SQL_user'] = "kabano";
$config['SQL_pass'] = "PASSWORD";
$config['SQL_db'] = "postgres";
/*****
** Mail configuration
*****/
$config['admin_mail'] = "leo@lstronic.com";
$config['bot_mail'] = "robot@kabano.com";
/*****
** Locales configuration
*****/
$config['locales'] = array(
"fr" => array("fr","fr_FR.UTF8","french","fr_FR","fr_FR.UTF-8", "Français")
);
$config['roles'] = array(
1000 => array(1000,"Administrateur", "red"),
800 => array(800,"Modérateur", "orangered"),
600 => array(600,"Membre premium", "orange"),
400 => array(400,"Utilisateur", "green"),
200 => array(200,"Membre archivé", "#aaa"),
0 => array(0,"Visiteur", "black")
);
?>

42
includes/images.php Executable file
View File

@ -0,0 +1,42 @@
<?
function generate_image_thumbnail($source_image_path, $thumbnail_image_path, $width, $height)
{
list($source_image_width, $source_image_height, $source_image_type) = getimagesize($source_image_path);
switch ($source_image_type) {
case IMAGETYPE_GIF:
$source_gd_image = imagecreatefromgif($source_image_path);
break;
case IMAGETYPE_JPEG:
$source_gd_image = imagecreatefromjpeg($source_image_path);
break;
case IMAGETYPE_PNG:
$source_gd_image = imagecreatefrompng($source_image_path);
break;
}
if ($source_gd_image === false) {
return false;
}
$src_x = 0;
$src_y = 0;
$thumbnail_image_height = $height;
$thumbnail_image_width = $width;
// If the limitation is on the height (cuts on the width)
if($height*$source_image_width/$source_image_height > $width) {
$src_x = (int)(($source_image_width - $source_image_height * $width / $height) / 2);
$source_image_width = $source_image_height * $width / $height;
} else {
$src_y = (int)(($source_image_height - $source_image_width * $height / $width) / 2);
$source_image_height = $source_image_width * $height / $width;
}
$thumbnail_gd_image = imagecreatetruecolor($thumbnail_image_width, $thumbnail_image_height);
imagecopyresampled($thumbnail_gd_image, $source_gd_image, 0, 0, $src_x, $src_y, $thumbnail_image_width, $thumbnail_image_height, $source_image_width, $source_image_height);
imagejpeg($thumbnail_gd_image, $thumbnail_image_path, 90);
imagedestroy($source_gd_image);
imagedestroy($thumbnail_gd_image);
return true;
}
?>

71
includes/routes.php Executable file
View File

@ -0,0 +1,71 @@
<?
/*****
** This file contains the routing from any request to the correct view and controller
*****/
$controller = new stdClass;
$view = new stdClass;
$controller->full_url = $_SERVER['REQUEST_URI'];
$controller->url_no_param = explode('?',$controller->full_url);
// URL without ?parameters and /subfolder/
$controller->base_url=str_replace('RACINE'.$config['rel_root_folder'],'','RACINE'.$controller->url_no_param[0]);
$controller->splitted_url = explode ('/',$controller->base_url);
// By default we use the desktop
$view->prefix = "d.";
$controller->prefix = "d.";
$notfound = 0;
$session = 1;
// Routing to the correct page from the correct link
switch ($controller->splitted_url[0])
{
case "index": case "" :
$controller->name="";
$view->name="index";
break;
case "user" :
$controller->name="users";
$view->name="";
break;
case "contact" :
case "wiki" :
case "blog" :
case "map" :
case "admin" :
$controller->name=$controller->splitted_url[0];
$view->name="";
break;
default :
$controller->name="";
$view->name="";
$notfound = 1;
break;
}
if($session==1) {
require_once('session.php');
}
if($controller->name != "") {
include ($config['controllers_folder'].$controller->prefix.$controller->name.".php");
}
if($view->name != "") {
include ($config['views_folder'].$view->prefix.$view->name.".html");
}
if($notfound) {
require_once('session.php');
require_once($config['models_folder']."d.wiki.php");
$wikiPage = new WikiPage();
$wikiPage->checkUrl('404');
$wikiPage->populate();
$wikiPage->md2html();
$head['css'] = "d.index.css;d.wiki.css";
$head['title'] = $wikiPage->title;
include ($config['views_folder']."d.wiki.view.html");
}
?>

23
includes/session.php Executable file
View File

@ -0,0 +1,23 @@
<?
require_once($config['models_folder']."d.users.php");
ini_set("session.cookie_lifetime",60*60*24*30);
session_start();
$user = new User();
$user->role == 0; // All users are visitors
if(isset($_SESSION['userid'])) {
$user->checkID($_SESSION['userid']);
if ($user->id != 0) {
$user->updateLoginDate();
$user->populate();
setlocale(LC_ALL, $config['locales'][$user->locale][4]);
}
else {
session_destroy();
}
}
?>

6
index.php Executable file
View File

@ -0,0 +1,6 @@
<?
require_once('includes/config.php');
require_once('includes/routes.php');
?>

6
info.php Executable file
View File

@ -0,0 +1,6 @@
<?
phpinfo();
exit();
?>

487
models/d.blog.php Executable file
View File

@ -0,0 +1,487 @@
<?
/**********************************************************
***********************************************************
**
** This class is to manage a blog article object
**
***********************************************************
**********************************************************/
require_once($config['third_folder']."Md/MarkdownExtra.inc.php");
class BlogArticle
{
public $id = 0;
public $title = NULL;
public $url = NULL;
public $locale = NULL;
public $lastedit = NULL;
public $archive = NULL;
public $content = NULL;
public $author = NULL;
public $comments = NULL;
/*****
** Checks if a page at this URL exists and return the ID
*****/
public function checkUrl($url, $withArchive=0, $elementNb=0) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM blog_articles WHERE url=$1";
if($withArchive==0) {
$query .= " AND archive=FALSE";
}
$query .= " ORDER BY lastedit DESC LIMIT 1 OFFSET $2";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($url, $elementNb))
or die ("Cannot execute statement\n");
pg_close($con);
if(pg_num_rows($result) == 1) {
$article = pg_fetch_assoc($result);
$this->id = $article['id'];
$this->url = $url;
return 1;
}
else {
$this->url = $url;
return 0;
}
}
/*****
** Populate the object using its ID
*****/
public function populate() {
global $config;
if($this->id != 0) {
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT * FROM blog_articles WHERE id=$1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($this->id))
or die ("Cannot execute statement\n");
pg_close($con);
$blog_article = pg_fetch_assoc($result);
$this->title = $blog_article['title'];
$this->url = $blog_article['url'];
$this->locale = $blog_article['locale'];
$this->lastedit = $blog_article['lastedit'];
$this->archive = $blog_article['archive'];
$this->content = $blog_article['content'];
$this->author = $blog_article['author'];
$this->comments = $blog_article['comments'];
}
else {
die("Cannot populate a blog article without ID");
}
}
/*****
** Edit a page by archiving the current one and inserting a new one ID
*****/
public function update() {
global $config;
global $user;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
// Archive previous article
$query = "UPDATE blog_articles SET archive = TRUE WHERE url = $1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($this->url))
or die ("Cannot execute statement\n");
// Publish the new one
$query = "INSERT INTO blog_articles (url, title, content, lastedit, archive, locale, author, comments) VALUES
($1, $2, $3, $4, FALSE, $5, $6, $7) RETURNING id";
pg_prepare($con, "prepare2", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare2", array($this->url, $this->title, $this->content, date('r'), $this->locale, $this->author, $this->comments))
or die ("Cannot execute statement\n");
$this->id = pg_fetch_assoc($result)['id'];
// Move all comments to the new one
$query = "UPDATE blog_comments bc SET article = $1 FROM blog_articles ba WHERE bc.article = ba.id AND ba.url = $2";
pg_prepare($con, "prepare3", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare3", array($this->id, $this->url))
or die ("Cannot execute statement\n");
pg_close($con);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tUPDATE \tEdit blog article '".$this->url."'\r\n",
3,
$config['logs_folder'].'blog.articles.log');
}
/*****
** Delete an article by archiving it
*****/
public function delete() {
global $config;
global $user;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "UPDATE blog_articles SET archive = TRUE WHERE url = $1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($this->url))
or die ("Cannot execute statement\n");
pg_close($con);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tDELETE \tArchive blog article '".$this->url."'\r\n",
3,
$config['logs_folder'].'blog.articles.log');
}
/*****
** Create an article
*****/
public function insert() {
global $config;
global $user;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "INSERT INTO blog_articles (url, title, content, lastedit, archive, locale, author, comments) VALUES
($1, $2, $3, $4, FALSE, $5, $6, $7)";
pg_prepare($con, "prepare2", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare2", array($this->url, $this->title, $this->content, date('r'), $this->locale, $this->author, $this->comments))
or die ("Cannot execute statement\n");
pg_close($con);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tINSERT \tCreate new blog article '".$this->url."'\r\n",
3,
$config['logs_folder'].'blog.articles.log');
}
/*****
** Converts the Markdown content to HTML
*****/
public function md2html() {
$this->content_html = \Michelf\MarkdownExtra::defaultTransform($this->content);
}
/*****
** Converts the Markdown content to text
*****/
public function md2txt() {
$this->md2html();
$this->content_txt = strip_tags($this->content_html);
}
}
/**********************************************************
***********************************************************
**
** This class is to manage a list of blog articles
**
***********************************************************
**********************************************************/
class BlogArticles
{
public $ids = array();
public $number = NULL;
/*****
** Return the list of different articles
*****/
public function listArticles($first, $count, $archive=0) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
if ($archive == 1) {
// You just want one per url and the criteria is ORDER BY archives = true, time DES=C
$query = "SELECT id FROM (SELECT a.id, a.lastedit , ROW_NUMBER() OVER (PARTITION BY a.url ORDER BY CASE WHEN a.archive IS TRUE THEN 1 ELSE 0 END, a.lastedit DESC) AS r FROM blog_articles AS a) AS b WHERE r = 1 ORDER BY lastedit DESC";
}
else {
$query = "SELECT id FROM blog_articles WHERE archive IS NOT TRUE ORDER BY lastedit DESC";
}
$query .= " LIMIT $1 OFFSET $2";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($count, $first))
or die ("Cannot execute statement\n");
pg_close($con);
for($i = 0; $i < pg_num_rows($result); $i++) {
$row = pg_fetch_assoc($result, $i);
$this->ids[$i] = $row['id'];
}
}
/*****
** Return the number of articles
*****/
public function number($archive=0) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
if ($archive == 1) {
// You just want one per url and the criteria is ORDER BY archives = true, time DES=C
$query = "SELECT id FROM (SELECT a.id, a.lastedit , ROW_NUMBER() OVER (PARTITION BY a.url ORDER BY CASE WHEN a.archive IS TRUE THEN 1 ELSE 0 END, a.lastedit DESC) AS r FROM blog_articles AS a) AS b WHERE r = 1 ORDER BY lastedit DESC";
}
else {
$query = "SELECT id FROM blog_articles WHERE archive IS NOT TRUE ORDER BY lastedit DESC";
}
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array())
or die ("Cannot execute statement\n");
pg_close($con);
$this->number = pg_num_rows($result);
}
/*****
** Return the list of archived version of a blog article
*****/
public function getHistory($url) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM blog_articles WHERE url=$1 ORDER BY lastedit DESC";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($url))
or die ("Cannot execute statement\n");
pg_close($con);
$this->number = pg_num_rows($result);
for($i = 0; $i < $this->number; $i++) {
$row = pg_fetch_assoc($result, $i);
$this->ids[$i] = $row['id'];
}
}
}
/**********************************************************
***********************************************************
**
** This class is to manage a blog comment object
**
***********************************************************
**********************************************************/
class BlogComment
{
public $id = 0;
public $locale = NULL;
public $lastedit = NULL;
public $archive = NULL;
public $content = NULL;
public $author = NULL;
public $article = NULL;
/*****
** Populate the object using its ID
*****/
public function populate() {
global $config;
if($this->id != 0) {
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT * FROM blog_comments WHERE id=$1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($this->id))
or die ("Cannot execute statement\n");
pg_close($con);
$blog_comment = pg_fetch_assoc($result);
$this->locale = $blog_comment['locale'];
$this->lastedit = $blog_comment['lastedit'];
$this->archive = $blog_comment['archive'];
$this->content = $blog_comment['content'];
$this->author = $blog_comment['author'];
$this->article = $blog_comment['article'];
}
else {
die("Cannot populate a blog article without ID");
}
}
/*****
** Create a new comment
*****/
public function insert() {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "INSERT INTO blog_comments (content, lastedit, archive, locale, author, article) VALUES
($1, $2, FALSE, $3, $4, $5)";
pg_prepare($con, "prepare2", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare2", array($this->content, date('r'), $this->locale, $this->author, $this->article))
or die ("Cannot execute statement\n");
pg_close($con);
}
/*****
** Archive a comment
*****/
public function delete() {
global $config;
global $user;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "UPDATE blog_comments SET archive = TRUE WHERE id = $1";
pg_prepare($con, "prepare2", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare2", array($this->id))
or die ("Cannot execute statement\n");
pg_close($con);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tDELETE \tArchive comment ".$this->id."\r\n",
3,
$config['logs_folder'].'blog.comments.log');
}
/*****
** DeArchive a comment
*****/
public function undelete() {
global $config;
global $user;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "UPDATE blog_comments SET archive = FALSE WHERE id = $1";
pg_prepare($con, "prepare2", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare2", array($this->id))
or die ("Cannot execute statement\n");
pg_close($con);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tPUBLISH \tUn archive comment ".$this->id."\r\n",
3,
$config['logs_folder'].'blog.comments.log');
}
/*****
** Converts the Markdown content to HTML
*****/
public function md2html() {
$this->content_html = \Michelf\MarkdownExtra::defaultTransform($this->content);
}
/*****
** Converts the Markdown content to text
*****/
public function md2txt() {
$this->md2html();
$this->content_txt = strip_tags($this->content_html);
}
}
/**********************************************************
***********************************************************
**
** This class is to manage a list of blog comments
**
***********************************************************
**********************************************************/
class BlogComments
{
public $ids = array();
public $number = NULL;
/*****
** Return the list of different articles
*****/
public function listComments($id, $archive=0) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM blog_comments WHERE article = $1 ";
if ($archive == 0)
$query .= "AND archive IS FALSE ";
$query .= "ORDER BY lastedit DESC";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($id))
or die ("Cannot execute statement\n");
pg_close($con);
$this->number = pg_num_rows($result);
for($i = 0; $i < pg_num_rows($result); $i++) {
$row = pg_fetch_assoc($result, $i);
$this->ids[$i] = $row['id'];
}
}
}
?>

410
models/d.users.php Executable file
View File

@ -0,0 +1,410 @@
<?
/**********************************************************
***********************************************************
**
** This class is to manage User object
**
***********************************************************
**********************************************************/
class User
{
public $id = 0;
public $name = NULL;
public $avatar = NULL;
public $locale = NULL;
public $role = NULL;
public $lastlogin = NULL;
public $mail = NULL;
public $website = NULL;
public $password = NULL;
public $registered = NULL;
/*****
** Connect to correct account using ID and stores its ID
*****/
public function checkID($id) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM users WHERE id=$1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($id))
or die ("Cannot execute statement\n");
pg_close($con);
if(pg_num_rows($result) == 1) {
$this->id = $id;
return 1;
}
else {
return 0;
}
}
/*****
** Connect to correct account using user/pass and stores its ID
*****/
public function login($login, $pass) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM users WHERE name=$1 AND password=$2";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($login, sha1($pass)))
or die ("Cannot execute statement\n");
pg_close($con);
if(pg_num_rows($result) == 1) {
$user = pg_fetch_assoc($result);
$this->id = $user['id'];
}
}
/*****
** Populate the object using its ID
*****/
public function populate() {
global $config;
if($this->id != 0) {
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT * FROM users WHERE id=$1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($this->id))
or die ("Cannot execute statement\n");
pg_close($con);
$user = pg_fetch_assoc($result);
$this->name = $user['name'];
$this->avatar = $user['avatar'];
$this->locale = $user['locale'];
$this->role = $user['role'];
$this->lastlogin = $user['lastlogin'];
$this->mail = $user['mail'];
$this->website = $user['website'];
$this->registered = $user['registered'];
}
else {
die("Cannot populate an User without ID");
}
}
/*****
** Checks if the user's name is available or not
*****/
public function availableName() {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM users WHERE lower(name)=$1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array(strtolower($this->name)))
or die ("Cannot execute statement\n");
pg_close($con);
if(pg_num_rows($result) < 1) {
return 1;
}
else {
if(pg_num_rows($result)==1) {
$user = pg_fetch_assoc($result);
$this->id = $user['id'];
}
return 0;
}
}
/*****
** Checks if the user's mail address exists in the database
*****/
public function availableMail() {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM users WHERE lower(mail)=$1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array(strtolower($this->mail)))
or die ("Cannot execute statement\n");
pg_close($con);
if(pg_num_rows($result) < 1) {
return 1;
}
else {
if(pg_num_rows($result)==1) {
$user = pg_fetch_assoc($result);
$this->id = $user['id'];
}
return 0;
}
}
/*****
** Creates a new user.
*****/
public function create() {
global $config;
$regex = '/^(https?:\/\/)/';
if (!preg_match($regex, $this->website) && $this->website!="")
$this->website = "http://".$this->website;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "INSERT INTO users (name, password, avatar, locale, role, lastlogin, mail, website, registered) VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9)";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
pg_execute($con, "prepare1", array($this->name, $this->password, $this->avatar, $this->locale, $this->role, $this->lastlogin, $this->mail, $this->website, date('r')))
or die ("Cannot execute statement\n");
pg_close($con);
$this->updateLoginDate();
}
/*****
** Update the user profile
*****/
public function update() {
global $config;
global $user;
$regex = '/^(https?:\/\/)/';
if (!preg_match($regex, $this->website) && $this->website!="")
$this->website = "http://".$this->website;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
if($this->password=='') {
$query = "UPDATE users SET name = $1, avatar = $2, locale = $3, role = $4, mail = $5, website = $6 WHERE id = $7";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
pg_execute($con, "prepare1", array($this->name, $this->avatar, $this->locale, $this->role, $this->mail, $this->website, $this->id))
or die ("Cannot execute statement\n");
}
else {
$query = "UPDATE users SET name = $1, avatar = $2, locale = $3, role = $4, mail = $5, website = $6, password = $7 WHERE id = $8";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
pg_execute($con, "prepare1", array($this->name, $this->avatar, $this->locale, $this->role, $this->mail, $this->website, $this->password, $this->id))
or die ("Cannot execute statement\n");
}
pg_close($con);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tUPDATE \tEdit user ".$this->name." (".$this->id.")\r\n",
3,
$config['logs_folder'].'users.log');
}
/*****
** Generates a random passwords, update the base and send the new password by mail.
*****/
public function sendPassword() {
global $config;
$newPass = randomPassword();
$this->password = sha1($newPass);
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "UPDATE users SET password = $1 WHERE mail = $2";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
pg_execute($con, "prepare1", array($this->password, $this->mail))
or die ("Cannot execute statement\n");
pg_close($con);
$this->availableMail();
$this->populate();
$url = "http://".$_SERVER['SERVER_NAME'].$config['rel_root_folder'];
$message = "Bonjour ".$this->name.",<br>\r\n";
$message .= "<br>\r\n";
$message .= "Voici votre nouveau mot de passe <a href='".$url."'>Kabano</a> : <b>".$newPass."</b><br>\r\n";
$message .= "<br>\r\n";
$message .= "Cordialement,<br>\r\n";
$message .= "<br>\r\n";
$message .= "L'équipe Kabano.<br>\r\n";
$message .= "<small style='color:#777;'><i>Fait avec ♥ depuis Toulouse.</i></small><br>\r\n";
$headers = 'From: '. $config['bot_mail'] . "\r\n" .
'Reply-To: '. $config['bot_mail'] . "\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=UTF-8' . "\r\n";
mail($this->mail, 'Kabano - Nouveau mot de passe', $message, $headers);
}
/*****
** Update the last login date
*****/
public function updateLoginDate() {
global $config;
$this->lastlogin = date('r');
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "UPDATE users SET lastlogin = $1 WHERE id = $2";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
pg_execute($con, "prepare1", array($this->lastlogin, $this->id))
or die ("Cannot execute statement\n");
pg_close($con);
}
/*****
** Outputs the role of the user
*****/
public function role() {
global $config;
return '<span class="userrole" style="color: '.$config['roles'][$this->role][2].';">'.$config['roles'][$this->role][1].'</span>';
}
/*****
** Sends an email to the user from an other user
*****/
public function sendMail($content, $from) {
global $config;
global $user;
$this->populate();
$url = "http://".$_SERVER['SERVER_NAME'].$config['rel_root_folder'];
$message = "Bonjour ".$this->name.",<br>\r\n";
$message .= "<br>\r\n";
$message .= "Vous venez de recevoir un message de <b>".$from->name."</b> envoyé depuis <a href='".$url."'>Kabano</a>.<br>\r\n";
$message .= "<br>\r\n";
$message .= "<pre style='padding: 10px; background: #ccc;'>".strip_tags($content)."</pre><br>\r\n";
$message .= "<br>\r\n";
$message .= "Vous pouvez simplement répondre à cet email.<br>\r\n";
$message .= "<br>\r\n";
$message .= "L'équipe Kabano.<br>\r\n";
$message .= "<small style='color:#777;'><i>Fait avec ♥ depuis Toulouse.</i></small><br>\r\n";
$headers = 'From: '. $from->mail . "\r\n" .
'Reply-To: '. $from->mail . "\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=UTF-8' . "\r\n";
mail($this->mail, 'Kabano - Nouveau message privé', $message, $headers);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tMAIL \tMail sent to ".$this->name." (".$this->id.")\r\n",
3,
$config['logs_folder'].'users.log');
}
}
function randomPassword() {
$alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
$pass = array(); //remember to declare $pass as an array
$alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
for ($i = 0; $i < 8; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
}
return implode($pass); //turn the array into a string
}
/**********************************************************
***********************************************************
**
** This class is to manage Users list object
**
***********************************************************
**********************************************************/
class Users
{
public $ids = array();
public $number = NULL;
/*****
** Get the users number and return the value
*****/
public function number() {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM users";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array())
or die ("Cannot execute statement\n");
pg_close($con);
$this->number = pg_num_rows($result);
}
/*****
** Get a list of users if according to the arguments
*****/
public function list_users($first, $count, $orderby = "id", $order = "ASC") {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$orders=array("id","name","lastlogin","registered","website","role");
$key=array_search($orderby,$orders);
$orderbysafe=$orders[$key];
if ($order == 'ASC')
$query = "SELECT id FROM users ORDER BY $orderbysafe ASC LIMIT $1 OFFSET $2";
else
$query = "SELECT id FROM users ORDER BY $orderbysafe DESC LIMIT $1 OFFSET $2";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($count, $first))
or die ("Cannot execute statement\n");
pg_close($con);
for($i = 0; $i < pg_num_rows($result); $i++) {
$row = pg_fetch_assoc($result, $i);
$this->ids[$i] = $row['id'];
}
}
}
?>

215
models/d.wiki.php Executable file
View File

@ -0,0 +1,215 @@
<?
/**********************************************************
***********************************************************
**
** This class is to manage a wiki page object
**
***********************************************************
**********************************************************/
require_once($config['third_folder']."Md/MarkdownExtra.inc.php");
class WikiPage
{
public $id = 0;
public $title = NULL;
public $url = NULL;
public $locale = NULL;
public $lastedit = NULL;
public $archive = NULL;
public $content = NULL;
/*****
** Checks if a page at this URL exists and return the ID
*****/
public function checkUrl($url, $withArchive=0, $elementNb=0) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM wiki WHERE url=$1";
if($withArchive==0) {
$query .= " AND archive=FALSE";
}
$query .= " ORDER BY lastedit DESC LIMIT 1 OFFSET $2";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($url, $elementNb))
or die ("Cannot execute statement\n");
pg_close($con);
if(pg_num_rows($result) == 1) {
$wiki = pg_fetch_assoc($result);
$this->id = $wiki['id'];
$this->url = $url;
return 1;
}
else {
$this->url = $url;
return 0;
}
}
/*****
** Populate the object using its ID
*****/
public function populate() {
global $config;
if($this->id != 0) {
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT * FROM wiki WHERE id=$1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($this->id))
or die ("Cannot execute statement\n");
pg_close($con);
$wiki = pg_fetch_assoc($result);
$this->title = $wiki['title'];
$this->url = $wiki['url'];
$this->locale = $wiki['locale'];
$this->lastedit = $wiki['lastedit'];
$this->archive = $wiki['archive'];
$this->content = $wiki['content'];
}
else {
die("Cannot populate a wiki page without ID");
}
}
/*****
** Edit a page by archiving the current one and inserting a new one ID
*****/
public function update() {
global $config;
global $user;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "UPDATE wiki SET archive = TRUE WHERE url = $1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($this->url))
or die ("Cannot execute statement\n");
$query = "INSERT INTO wiki (url, title, content, lastedit, archive, locale) VALUES
($1, $2, $3, $4, FALSE, $5)";
pg_prepare($con, "prepare2", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare2", array($this->url, $this->title, $this->content, date('r'), $this->locale))
or die ("Cannot execute statement\n");
pg_close($con);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tUPDATE \tEdit wiki page '".$this->url."'\r\n",
3,
$config['logs_folder'].'wiki.log');
}
/*****
** Delete a page by archiving it
*****/
public function delete() {
global $config;
global $user;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "UPDATE wiki SET archive = TRUE WHERE url = $1";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($this->url))
or die ("Cannot execute statement\n");
pg_close($con);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tDELETE \tArchive wiki page '".$this->url."'\r\n",
3,
$config['logs_folder'].'wiki.log');
}
/*****
** Create a page by archiving the current one and inserting a new one ID
*****/
public function insert() {
global $config;
global $user;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "INSERT INTO wiki (url, title, content, lastedit, archive, locale) VALUES
($1, $2, $3, $4, FALSE, $5)";
pg_prepare($con, "prepare2", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare2", array($this->url, $this->title, $this->content, date('r'), $this->locale))
or die ("Cannot execute statement\n");
pg_close($con);
error_log(
date('r')." \t".$user->name." (".$user->id.") \tINSERT \tCreate new wiki page '".$this->url."'\r\n",
3,
$config['logs_folder'].'wiki.log');
}
/*****
** Converts the Markdown content to HTML
*****/
public function md2html() {
$this->content_html = \Michelf\MarkdownExtra::defaultTransform($this->content);
}
}
class WikiPages
{
public $ids = array();
public $number = NULL;
/*****
** Checks if a page at this URL exists and return the ID
*****/
public function getHistory($url) {
global $config;
$con = pg_connect("host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass'])
or die ("Could not connect to server\n");
$query = "SELECT id FROM wiki WHERE url=$1 ORDER BY lastedit DESC";
pg_prepare($con, "prepare1", $query)
or die ("Cannot prepare statement\n");
$result = pg_execute($con, "prepare1", array($url))
or die ("Cannot execute statement\n");
pg_close($con);
$this->number = pg_num_rows($result);
for($i = 0; $i < $this->number; $i++) {
$row = pg_fetch_assoc($result, $i);
$this->ids[$i] = $row['id'];
}
}
}
?>

48
src/Mercator-Mountain1.svg Executable file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.2 KiB

119
src/exportpgsql.backup Executable file
View File

@ -0,0 +1,119 @@
COMMENT ON DATABASE kabano IS 'Kabano database';
-- SEQUENCES
CREATE SEQUENCE blog_articles_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE blog_articles_id_seq OWNER TO kabano;
CREATE SEQUENCE blog_comments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE blog_comments_id_seq OWNER TO kabano;
CREATE SEQUENCE users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE users_id_seq OWNER TO kabano;
CREATE SEQUENCE wiki_id_seq
START WITH 5
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE wiki_id_seq OWNER TO kabano;
-- TABLES
CREATE TABLE blog_articles (
id integer DEFAULT nextval('blog_articles_id_seq'::regclass) NOT NULL,
url text,
title text,
content text,
lastedit timestamp without time zone,
archive boolean DEFAULT false NOT NULL,
locale text,
comments boolean DEFAULT true NOT NULL,
author integer
);
ALTER TABLE blog_articles OWNER TO kabano;
COMMENT ON TABLE blog_articles IS 'This table contains all archived and visible blog articles';
ALTER TABLE ONLY blog_articles
ADD CONSTRAINT blog_articles_pkey PRIMARY KEY (id);
CREATE TABLE blog_comments (
id integer DEFAULT nextval('blog_comments_id_seq'::regclass) NOT NULL,
article integer,
lastedit timestamp without time zone,
author integer,
locale text,
content text,
archive boolean DEFAULT false NOT NULL
);
ALTER TABLE blog_comments OWNER TO kabano;
COMMENT ON TABLE blog_comments IS 'This table contains all blog comments';
ALTER TABLE ONLY blog_comments
ADD CONSTRAINT blog_comments_pkey PRIMARY KEY (id);
CREATE TABLE users (
id integer DEFAULT nextval('users_id_seq'::regclass) NOT NULL,
name text,
password text,
locale text,
lastlogin timestamp without time zone,
mail text,
website text,
role integer DEFAULT 400 NOT NULL,
avatar boolean DEFAULT false NOT NULL
);
ALTER TABLE users OWNER TO kabano;
COMMENT ON TABLE users IS 'This user database contains all users informations';
ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
CREATE TABLE wiki (
id integer DEFAULT nextval('wiki_id_seq'::regclass) NOT NULL,
url text,
title text,
content text,
lastedit timestamp without time zone,
archive boolean DEFAULT false NOT NULL,
locale text
);
ALTER TABLE wiki OWNER TO kabano;
COMMENT ON TABLE wiki IS 'This wiki database contains all archived and displayed wiki pages';
ALTER TABLE ONLY wiki
ADD CONSTRAINT wiki_pkey PRIMARY KEY (id);
-- Foreign keys
ALTER TABLE ONLY blog_articles
ADD CONSTRAINT blog_articles_author_fkey FOREIGN KEY (author) REFERENCES users(id);
ALTER TABLE ONLY blog_comments
ADD CONSTRAINT blog_comments_article_fkey FOREIGN KEY (article) REFERENCES blog_articles(id);
ALTER TABLE ONLY blog_comments
ADD CONSTRAINT blog_comments_author_fkey FOREIGN KEY (author) REFERENCES users(id);

6
src/logo.min.svg Executable file
View File

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="140" height="46" viewBox="0 0 140 46">
<path id="kabanologomount" d="M40.652.398l-16.007 25.19 2.832-8.63-5.274-9.612L0 46h67.363l-4.455-7.607h-2.32L63.873 44H3.457l18.707-32.568 3.143 5.728-5.06 15.402.948.313.846.537L40.585 4.236l10.238 17.48v-3.954L40.652.398z" fill="#fff"/>
<path id="kabanologomountbgtext" d="M50.822 17.762v3.955l9.766 16.676h2.32l-12.086-20.63z" fill="#fff"/>
<path id="kabanologotext" d="M58.31 16.105h-2.375V33.33h2.375V16.105zm9.375 0h-2.7l-6.55 8.025 6.8 9.2h2.925l-7-9.35 6.525-7.875zM79.284 30.255V24.23c0-2.75-1.45-4.375-4.625-4.375-1.476 0-2.926.3-4.55.9l.574 1.675c1.35-.45 2.575-.7 3.55-.7 1.825 0 2.75.7 2.75 2.6v.975H74.96c-3.676 0-5.8 1.525-5.8 4.35 0 2.35 1.574 3.975 4.2 3.975 1.6 0 3-.6 3.924-1.975.4 1.3 1.25 1.825 2.575 1.975l.524-1.6c-.675-.25-1.1-.625-1.1-1.775zm-5.4 1.65c-1.5 0-2.275-.825-2.275-2.375 0-1.8 1.224-2.7 3.65-2.7h1.724v3.025c-.75 1.375-1.75 2.05-3.1 2.05zM90.057 19.855c-1.6 0-2.825.725-3.725 1.95V14.58l-2.3.275V33.33h2.025l.225-1.45c.9 1.1 2.05 1.75 3.5 1.75 3.2 0 5.175-2.775 5.175-6.9 0-4.4-1.925-6.875-4.9-6.875zm-.825 11.95c-1.175 0-2.225-.725-2.9-1.775v-6.3c.675-1.05 1.625-2.05 3.075-2.05 1.85 0 3.075 1.3 3.075 5.05 0 3.6-1.325 5.075-3.25 5.075zM107.75 30.255V24.23c0-2.75-1.45-4.375-4.624-4.375-1.475 0-2.925.3-4.55.9l.575 1.675c1.35-.45 2.576-.7 3.55-.7 1.826 0 2.75.7 2.75 2.6v.975h-2.024c-3.675 0-5.8 1.525-5.8 4.35 0 2.35 1.575 3.975 4.2 3.975 1.6 0 3-.6 3.925-1.975.4 1.3 1.25 1.825 2.576 1.975l.525-1.6c-.674-.25-1.1-.625-1.1-1.775zm-5.4 1.65c-1.5 0-2.274-.825-2.274-2.375 0-1.8 1.225-2.7 3.65-2.7h1.725v3.025c-.75 1.375-1.75 2.05-3.1 2.05zM118.7 19.855c-1.726 0-3.126.9-4.026 2.25l-.2-1.95H112.5V33.33h2.3v-9.35c.874-1.4 1.874-2.325 3.35-2.325 1.274 0 2.074.575 2.074 2.55v9.125h2.3v-9.45c0-2.5-1.4-4.025-3.825-4.025zM132.097 19.855c-3.75 0-5.9 2.825-5.9 6.9 0 4.175 2.125 6.875 5.875 6.875 3.725 0 5.875-2.825 5.875-6.9 0-4.175-2.1-6.875-5.85-6.875zm0 1.85c2.175 0 3.375 1.6 3.375 5.025 0 3.45-1.2 5.05-3.4 5.05s-3.4-1.6-3.4-5.025c0-3.45 1.225-5.05 3.425-5.05z" fill="#fff"/>
<path id="kabanologobase" d="M67.364 46l-2.344-4H2.3L0 46z" fill="#fff"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

217
src/logo.svg Executable file
View File

@ -0,0 +1,217 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="180"
height="50"
viewBox="0 0 180 50.000001"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="logo.svg"
inkscape:export-filename="/home/leo/public_html/Kabano/views/img/header3.png"
inkscape:export-xdpi="84.599998"
inkscape:export-ydpi="84.599998">
<defs
id="defs4">
<linearGradient
id="linearGradient4272"
osb:paint="solid">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4274" />
</linearGradient>
<filter
style="color-interpolation-filters:sRGB"
inkscape:label="Invert"
id="filter4242">
<feColorMatrix
type="hueRotate"
values="180"
result="color1"
id="feColorMatrix4244" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 "
result="fbSourceGraphic"
id="feColorMatrix4246" />
<feColorMatrix
result="fbSourceGraphicAlpha"
in="fbSourceGraphic"
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
id="feColorMatrix4248" />
<feColorMatrix
id="feColorMatrix4250"
type="hueRotate"
values="180"
result="color1"
in="fbSourceGraphic" />
<feColorMatrix
id="feColorMatrix4252"
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 "
result="fbSourceGraphic" />
<feColorMatrix
result="fbSourceGraphicAlpha"
in="fbSourceGraphic"
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
id="feColorMatrix4254" />
<feColorMatrix
id="feColorMatrix4256"
type="hueRotate"
values="180"
result="color1"
in="fbSourceGraphic" />
<feColorMatrix
id="feColorMatrix4258"
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 "
result="color2" />
</filter>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4272"
id="linearGradient4276"
x1="463.53574"
y1="598.1972"
x2="579.35376"
y2="598.1972"
gradientUnits="userSpaceOnUse" />
<filter
style="color-interpolation-filters:sRGB"
inkscape:label="Invert"
id="filter4278">
<feColorMatrix
type="hueRotate"
values="180"
result="color1"
id="feColorMatrix4280" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 "
result="color2"
id="feColorMatrix4282" />
</filter>
<filter
style="color-interpolation-filters:sRGB"
inkscape:label="Invert"
id="filter4284">
<feColorMatrix
type="hueRotate"
values="180"
result="color1"
id="feColorMatrix4286" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 "
result="color2"
id="feColorMatrix4288" />
</filter>
<filter
style="color-interpolation-filters:sRGB"
inkscape:label="Invert"
id="filter4290">
<feColorMatrix
type="hueRotate"
values="180"
result="color1"
id="feColorMatrix4292" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 "
result="color2"
id="feColorMatrix4294" />
</filter>
<filter
style="color-interpolation-filters:sRGB"
inkscape:label="Invert"
id="filter4296">
<feColorMatrix
type="hueRotate"
values="180"
result="color1"
id="feColorMatrix4298" />
<feColorMatrix
values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 -0.21 -0.72 -0.07 2 0 "
result="color2"
id="feColorMatrix4300" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#8d9894"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="67.921239"
inkscape:cy="36.484649"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1366"
inkscape:window-height="745"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="1"
units="px" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1002.3622)">
<g
id="g4356"
transform="matrix(1.1515318,0,0,1.1657795,-6.3342807,-170.57805)">
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
id="path4260"
d="m 6.4114189,1048.2461 21.0000001,-34.6129 7,11.2258 12.00019,-17.7743 24.114,41.161 z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.72617102;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4278)" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path4264"
d="m 34.411419,1024.859 -14,23.3871"
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.72617102;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4284)" />
<path
sodipodi:nodetypes="cccc"
inkscape:connector-curvature="0"
id="path4335"
d="m 46.411609,1007.0847 0,41.161 24.114,0 z"
style="opacity:0.65;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter4296)"
x="54.34478"
y="1041.3604"
id="text4268"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4270"
x="54.34478"
y="1041.3604"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:35px;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"><tspan
style="font-weight:bold"
id="tspan4333">K</tspan>abano</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.5 KiB

102
src/logo2.svg Executable file
View File

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="140"
height="46"
viewBox="0 0 140 46.000001"
id="svg4170"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="logo2.svg">
<defs
id="defs4172" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6568543"
inkscape:cx="63.834622"
inkscape:cy="18.257409"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1366"
inkscape:window-height="745"
inkscape:window-x="1280"
inkscape:window-y="23"
inkscape:window-maximized="1" />
<metadata
id="metadata4175">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1006.3622)">
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="M 50.822266 17.761719 L 50.822266 21.716797 L 60.587891 38.392578 L 62.908203 38.392578 L 50.822266 17.761719 z "
id="path4884"
transform="translate(0,1006.3622)" />
<path
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="M 40.652344 0.3984375 L 24.644531 25.587891 L 27.476562 16.958984 L 22.203125 7.3457031 L 0 46 L 67.363281 46 L 62.908203 38.392578 L 60.587891 38.392578 L 63.873047 44 L 3.4570312 44 L 22.164062 11.431641 L 25.306641 17.160156 L 20.248047 32.5625 L 21.195312 32.875 L 22.041016 33.412109 L 40.583984 4.2363281 L 50.822266 21.716797 L 50.822266 17.761719 L 40.652344 0.3984375 z "
id="path3349"
transform="translate(0,1006.3622)" />
<g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text4151">
<path
d="m 58.309608,1022.4674 -2.375,0 0,17.225 2.375,0 0,-17.225 z m 9.375,0 -2.7,0 -6.55,8.025 6.8,9.2 2.925,0 -7,-9.35 6.525,-7.875 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';fill:#ffffff;fill-opacity:1"
id="path4887" />
<path
d="m 79.284218,1036.6174 0,-6.025 c 0,-2.75 -1.45,-4.375 -4.625,-4.375 -1.475,0 -2.925,0.3 -4.55,0.9 l 0.575,1.675 c 1.35,-0.45 2.575,-0.7 3.55,-0.7 1.825,0 2.75,0.7 2.75,2.6 l 0,0.975 -2.025,0 c -3.675,0 -5.8,1.525 -5.8,4.35 0,2.35 1.575,3.975 4.2,3.975 1.6,0 3,-0.6 3.925,-1.975 0.4,1.3 1.25,1.825 2.575,1.975 l 0.525,-1.6 c -0.675,-0.25 -1.1,-0.625 -1.1,-1.775 z m -5.4,1.65 c -1.5,0 -2.275,-0.825 -2.275,-2.375 0,-1.8 1.225,-2.7 3.65,-2.7 l 1.725,0 0,3.025 c -0.75,1.375 -1.75,2.05 -3.1,2.05 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';fill:#ffffff;fill-opacity:1"
id="path4889" />
<path
d="m 90.057265,1026.2174 c -1.6,0 -2.825,0.725 -3.725,1.95 l 0,-7.225 -2.3,0.275 0,18.475 2.025,0 0.225,-1.45 c 0.9,1.1 2.05,1.75 3.5,1.75 3.2,0 5.175,-2.775 5.175,-6.9 0,-4.4 -1.925,-6.875 -4.9,-6.875 z m -0.825,11.95 c -1.175,0 -2.225,-0.725 -2.9,-1.775 l 0,-6.3 c 0.675,-1.05 1.625,-2.05 3.075,-2.05 1.85,0 3.075,1.3 3.075,5.05 0,3.6 -1.325,5.075 -3.25,5.075 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';fill:#ffffff;fill-opacity:1"
id="path4891" />
<path
d="m 107.75101,1036.6174 0,-6.025 c 0,-2.75 -1.45,-4.375 -4.625,-4.375 -1.475,0 -2.925,0.3 -4.549995,0.9 l 0.575,1.675 c 1.349995,-0.45 2.574995,-0.7 3.549995,-0.7 1.825,0 2.75,0.7 2.75,2.6 l 0,0.975 -2.025,0 c -3.674995,0 -5.799995,1.525 -5.799995,4.35 0,2.35 1.575,3.975 4.199995,3.975 1.6,0 3,-0.6 3.925,-1.975 0.4,1.3 1.25,1.825 2.575,1.975 l 0.525,-1.6 c -0.675,-0.25 -1.1,-0.625 -1.1,-1.775 z m -5.4,1.65 c -1.5,0 -2.275,-0.825 -2.275,-2.375 0,-1.8 1.225,-2.7 3.65,-2.7 l 1.725,0 0,3.025 c -0.75,1.375 -1.75,2.05 -3.1,2.05 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';fill:#ffffff;fill-opacity:1"
id="path4893" />
<path
d="m 118.69906,1026.2174 c -1.725,0 -3.125,0.9 -4.025,2.25 l -0.2,-1.95 -1.975,0 0,13.175 2.3,0 0,-9.35 c 0.875,-1.4 1.875,-2.325 3.35,-2.325 1.275,0 2.075,0.575 2.075,2.55 l 0,9.125 2.3,0 0,-9.45 c 0,-2.5 -1.4,-4.025 -3.825,-4.025 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';fill:#ffffff;fill-opacity:1"
id="path4895" />
<path
d="m 132.0975,1026.2174 c -3.75,0 -5.9,2.825 -5.9,6.9 0,4.175 2.125,6.875 5.875,6.875 3.725,0 5.875,-2.825 5.875,-6.9 0,-4.175 -2.1,-6.875 -5.85,-6.875 z m 0,1.85 c 2.175,0 3.375,1.6 3.375,5.025 0,3.45 -1.2,5.05 -3.4,5.05 -2.2,0 -3.4,-1.6 -3.4,-5.025 0,-3.45 1.225,-5.05 3.425,-5.05 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';fill:#ffffff;fill-opacity:1"
id="path4897" />
</g>
<path
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 67.364,1052.3622 -2.344,-4 -62.72,0 -2.3,4 z"
id="path4820"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.3 KiB

104
src/logo3.svg Executable file
View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="154"
height="44"
viewBox="0 0 154 44"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="logo3.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="56.867628"
inkscape:cy="65.836934"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1366"
inkscape:window-height="745"
inkscape:window-x="1280"
inkscape:window-y="23"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(2.2888184e-7,-1008.3622)">
<g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text4136"
transform="matrix(1.1379801,0,0,1.1379801,3.1581138e-8,-151.20504)">
<path
d="m 1.3999998,1024.6822 -1.40000002888184,0 0,27.28 1.40000002888184,0 0,-27.28 z m 13.9200002,0 -1.68,0 -12.1200002,12.6 12.7200002,14.68 1.72,0 -12.6800002,-14.68 12.0400002,-12.6 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4186"
inkscape:connector-curvature="0" />
<path
d="m 53.246875,1037.4822 c 3,-0.52 4.92,-2.44 4.92,-6.04 0,-4.56 -3.44,-6.76 -9.32,-6.76 l -5.8,0 0,27.28 7.36,0 c 5.76,0 9.12,-2.64 9.12,-7.44 0,-4.76 -2.88,-6.84 -6.28,-7.04 z m -4.24,-11.52 c 4.96,0 7.72,1.68 7.72,5.52 0,3.4 -2.32,5.48 -5.8,5.48 l -6.48,0 0,-11 4.56,0 z m 1.44,24.72 -6,0 0,-12.52 6.68,0 c 4.04,0 6.96,2 6.96,6.36 0,4.16 -2.88,6.16 -7.64,6.16 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4190"
inkscape:connector-curvature="0" />
<path
d="m 105.32312,1024.6822 -1.36,0 0,17.8 c 0,3.64 0.08,6.36 0.16,7.92 l -14.159995,-25.72 -1.76,0 0,27.28 1.36,0 0,-17.2 c 0,-4.8 -0.08,-6.92 -0.2,-8.52 l 14.199995,25.72 1.76,0 0,-27.28 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4194"
inkscape:connector-curvature="0" />
<path
d="m 123.80562,1024.2422 c -6.4,0 -10.84,5.12 -10.84,14.16 0,9 4.4,13.96 10.84,13.96 6.68,0 10.84,-5.12 10.84,-14 0,-9.24 -4.36,-14.12 -10.84,-14.12 z m 0,1.32 c 5.64,0 9.4,4.2 9.4,12.8 0,8.4 -3.56,12.72 -9.4,12.72 -5.52,0 -9.4,-4.32 -9.4,-12.68 0,-8.56 3.84,-12.84 9.4,-12.84 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4196"
inkscape:connector-curvature="0" />
</g>
<g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text4136-1"
transform="matrix(1.1379801,0,0,1.1379801,-327.34608,665.85293)">
<path
d="m 327.11423,334.16668 -10.09786,-27.23536 -10.34214,27.23536 z m -18.81955,-1.19739 5.88391,-15.62044 4.87414,-1.40926 6.40569,16.95891 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4159"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<path
d="m 372.70688,333.82719 -0.008,-1.24916 -1.36672,-0.006 -8.73903,-23.76226 0.83839,-1.55306 -0.73436,-0.62958 -0.82296,1.22506 -0.69448,-1.17371 -0.71601,0.66008 0.84437,1.49829 -9.42882,23.88393 -1.23813,0.005 0.0188,1.14693 z m -17.50259,-1.13043 6.57828,-15.51649 6.1435,15.46802 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-size:40px;line-height:125%;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path4159-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccccccc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/logo3_black.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

1
src/wiki.backup Executable file
View File

@ -0,0 +1 @@
INSERT INTO wiki (id, url, title, content, lastedit, archive, locale) VALUES (1, '404', 'Erreur 404', 'Le page recherchée n''existe pas', '2016-03-30 08:42:11', true, 'fr');

10
third/Md/Markdown.inc.php Executable file
View File

@ -0,0 +1,10 @@
<?php
# Use this file if you cannot use class autoloading. It will include all the
# files needed for the Markdown parser.
#
# Take a look at the PSR-0-compatible class autoloading implementation
# in the Readme.php file if you want a simple autoloader setup.
require_once dirname(__FILE__) . '/MarkdownInterface.php';
require_once dirname(__FILE__) . '/Markdown.php';

1616
third/Md/Markdown.php Executable file

File diff suppressed because it is too large Load Diff

11
third/Md/MarkdownExtra.inc.php Executable file
View File

@ -0,0 +1,11 @@
<?php
# Use this file if you cannot use class autoloading. It will include all the
# files needed for the MarkdownExtra parser.
#
# Take a look at the PSR-0-compatible class autoloading implementation
# in the Readme.php file if you want a simple autoloader setup.
require_once dirname(__FILE__) . '/MarkdownInterface.php';
require_once dirname(__FILE__) . '/Markdown.php';
require_once dirname(__FILE__) . '/MarkdownExtra.php';

1625
third/Md/MarkdownExtra.php Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
<?php
# Use this file if you cannot use class autoloading. It will include all the
# files needed for the MarkdownInterface interface.
#
# Take a look at the PSR-0-compatible class autoloading implementation
# in the Readme.php file if you want a simple autoloader setup.
require_once dirname(__FILE__) . '/MarkdownInterface.php';

34
third/Md/MarkdownInterface.php Executable file
View File

@ -0,0 +1,34 @@
<?php
#
# Markdown - A text-to-HTML conversion tool for web writers
#
# PHP Markdown
# Copyright (c) 2004-2015 Michel Fortin
# <https://michelf.ca/projects/php-markdown/>
#
# Original Markdown
# Copyright (c) 2004-2006 John Gruber
# <https://daringfireball.net/projects/markdown/>
#
namespace Michelf;
#
# Markdown Parser Interface
#
interface MarkdownInterface {
#
# Initialize the parser and return the result of its transform method.
# This will work fine for derived classes too.
#
public static function defaultTransform($text);
#
# Main function. Performs some preprocessing on the input text
# and pass it through the document gamut.
#
public function transform($text);
}

7
views/blocks/d.footer.html Executable file
View File

@ -0,0 +1,7 @@
<footer>
<div id="footernav">
<a href="<?=$config['rel_root_folder']?>wiki/legal">Mentions Légales</a> &mdash;
<a href="<?=$config['rel_root_folder']?>contact">Contact</a>
</div>
<p><i>Applications mobiles bientôt disponibles.</i></p>
</footer>

46
views/blocks/d.head.html Executable file
View File

@ -0,0 +1,46 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height">
<link rel="shortcut icon" href="<?=$config['views_url']?>img/favicon.png">
<? if (isset($head['css'])) {
foreach(explode(";",$head['css']) as $css) { ?>
<link rel="stylesheet" href="<?=$config['views_url']?>css/<?=$css?>"/>
<? }
}
else { ?>
<link rel="stylesheet" href="<?=$config['views_url']?>css/d.index.css"/>
<? } ?>
<link rel="stylesheet" href="<?=$config['views_url']?>third/font-awesome-4.7.0/css/font-awesome.min.css"/>
<script type="text/javascript" src="<?=$config['views_url']?>third/jquery-3.1.1.min.js"></script>
<? if (isset($head['third'])) {
foreach(explode(";",$head['third']) as $third) { ?>
<script type="text/javascript" src="<?=$config['views_url']?>third/<?=$third?>"></script>
<? }
} ?>
<script type="text/javascript" src="<?=$config['views_url']?>js/d.header.js"></script>
<? if (isset($head['js'])) {
foreach(explode(";",$head['js']) as $js) { ?>
<script type="text/javascript" src="<?=$config['views_url']?>js/<?=$js?>"></script>
<? }
} ?>
<? if (isset($head['title'])) { ?>
<title><?=$head['title']?> &mdash; Kabano</title>
<? }
else { ?>
<title>Cabanes et bivouac en montagne</title>
<? } ?>
<? if (isset($head['description'])) { ?>
<meta name="description" content="<?=$head['description']?>">
? }
else { ?>
<meta name="description" content="Annuaire collaboratif des hébergements pour les activitées de plein air : cabanes, refuges, campings...">
<? } ?>
<? if (isset($head['keywords'])) { ?>
<meta name="keywords" content="<?=$head['keywords']?>">
<? }
else { ?>
<meta name="keywords" content="kabano, huts, mountain, hiking, cabanes, refuges, bivouac, montagne, randonnée">
<? } ?>
</head>

52
views/blocks/d.nav.html Executable file
View File

@ -0,0 +1,52 @@
<header>
<div id="Hcontent">
<a href="<?=$config['rel_root_folder']?>" id="logo">
<img alt="Kabano logo" src="<?=$config['views_url'].'img/'?>header.svg">
</a>
<nav>
<ul>
<li class="on-bar"><a class="on-bar" href="<?=$config['rel_root_folder']?>map">Carte</a></li>
<li class="on-bar"><a class="on-bar" href="<?=$config['rel_root_folder']?>search">Recherche</a></li>
<li class="on-bar"><a class="on-bar" href="<?=$config['rel_root_folder']?>news">Nouveautés</a></li>
<li class="on-bar"><a class="on-bar" href="<?=$config['rel_root_folder']?>community">Contribuer</a></li>
<li class="on-bar has-sub">
<? if (isset($user->avatar) AND $user->avatar=='t') { ?>
<a class="on-bar" href="#"><img alt="Avatar" class="icon avatar" src="<?=$config['rel_root_folder']?>medias/avatars/<?=$user->id?>_s.jpg"></a>
<? } elseif (isset($user->avatar) AND $user->avatar=='f') { ?>
<a class="on-bar" href="#"><i class="icon fa fa-user-secret"></i></a>
<? } else { ?>
<a class="on-bar" href="#"><i class="icon fa fa-user"></i></a>
<? } ?>
<ul>
<? if($user->role == 0) { ?>
<li id="connectform">
<form action="<?=$config['rel_root_folder']?>user/login" method="post">
<input type="text" name="login" placeholder="Nom d'utilisateur">
<input type="password" name="password" placeholder="Mot de passe">
<input type="submit" name="submit" value="Se connecter">
</form>
</li>
<li><a href="<?=$config['rel_root_folder']?>user/signin">S'inscrire</a></li>
<? } else { ?>
<li><a href="<?=$config['rel_root_folder']?>user/p">Mon profil</a></li>
<li><a href="<?=$config['rel_root_folder']?>user/member_list">Liste des membres</a></li>
<? if($user->role >= 800) { ?>
<li><a href="<?=$config['rel_root_folder']?>admin">Administration</a></li>
<? } ?>
<li><a href="<?=$config['rel_root_folder']?>user/logout">Se déconnecter</a></li>
<? } ?>
</ul>
</li>
<li class="on-bar has-sub"><a class="on-bar" href="#"><i class="icon fa fa-question"></i></a>
<ul>
<li><a href="<?=$config['rel_root_folder']?>wiki/help">Aide</a></li>
<li><a href="<?=$config['rel_root_folder']?>blog">Blog</a></li>
<li><a href="<?=$config['rel_root_folder']?>contact">Contact</a></li>
<li><a href="<?=$config['rel_root_folder']?>wiki/api">API Développeurs</a></li>
<li><a href="<?=$config['rel_root_folder']?>wiki/about">À propos</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</header>

240
views/css/d.blog.css Executable file
View File

@ -0,0 +1,240 @@
/*********************************/
/** Blog list page **/
/*********************************/
#blog_list article {
margin: 40px auto 0 auto;
width: 90%;
background: #efefef;
border: 1px solid #ccc;
border-bottom: 2px solid #ccc;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
#blog_list #articles_list article:first-child {
margin-top: 80px;
}
#blog_list .article_title {
background: #ccc;
padding: 5px 10px;
}
#blog_list .article_content {
padding: 20px 10px 5px 10px;
white-space: pre-line;
}
#blog_list .article_legend {
font-style: italic;
padding: 0 10px;
}
#blog_list .article_link {
font-weight: 500;
}
#blog_list .article_infos {
float: right;
}
#blog_list .article_archive {
opacity: 0.5;
}
#blog_list .pagebuttons {
text-align: center;
margin: 40px 0 30px 0;
}
#blog_list .pagebuttons a {
background: #efefef;
border: 1px solid #ccc;
padding: 5px;
font-size: 1.5em;
}
#blog_list .pagebuttons .previous {
margin-right: -1px;
}
/*********************************/
/** Blog view article page **/
/*********************************/
#blogTimestamp {
font-size: 0.8em;
font-weight: 500;
float: right;
font-style: italic;
}
#blogContent {
margin: 50px 0 20px 0;
}
#blogContent h2 { margin: .75em 0 }
#blogContent h3 { margin: .83em 0 }
#blogContent h4, #blogContent p, #blogContent blockquote, #blogContent ul, #blogContent fieldset, #blogContent form, #blogContent ol, #blogContent dl { margin: 1.12em 0 }
#blogContent h5 { margin: 1.5em 0 }
#blogContent h6 { margin: 1.67em 0 }
#blogContent blockquote { margin-left: 40px; margin-right: 40px }
#blogContent ol, #blogContent ul, #blogContent dd { margin-left: 40px }
#blogContent ol ul, #blogContent ul ol, #blogContent ul ul, #blogContent ol ol { margin-top: 0; margin-bottom: 0 }
#blogContent .footnotes {
font-size: 0.8em;
}
#blogContent .footnotes p {
margin: 0.4em 0;
}
#blogContent hr {
border: 1px inset;
}
#new_comment {
clear: both;
margin: 100px auto 0 auto;
width: 90%;
background: #efefef;
border: 1px solid #ccc;
border-bottom: 3px solid #ccc;
}
#new_comment_label {
background: #ccc;
padding: 15px 10px;
cursor: pointer;
font-weight: 500;
font-size: 1.1em;
}
#new_comment_label p {
margin: 0;
}
#new_comment_label input {
display: none;
margin: -2px;
float: right;
padding: 5px 10px;
position: relative;
top: -7px;
width: 140px;
}
#new_comment_form {
display: none;
}
#new_comment_form textarea {
margin: 0;
border: 0;
}
#new_comment_label.sent {
cursor: default;
}
#blog_article article {
margin: 40px auto 0 auto;
width: 90%;
background: #efefef;
border: 1px solid #ccc;
border-bottom: 2px solid #ccc;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
#blog_article .comment_title {
background: #ccc;
padding: 5px 10px;
}
#blog_article .delete_link {
font-variant: small-caps;
font-weight: 500;
padding: 4px 0;
float: right;
}
#blog_article .icon {
border: 1px solid #999;
border-radius: 3px;
margin: 0 3px 0 3px;
padding: 4px 0;
line-height: 20px;
text-align: center;
width: 28px;
background: #ccc;
vertical-align: middle;
}
#blog_article .icon.avatar {
padding: 0;
height: 28px;
}
#blog_article .comment_content {
padding: 5px 10px;
}
#blog_article article.comment_archive {
opacity: 0.5;
}
#blog_article.archive {
opacity: 0.5;
}
/*********************************/
/** Blog edit article page **/
/*********************************/
form.form input[type="checkbox"] {
display:none;
}
form.form input[type="checkbox"] + span:before {
font-family: 'FontAwesome';
vertical-align: middle;
padding: 2px 4px 0px 5px;
margin-right: 10px;
display: inline-block;
width: 21px;
background: #ddd;
font-size: 25px;
}
form.form input[type="checkbox"] + span:before {
content: "\f096"; /* check-empty */
}
form.form input[type="checkbox"]:checked + span:before {
content: "\f046"; /* check */
}
/* Also used for new comment form in the view page */
form.form input, form.form textarea, #locale {
background: #ddd;
border-bottom: 2px solid #ccc;
display: block;
padding: 10px;
}
form.form textarea {
font-size: 14px;
margin: 10px 0 10px 0px;
width: calc(100% - 20px);
}
form.form input {
width: 58%;
margin: 10px 0 10px 0px;
vertical-align: middle;
font-size: 18px;
}
form.form label {
font-size: 18px;
}
#locale {
width: 38%;
float: right;
font-size: 17px;
}
#url {
width: calc(100% - 20px);
}
form.form input[type=submit] {
width: auto;
margin: auto;
border-bottom: 2px solid blue;
}

341
views/css/d.index.css Executable file
View File

@ -0,0 +1,341 @@
* {
border: 0;
margin: 0;
padding: 0;
}
body {
font-family: "Fira Sans", "Open Sans",Helvetica,Arial,sans-serif;
color: #333;
background: #ddd;
padding-top: 65px;
}
a {
text-decoration: none;
color: blue;
}
a:hover {
color: #212121;
text-decoration: none;
}
input {
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
textarea {
resize:vertical;
}
small {
font-weight: 500;
}
.button {
padding: 5px 10px;
margin: 5px 10px;
border: 1px solid blue;
border-radius: 5px;
background: #ddddff;
}
.button:hover {
background: #eeeeff;
}
/* FONTS */
@font-face {
font-family: 'Fira Sans';
font-weight: 700;
src: url('../fonts/FiraSans-Bold.eot');
src: local('Fira-Sans-Bold'), local('Fira Sans Bold'), url('../fonts/FiraSans-Bold.otf') format('otf'), url('../fonts/FiraSans-Bold.ttf') format('truetype');
}
@font-face {
font-family: 'Fira Sans';
font-weight: 600;
src: url('../fonts/FiraSans-Medium.eot');
src: local('Fira-Sans-Medium'), local('Fira Sans Medium'), url('../fonts/FiraSans-Medium.otf') format('otf'), url('../fonts/FiraSans-Medium.ttf') format('truetype');
}
@font-face {
font-family: 'Fira Sans';
font-weight: 500;
src: url('../fonts/FiraSans-Regular.eot');
src: local('Fira-Sans'), local('Fira Sans'), url('../fonts/FiraSans-Regular.otf') format('otf'), url('../fonts/FiraSans-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Fira Sans';
font-weight: 400;
src: url('../fonts/FiraSans-Light.eot');
src: local('Fira-Sans-Light'), local('Fira Sans Light'), url('../fonts/FiraSans-Light.otf') format('otf'), url('../fonts/FiraSans-Light.ttf') format('truetype');
}
@font-face {
font-family: 'Fira Sans';
font-weight: 300;
src: url('../fonts/FiraSans-ExtraLight.eot');
src: local('Fira-Sans-ExtraLight'), local('Fira Sans ExtraLight'), url('../fonts/FiraSans-ExtraLight.otf') format('otf'), url('../fonts/FiraSans-ExtraLight.ttf') format('truetype');
}
/*********************************/
header {
position: fixed;
top: 0;
width: 100%;
background: black;
height: 65px;
color: white;
box-shadow: 0 0 3px black;
z-index: 1000;
}
header ul {
float: right;
position: relative;
}
header li {
display: inline-block;
height: 65px;
vertical-align: middle;
}
header li a {
color: white;
padding: 25px 15px 15px;
height: 20px;
display: block;
vertical-align: middle;
}
header li a:hover {
color: white;
}
header li:hover a {
border-bottom: 6px solid blue;
background: #212121;
}
header .icon {
border: 1px solid white;
border-radius: 3px;
margin: -5px 0;
padding: 4px 0;
line-height: 20px;
text-align: center;
width: 28px;
}
header .icon.avatar {
padding: 0;
height: 28px;
}
header li.has-sub:hover a {
border-bottom: 6px solid #212121;
}
header li.has-sub:hover > ul {
display: block;
}
header li.has-sub ul {
display: none;
position: absolute;
right: 0px;
margin-top: -1px;
background: #212121;
}
header li.has-sub ul li {
display: block;
height: 46px;
border-left: 6px solid #212121;
}
header #connectform {
height: 127px;
}
header li.has-sub ul li a {
float: none;
padding: 15px 25px 15px 10px;
height: 10px;
border-bottom: none;
}
header li.has-sub ul li:hover {
border-left: 6px solid blue;
border-bottom: none;
}
header form {
display: block;
width: 200px;
padding: 15px 15px 0 15px;
}
header input {
margin: 0 0 10px -5px;
padding: 5px;
background: #333;
border-bottom: 1px solid #555;
display: block;
width: 100%;
color: #bbb;
}
header input[type=submit] {
position: relative;
margin-left: 0;
}
header input[type=submit] {
background: #555;
border-bottom: 1px solid #777;
}
header input:hover {
background: #DDD;
color: #222;
}
#Hcontent {
width: 850px;
margin: 0 auto;
}
#logo {
float: left;
padding: 8px 15px;
margin: 2px 0;
opacity: 0.85;
}
#logo:hover {
opacity: 1;
}
#logo img {
height: 44px;
}
/*********************************/
section {
position: relative;
background: white;
margin: auto;
width: 820px;
min-height: 320px;
z-index: 10;
padding: 15px;
text-align: justify;
}
section h1 {
font-weight: 300;
font-size: 43px;
margin-top: 20px;
border-bottom: 1px solid #bbb;
}
section .subtitle {
font-variant: small-caps;
font-weight: 500;
background: #ddd;
margin: 0 20px 20px 0;
display: inline-block;
padding: 3px 5px;
float: right;
}
section p {
margin: 20px 0;
}
/***************************************/
footer {
background: #212121;
width: 820px;
padding: 15px;
margin: 15px auto 0 auto;
color: #c1c1c1;
text-align: left;
}
footer #footernav {
float: right;
padding: 0;
margin: 0;
}
footer a {
color: white;
padding: 0 8px;
}
footer a:hover {
color: white;
}
/*********************************/
/** Index page **/
/*********************************/
#indexFullW {
position: relative;
background: url('../img/aside.jpg') center center no-repeat #070707;
width: 100%;
height: 320px;
z-index: 100;
box-shadow: inset 0 -1px 0 #444, 0 1px 5px black;
}
#AScontent {
height: 320px;
width: 850px;
margin: auto;
}
#spacebeforesponsors {
height: 238px;
}
#sponsors {
height: 70px;
background: rgba(0,0,0,0.5);
padding: 5px 30px;
}
#sponsors a {
float: right;
display: block;
padding-top: 5px;
padding-left: 5px;
padding-right: 5px;
}
#sponsors a img {
height: 60px;
display: inline;
}
#sponsors p {
float: left;
color: white;
font-size: 20px;
font-variant: small-caps;
line-height: 70px;
}
section .thumb {
margin: 0 10px;
border: 1px solid #aaa;
}

173
views/css/d.map.css Executable file
View File

@ -0,0 +1,173 @@
/* Custom configuration for the map page */
html {
height: 100%;
}
body {
height: calc(100% - 65px);
}
footer {
position: absolute;
bottom: 0;
left: calc(50% - 425px);
z-index: 10000;
}
/*****************************************
Controls of the map
*****************************************/
/* General */
.leaflet-control-container {
position: absolute !important;
width: 850px !important;
height: 100%;
left: calc(50% - 425px) !important;
font-family: "Fira Sans", "Open Sans",Helvetica,Arial,sans-serif !important;
}
.leaflet-fullscreen-on .leaflet-control-container {
position: absolute !important;
width: 100% !important;
left: 0 !important;
}
.leaflet-bottom.leaflet-left {
margin-bottom: 60px !important;
}
.leaflet-fullscreen-on .leaflet-bottom.leaflet-left {
margin-bottom: 15px !important;
margin-left: 15px !important;
}
.leaflet-bottom.leaflet-right {
margin-bottom: 60px !important;
}
.leaflet-fullscreen-on .leaflet-bottom.leaflet-right {
margin-bottom: 15px !important;
margin-right: 15px !important;
}
.leaflet-control {
clear: none !important;
padding: 0 !important;
border-radius: 0 !important;
box-shadow: none !important;
color: #c1c1c1 !important;
}
.leaflet-right .leaflet-control {
margin: 0 0 0 15px !important;
}
.leaflet-left .leaflet-control {
margin: 0 15px 0 0 !important;
}
.leaflet-control a, .leaflet-control button {
display: inline-block !important;
float: none !important;
border: none !important;
background-color: #212121 !important;
border-radius: 0 !important;
color: #c1c1c1 !important;
border-right: 1px #3e3e3e solid !important;
}
.leaflet-control a:last-child, .leaflet-control button:last-child {
border-right: none !important;
}
/* Zoom */
.leaflet-control-zoom-in, .leaflet-control-zoom-out {
font-size: 10px !important;
}
.leaflet-disabled {
background-color: rgba(33, 33, 33, 0.8) !important;
opacity: 0.8 !important;
}
/* Fullscreen */
.leaflet-control-fullscreen a {
background: #212121 !important;
}
.leaflet-control-fullscreen a:before {
content: "\f065";
font-family: FontAwesome;
background: none !important;
}
.leaflet-fullscreen-on .leaflet-control-fullscreen a:before {
content: "\f066";
font-family: FontAwesome;
}
/* Baselayers */
.leaflet-control-layers a {
background: #212121 !important;
width: 26px !important;
height: 26px !important;
line-height: 26px !important;
text-align: center !important;
border-right: none !important;
}
.leaflet-control-layers a:before {
content: "\f279";
font-family: FontAwesome;
background: none !important;
}
.leaflet-control-layers-expanded a {
display: none !important;
}
.leaflet-control-layers-list {
padding: 3px 8px !important;
color: white !important;
background: #212121 !important;
}
/* Credit / Legend */
.leaflet-control button {
font-size: 12px !important;
}
#footer-credits, #footer-legend {
background: #212121;
width: 820px;
padding: 15px;
margin: 15px auto 0 auto;
color: #c1c1c1;
text-align: left;
position: absolute;
bottom: 0;
left: calc(50% - 425px);
z-index: 10000;
}
#footer-credits .close-link, #footer-legend .close-link {
float: right;
color: white;
padding: 0 8px;
cursor: pointer;
}
#footer-credits a, #footer-legend a {
color: white;
}
#footer-credits a:hover, #footer-legend a:hover {
color: white;
}
/* Scale */
.leaflet-control-scale-line {
height: 26px !important;
background: #212121 !important;
color: #c1c1c1 !important;
text-align: center !important;
border: none !important;
font-size: 12px !important;
line-height: 20px !important;
}
.leaflet-control-scale {
opacity: 0.8 !important;
}

219
views/css/d.user.css Executable file
View File

@ -0,0 +1,219 @@
/*********************************/
/** Login page **/
/*********************************/
form.form {
width: 50%;
margin: 25px auto;
text-align: center;
}
form.form input, form.form textarea {
background: #ddd;
border-bottom: 2px solid #ccc;
width: 100%;
display: block;
margin: 10px 0 15px -10px;
padding: 10px;
}
form.form textarea {
font-size: 14px;
}
form.form input {
font-size: 18px;
}
form.form input[type=submit] {
width: auto;
margin: auto;
border-bottom: 2px solid blue;
}
/*********************************/
/** Profile page **/
/*********************************/
#profile article {
margin: 30px 0;
}
#profile aside {
width: 220px;
height: 240px;
background: #ddd;
float: left;
margin: 0 30px 0 0;
border: 1px solid #bbb;
text-align: center;
color: #999;
line-height: 238px;
overflow: hidden;
}
#profile aside img {
vertical-align: middle;
max-width: 220px;
max-height: 240px;
z-index: 1;
box-shadow: 0 0 15px #aaa;
}
#profile aside.noavatar #profileavatar {
display: none;
}
#profile aside.avatar #profilenoavatar {
display: none;
}
#profile aside.noavatar #profilenoavatar {
display: inline;
font-size: 150px;
line-height: 238px;
}
#profile aside.avatar #profileavatar {
display: inline;
}
.userrole {
font-variant: small-caps;
font-weight: 500;
}
.external-link {
font-size: 0.8em;
margin: 0 3px;
}
#profile form.form {
width: 90%;
}
/*********************************/
/** Edit user page **/
/*********************************/
form.edituser ul {
margin-left: 250px;
}
form.edituser ul {
list-style-type: none;
}
form.edituser label {
width: 150px;
float: left;
margin: 13px 15px 0 0;
text-align: right;
}
form.edituser input, form.edituser select {
background: #ddd;
border-bottom: 2px solid #ccc;
margin: 5px;
padding: 10px;
width: 250px;
}
form.edituser input[type=submit] {
width: 150px;
margin: 20px 0 0 170px;
border-bottom: 2px solid blue;
}
form.edituser #picturebuttonscontainer {
text-align: left;
height: 0;
top: 106px;
left: 0;
position: relative;
z-index: 10;
}
form.edituser #picturebuttons {
text-align: center;
line-height: 30px;
height: 30px;
display: inline-block;
background: #bbb;
}
form.edituser #picturebuttons a {
width: 30px;
display: inline-block;
}
/*********************************/
/** Member list page **/
/*********************************/
#member_list table {
width: 100%;
margin: 30px auto;
}
#member_list table, #member_list td {
border: 1px solid #ccc;
border-collapse: collapse;
}
#member_list th {
border: 1px solid #aaa;
border-collapse: collapse;
}
#member_list th a {
color: inherit !important;
}
#member_list th i {
float: right;
}
#member_list td, #member_list th {
padding: 5px;
}
#member_list tr:nth-child(even) {
background: #efefef;
}
#member_list tr:nth-child(odd) {
background: #e1e1e1;
}
#member_list tr.first {
background: #ccc;
}
#member_list tr:hover {
background: #f5f5f5;
}
#member_list tr.first:hover {
background: #ccc;
}
#member_list .username {
font-size: 1.2em;
}
#member_list .icon {
border: 1px solid #999;
border-radius: 3px;
margin: 0 3px 0 0;
padding: 4px 0;
line-height: 20px;
text-align: center;
width: 28px;
background: #ccc;
vertical-align: middle;
}
#member_list .icon.avatar {
padding: 0;
height: 28px;
}
#member_list .pagebuttons {
text-align: center;
}
#member_list .pagebuttons a {
background: #efefef;
border: 1px solid #ccc;
padding: 5px;
font-size: 1.5em;
}
#member_list .pagebuttons .previous {
margin-right: -1px;
}

66
views/css/d.wiki.css Executable file
View File

@ -0,0 +1,66 @@
/*********************************/
/** View page **/
/*********************************/
#wikiTimestamp {
font-size: 0.8em;
font-weight: 500;
float: right;
font-style: italic;
}
form.form input, form.form textarea, #locale {
background: #ddd;
border-bottom: 2px solid #ccc;
display: block;
padding: 10px;
}
form.form textarea {
font-size: 14px;
margin: 10px 0 10px 0px;
width: calc(100% - 20px);
}
form.form input {
width: 58%;
margin: 10px 0 10px 0px;
font-size: 18px;
}
#locale {
width: 38%;
float: right;
font-size: 17px;
}
form.form input[type=submit] {
width: auto;
margin: auto;
border-bottom: 2px solid blue;
}
#wikiContent {
margin: 50px 0;
}
#wikiContent h2 { margin: .75em 0 }
#wikiContent h3 { margin: .83em 0 }
#wikiContent h4, #wikiContent p, #wikiContent blockquote, #wikiContent ul, #wikiContent fieldset, #wikiContent form, #wikiContent ol, #wikiContent dl { margin: 1.12em 0 }
#wikiContent h5 { margin: 1.5em 0 }
#wikiContent h6 { margin: 1.67em 0 }
#wikiContent blockquote { margin-left: 40px; margin-right: 40px }
#wikiContent ol, #wikiContent ul, #wikiContent dd { margin-left: 40px }
#wikiContent ol ul, #wikiContent ul ol, #wikiContent ul ul, #wikiContent ol ol { margin-top: 0; margin-bottom: 0 }
#wikiContent .footnotes {
font-size: 0.8em;
}
#wikiContent .footnotes p {
margin: 0.4em 0;
}
#wikiContent hr {
border: 1px inset;
}
#wiki_page.archive {
opacity: 0.5;
}

23
views/d.admin.git-pull.html Executable file
View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<h1>Mise à jour.</h1>
<br>
<pre><?
foreach($output as $line) {
echo $line."<br>";
}
?></pre>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

24
views/d.admin.html Executable file
View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<h1>Administration.</h1>
<br>
<? if($user->role >= 1000) { ?>
<a href="<?=$config['rel_root_folder']?>admin/git-pull" class="button"><i class="fa fa-refresh"></i> Mettre à jour</a> <small>Met à jour le logiciel depuis le dépôt GIT.</small><br><br>
<? } ?>
<? if($user->role >= 800) { ?>
<a href="<?=$config['rel_root_folder']?>admin/logs" class="button"><i class="fa fa-history"></i> Voir les logs</a> <small>Permet d'accéder aux 200 dernières lignes des logs bruts des actions sur la base de données.</small><br><br>
<? } ?>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

41
views/d.admin.logs.html Executable file
View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<h1>Logs.</h1>
<span class="subtitle">
<select id="logfile">
<? $i = 0;
foreach ($files_list as $row) {
if ($row != "." && $row != "..") { ?>
<option <?=$i==$filenb?'selected':''?> value="<?=$i?>"><? echo $row; ?></option>
<? $i++;
} ?>
<? } ?>
</select>
</span>
<br>
<br>
<pre><?
foreach($output as $line) {
echo $line."<br>";
}
?></pre>
</section>
<script type="text/javascript">
$( "#logfile" ).change(function() {
window.location.href = "<?=$config['rel_root_folder']?>admin/logs/"+$( this ).val();
});
</script>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

72
views/d.blog.edit.html Executable file
View File

@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<? if(isset($new) AND $new==1) { ?>
<form class="form" action="<?=$config['rel_root_folder']?>blog/new" method="post">
<? }
else { ?>
<form class="form" action="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->url?>/edit" method="post">
<? } ?>
<h1>
<select name="locale" id="locale">
<? foreach($config['locales'] as $locale) { ?>
<option <?=$blogArticle->locale==$locale[0]?'selected':''?> value="<?=$locale[0]?>"><?=$locale[5]?></option>
<? } ?>
</select>
<input type="text" value="<?=$blogArticle->title?>" name="title" id="title" placeholder="Titre">
</h1>
<? if(isset($error) AND $error=="url") { ?>
<p style="color: red;">L'URL sélectionnée est déjà prise.</p>
<? } ?>
<textarea rows="30" name="content" id="content" placeholder="Contenu de la page"><?=$blogArticle->content?></textarea>
<? if(isset($new) AND $new==1) { ?>
<input type="text" value="<?=$blogArticle->url?>" name="url" id="url" placeholder="URL">
<? } ?>
<label for="comments">
<input type="checkbox" name="comments" id="comments" value="comments"
<? if($blogArticle->comments == 't') { ?>
checked
<? } ?>
/>
<span>Autoriser les commentaires</span>
</label>
<input name="submit" id="submit" type="submit" value="Envoyer">
</form>
</section>
<script type="text/javascript">
$( "#title" ).keyup(function() {
url = $( "#title" ).val();
url = url.replace(/ /g,'_');
url = url.toLowerCase();
url = url.replace(/[^a-z0-9_]/g,'-');
url = url.replace(/[_$]/g,'-');
$( "#url" ).val(url);
});
$( "#title" ).change(function() {
url = $( "#title" ).val();
url = url.replace(/ /g,'_');
url = url.toLowerCase();
url = url.replace(/[^a-z0-9_]/g,'-');
url = url.replace(/[_$]/g,'-');
$( "#url" ).val(url);
});
</script>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

55
views/d.blog.list.html Executable file
View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section id="blog_list">
<h1>Blog.</h1>
<p class="subtitle">
<? if ($user->role >= 800) { ?>
<a href="<?=$config['rel_root_folder']?>blog/new"><i class="fa fa-plus"></i> Nouvel article</a> &mdash;
<? } ?>
<a href="<?=$config['rel_root_folder']?>blog/rss"><i class="fa fa-rss" aria-hidden="true"></i> Flux RSS</a> &mdash;
Articles <?=$first?> à <?=$last?> sur <?=$blogArticles->number?>
</p>
<div id="articles_list">
<? foreach ($blogArticles_list as $row) { ?>
<article <? if($row->archive == 't') echo 'class="article_archive" '; ?>>
<h2 class="article_title"><?=$row->title?>.</h2>
<div class="article_content"><?=mb_substr($row->content_txt,0,200)?>...</div>
<p class="article_legend">
<a class="article_link" href="<?=$config['rel_root_folder']?>blog/<?=$row->url?>">Lire la suite...</a>
<span class="article_infos">
Le <? echo strftime('%e %B %G',strtotime($row->lastedit)) ?> par
<? if ($user->role > 0) { ?>
<a href="<?=$config['rel_root_folder']?>user/p/<?=$row->author?>"><?=$row->author_name?></a>
<? }
else { ?>
<?=$row->author_name?>
<? } ?>
</span>
</p>
</article>
<? } ?>
</div>
<div class="pagebuttons">
<? if ($page != 0) { ?><a class="previous" href="<?=$config['rel_root_folder']?>blog/<?=$page?>"><i class="fa fa-chevron-left fa-fw"></i></a><? }
if (($page+1)*$articles_per_pages < $blogArticles->number) { ?><a class="next" href="<?=$config['rel_root_folder']?>blog/<?=$page+2?>"><i class="fa fa-chevron-right fa-fw"></i></a><? } ?>
</div>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

45
views/d.blog.list.rss Executable file
View File

@ -0,0 +1,45 @@
<?
$ts = gmdate("D, d M Y H:i:s", time() + 60) . " GMT";
header("Content-disposition: filename=blog.rss");
header("Content-Type: application/xml; UTF-8");
header("Content-Transfer-Encoding: binary");
header("Pragma: cache");
header("Expires: $ts");
header("Access-Control-Allow-Origin: *");
header("Cache-Control: max-age=60");
echo ('<?xml version="1.0" encoding="UTF-8"?>'); ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Kabano</title>
<link><?=$config['rel_root_folder']?></link>
<atom:link href="<?=$config['rel_root_folder']?>blog/rss" rel="self" type="application/rss+xml" />
<description>L'actualité du blog officiel de Kabano : Plateforme collaborative de recensement de cabanes et refuges.</description>
<language>fr</language>
<image>
<url><?=$config['views_url']?>img/header_rss.svg</url>
<title>Kabano</title>
<link><?=$config['rel_root_folder']?></link>
<height>44</height>
<width>154</width>
</image>
<? foreach ($blogArticles_list as $row) { ?>
<item>
<title><?=$row->title?></title>
<link><?=$config['rel_root_folder']?>blog/<?=$row->url?></link>
<guid><?=$config['rel_root_folder']?>blog/<?=$row->url?></guid>
<pubDate><?=$row->lastedit?></pubDate>
<description><![CDATA[
<?=$row->content_html?>
]]></description>
</item>
<? } ?>
</channel>
</rss>

125
views/d.blog.view.html Executable file
View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section id="blog_article" <?=$blogArticle->archive=="t"?'class="archive"':''?>>
<h1><?=$blogArticle->title?>.</h1>
<? if($user->role >= 600) { ?>
<span class="subtitle">
<? if(isset($blogArticles_history_list)) { ?>
<select id="bloghistory">
<? $i = 0;
foreach ($blogArticles_history_list as $row) { ?>
<option <?=$row->id==$blogArticle->id?'selected':''?> value="<?=$i?>"><?=$row->archive=="f"?'&bull; ':''?><? echo strftime('%d/%m/%Y %H:%M:%S',strtotime($row->lastedit)) ?></option>
<? $i++;
} ?>
</select>
<? }
if ($user->role >= 800 && isset($blogArticles_history_list)) { ?>
&mdash;
<? }
if ($user->role >= 800) { ?>
<a href="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->url?>/edit"><i class="fa fa-pencil"></i> Éditer l'article</a>
<? if ($blogArticle->archive == 'f') { ?>
&mdash;
<a href="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->url?>/delete"><i class="fa fa-trash"></i> Effacer l'article</a>
<? } ?>
<? } ?>
</span>
<? } ?>
<div id="blogContent">
<?=$blogArticle->content_html?>
</div>
<p id="blogTimestamp">Article écrit par
<? if ($user->role > 0) { ?>
<a href="<?=$config['rel_root_folder']?>user/p/<?=$blogArticle->author?>"><?=$blogArticle->author_name?></a>
<? }
else { ?>
<?=$blogArticle->author_name?>
<? } ?>
le <? echo strftime('%e %B %G, %kh%Mm%Ss',strtotime($blogArticle->lastedit)) ?> <small><abbr title="Temps Universel Coordonné">UTC</abbr></small></p>
<!-- COMMENTS -->
<? if ($blogArticle->comments == "t" && $blogArticle->archive == "f") { ?>
<div id="new_comment">
<form class="form" action="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->url?>/new_comment" method="post">
<div id="new_comment_label" <?=$user->role==0?"class='sent' ":""?>>
<? if ($user->role > 0) { ?>
<input name="submit" type="submit" value="Envoyer">
<p>Ajouter un nouveau commentaire</p>
<? } else { ?>
<p>Veuillez vous connecter pour ajouter un commentaire</p>
<? } ?>
</div>
<div id="new_comment_form">
<textarea id="comment" name="comment" rows="5" placeholder="Votre commentaire"></textarea>
</div>
</form>
</div>
<? if(isset($blogArticles_comments_list)) {
foreach ($blogArticles_comments_list as $row) { ?>
<article <? if($row->archive == 't') echo 'class="comment_archive" '; ?>>
<div class="comment_title">
<? if ($row->author_obj->avatar=='t') { ?>
<img alt="Avatar" class="icon avatar" src="<?=$config['rel_root_folder']?>medias/avatars/<?=$row->author_obj->id?>_s.jpg">
<? } else { ?>
<i class="icon fa fa-user-secret"></i>
<? } ?>
<? if ($user->role > 0) { ?>
<a class="username" href="<?=$config['rel_root_folder']?>user/p/<?=$row->author_obj->id?>"><?=$row->author_obj->name?></a>
<? } else { ?>
<?=$row->author_obj->name?>
<? } ?>
le <? echo strftime('%e %B %G, %kh%Mm%Ss',strtotime($row->lastedit)) ?> <small><abbr title="Temps Universel Coordonné">UTC</abbr></small>
<? if (($user->role >= 800 || $user->id == $row->author) && $row->archive == 'f') { ?>
<span class="delete_link"><a href="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->url?>/delete_comment/<?=$row->id?>"><i class="fa fa-trash"></i> Effacer le commentaire</a></span>
<? } ?>
<? if (($user->role >= 800 || $user->id == $row->author) && $row->archive == 't') { ?>
<span class="delete_link"><a href="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->url?>/undelete_comment/<?=$row->id?>"><i class="fa fa-eye"></i> Réafficher le commentaire</a></span>
<? } ?>
</div>
<div class="comment_content">
<?=$row->content_html?>
</div>
</article>
<? }
}
} ?>
<br>
<br>
<div style="clear: both;"> </div>
</section>
<? if($user->role >= 600) { ?>
<script type="text/javascript">
$( "#bloghistory" ).change(function() {
window.location.href = "<?=$config['rel_root_folder']?>blog/<?=$blogArticle->url?>/"+$( this ).val();
});
</script>
<? } ?>
<? if($user->role > 0) { ?>
<script type="text/javascript">
$( "#new_comment_label" ).click(function() {
$( "#new_comment_form" ).show(400);
$( "#new_comment_label input" ).show(0);
$( "#new_comment_label").addClass('sent');
});
</script>
<? } ?>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

58
views/d.contact.html Executable file
View File

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<h1>Nous contacter.</h1>
<form class="form" action="<?=$config['rel_root_folder']?>contact" method="post">
<? if($error=="name") { ?>
<p style="color: red;">Veuillez renseigner votre nom.</p>
<? } ?>
<? if($error=="subject") { ?>
<p style="color: red;">Veuillez renseigner un sujet.</p>
<? } ?>
<? if($error=="mail") { ?>
<p style="color: red;">Veuillez renseigner une adresse mail.</p>
<? } ?>
<? if($error=="message") { ?>
<p style="color: red;">Veuillez renseigner un message.</p>
<? } ?>
<? if($error=="unknown") { ?>
<p style="color: red;">Une erreur est survenue.</p>
<? } ?>
<? if($error=="spam") { ?>
<p style="color: red;">Veuillez n'envoyer qu'un message et attendre la fin du compte à rebours.<br>
Avez-vous javascript activé et attendu la fin du compte à rebours ?</p>
<? } ?>
<? if($error=="none") { ?>
<p style="color: green;">Message bien envoyé.</p>
<? } ?>
<input type="text" name="name" id="name" placeholder="Nom" value="<?=$contact['name']?>">
<input type="text" name="mail" id="mail" placeholder="Adresse mail" value="<?=$contact['mail']?>">
<input type="text" name="subject" id="subject" placeholder="Sujet" value="<?=$contact['subject']?>">
<textarea name="message" id="message" rows="12" placeholder="Contenu de votre message"><?=$contact['message']?></textarea>
<? if($user->role >= 200) { ?>
<input type="hidden" name="captcha" value="-2">
<input type="submit" name="submit" value="Envoyer">
<? }
else { ?>
<p id="captcha">
<input type="hidden" id="captchahidden" name="captcha" value="10">
<span id="captchatext">Merci d'attendre <b id="captchasec">10 s</b> avant de pouvoir nous contacter.<br>
<small>Ceci nous permet de laisser les robots à la porte.</small></span>
<input disabled id="captchasubmit" style="display:none;" type="submit" name="submit" value="Envoyer">
</p>
<? } ?>
<input type="hidden" name="ns" value="<?=$contact['ns']?>"/>
</form>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

33
views/d.index.html Executable file
View File

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<aside id="indexFullW">
<!-- <div id="AScontent">
<div id="spacebeforesponsors"></div>
<div id="sponsors">
<p style="font-size: 1.3em;">Aidez Kabano en partagant sa <a style="font-weight: 6b00; color: orange; float: none; padding: 0; display: inline;" href="http://fr.ulule.com/kabano/" target="_blank">campagne de financement Ulule</a> !</p>
</div>
</div> -->
</aside>
<section>
<h1>Cabanes et bivouac en montagne.</h1>
<p><abbr title="Cabane en espéranto">Kabano</abbr> est une plateforme collaborative sur laquelle vous pouvez récupérer toutes les informations nécessaires relatives aux hébergements en montagne. Ces informations ont été ajoutées par vous, pour vous, c'est pourquoi il est primordial de ne pas cesser d'ajouter des commentaires, cabanes, refuges ou emplacements de bivouac. Attention toutefois, ces données ne sont en aucun cas garanties et des précautions dues à l'environnement montagnard sont à prendre.</p>
<br>
<p style="text-align: center;">
<img alt="Illustration hut" src="<?=$config['views_url']?>img/thumb1.jpg" class="thumb" title="© ptit tapou - Forums Pyrénées Team">
<img alt="Illustration tent" src="<?=$config['views_url']?>img/thumb2.jpg" class="thumb">
<img alt="Illustration hut" src="<?=$config['views_url']?>img/thumb3.jpg" class="thumb" title="CC BY-SA - EricM - refuges.info">
</p>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

25
views/d.map.html Executable file
View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<div id="mapid" style="height: 100%;"></div>
<div id="footer-credits" style="display: none;">
<i class="fa fa-times close-link" aria-hidden="true"></i>
<p><i id="map-credits"></i></p>
</div>
<div id="footer-legend" style="display: none;">
<i class="fa fa-times close-link" aria-hidden="true"></i>
<p><i id="map-legend">Légende.</i></p>
</div>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

34
views/d.user.login.html Executable file
View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<h1>Connexion.</h1>
<form class="form" action="<?=$config['rel_root_folder']?>user/login" method="post" id="login">
<? if(isset($_GET['error']) AND $_GET['error']==1) { ?>
<p style="color: red;">Erreur lors de la connexion, merci de réessayer.</p>
<? } ?>
<? if(isset($_GET['status']) AND $_GET['status']=="created") { ?>
<p style="color: #006600;">Votre compte a été créé, vous pouvez vous connecter.</p>
<? } ?>
<? if(isset($_GET['status']) AND $_GET['status']=="password_sent") { ?>
<p style="color: #006600;">Un nouveau mot de passe vous a été envoyé par mail.</p>
<? } ?>
<input type="text" name="login" id="login" placeholder="Nom d'utilisateur">
<input type="password" name="password" id="password" placeholder="Mot de passe">
<input type="submit" name="submit" value="Se connecter">
<p style="text-align: center;">
<a href="<?=$config['rel_root_folder']?>user/password_lost">Mot de passe oublié</a>
</p>
</form>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

70
views/d.user.member_list.html Executable file
View File

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section id="member_list">
<h1>Liste des membres.</h1>
<p class="subtitle">Membres <?=$first?> à <?=$last?> sur les <?=$users->number?> inscrits</p>
<table>
<tr class="first">
<th>
<a href="<?=$config['rel_root_folder']?>user/member_list/<?=$page+1?>?orderby=name&amp;order=<?=$order=='ASC'?'DESC':'ASC'?>">Nom d'utilisateur</a>
<?=$orderby=='name'?$order=='ASC'?'<i class="fa fa-caret-down" aria-hidden="true"></i>':'<i class="fa fa-caret-up" aria-hidden="true"></i>':''?>
</th>
<th>
<a href="<?=$config['rel_root_folder']?>user/member_list/<?=$page+1?>?orderby=role&amp;order=<?=$order=='ASC'?'DESC':'ASC'?>">Rôle</a>
<?=$orderby=='role'?$order=='ASC'?'<i class="fa fa-caret-down" aria-hidden="true"></i>':'<i class="fa fa-caret-up" aria-hidden="true"></i>':''?>
</th>
<th>
<a href="<?=$config['rel_root_folder']?>user/member_list/<?=$page+1?>?orderby=registered&amp;order=<?=$order=='ASC'?'DESC':'ASC'?>">Inscription</a>
<?=$orderby=='registered'?$order=='ASC'?'<i class="fa fa-caret-down" aria-hidden="true"></i>':'<i class="fa fa-caret-up" aria-hidden="true"></i>':''?>
</th>
<th>
<a href="<?=$config['rel_root_folder']?>user/member_list/<?=$page+1?>?orderby=lastlogin&amp;order=<?=$order=='ASC'?'DESC':'ASC'?>">Dernière visite</a>
<?=$orderby=='lastlogin'?$order=='ASC'?'<i class="fa fa-caret-down" aria-hidden="true"></i>':'<i class="fa fa-caret-up" aria-hidden="true"></i>':''?>
</th>
<th>
<a href="<?=$config['rel_root_folder']?>user/member_list/<?=$page+1?>?orderby=website&amp;order=<?=$order=='ASC'?'DESC':'ASC'?>">Site internet</a>
<?=$orderby=='website'?$order=='ASC'?'<i class="fa fa-caret-down" aria-hidden="true"></i>':'<i class="fa fa-caret-up" aria-hidden="true"></i>':''?>
</th>
</tr>
<? foreach ($user_list as $row) { ?>
<tr>
<td>
<? if ($row->avatar=='t') { ?>
<img alt="Avatar" class="icon avatar" src="<?=$config['rel_root_folder']?>medias/avatars/<?=$row->id?>_s.jpg">
<? } else { ?>
<i class="icon fa fa-user-secret"></i>
<? } ?>
<a class="username" href="<?=$config['rel_root_folder']?>user/p/<?=$row->id?>"><?=$row->name?></a>
</td>
<td><?=$row->role()?></td>
<td><? echo strftime('%e %B %G',strtotime($row->registered)) ?></td>
<td><? echo strftime('%e %B %G',strtotime($row->lastlogin)) ?></td>
<td>
<? if ($row->website != "") { ?>
<a target="_blank" href="<?=$row->website?>">Site internet <span class="external-link"><i class="fa fa-external-link"></i></span></a>
<? } ?>
</td>
</tr>
<? } ?>
</table>
<div class="pagebuttons">
<? if ($page != 0) { ?><a class="previous" href="<?=$config['rel_root_folder']?>user/member_list/<?=$page?>?orderby=<?=$orderby?>&amp;order=<?=$order?>"><i class="fa fa-chevron-left fa-fw"></i></a><? }
if (($page+1)*$rows_per_pages < $users->number) { ?><a class="next" href="<?=$config['rel_root_folder']?>user/member_list/<?=$page+2?>?orderby=<?=$orderby?>&amp;order=<?=$order?>"><i class="fa fa-chevron-right fa-fw"></i></a><? } ?>
</div>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

24
views/d.user.password_lost.html Executable file
View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<h1>Envoi d'un mot de passe.</h1>
<form class="form" action="<?=$config['rel_root_folder']?>user/password_lost" method="post" id="password_lodt">
<? if(isset($_GET['error']) AND $_GET['error']==1) { ?>
<p style="color: red;">Cette adresse mail n'existe pas.</p>
<? } ?>
<input type="text" name="mail" id="mail" placeholder="Adresse mail">
<input type="submit" name="submit" value="Envoyer un nouveau mot de passe">
</form>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

74
views/d.user.profile.edit.html Executable file
View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section id="profile">
<? if ($userProfile->id != 0) { ?>
<h1><?=$userProfile->name?></h1>
<article>
<? if(isset($nameError) AND $nameError==1) { ?>
<p style="color: #660000;">Veuillez choisir un autre nom d'utilisateur.</p>
<? } ?>
<? if(isset($nameError) AND $nameError==1) { ?>
<p style="color: #660000;">Veuillez choisir un autre nom d'utilisateur.</p>
<? } ?>
<? if(isset($updated) AND $updated==1) { ?>
<p style="color: #006600;">Le profil a été mis à jour.</p>
<? } ?>
<form action="<?=$config['rel_root_folder']?>user/p/<?=$userProfile->id?>/edit" method="post" class="edituser" enctype="multipart/form-data">
<aside class="<?=$userProfile->avatar=='t'?'':'no'?>avatar">
<div id="picturebuttonscontainer">
<div id="picturebuttons">
<a href="#" id="uploadavatar"><i class="fa fa-camera"></i></a><a <?=$userProfile->avatar=='t'?'':'style="display: none;"'?> href="#" id="deleteavatar" style="font-size: 1.1em;"><i class="fa fa-trash"></i></a>
</div>
</div>
<img alt="Avatar" id="profileavatar" src="<?=$config['rel_root_folder']?>medias/avatars/<?=$userProfile->id?>_p.jpg" alt="Profile picture">
<i id="profilenoavatar" class="fa fa-user-secret"></i>
</aside>
<input id="avatarcheckbox" style="display: none;" type="checkbox" name="avatar" <?=$userProfile->avatar=='t'?'checked':''?>>
<input type="hidden" name="MAX_FILE_SIZE" value="4194304" />
<input id="avatarfile" name="avatarfile" style="display: none;" type="file" accept="image/*" />
<div id="description">
<ul>
<li><label for="name">Nom d'utilisateur :</label><input name="name" id="name" type="text" value="<?=$userProfile->name?>" placeholder="Charlie"></li>
<li><label for="mail">Adresse mail :</label><input name="mail" id="mail" type="text" value="<?=$userProfile->mail?>" placeholder="charlie@mountain.org"></li>
<li><label for="password">Mot de passe :</label><input name="password" id="password" type="password" placeholder="Nouveau mot de passe"></li>
<li><label for="locale">Langue :</label>
<select name="locale" id="locale">
<? foreach($config['locales'] as $locale) { ?>
<option <?=$userProfile->locale==$locale[0]?'selected':''?> value="<?=$locale[0]?>"><?=$locale[5]?></option>
<? } ?>
</select></li>
<? if($user->role >= 1000) { ?>
<li><label for="role">Rang : </label>
<select name="role" id="role">
<? foreach($config['roles'] as $role) { ?>
<option <?=$userProfile->role==$role[0]?'selected':''?> value="<?=$role[0]?>"><?=$role[1]?></option>
<? } ?>
</select></li>
<? } ?>
<li><label for="website">Site internet :</label><input name="website" id="website" type="text" value="<?=$userProfile->website?>" placeholder="mountain.org"></li>
<input name="submit" id="submit" type="submit" value="Envoyer">
</ul>
</div>
<div style="clear:both;"></div>
</form>
</article>
<? } else { ?>
<p style="color:red;">Le profil demandé n'existe pas.</p>
<? } ?>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

66
views/d.user.profile.html Executable file
View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section id="profile">
<? if ($userProfile->id != 0) { ?>
<h1><?=$userProfile->name?></h1>
<? if($user->role >= 800 || $user->id == $userProfile->id) { ?>
<a class="subtitle" id="editprofile" href="<?=$config['rel_root_folder']?>user/p/<?=$userProfile->id?>/edit"><i class="fa fa-pencil"></i> Éditer les paramètres du compte</a>
<? } ?>
<article>
<div id="profilepart">
<? if(isset($mailsent) AND $mailsent==1) { ?>
<p style="color: #006600;">Le message a bien été envoyé.</p>
<? } ?>
<aside class="<?=$userProfile->avatar=='t'?'':'no'?>avatar">
<img alt="Avatar" id="profileavatar" src="<?=$config['rel_root_folder']?>medias/avatars/<?=$userProfile->id?>_p.jpg" alt="Profile picture">
<i id="profilenoavatar" class="fa fa-user-secret"></i>
</aside>
<div id="description">
<p>Langue : <?=$config['locales'][$userProfile->locale][5]?></p>
<p>Inscrit le <? echo strftime('%e %B %G, %kh%Mm%Ss',strtotime($userProfile->registered)) ?> <small><abbr title="Temps Universel Coordonné">UTC</abbr></small></p>
<p>Dernière connexion le <? echo strftime('%e %B %G, %kh%Mm%Ss',strtotime($userProfile->lastlogin)) ?> <small><abbr title="Temps Universel Coordonné">UTC</abbr></small></p>
<p><?=$userProfile->role()?></p>
<p>
<? if ($userProfile->website != "") { ?>
<a target="_blank" href="<?=$userProfile->website?>">Site internet <span class="external-link"><i class="fa fa-external-link"></i></span></a>
<? }
if ($userProfile->website != "" AND $userProfile->id != $user->id) { ?>
&mdash;
<? }
if ($userProfile->id != $user->id) { ?>
<a href="#" onclick="$('#profilepart').hide(0, function(){$('#contact').show('fast');});">Contacter par mail</a>
<? }
if ($user->role >= 600 AND ($userProfile->website != "" OR $userProfile->id != $user->id)) { ?>
&mdash;
<? }
if ($user->role >= 600) { ?>
<a href="mailto:<?=$userProfile->mail?>"><?=$userProfile->mail?></a>
<? } ?>
</p>
</div>
<div style="clear:both;"></div>
</div>
<? if ($userProfile->id != $user->id) { ?>
<form style="display:none;" class="form" id="contact" action="<?=$config['rel_root_folder']?>user/p/<?=$userProfile->id?>" method="post" >
<textarea rows="12" name="message" id="message" placeholder="Votre message"></textarea>
<p><i>Votre adresse email sera transmise à votre destinataire.</i></p>
<input type="submit" name="submit" value="Envoyer">
</form>
<? } ?>
</article>
<? } else { ?>
<p style="color:red;">Le profil demandé n'existe pas.</p>
<? } ?>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

41
views/d.user.signin.html Executable file
View File

@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<h1>Inscription.</h1>
<form class="form" action="<?=$config['rel_root_folder']?>user/signin" method="post" id="signin">
<? if(isset($_GET['error']) AND $_GET['error']=="name") { ?>
<p style="color: red;">Veuillez choisir un autre nom d'utilisateur.</p>
<? } ?>
<? if(isset($_GET['error']) AND $_GET['error']=="mail") { ?>
<p style="color: red;">Cette adresse mail est déjà prise.</p>
<? } ?>
<? if(isset($_GET['error']) AND $_GET['error']=="empty") { ?>
<p style="color: red;">Merci de remplir tous les champs, il n'y en a que trois.</p>
<? } ?>
<? if(isset($_GET['error']) AND $_GET['error']=="captcha") { ?>
<p style="color: red;">Nous n'avons pas pu vérifier que vous êtes un humain.<br>
Avez-vous javascript activé et attendu la fin du compte à rebours ?</p>
<? } ?>
<input type="text" name="login" id="login" placeholder="Nom d'utilisateur">
<input type="password" name="password" id="password" placeholder="Mot de passe">
<input type="text" name="mail" id="mail" placeholder="Adresse mail">
<p id="captcha">
<input type="hidden" id="captchahidden" name="captcha" value="10">
<span id="captchatext">Merci d'attendre <b id="captchasec">10 s</b> avant de pouvoir vous inscrire.<br>
<small>Ceci nous permet de laisser les robots à la porte.</small></span>
<input disabled id="captchasubmit" style="display:none;" type="submit" name="submit" value="S'inscrire">
</p>
</form>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

30
views/d.wiki.edit.html Executable file
View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section>
<form class="form" action="<?=$config['rel_root_folder']?>wiki/<?=$wikiPage->url?>/edit" method="post">
<h1>
<select name="locale" id="locale">
<? foreach($config['locales'] as $locale) { ?>
<option <?=$wikiPage->locale==$locale[0]?'selected':''?> value="<?=$locale[0]?>"><?=$locale[5]?></option>
<? } ?>
</select>
<input type="text" value="<?=$wikiPage->title?>" name="title" id="title" placeholder="Titre">
</h1>
<textarea rows="30" name="content" id="content" placeholder="Contenu de la page"><?=$wikiPage->content?></textarea>
<input name="submit" id="submit" type="submit" value="Envoyer">
</form>
</section>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

56
views/d.wiki.view.html Executable file
View File

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="fr">
<? include('blocks/d.head.html'); ?>
<body>
<? include('blocks/d.nav.html'); ?>
<section id="wiki_page" <?=$wikiPage->archive=="t"?'class="archive"':''?>>
<h1><?=$wikiPage->title?>.</h1>
<? if($user->role >= 600) { ?>
<span class="subtitle">
<? if(isset($wikiHistory_list)) { ?>
<select id="wikihistory">
<? $i = 0;
foreach ($wikiHistory_list as $row) { ?>
<option <?=$row->id==$wikiPage->id?'selected':''?> value="<?=$i?>"><?=$row->archive=="f"?'&bull; ':''?><? echo strftime('%d/%m/%Y %H:%M:%S',strtotime($row->lastedit)) ?></option>
<? $i++;
} ?>
</select>
<? }
if ($user->role >= 800 && isset($wikiHistory_list)) { ?>
&mdash;
<? }
if ($user->role >= 800) { ?>
<a href="<?=$config['rel_root_folder']?>wiki/<?=$wikiPage->url?>/edit"><i class="fa fa-pencil"></i> Éditer la page</a>
<? if ($wikiPage->archive == 'f') { ?>
&mdash;
<a href="<?=$config['rel_root_folder']?>wiki/<?=$wikiPage->url?>/delete"><i class="fa fa-trash"></i> Effacer la page</a>
<? } ?>
<? } ?>
</span>
<? } ?>
<div id="wikiContent">
<?=$wikiPage->content_html?>
</div>
<p id="wikiTimestamp">Page mise à jour le <? echo strftime('%e %B %G, %kh%Mm%Ss',strtotime($wikiPage->lastedit)) ?> <small><abbr title="Temps Universel Coordonné">UTC</abbr></small></p>
<div style="clear: both;"> </div>
</section>
<? if($user->role >= 600) { ?>
<script type="text/javascript">
$( "#wikihistory" ).change(function() {
window.location.href = "<?=$config['rel_root_folder']?>wiki/<?=$wikiPage->url?>/"+$( this ).val();
});
</script>
<? } ?>
<? include('blocks/d.footer.html'); ?>
</body>
</html>

BIN
views/fonts/FiraMono-Bold.eot Executable file

Binary file not shown.

BIN
views/fonts/FiraMono-Bold.otf Executable file

Binary file not shown.

BIN
views/fonts/FiraSans-Bold.ttf Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
views/fonts/FiraSans-Light.eot Executable file

Binary file not shown.

BIN
views/fonts/FiraSans-Light.otf Executable file

Binary file not shown.

BIN
views/fonts/FiraSans-Light.ttf Executable file

Binary file not shown.

BIN
views/fonts/FiraSans-Medium.eot Executable file

Binary file not shown.

BIN
views/fonts/FiraSans-Medium.otf Executable file

Binary file not shown.

BIN
views/fonts/FiraSans-Medium.ttf Executable file

Binary file not shown.

BIN
views/fonts/FiraSans-Regular.eot Executable file

Binary file not shown.

BIN
views/fonts/FiraSans-Regular.otf Executable file

Binary file not shown.

BIN
views/fonts/FiraSans-Regular.ttf Executable file

Binary file not shown.

BIN
views/img/aside.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
views/img/favicon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

104
views/img/header.svg Executable file
View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="154"
height="44"
viewBox="0 0 154 44"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="logo3.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="56.867628"
inkscape:cy="65.836934"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1366"
inkscape:window-height="745"
inkscape:window-x="1280"
inkscape:window-y="23"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(2.2888184e-7,-1008.3622)">
<g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text4136"
transform="matrix(1.1379801,0,0,1.1379801,3.1581138e-8,-151.20504)">
<path
d="m 1.3999998,1024.6822 -1.40000002888184,0 0,27.28 1.40000002888184,0 0,-27.28 z m 13.9200002,0 -1.68,0 -12.1200002,12.6 12.7200002,14.68 1.72,0 -12.6800002,-14.68 12.0400002,-12.6 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4186"
inkscape:connector-curvature="0" />
<path
d="m 53.246875,1037.4822 c 3,-0.52 4.92,-2.44 4.92,-6.04 0,-4.56 -3.44,-6.76 -9.32,-6.76 l -5.8,0 0,27.28 7.36,0 c 5.76,0 9.12,-2.64 9.12,-7.44 0,-4.76 -2.88,-6.84 -6.28,-7.04 z m -4.24,-11.52 c 4.96,0 7.72,1.68 7.72,5.52 0,3.4 -2.32,5.48 -5.8,5.48 l -6.48,0 0,-11 4.56,0 z m 1.44,24.72 -6,0 0,-12.52 6.68,0 c 4.04,0 6.96,2 6.96,6.36 0,4.16 -2.88,6.16 -7.64,6.16 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4190"
inkscape:connector-curvature="0" />
<path
d="m 105.32312,1024.6822 -1.36,0 0,17.8 c 0,3.64 0.08,6.36 0.16,7.92 l -14.159995,-25.72 -1.76,0 0,27.28 1.36,0 0,-17.2 c 0,-4.8 -0.08,-6.92 -0.2,-8.52 l 14.199995,25.72 1.76,0 0,-27.28 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4194"
inkscape:connector-curvature="0" />
<path
d="m 123.80562,1024.2422 c -6.4,0 -10.84,5.12 -10.84,14.16 0,9 4.4,13.96 10.84,13.96 6.68,0 10.84,-5.12 10.84,-14 0,-9.24 -4.36,-14.12 -10.84,-14.12 z m 0,1.32 c 5.64,0 9.4,4.2 9.4,12.8 0,8.4 -3.56,12.72 -9.4,12.72 -5.52,0 -9.4,-4.32 -9.4,-12.68 0,-8.56 3.84,-12.84 9.4,-12.84 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4196"
inkscape:connector-curvature="0" />
</g>
<g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text4136-1"
transform="matrix(1.1379801,0,0,1.1379801,-327.34608,665.85293)">
<path
d="m 327.11423,334.16668 -10.09786,-27.23536 -10.34214,27.23536 z m -18.81955,-1.19739 5.88391,-15.62044 4.87414,-1.40926 6.40569,16.95891 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#ffffff;fill-opacity:1"
id="path4159"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<path
d="m 372.70688,333.82719 -0.008,-1.24916 -1.36672,-0.006 -8.73903,-23.76226 0.83839,-1.55306 -0.73436,-0.62958 -0.82296,1.22506 -0.69448,-1.17371 -0.71601,0.66008 0.84437,1.49829 -9.42882,23.88393 -1.23813,0.005 0.0188,1.14693 z m -17.50259,-1.13043 6.57828,-15.51649 6.1435,15.46802 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-size:40px;line-height:125%;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path4159-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccccccc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

104
views/img/header_rss.svg Executable file
View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="154"
height="44"
viewBox="0 0 154 44"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="header_rss.svg">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="55.336881"
inkscape:cy="65.836934"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1366"
inkscape:window-height="745"
inkscape:window-x="1280"
inkscape:window-y="279"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(2.2888184e-7,-1008.3622)">
<g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text4136"
transform="matrix(1.1379801,0,0,1.1379801,3.1581138e-8,-151.20504)">
<path
d="m 1.3999998,1024.6822 -1.40000002888184,0 0,27.28 1.40000002888184,0 0,-27.28 z m 13.9200002,0 -1.68,0 -12.1200002,12.6 12.7200002,14.68 1.72,0 -12.6800002,-14.68 12.0400002,-12.6 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#000000;fill-opacity:1"
id="path4186"
inkscape:connector-curvature="0" />
<path
d="m 53.246875,1037.4822 c 3,-0.52 4.92,-2.44 4.92,-6.04 0,-4.56 -3.44,-6.76 -9.32,-6.76 l -5.8,0 0,27.28 7.36,0 c 5.76,0 9.12,-2.64 9.12,-7.44 0,-4.76 -2.88,-6.84 -6.28,-7.04 z m -4.24,-11.52 c 4.96,0 7.72,1.68 7.72,5.52 0,3.4 -2.32,5.48 -5.8,5.48 l -6.48,0 0,-11 4.56,0 z m 1.44,24.72 -6,0 0,-12.52 6.68,0 c 4.04,0 6.96,2 6.96,6.36 0,4.16 -2.88,6.16 -7.64,6.16 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#000000;fill-opacity:1"
id="path4190"
inkscape:connector-curvature="0" />
<path
d="m 105.32312,1024.6822 -1.36,0 0,17.8 c 0,3.64 0.08,6.36 0.16,7.92 l -14.159995,-25.72 -1.76,0 0,27.28 1.36,0 0,-17.2 c 0,-4.8 -0.08,-6.92 -0.2,-8.52 l 14.199995,25.72 1.76,0 0,-27.28 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#000000;fill-opacity:1"
id="path4194"
inkscape:connector-curvature="0" />
<path
d="m 123.80562,1024.2422 c -6.4,0 -10.84,5.12 -10.84,14.16 0,9 4.4,13.96 10.84,13.96 6.68,0 10.84,-5.12 10.84,-14 0,-9.24 -4.36,-14.12 -10.84,-14.12 z m 0,1.32 c 5.64,0 9.4,4.2 9.4,12.8 0,8.4 -3.56,12.72 -9.4,12.72 -5.52,0 -9.4,-4.32 -9.4,-12.68 0,-8.56 3.84,-12.84 9.4,-12.84 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#000000;fill-opacity:1"
id="path4196"
inkscape:connector-curvature="0" />
</g>
<g
style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="text4136-1"
transform="matrix(1.1379801,0,0,1.1379801,-327.34608,665.85293)">
<path
d="m 327.11423,334.16668 -10.09786,-27.23536 -10.34214,27.23536 z m -18.81955,-1.19739 5.88391,-15.62044 4.87414,-1.40926 6.40569,16.95891 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';fill:#000000;fill-opacity:1"
id="path4159"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<path
d="m 372.70688,333.82719 -0.008,-1.24916 -1.36672,-0.006 -8.73903,-23.76226 0.83839,-1.55306 -0.73436,-0.62958 -0.82296,1.22506 -0.69448,-1.17371 -0.71601,0.66008 0.84437,1.49829 -9.42882,23.88393 -1.23813,0.005 0.0188,1.14693 z m -17.50259,-1.13043 6.57828,-15.51649 6.1435,15.46802 z"
style="font-style:normal;font-variant:normal;font-weight:200;font-stretch:normal;font-size:40px;line-height:125%;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans Ultra-Light';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path4159-4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccccccc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
views/img/lstronic.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
views/img/thumb1.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
views/img/thumb2.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
views/img/thumb3.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

40
views/js/d.avatar.js Executable file
View File

@ -0,0 +1,40 @@
$(window).ready(function() {
$("#deleteavatar").click(function() {
$("aside").removeClass("avatar").addClass("noavatar");
$("#deleteavatar").hide();
$("#avatarcheckbox").prop("checked", false);
$('#avatarfile').val('');
});
$("#uploadavatar").click(function() {
$('#avatarfile').trigger('click');
});
$("#avatarfile").change(function () {
if($("#avatarfile").val == '') {
$("#avatarcheckbox").prop("checked", false);
$("aside").removeClass("avatar").addClass("noavatar");
$("#deleteavatar").hide();
}
else {
$("#avatarcheckbox").prop("checked", true);
$("aside").removeClass("noavatar").addClass("avatar");
$("#deleteavatar").show();
readURL(this);
}
});
});
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#profileavatar').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}$

22
views/js/d.captcha.js Executable file
View File

@ -0,0 +1,22 @@
var time = 9;
$(window).ready(function() {
var interval = setInterval(function() {
if (time > 0) {
$("#captchahidden").val(time);
$("#captchasec").html(time+" s");
time--;
}
else {
time--;
$("#captchahidden").val(time);
$("#captchatext").remove();
$("#captchasubmit").removeAttr('disabled');
$("#captchasubmit").css("display", "block");
time--;
$("#captchahidden").val(time);
clearInterval(interval);
}
}, 1000);
});

81
views/js/d.header.js Executable file
View File

@ -0,0 +1,81 @@
var small = 2;
function reduce() {
$( "header" ).animate({
height: "45px"
}, 100, function() {
// Animation complete.
});
$( "header #logo img" ).animate({
height: "34px"
}, 100, function() {
// Animation complete.
});
$( "header #logo" ).animate({
paddingTop: "3px"
}, 100, function() {
// Animation complete.
});
$( "header li.on-bar" ).animate({
height: "45px"
}, 100, function() {
// Animation complete.
});
$( "header a.on-bar" ).animate({
paddingTop: "15px",
paddingBottom: "5px"
}, 100, function() {
// Animation complete.
});
}
function enlarge() {
$( "header" ).animate({
height: "65px"
}, 100, function() {
// Animation complete.
});
$( "header #logo img" ).animate({
height: "44px"
}, 100, function() {
// Animation complete.
});
$( "header #logo" ).animate({
paddingTop: "8px"
}, 100, function() {
// Animation complete.
});
$( "header li.on-bar" ).animate({
height: "65px"
}, 100, function() {
// Animation complete.
});
$( "header a.on-bar" ).animate({
paddingTop: "25px",
paddingBottom: "15px"
}, 100, function() {
// Animation complete.
});
}
$(window).scroll(function() {
var position = $(window).scrollTop();
if (position>80 && small!=1) {
small = 1;
reduce();
}
else if (position<=80 && small!=0) {
small = 0;
enlarge();
}
});
$(window).ready(function() {
$( "#logo" ).hover(
function() {
$("#kabanologotext").show(100);
}, function() {
$("#kabanologotext").hide(100);
}
)
});

64
views/js/d.map.js Executable file
View File

@ -0,0 +1,64 @@
var mymap;
$( document ).ready(function() {
// Differents layers for the map
var osmfr = L.tileLayer('//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {maxZoom: 20, attribution: 'Maps © <a href="http://www.openstreetmap.fr">OpenSreetMap France</a>, Data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>'});
var wikimedia = L.tileLayer('//maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png', {maxZoom: 18, attribution: 'Maps © <a href="http://wikimedia.org">Wikimedia</a>, Data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>'});
// Base layers
var baseLayers = {
"OSM France": osmfr,
"OSM Wikimedia": wikimedia,
};
mymap = L.map('mapid', {
zoomControl: false,
layers: [wikimedia],
}).setView([47.018, 3.142], 6);
$("#map-credits").html(wikimedia.getAttribution());
L.control.scale({
position: "bottomleft",
imperial: false
}).addTo(mymap);
var credits = L.easyButton('fa-info',
function(control, mymap){
$("footer").hide();
$("#footer-credits").show();
$("#footer-legend").hide();
}, 'Credits');
var legend = L.easyButton('fa-question',
function(control, mymap){
$("footer").hide();
$("#footer-credits").hide();
$("#footer-legend").show();
}, 'Legend');
L.easyBar([ credits, legend, ], {position: "bottomleft"}).addTo(mymap);
L.control.fullscreen({
position: "bottomleft"
}).addTo(mymap);
L.control.zoom({
zoomOutText: "<i class=\"fa fa-minus\" aria-hidden=\"true\"></i>",
zoomInText: "<i class=\"fa fa-plus\" aria-hidden=\"true\"></i>",
position: "bottomleft"
}).addTo(mymap);
L.control.layers(baseLayers,null,{
position: "bottomright"
}).addTo(mymap);
mymap.removeControl(mymap.attributionControl);
$(".close-link").click(function() {
$("footer").show();
$("#footer-credits").hide();
$("#footer-legend").hide();
});
mymap.on('baselayerchange', function(e) {
$("#map-credits").html(e.layer.getAttribution());
});
});

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

4
views/third/jquery-3.1.1.min.js vendored Executable file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,56 @@
.leaflet-bar button,
.leaflet-bar button:hover {
background-color: #fff;
border: none;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar button {
background-position: 50% 50%;
background-repeat: no-repeat;
overflow: hidden;
display: block;
}
.leaflet-bar button:hover {
background-color: #f4f4f4;
}
.leaflet-bar button:first-of-type {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar button:last-of-type {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar.disabled,
.leaflet-bar button.disabled {
cursor: default;
pointer-events: none;
opacity: .4;
}
.easy-button-button .button-state{
display: block;
width: 100%;
height: 100%;
position: relative;
}
.leaflet-touch .leaflet-bar button {
width: 30px;
height: 30px;
line-height: 30px;
}

View File

@ -0,0 +1,379 @@
(function(){
// This is for grouping buttons into a bar
// takes an array of `L.easyButton`s and
// then the usual `.addTo(map)`
L.Control.EasyBar = L.Control.extend({
options: {
position: 'topleft', // part of leaflet's defaults
id: null, // an id to tag the Bar with
leafletClasses: true // use leaflet classes?
},
initialize: function(buttons, options){
if(options){
L.Util.setOptions( this, options );
}
this._buildContainer();
this._buttons = [];
for(var i = 0; i < buttons.length; i++){
buttons[i]._bar = this;
buttons[i]._container = buttons[i].button;
this._buttons.push(buttons[i]);
this.container.appendChild(buttons[i].button);
}
},
_buildContainer: function(){
this._container = this.container = L.DomUtil.create('div', '');
this.options.leafletClasses && L.DomUtil.addClass(this.container, 'leaflet-bar easy-button-container leaflet-control');
this.options.id && (this.container.id = this.options.id);
},
enable: function(){
L.DomUtil.addClass(this.container, 'enabled');
L.DomUtil.removeClass(this.container, 'disabled');
this.container.setAttribute('aria-hidden', 'false');
return this;
},
disable: function(){
L.DomUtil.addClass(this.container, 'disabled');
L.DomUtil.removeClass(this.container, 'enabled');
this.container.setAttribute('aria-hidden', 'true');
return this;
},
onAdd: function () {
return this.container;
},
addTo: function (map) {
this._map = map;
for(var i = 0; i < this._buttons.length; i++){
this._buttons[i]._map = map;
}
var container = this._container = this.onAdd(map),
pos = this.getPosition(),
corner = map._controlCorners[pos];
L.DomUtil.addClass(container, 'leaflet-control');
if (pos.indexOf('bottom') !== -1) {
corner.insertBefore(container, corner.firstChild);
} else {
corner.appendChild(container);
}
return this;
}
});
L.easyBar = function(){
var args = [L.Control.EasyBar];
for(var i = 0; i < arguments.length; i++){
args.push( arguments[i] );
}
return new (Function.prototype.bind.apply(L.Control.EasyBar, args));
};
// L.EasyButton is the actual buttons
// can be called without being grouped into a bar
L.Control.EasyButton = L.Control.extend({
options: {
position: 'topleft', // part of leaflet's defaults
id: null, // an id to tag the button with
type: 'replace', // [(replace|animate)]
// replace swaps out elements
// animate changes classes with all elements inserted
states: [], // state names look like this
// {
// stateName: 'untracked',
// onClick: function(){ handle_nav_manually(); };
// title: 'click to make inactive',
// icon: 'fa-circle', // wrapped with <a>
// }
leafletClasses: true, // use leaflet styles for the button
tagName: 'button',
},
initialize: function(icon, onClick, title, id){
// clear the states manually
this.options.states = [];
// add id to options
if(id != null){
this.options.id = id;
}
// storage between state functions
this.storage = {};
// is the last item an object?
if( typeof arguments[arguments.length-1] === 'object' ){
// if so, it should be the options
L.Util.setOptions( this, arguments[arguments.length-1] );
}
// if there aren't any states in options
// use the early params
if( this.options.states.length === 0 &&
typeof icon === 'string' &&
typeof onClick === 'function'){
// turn the options object into a state
this.options.states.push({
icon: icon,
onClick: onClick,
title: typeof title === 'string' ? title : ''
});
}
// curate and move user's states into
// the _states for internal use
this._states = [];
for(var i = 0; i < this.options.states.length; i++){
this._states.push( new State(this.options.states[i], this) );
}
this._buildButton();
this._activateState(this._states[0]);
},
_buildButton: function(){
this.button = L.DomUtil.create(this.options.tagName, '');
// the next three if statements should be collapsed into the options
// when it's time for breaking changes.
if (this.tagName === 'button') {
this.button.type = 'button';
}
if (this.options.id ){
this.button.id = this.options.id;
}
if (this.options.leafletClasses){
L.DomUtil.addClass(this.button, 'easy-button-button leaflet-bar-part leaflet-interactive');
}
// don't let double clicks and mousedown get to the map
L.DomEvent.addListener(this.button, 'dblclick', L.DomEvent.stop);
L.DomEvent.addListener(this.button, 'mousedown', L.DomEvent.stop);
// take care of normal clicks
L.DomEvent.addListener(this.button,'click', function(e){
L.DomEvent.stop(e);
this._currentState.onClick(this, this._map ? this._map : null );
this._map.getContainer().focus();
}, this);
// prep the contents of the control
if(this.options.type == 'replace'){
this.button.appendChild(this._currentState.icon);
} else {
for(var i=0;i<this._states.length;i++){
this.button.appendChild(this._states[i].icon);
}
}
},
_currentState: {
// placeholder content
stateName: 'unnamed',
icon: (function(){ return document.createElement('span'); })()
},
_states: null, // populated on init
state: function(newState){
// activate by name
if(typeof newState == 'string'){
this._activateStateNamed(newState);
// activate by index
} else if (typeof newState == 'number'){
this._activateState(this._states[newState]);
}
return this;
},
_activateStateNamed: function(stateName){
for(var i = 0; i < this._states.length; i++){
if( this._states[i].stateName == stateName ){
this._activateState( this._states[i] );
}
}
},
_activateState: function(newState){
if( newState === this._currentState ){
// don't touch the dom if it'll just be the same after
return;
} else {
// swap out elements... if you're into that kind of thing
if( this.options.type == 'replace' ){
this.button.appendChild(newState.icon);
this.button.removeChild(this._currentState.icon);
}
if( newState.title ){
this.button.title = newState.title;
} else {
this.button.removeAttribute('title');
}
// update classes for animations
for(var i=0;i<this._states.length;i++){
L.DomUtil.removeClass(this._states[i].icon, this._currentState.stateName + '-active');
L.DomUtil.addClass(this._states[i].icon, newState.stateName + '-active');
}
// update classes for animations
L.DomUtil.removeClass(this.button, this._currentState.stateName + '-active');
L.DomUtil.addClass(this.button, newState.stateName + '-active');
// update the record
this._currentState = newState;
}
},
enable: function(){
L.DomUtil.addClass(this.button, 'enabled');
L.DomUtil.removeClass(this.button, 'disabled');
this.button.setAttribute('aria-hidden', 'false');
return this;
},
disable: function(){
L.DomUtil.addClass(this.button, 'disabled');
L.DomUtil.removeClass(this.button, 'enabled');
this.button.setAttribute('aria-hidden', 'true');
return this;
},
removeFrom: function (map) {
this._container.parentNode.removeChild(this._container);
this._map = null;
return this;
},
onAdd: function(){
var containerObj = L.easyBar([this], {
position: this.options.position,
leafletClasses: this.options.leafletClasses
});
this._container = containerObj.container;
return this._container;
}
});
L.easyButton = function(/* args will pass automatically */){
var args = Array.prototype.concat.apply([L.Control.EasyButton],arguments);
return new (Function.prototype.bind.apply(L.Control.EasyButton, args));
};
/*************************
*
* util functions
*
*************************/
// constructor for states so only curated
// states end up getting called
function State(template, easyButton){
this.title = template.title;
this.stateName = template.stateName ? template.stateName : 'unnamed-state';
// build the wrapper
this.icon = L.DomUtil.create('span', '');
L.DomUtil.addClass(this.icon, 'button-state state-' + this.stateName.replace(/(^\s*|\s*$)/g,''));
this.icon.innerHTML = buildIcon(template.icon);
this.onClick = L.Util.bind(template.onClick?template.onClick:function(){}, easyButton);
}
function buildIcon(ambiguousIconString) {
var tmpIcon;
// does this look like html? (i.e. not a class)
if( ambiguousIconString.match(/[&;=<>"']/) ){
// if so, the user should have put in html
// so move forward as such
tmpIcon = ambiguousIconString;
// then it wasn't html, so
// it's a class list, figure out what kind
} else {
ambiguousIconString = ambiguousIconString.replace(/(^\s*|\s*$)/g,'');
tmpIcon = L.DomUtil.create('span', '');
if( ambiguousIconString.indexOf('fa-') === 0 ){
L.DomUtil.addClass(tmpIcon, 'fa ' + ambiguousIconString)
} else if ( ambiguousIconString.indexOf('glyphicon-') === 0 ) {
L.DomUtil.addClass(tmpIcon, 'glyphicon ' + ambiguousIconString)
} else {
L.DomUtil.addClass(tmpIcon, /*rollwithit*/ ambiguousIconString)
}
// make this a string so that it's easy to set innerHTML below
tmpIcon = tmpIcon.outerHTML;
}
return tmpIcon;
}
})();

View File

@ -0,0 +1,152 @@
L.Control.Fullscreen = L.Control.extend({
options: {
position: 'topleft',
title: {
'false': 'View Fullscreen',
'true': 'Exit Fullscreen'
}
},
onAdd: function (map) {
var container = L.DomUtil.create('div', 'leaflet-control-fullscreen leaflet-bar leaflet-control');
this.link = L.DomUtil.create('a', 'leaflet-control-fullscreen-button leaflet-bar-part', container);
this.link.href = '#';
this._map = map;
this._map.on('fullscreenchange', this._toggleTitle, this);
this._toggleTitle();
L.DomEvent.on(this.link, 'click', this._click, this);
return container;
},
_click: function (e) {
L.DomEvent.stopPropagation(e);
L.DomEvent.preventDefault(e);
this._map.toggleFullscreen(this.options);
},
_toggleTitle: function() {
this.link.title = this.options.title[this._map.isFullscreen()];
}
});
L.Map.include({
isFullscreen: function () {
return this._isFullscreen || false;
},
toggleFullscreen: function (options) {
var container = this.getContainer();
if (this.isFullscreen()) {
if (options && options.pseudoFullscreen) {
this._disablePseudoFullscreen(container);
} else if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else {
this._disablePseudoFullscreen(container);
}
} else {
if (options && options.pseudoFullscreen) {
this._enablePseudoFullscreen(container);
} else if (container.requestFullscreen) {
container.requestFullscreen();
} else if (container.mozRequestFullScreen) {
container.mozRequestFullScreen();
} else if (container.webkitRequestFullscreen) {
container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
} else if (container.msRequestFullscreen) {
container.msRequestFullscreen();
} else {
this._enablePseudoFullscreen(container);
}
}
},
_enablePseudoFullscreen: function (container) {
L.DomUtil.addClass(container, 'leaflet-pseudo-fullscreen');
this._setFullscreen(true);
this.fire('fullscreenchange');
},
_disablePseudoFullscreen: function (container) {
L.DomUtil.removeClass(container, 'leaflet-pseudo-fullscreen');
this._setFullscreen(false);
this.fire('fullscreenchange');
},
_setFullscreen: function(fullscreen) {
this._isFullscreen = fullscreen;
var container = this.getContainer();
if (fullscreen) {
L.DomUtil.addClass(container, 'leaflet-fullscreen-on');
} else {
L.DomUtil.removeClass(container, 'leaflet-fullscreen-on');
}
this.invalidateSize();
},
_onFullscreenChange: function (e) {
var fullscreenElement =
document.fullscreenElement ||
document.mozFullScreenElement ||
document.webkitFullscreenElement ||
document.msFullscreenElement;
if (fullscreenElement === this.getContainer() && !this._isFullscreen) {
this._setFullscreen(true);
this.fire('fullscreenchange');
} else if (fullscreenElement !== this.getContainer() && this._isFullscreen) {
this._setFullscreen(false);
this.fire('fullscreenchange');
}
}
});
L.Map.mergeOptions({
fullscreenControl: false
});
L.Map.addInitHook(function () {
if (this.options.fullscreenControl) {
this.fullscreenControl = new L.Control.Fullscreen(this.options.fullscreenControl);
this.addControl(this.fullscreenControl);
}
var fullscreenchange;
if ('onfullscreenchange' in document) {
fullscreenchange = 'fullscreenchange';
} else if ('onmozfullscreenchange' in document) {
fullscreenchange = 'mozfullscreenchange';
} else if ('onwebkitfullscreenchange' in document) {
fullscreenchange = 'webkitfullscreenchange';
} else if ('onmsfullscreenchange' in document) {
fullscreenchange = 'MSFullscreenChange';
}
if (fullscreenchange) {
var onFullscreenChange = L.bind(this._onFullscreenChange, this);
this.whenReady(function () {
L.DomEvent.on(document, fullscreenchange, onFullscreenChange);
});
this.on('unload', function () {
L.DomEvent.off(document, fullscreenchange, onFullscreenChange);
});
}
});
L.control.fullscreen = function (options) {
return new L.Control.Fullscreen(options);
};

View File

@ -0,0 +1 @@
L.Control.Fullscreen=L.Control.extend({options:{position:"topleft",title:{"false":"View Fullscreen","true":"Exit Fullscreen"}},onAdd:function(map){var container=L.DomUtil.create("div","leaflet-control-fullscreen leaflet-bar leaflet-control");this.link=L.DomUtil.create("a","leaflet-control-fullscreen-button leaflet-bar-part",container);this.link.href="#";this._map=map;this._map.on("fullscreenchange",this._toggleTitle,this);this._toggleTitle();L.DomEvent.on(this.link,"click",this._click,this);return container},_click:function(e){L.DomEvent.stopPropagation(e);L.DomEvent.preventDefault(e);this._map.toggleFullscreen(this.options)},_toggleTitle:function(){this.link.title=this.options.title[this._map.isFullscreen()]}});L.Map.include({isFullscreen:function(){return this._isFullscreen||false},toggleFullscreen:function(options){var container=this.getContainer();if(this.isFullscreen()){if(options&&options.pseudoFullscreen){this._disablePseudoFullscreen(container)}else if(document.exitFullscreen){document.exitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitCancelFullScreen){document.webkitCancelFullScreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else{this._disablePseudoFullscreen(container)}}else{if(options&&options.pseudoFullscreen){this._enablePseudoFullscreen(container)}else if(container.requestFullscreen){container.requestFullscreen()}else if(container.mozRequestFullScreen){container.mozRequestFullScreen()}else if(container.webkitRequestFullscreen){container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}else if(container.msRequestFullscreen){container.msRequestFullscreen()}else{this._enablePseudoFullscreen(container)}}},_enablePseudoFullscreen:function(container){L.DomUtil.addClass(container,"leaflet-pseudo-fullscreen");this._setFullscreen(true);this.fire("fullscreenchange")},_disablePseudoFullscreen:function(container){L.DomUtil.removeClass(container,"leaflet-pseudo-fullscreen");this._setFullscreen(false);this.fire("fullscreenchange")},_setFullscreen:function(fullscreen){this._isFullscreen=fullscreen;var container=this.getContainer();if(fullscreen){L.DomUtil.addClass(container,"leaflet-fullscreen-on")}else{L.DomUtil.removeClass(container,"leaflet-fullscreen-on")}this.invalidateSize()},_onFullscreenChange:function(e){var fullscreenElement=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;if(fullscreenElement===this.getContainer()&&!this._isFullscreen){this._setFullscreen(true);this.fire("fullscreenchange")}else if(fullscreenElement!==this.getContainer()&&this._isFullscreen){this._setFullscreen(false);this.fire("fullscreenchange")}}});L.Map.mergeOptions({fullscreenControl:false});L.Map.addInitHook(function(){if(this.options.fullscreenControl){this.fullscreenControl=new L.Control.Fullscreen(this.options.fullscreenControl);this.addControl(this.fullscreenControl)}var fullscreenchange;if("onfullscreenchange"in document){fullscreenchange="fullscreenchange"}else if("onmozfullscreenchange"in document){fullscreenchange="mozfullscreenchange"}else if("onwebkitfullscreenchange"in document){fullscreenchange="webkitfullscreenchange"}else if("onmsfullscreenchange"in document){fullscreenchange="MSFullscreenChange"}if(fullscreenchange){var onFullscreenChange=L.bind(this._onFullscreenChange,this);this.whenReady(function(){L.DomEvent.on(document,fullscreenchange,onFullscreenChange)});this.on("unload",function(){L.DomEvent.off(document,fullscreenchange,onFullscreenChange)})}});L.control.fullscreen=function(options){return new L.Control.Fullscreen(options)};

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

View File

@ -0,0 +1,40 @@
.leaflet-control-fullscreen a {
background:#fff url(fullscreen.png) no-repeat 0 0;
background-size:26px 52px;
}
.leaflet-touch .leaflet-control-fullscreen a {
background-position: 2px 2px;
}
.leaflet-fullscreen-on .leaflet-control-fullscreen a {
background-position:0 -26px;
}
.leaflet-touch.leaflet-fullscreen-on .leaflet-control-fullscreen a {
background-position: 2px -24px;
}
/* Do not combine these two rules; IE will break. */
.leaflet-container:-webkit-full-screen {
width:100%!important;
height:100%!important;
}
.leaflet-container.leaflet-fullscreen-on {
width:100%!important;
height:100%!important;
}
.leaflet-pseudo-fullscreen {
position:fixed!important;
width:100%!important;
height:100%!important;
top:0!important;
left:0!important;
z-index:99999;
}
@media
(-webkit-min-device-pixel-ratio:2),
(min-resolution:192dpi) {
.leaflet-control-fullscreen a {
background-image:url(fullscreen@2x.png);
}
}

Some files were not shown because too many files have changed in this diff Show More