Commit cdc068e4 authored by Jordan Breton's avatar Jordan Breton

Some bug fixes and interface adjustments.

parent 46cd40b6
Ce document est également disponible en [français](README.md)
# Foreword
The **wfw** framework (for Web FrameWork) have been designed to create websites, webservices and
more or less complicated web applications. It natively supports multilang and have been written in **PHP 7.2**.
The purpose is to provide a support to **Event-sourced** projects and a design which encourages
use of **CQRS**. If you want to know more about those principles, please takes a look to **Greg Young**'s
conferences on youtube.
The wfw design don't use a MVC pattern (and no one of it's derivatives) because it should
be used to design long-running process. Often missused, or used where it shouldn't, it leads
to structural problem in most web softwares. For more informations about this complex subject,
I let you take a look to a bunch of articles written by Tom Butler about MVC, including this one
beautifully entititled [MVC : Model-View-Confusion](https://r.je/views-are-not-templates.html).
Because of the way HTTP works, I choose to implements a handlers based architecture created to
be easy-to-use to create websites. I tried to make it flexible to handle most use-cases.
Furthermore, I decided to avoid use of third party libraries to keep control on the framework's
evolutions without depending on other projetcs and sustain it.
Code reuse is a beautifull concept, when applyed carefully. In my opinion, a project which depends
upon ten or more other projects become a maintenance nightmare after few years.
# Attribution
On of the wfw's principal concern is to avoid third party libraries, But I still integrated three of them
in the framework's core :
- [PHPMailer](https://github.com/PHPMailer/PHPMailer)
- [HTMLPurifier](http://htmlpurifier.org/)
- [Dice](https://github.com/Level-2/Dice)
Why ? Because those libraries seems essentials to me, and beacause it's far beyond what I can
ever do myself :
- **HTMLPurifier**, a very good protection against XSS.
- **PHPMailer**, which I shouldn't have to introduce, to easily send mails.
- **Dice**, the only one dependency injection container which is efficient and not over-complicated.
(To be as convinced as I am, please take the time to read [this](https://github.com/Level-2/Dice#performance)
about performances and it's well written documentation)
Finally, even if this libraries have been integrated in the framework's core, they can be
replaced by watever you want. I tried to design this framework as flexible as I can, so I
hope that it's a success.
# Documentation
The full documenation can be found on it's [dedicated website](https://wfwdoc.bee-color.fr).
# Contribution
Feel free to contribute !
I do my best to write this documentation in two langs : English and French. Since I'm a french
guy, I try to traduce it as I can, so please do not hesitate to correct me when I'm wrong, it
would be appreciated.
Finally, I try to produce a well written doc, as clear and detailed as possible, so, once again,
if something is missing or unclear, don't hesistate to contact me.
\ No newline at end of file
This document is also available in [english](README.en.md).
# Documentation update
# Avant-propos
**Since a major update is about to be released, the current documentation website is outdated and will
be entierly rewritten to be clearer and takes new functionnalities into consideration.**
Le framework **wfw** (pour Web FrameWork) est un framework prévu pour la réalisation
de sites web et/ou services et/ou application plus ou moins complexes et est
déjà équipé d'un système de gestion des langues et a été écrit en **PHP 7.2**.
# Foreword
Le but est de promouvoir un support de base pour la création de projets articulés autour
du principe **CQRS** et pour offrir un support de base à l'**Event-sourcing**. Si vous souhaitez
vous documenter sur ces sujets, n'hésitez pas à visionner les conférences de **Greg Young** et
de ses confrères.
The **wfw** framework (for Web FrameWork) have been designed to create websites, webservices and
more or less complicated web applications. It natively supports multilang and have been written in **PHP 7.2**.
Son architecture ne se base pas sur MVC (ou aucun autre de ses dérivés) parce
que ce pattern est avant tout destiné à des long-running process et qu'il est bien
souvent utilisé à tort et à travers, et souvent mal appliqué (je vous renvoie
sur les articles éclairés et documentés de Tom Butler sur ce design
pattern, et notamment les deux articles très justement appelés
[MVC : Model-View-Confusion](https://r.je/views-are-not-templates.html)).
The purpose is to provide a support to **Event-sourced** projects and a design which encourages
use of **CQRS**. If you want to know more about those principles, please takes a look to **Greg Young**'s
conferences on youtube.
Un serveur http ayant un fonctionnement totalement différent, j'ai choisi d'implémenter
un pattern personnalisé à base de handlers, prévu pour simplifier au maximum
la création de sites internet sans impacter le nombre de possibilités d'utilisation.
The wfw design don't use a MVC pattern (and no one of it's derivatives) because it should
be used to design long-running process. Often missused, or used where it shouldn't, it leads
to structural problem in most web softwares. For more informations about this complex subject,
I let you take a look to a bunch of articles written by Tom Butler about MVC, including this one
beautifully entititled [MVC : Model-View-Confusion](https://r.je/views-are-not-templates.html).
De plus, j'ai choisi volontairement de limiter au strict minimum le recours à
des librairies tierces afin de garder la maîtrise de l'évolution du framework
sans avoir à dépendre d'autres projets, afin de pérenniser mon travail.
Because of the way HTTP works, I choose to implements a handlers based architecture created to
be easy-to-use to create websites. I tried to make it flexible to handle most use-cases.
La réutilisation du code est une très bonne chose, lorsqu'elle est faite avec
intelligence et discernement. Un projet qui a besoin de plus de 10 autres projets
indépendants devient très difficile à maintenir avec le temps.
Furthermore, I decided to avoid use of third party libraries to keep control on the framework's
evolutions without depending on other projetcs and sustain it.
Code reuse is a beautifull concept, when applyed carefully. In my opinion, a project which depends
upon ten or more other projects become a maintenance nightmare after few years.
## Attribution :
# Attribution
Si l'un des principaux buts de ce framework est de limiter le recours aux dépendances
à d'autres projets, j'en ai tout de même intégré trois au coeur du framework :
- [PHPMailer](https://github.com/PHPMailer/PHPMailer)
On of the wfw's principal concern is to avoid third party libraries, But I still integrated three of them
in the framework's core :
- [PHPMailer](https://github.com/PHPMailer/PHPMailer)
- [HTMLPurifier](http://htmlpurifier.org/)
- [Dice](https://github.com/Level-2/Dice)
Pourquoi ? Parce que ces librairies me semblent parfaitement indispensables et
surtout sont bien plus abouties que tout ce que j'aurais pu coder moi même:
- **HTMLPurifier** est un projet brillant qui demande des connaissances que je ne
possède pas dans le domaine des failles XSS.
- **PHPMailer**, qu'il est inutile de présenter, est une fantastique librairie pour
les envois de mails.
- **Dice** est le seul conteneur d'injection de dépendances qui joue son rôle avec
efficacité sans dévier de son objectif principal. Ses performances rivalisent avec
les DIC les plus aboutis (et les surpassent même, voir les tests de performance
[ici](https://github.com/Level-2/Dice#performance)).
Il est par ailleurs à noter que ces librairies sont intégrées au coeur du framework,
mais peuvent être remplacées si vous le souhaitez par celles de votre choix.
WFW se veut totalement souple, et j'espère que ce pari est réussi.
Why ? Because those libraries seems essentials to me, and beacause it's far beyond what I can
ever do myself :
- **HTMLPurifier**, a very good protection against XSS.
- **PHPMailer**, which I shouldn't have to introduce, to easily send mails.
- **Dice**, the only one dependency injection container which is efficient and not over-complicated.
(To be as convinced as I am, please take the time to read [this](https://github.com/Level-2/Dice#performance)
about performances and it's well written documentation)
Finally, even if this libraries have been integrated in the framework's core, they can be
replaced by watever you want. I tried to design this framework as flexible as I can, so I
hope that it's a success.
# Documentation
La documentation complète est disponible sur un [site internet dédié](https://wfwdoc.bee-color.fr).
The full documenation can be found on it's [dedicated website](https://wfwdoc.bee-color.fr).
# Contribution
N'hésitez pas à contribuer !
Feel free to contribute !
Je fais actuellement de mon mieux pour essayer de proposer
la documentation en deux langues : anglais et français. Si vous avez des corrections
à apporter, ou des traductions à proposer, je les accepte volontiers.
I do my best to write this documentation in two langs : English and French. Since I'm a french
guy, I try to traduce it as I can, so please do not hesitate to correct me when I'm wrong, it
would be appreciated.
Enfin, je fais tout mon possible pour produire une documentation aussi claire et
détaillée que possible, mais je ne suis pas à l'abri d'erreurs, notamment dans
la documentation en anglais. Plus que votre indulgence, votre participation sera
grandement appréciée.
\ No newline at end of file
Finally, I try to produce a well written doc, as clear and detailed as possible, so, once again,
if something is missing or unclear, don't hesistate to contact me.
\ No newline at end of file
......@@ -140,7 +140,7 @@
"WARN_MEDIA_TYPE_ACCEPTED" : "Only audio mp3, video mp4 and picture files are allowed !",
"WAITING_SEND_FILE" : "Sending file in progress, please wait...",
"ERR_SERVER_REFUSES_FILE" : "The server can't save your file.\nOnly pictures, mp4 and mp3 files are allowed (max 300Mo) \nIf you sent a valid file, maybe your storage space is full, please remove useless files.",
"ADD_FILE" : "Add a file",
"ADD_FILE" : "Add files",
"REMOVE_SELECTED" : "Delete selected items",
"LOADING" : "Loading in progress, please wait..."
},
......@@ -231,6 +231,7 @@
"CONTACT_PANEL_TITLE" : "Message management",
"CONTACT_PANEL_HINT" : "Manage your messages",
"LOGOUT" : "Logout",
"DISCONNECTED" : "You've been disconnected",
"CONFIRM_LOGOUT" : "Do you really want to logout ?",
"YES" : "Yes",
"NO" : "No"
......
......@@ -140,7 +140,7 @@
"WARN_MEDIA_TYPE_ACCEPTED" : "Seuls les fichiers audio mp3, video mp4 et images sont admis !",
"WAITING_SEND_FILE" : "Envoi du/des fichier(s) en cours, veuillez patienter...",
"ERR_SERVER_REFUSES_FILE" : "Le serveur n'a pas pu enregistrer votre fichier.\nSeuls les fichiers images, mp3 et mp4 de moins de 300Mo sont acceptés !\nSi votre fichier est valide, c'est que votre espace de stockage est plein, pensez à supprimer les fichiers intuiles.",
"ADD_FILE" : "Ajouter un fichier",
"ADD_FILE" : "Ajouter un ou plusieurs fichiers",
"REMOVE_SELECTED" : "Supprimer le(s) élément(s) séléctionné(s)",
"LOADING" : "Chargement en cours, veuillez patienter..."
},
......@@ -219,34 +219,6 @@
"WAITING_MAIL" : "⏳ Confirmation e-mail",
"PWD_RESET" : "Récupération du mot de passe",
"WAITING_REGISTRATION" : "⏳ Confirmation d'inscription"
},
"management" : {
"settings" : {
"CHOOSE_PICTURE" : "Choisissez une image",
"CHOOSE" : "Choisir",
"WARN_ONLY_CHOOSE_ONE" : "Vous ne pouvez choisir qu'une seule image !",
"WARN_MUST_SELECT_PICTURE" : "Vous devez séléctionner une image !",
"CANCEL" : "Annuler",
"CHOOSE_LOGO" : "Choisissez un logo"
},
"legals" : {
"DESC" : "Mention",
"AUTO_CHK" : "Activé"
},
"SETTINGS" : "Entreprise",
"CLIENTS" : "Clients",
"PRODUCTS" : "Produits",
"SERVICES" : "Services",
"QUOTATIONS" : "Devis",
"INVOICES" : "Factures",
"ACCOUNTING" : "Comptabilité",
"SETTINGS_PANEL_TITLE" : "Gestion des paramètres de votre entreprise",
"CLIENTS_PANEL_TITLE" : "Gestion de vos clients",
"PRODUCTS_PANEL_TITLE" : "Gestion de vos produits",
"SERVICES_PANEL_TITLE" : "Gestion de vos services",
"QUOTATIONS_PANEL_TITLE" : "Gestion de vos devis",
"INVOICES_PANEL_TITLE" : "Gestion de vos factures",
"ACCOUNTING_PANEL_TITLE" : "Comptabilité"
}
},
"plugins" : {
......@@ -261,6 +233,7 @@
"CONTACT_PANEL_TITLE" : "Gestion de vos prises de contact",
"CONTACT_PANEL_HINT" : "Gérez vos prises de contact",
"LOGOUT" : "Se déconnecter",
"DISCONNECTED" : "Vous avez été deconnecté",
"CONFIRM_LOGOUT" : "Voulez-vous vraiment vous déconnecter ?",
"YES" : "Oui",
"NO" : "Non"
......
:root{
--adminPanel-color:#FF9900;
--adminPanel-color-lighter:#FFBB00;
--adminPanel-height:90%;
--adminPanel-width:90%;
--adminPanel-top:5%;
--adminPanel-left:5%;
--adminPanel-workSpace-scale : 0.935;
--adminPanel-leftBar : 6.5%;
--adminPanel-bottomBar : 6.5%;
--adminPanel-leftIcon-height : 70px;
--adminPanel-height:95%;
--adminPanel-width:95%;
--adminPanel-top:2.5%;
--adminPanel-left:2.5%;
--adminPanel-workSpace-scale : 0.95;
--adminPanel-leftBar : 5%;
--adminPanel-bottomBar : 5%;
--adminPanel-leftIcon-height : 60px;
--adminPanel-bottomIcon-width : 60px;
--adminPanel-settingsIcon-height : 40px;
--adminPanel-settingsIcon-width : 40px;
}
html{
height:100%;
......@@ -60,7 +63,7 @@ iframe{
box-sizing: border-box;
height:100%;
transition:all 0.35s;
width:80px;
width:var(--adminPanel-bottomIcon-width);
display:block;
margin:0;
}
......@@ -83,7 +86,7 @@ iframe{
.panel-bottom > .panel-item > * > svg{
height:100%;
box-sizing: border-box;
width:80px;
width:var(--adminPanel-bottomIcon-width);
}
.panel > .panel-item > * > svg polygon,
.panel > .panel-item > * > svg path{
......@@ -184,7 +187,7 @@ iframe{
.panel-bottom{
left:var(--adminPanel-leftBar);
bottom:-100%;
width:90%;
width:calc(100% - var(--adminPanel-leftBar));
height:var(--adminPanel-bottomBar);
}
#panel-command:checked ~ .panel-left{
......@@ -198,8 +201,8 @@ iframe{
bottom:20px;
left:20px;
cursor:pointer;
height:50px;
width:50px;
height:var(--adminPanel-settingsIcon-height);
width:var(--adminPanel-settingsIcon-width);
transition: all 0.35s;
}
.panel-main-button path{
......
......@@ -381,8 +381,9 @@
.lteditor-window.file-explorer{
padding:0;
height:80%;
width:80%;
height:95%;
max-height:95%;
width:95%;
border-radius: 0;
background-color: rgb(35,35,35);
display:flex;
......
......@@ -46,7 +46,8 @@ wfw.define("plugins/adminPanel/default", function ($params,$loadOrder,$hbTimeout
if ($sk in $defBtnParams) $mParams.btn = $defBtnParams[$sk];
else throw new Error("No btn field given for module " + $sk);
}
wfw.ui.adminPanel.get($k).appendChild($res = wfw.ui.adminPanel.createButton($sk,
wfw.ui.adminPanel.get($k).appendChild($res = wfw.ui.adminPanel.createButton(
$sk.replace(/\//g,"-"),
$mParams.btn.title,
$mParams.btn.icon,
$mParams.btn.panelTitle
......@@ -65,14 +66,14 @@ wfw.define("plugins/adminPanel/default", function ($params,$loadOrder,$hbTimeout
let $inputs = Array.from(document.querySelectorAll(".main-panel-display"));
$inputs.forEach(($i) => {
$i.addEventListener("change", () => {
let $m = $modules[$i.id.replace('-panel','')];
let $m = $modules[$i.id.replace('-panel','').replace(/-/g,"/")];
if ($i.checked){
if(typeof $m.show === 'function') $m.show();
$inputs.filter(($e) => {
return $i !== $e
}).forEach(($e) =>{
$e.checked = false;
let $m = $modules[$e.id.replace('-panel','')];
let $m = $modules[$e.id.replace('-panel','').replace(/-/g,"/")];
if(typeof $m.hide === 'function') $m.hide();
});
}else if(typeof $m.hide === 'function') $m.hide();
......@@ -84,7 +85,9 @@ wfw.define("plugins/adminPanel/default", function ($params,$loadOrder,$hbTimeout
});
$ready.forEach($fn=>$fn());
$loaded = true;
if($hbTimeout > 0) setInterval(()=>wfw.network.wfwAPI(wfw.webroot+"general/heartBeat"),$hbTimeout);
if($hbTimeout > 0) setInterval(()=>wfw.network.wfwAPI(wfw.webroot+"general/heartBeat",{
"403" : ($data)=>{alert($lstr('DISCONNECTED')); window.location.reload(true); }
}),$hbTimeout);
};
let $defBtnParams = {
users : {
......
......@@ -14,7 +14,7 @@ wfw.ready(()=>{
else $mediaWindow.parentNode.removeChild($mediaWindow);
};
let $fe = new wfw.ui.fileExplorer({
upload : {url:wfw.webroot+"uploader/uploadFile", paramName:{ file:'file',name:'name' }},
upload : {url:wfw.webroot+"uploader/uploadFile"},
delete : {url:wfw.webroot+"uploader/delete", paramName:{ paths:"paths" }},
rename : {url:wfw.webroot+"uploader/rename", paramName:{ oldPaths:"oldPaths",newPaths:"newPaths" }},
create : {url:wfw.webroot+"uploader/createPath", paramName:{ paths:"paths" }},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment