Skip to content
Snippets Groups Projects
Unverified Commit 73cbeeab authored by SofianeLasri's avatar SofianeLasri Committed by GitHub
Browse files

Upload du bout du module d'écans de chargements

parent 17f2737b
Branches pre-2.0
No related tags found
No related merge requests found
Showing
with 673 additions and 0 deletions
<?php
$loadingScreenId = $bdd->query("SELECT COUNT(*) FROM `vbcms-loadingscreeens`")->fetchColumn() + 1;
?>
<!-- Contenu -->
<div class="page-content" leftSidebar="240" rightSidebar="0">
<h3><?=$translation["loadingscreen_create"]?></h3>
<p>Vous pouvez créer plusieurs écrans de chargement.</p>
<div class="d-flex flex-column width-50em" id="page-content">
<h5>Prévisualisation</h5>
<div class="loadsingScreenPreviewTop rounded d-flex p-2 justify-content-center">
<div class="loadingScreenPreview rounded" style="background-image: url('https://api.apiflash.com/v1/urltoimage?access_key=65e037cb81b44087ba537b58dd19e4ff&format=jpeg&height=1080&quality=80&response_type=image&url=<?php echo urlencode($websiteUrl."loadingscreen/".$loadingScreenId."?preview"); ?>&width=1920');"></div>
</div>
<h5 class="mt-5">Paramètres</h5>
<form class="needs-validation" novalidate>
<div class="form-group">
<label>Nom de l'écran de chargement</label>
<input type="text" name="name" class="form-control" value="<?= $_GET["name"] ?? '' ?>" placeholder="Un super écran de chargement" required>
<div class="valid-feedback">
Nickel!
</div>
<div class="invalid-feedback">
Veuillez donner un nom à l'écran de chargement.
</div>
</div>
<label>Images de fond</label>
<div class="form-row">
<div class="col-md-6 mb-3">
<input type="text" id="backgroundPics" name="backgroundPics" class="form-control" value="<?= $_GET["backgroundPics"] ?? '[]' ?>" required readonly>
<div class="valid-feedback">
Nickel!
</div>
<div class="invalid-feedback">
Veuillez choisir des images de fond
</div>
</div>
<div class="col-md-6 mb-3">
<button type="button" onclick="openGallery('backgroundPics')" id="chooseBackgroundPics" class="btn btn-brown">Choisir des images</button>
</div>
</div>
<button type="submit" name="submit" class="btn btn-brown">Créer l'écran de chargement</button>
</form>
</div>
</div>
<div class="modal fade" id="galleryModal" tabindex="-1">
<div class="modal-dialog galleryIncludeModal">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Choisir une image</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<!-- C'est ici que la galerie est incluse -->
<div class="modal-body">
<div id="alertContainer">
</div>
<div id="includeGallery"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var element = "";
(function() {
'use strict';
window.addEventListener('load', function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false);
})();
function openGallery(element){
$('#galleryModal').modal('toggle');
if ($('#includeGallery').html()=="")
$('#includeGallery').load('<?=$websiteUrl?>vbcms-content/modules/vbcms-filemanager/admin/gallery-include.php');
element = this.element;
}
// Contournement pour ne sélectionner que les images
function openViewer(path){
$("#websiteLogoPreview").css("background", "url(\"<?=$websiteUrl?>vbcms-content/uploads"+path+"\"),linear-gradient(180deg, rgba(65,65,65,1) 0%, rgba(1,1,1,1) 100%)");
$("#websiteLogo").val("<?=$websiteUrl?>vbcms-content/uploads"+path);
$('#galleryModal').modal('hide');
}
function openVideo(path){
$('#alertContainer').html("\
<div id=\"fileChooseAlert\" class=\"alert alert-warning alert-dismissible fade show\" role=\"alert\">\
<strong>Désolé,</strong> mais le fichier sélectionné ne semble pas être une image. :/\
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\
<span aria-hidden=\"true\">&times;</span>\
</button>\
</div>\
");
}
</script>
\ No newline at end of file
<!-- Contenu -->
<div class="page-content" leftSidebar="240" rightSidebar="0">
<h3><?=$translation["loadingscreens_list"]?></h3>
<p></p>
<div class="d-flex flex-column" id="page-content">
<div class="d-flex flex-wrap">
<div class="ld-card border rounded mx-1 my-1" style="background-image: url('https://sofianelasri.mtxserv.com/vbcms-content/uploads/stayonline.jpg');">
<div class="ld-card-content p-2">
<span><strong>Un super loading screen</strong></span>
<a href="#" class="btn btn-sm btn-brown float-right">Modifier</a>
</div>
</div>
<div class="ld-card border rounded mx-1 my-1" style="background-image: url('https://sofianelasri.mtxserv.com/vbcms-content/uploads/doubleload.jpg');">
<div class="ld-card-content p-2">
<span><strong>Un super loading screen</strong></span>
<a href="#" class="btn btn-sm btn-brown float-right">Modifier</a>
</div>
</div>
<div class="ld-card border rounded mx-1 my-1" style="background-image: url('https://sofianelasri.mtxserv.com/vbcms-content/uploads/themeTopImage.jpg');">
<div class="ld-card-content p-2">
<span><strong>Un super loading screen</strong></span>
<a href="#" class="btn btn-sm btn-brown float-right">Modifier</a>
</div>
</div>
<div class="ld-card border rounded mx-1 my-1" style="background-image: url('https://sofianelasri.mtxserv.com/vbcms-content/uploads/scp2.jpg');">
<div class="ld-card-content p-2">
<span><strong>Un super loading screen</strong></span>
<a href="#" class="btn btn-sm btn-brown float-right">Modifier</a>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<!-- Contenu -->
<div class="page-content" leftSidebar="240" rightSidebar="0">
<h3><?=$translation["loadingscreens_themes"]?></h3>
<p>Les thèmes de VBcms 1 ont été portés.</p>
<div class="d-flex flex-column" id="page-content">
<div class="d-flex flex-wrap">
<?php
$themes = $bdd->query("SELECT * FROM `vbcms-themes` WHERE designedFor = 6")->fetchAll(PDO::FETCH_ASSOC);
foreach ($themes as $theme) {
$themePath = $GLOBALS['vbcmsRootPath']."/vbcms-content/themes".$theme['path'];
$themeInfos = json_decode(file_get_contents($themePath."/theme.json") ,true);
echo '
<div class="ld-card border rounded" style="background-image: url(\''.$GLOBALS['websiteUrl']."/vbcms-content/themes".$theme['path'].'/themeLargePic.jpg\');">
<div class="ld-card-content p-2">
<span><strong>'.$themeInfos['showname'].'</strong></span>
<a href="/create?themeId='.$themeInfos['workshopId'].'" class="btn btn-sm btn-brown float-right">Choisir</a>
</div>
</div>';
}
?>
</div>
</div>
</div>
\ No newline at end of file
.ld-card{
position: relative;
width: 27em;
height: 15em;
background-color: #dadada;
overflow: hidden;
background-size: cover;
}
.ld-card-content{
position: absolute;
width: 100%;
bottom: 0;
background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75));
color: white;
}
.loadsingScreenPreviewTop {
width: 100%;
background-color: var(--mainBrown);
}
.loadingScreenPreview{
position: relative;
width: 34em;
height: 19em;
background-size: cover;
}
\ No newline at end of file
<?php
switch ($language) {
case "FR":
include $_SERVER['DOCUMENT_ROOT'].'/vbcms-content/modules/vbcms-loadingscreen/includes/translations/FR.php';
break;
case "EN":
include $_SERVER['DOCUMENT_ROOT'].'/vbcms-content/modules/vbcms-loadingscreen/includes/translations/EN.php';
break;
default:
include $_SERVER['DOCUMENT_ROOT'].'/vbcms-content/modules/vbcms-loadingscreen/includes/translations/FR.php';
break;
}
?>
\ No newline at end of file
<?php
print_r($GLOBALS['params']);
echo "string";
\ No newline at end of file
<?php
function getSizeName($numOctets){
// Array contenant les differents unités
$unite = array('octet','ko','mo','go');
if ($numOctets < 1000){
return $numOctets.$unite[0];
} else {
if ($numOctets < 1000000){
$ko = round($numOctets/1024,2);
return $ko.$unite[1];
} else {
if ($numOctets < 1000000000){
$mo = round($numOctets/(1024*1024),2);
return $mo.$unite[2];
} else{ //Normalement on est pas censé attendre le Gigaoctet sur VBcms -> /!\ int 32bit = 2Go
$go = round($numOctets/(1024*1024*1024),2);
return $go.$unite[3];
}
}
}
}
function getFolderContent($dir, $type) {
global $uploadFolderPath, $bdd;
if (substr($dir, -1)=="/") {
$dir=substr($dir, 0, -1);
}
$results = array();
$response = $bdd->prepare("SELECT * FROM `vbcms-folders` WHERE fullpath = ?");
$response->execute([$dir]);
if (empty($response->fetch())) {
$response = $bdd->prepare("INSERT INTO `vbcms-folders` (id, name, fullpath) VALUES (?,?,?)");
$response->execute([null, basename($dir), $dir]);
}
if (strpos($dir, $uploadFolderPath)===false){ //Si le chemin complet n'est pas déjà indiqué
$fullDir = $uploadFolderPath.$dir;
} else {
$fullDir = $dir;
}
if (substr($dir, -1)=="/") {// Permet de check si le dossier a un / à la fin
// A MODIFIER CAR CA SERT A RIEN
$directorySeparator="";
}else{
$directorySeparator="/";
}
$files = scandir($fullDir);
if ($type == 0){ // Liste tout récursivement
foreach ($files as $key => $value) {
$path = $fullDir.$directorySeparator.$value;
if (!is_dir($path)) {
$results[] = $path;
} else if ($value != "." && $value != "..") {
$results[] = $path;
$results=array_merge($results, getFolderContent($path, 0));
}
}
} elseif ($type == 1) { // liste les fichiers et dossiers
foreach ($files as $key => $value) {
$path = $fullDir.$directorySeparator.$value;
if (!is_dir($path)) {
$securePath = str_replace($uploadFolderPath, "", $path);
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent
$response->execute([$dir]);
$parentId = $response->fetch();
//Cherche si le fichier est déjà indexé
$response = $bdd->prepare("SELECT id FROM `vbcms-files` WHERE parentFolder = ? AND name = ?"); // Je récupère l'id du dossier parent
$response->execute([$parentId[0], basename($securePath)]);
if (empty($response->fetch())){
$response = $bdd->prepare("INSERT INTO `vbcms-files` (id, name, parentFolder, size, title, description, articles) VALUES (?,?,?,?,?,?,?)");
$response->execute([null, basename($securePath), $parentId[0], filesize($path), "", "", "[]"]);
}
$results[] = $path;
} else if ($value != "." && $value != "..") {
$results[] = $path;
}
}
} elseif ($type == 2) { //Liste uniquement les dossiers
foreach ($files as $key => $value) {
$path = $fullDir.$directorySeparator.$value;
if (is_dir($path) && $value != "." && $value != "..") {
$results[] = $path;
}
}
} elseif ($type == 3) { //Liste uniquement les fichiers
foreach ($files as $key => $value) {
$path = $fullDir.$directorySeparator.$value;
if (!is_dir($path)) {
$securePath = str_replace($uploadFolderPath, "", $path);
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent
$response->execute([$dir]);
$parentId = $response->fetch();
//Cherche si le fichier est déjà indexé
$response = $bdd->prepare("SELECT id FROM `vbcms-files` WHERE parentFolder = ? AND name = ?"); // Je récupère l'id du dossier parent
$response->execute([$parentId[0], basename($securePath)]);
if (empty($response->fetch())){
$response = $bdd->prepare("INSERT INTO `vbcms-files` (id, name, parentFolder, size, title, description, articles) VALUES (?,?,?,?,?,?,?)");
$response->execute([null, basename($securePath), $parentId[0], filesize($path), "", "", "[]"]);
}
$results[] = $path;
}
}
}
for ($i=0;$i<count($results);$i++) {
$results[$i]=str_replace($uploadFolderPath, "", $results[$i]);
}
return $results;
}
function deleteContent($path, $alreadyFullPath){
global $uploadFolderPath, $bdd;
if ($alreadyFullPath) {
$fullPath = $path;
} else {
$fullPath = $uploadFolderPath.$path;
}
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier
$response->execute([$path]);
$folderId = $response->fetch();
if (is_dir($fullPath)) {
//echo "Suppression du dossier";
$scan = getFolderContent($path, 0);
foreach ($scan as $element) {
if (strpos($element, $uploadFolderPath)===false) { //S'il ne s'agit pas du chemin d'accès complet
$element = $uploadFolderPath.$element; //Je le créé
}
if (is_dir($element)) {
deleteContent($element, true);
} else {
if (unlink($element)) { //Supprime le fichier et vérifie que c'est bon
$response = $bdd->prepare("DELETE FROM `vbcms-files` WHERE parentFolder = ?");
$response->execute([$folderId[0]]);
} else {
echo "Impossible de supprimer le fichier";
}
}
}
if (rmdir($fullPath)) { //Supprime le dossier et vérifie que c'est bon
$response = $bdd->prepare("DELETE FROM `vbcms-folders` WHERE id = ?");
$response->execute([$folderId[0]]);
} else {
echo "Impossible de supprimer le dossier";
}
} else {
//echo "Suppression du fichier";
if (unlink($fullPath)) { //Supprime le fichier et vérifie que c'est bon
$response = $bdd->prepare("DELETE FROM `vbcms-files` WHERE parentFolder = ?");
$response->execute([$folderId[0]]);
} else {
echo "Impossible de supprimer le fichier";
}
}
}
function getFileDetails($filePath){ //string ou id
global $uploadFolderPath, $bdd;
$details = array();
if (!is_numeric($filePath)) {
array_push($details, basename($filePath)); //Ajoute le nom du fichier
array_push($details, getSizeName(filesize($uploadFolderPath.$filePath))); //Ajoute la taille du fichier en questions
if (filemtime($uploadFolderPath.$filePath)!=false) {
array_push($details, date("F d Y H:i:s.", filemtime($uploadFolderPath.$filePath))); //Ajout de la date de modification
}else{
array_push($details, "Date inconnue");
}
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent
$response->execute([dirname($filePath)]);
$parentId = $response->fetch();
$response = $bdd->prepare("SELECT * FROM `vbcms-files` WHERE parentFolder = ? AND name = ?"); // Je récupère l'id du dossier parent
$response->execute([$parentId[0], basename($filePath)]);
$response = $response->fetch(PDO::FETCH_ASSOC);
array_push($details, $response["title"]);
array_push($details, $response["description"]);
array_push($details, $response["id"]);
array_push($details, $filePath);
}else{
$response = $bdd->prepare("SELECT * FROM `vbcms-files` WHERE id = ?"); // Je récupère l'id du dossier parent
$response->execute([$filePath]);
$response = $response->fetch(PDO::FETCH_ASSOC);
$parentId = $response["parentFolder"];
$filename = $response["name"];
array_push($details, $response["name"]); //Ajoute le nom du fichier
array_push($details, getSizeName($response["size"])); //Ajoute la taille du fichier en questions
$response2 = $bdd->prepare("SELECT * FROM `vbcms-folders` WHERE id = ?"); // Je récupère le fullpath
$response2->execute([$parentId]);
$response2 = $response2->fetch(PDO::FETCH_ASSOC);
if (filemtime($uploadFolderPath.$response2["fullpath"]."/".$filename)!=false) {
array_push($details, date("F d Y H:i:s.", filemtime($uploadFolderPath.$response2["fullpath"]."/".$filename))); //Ajout de la date de modification
}else{
array_push($details, "Date inconnue");
}
array_push($details, $response["title"]);
array_push($details, $response["description"]);
array_push($details, $response["id"]);
$response = $bdd->prepare("SELECT * FROM `vbcms-folders` WHERE id = ?"); // Je récupère le fullpath
$response->execute([$parentId]);
$response = $response->fetch(PDO::FETCH_ASSOC);
array_push($details, $response2["fullpath"]."/".$filename);
}
return $details;
}
function getFolderDetails($folderPath){
global $uploadFolderPath, $bdd;
$details = array();
if (!is_numeric($folderPath)) {
array_push($details, basename($folderPath)); //Ajoute le nom du fichier
array_push($details, getSizeName(filesize($uploadFolderPath.$folderPath))); //Ajoute la taille du fichier en questions
if (filemtime($uploadFolderPath.$folderPath)!=false) {
array_push($details, date("F d Y H:i:s.", filemtime($uploadFolderPath.$folderPath))); //Ajout de la date de modification
}else{
array_push($details, "Date inconnue");
}
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent
$response->execute([$folderPath]);
$response = $response->fetch(PDO::FETCH_ASSOC);
array_push($details, $response["id"]);
array_push($details, $folderPath);
}else{
$response = $bdd->prepare("SELECT * FROM `vbcms-folders` WHERE id = ?"); // Je récupère l'id du dossier parent
$response->execute([$folderPath]);
$response = $response->fetch(PDO::FETCH_ASSOC);
array_push($details, $response["name"]); //Ajoute le nom du fichier
array_push($details, getSizeName(filesize($uploadFolderPath.$response["fullpath"]))); //Ajoute la taille du fichier en questions
if (filemtime($uploadFolderPath.$response["fullpath"])!=false) {
array_push($details, date("F d Y H:i:s.", filemtime($uploadFolderPath.$response["fullpath"]))); //Ajout de la date de modification
}else{
array_push($details, "Date inconnue");
}
array_push($details, $response["id"]);
array_push($details, $response["fullpath"]);
}
return $details;
}
function updateFileDetails($path, $title, $description){
global $bdd;
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent
$response->execute([dirname($path)]);
$parentId = $response->fetch();
$filename = basename($path);
$response = $bdd->prepare("SELECT id FROM `vbcms-files` WHERE parentFolder = ? AND name = ?"); // Je récupère l'id du dossier parent
$response->execute([$parentId[0], basename($path)]);
$fileId = $response->fetch();
$response = $bdd->prepare("UPDATE `vbcms-files` SET title= ?, description=? WHERE id = ?");
$response->execute([$title, $description, $fileId[0]]);
}
function renameFile($path, $name){
global $uploadFolderPath, $bdd;
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent
$response->execute([dirname($path)]);
$parentId = $response->fetch();
$filename = basename($path);
$response = $bdd->prepare("SELECT id FROM `vbcms-files` WHERE parentFolder = ? AND name = ?"); // Je récupère l'id du dossier parent
$response->execute([$parentId[0], basename($path)]);
$fileId = $response->fetch();
rename($uploadFolderPath.$path, $uploadFolderPath.dirname($path)."/".$name);
$response = $bdd->prepare("UPDATE `vbcms-files` SET name= ? WHERE id = ?");
$response->execute([$name, $fileId[0]]);
}
function copyMove($path, $destination, $action){
global $uploadFolderPath, $bdd;
if ($action == "copy") {
copy($uploadFolderPath.$path, $uploadFolderPath.$destination);
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent original
$response->execute([dirname($path)]);
$parentId = $response->fetch();
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent de destination
$response->execute([dirname($destination)]);
$parentDestId = $response->fetch();
$response = $bdd->prepare("INSERT INTO `vbcms-files` (id, name, parentFolder, size, title, description, articles) VALUES (?,?,?,?,?,?,?)"); // Je créé la ligne du nouveau fichier
$response->execute([null, basename($destination), $parentDestId[0], filesize($uploadFolderPath.$destination), "", "", "[]"]);
} elseif($action == "move"){
copy($uploadFolderPath.$path, $uploadFolderPath.$destination);
unlink($uploadFolderPath.$path);
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent original
$response->execute([dirname($path)]);
$parentId = $response->fetch();
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent de destination
$response->execute([dirname($destination)]);
$parentDestId = $response->fetch();
$response = $bdd->prepare("SELECT id FROM `vbcms-files` WHERE parentFolder = ? AND name = ?"); // Je récupère l'id du fichier à délacer
$response->execute([$parentId[0], basename($path)]);
$fileId = $response->fetch();
$response = $bdd->prepare("UPDATE `vbcms-files` SET name= ?, parentFolder= ? WHERE parentFolder = ? AND name = ?"); // Je modifie les données en question
$response->execute([basename($destination),$parentDestId[0] ,$parentId[0], basename($path)]);
}
}
function deleteFileFolder($path){
global $uploadFolderPath, $bdd;
if (is_dir($uploadFolderPath.$path)) { // Si c'est un dossier
$filesFolders=getFolderContent($path, 1); // Alors je scan le contenu du dossier
foreach ($filesFolders as $object) { // Et je supprime tous les éléments 1 par 1
deleteFileFolder($object);
}
$response = $bdd->prepare("DELETE FROM `vbcms-folders` WHERE fullpath = ?"); // Je supprime le dossier
$response->execute([$path]);
rmdir($uploadFolderPath.$path);
} else {
unlink($uploadFolderPath.$path);
$response = $bdd->prepare("SELECT id FROM `vbcms-folders` WHERE fullpath = ?"); // Je récupère l'id du dossier parent
$response->execute([dirname($path)]);
$parentId = $response->fetch();
$filename = basename($path);
$response = $bdd->prepare("SELECT id FROM `vbcms-files` WHERE parentFolder = ? AND name = ?"); // Je récupère l'id du fichier
$response->execute([$parentId[0], basename($path)]);
$fileId = $response->fetch();
$response = $bdd->prepare("DELETE FROM `vbcms-files` WHERE id = ?"); // Je supprime le fichier
$response->execute([$fileId[0]]);
}
}
function createFolder($path){
global $uploadFolderPath, $bdd;
mkdir($uploadFolderPath.$path, 0755);
$response = $bdd->prepare("INSERT INTO `vbcms-folders` (id, name, fullpath) VALUES (?,?,?)");
$response->execute([null, basename($path), $path]);
}
?>
\ No newline at end of file
<?php
// Traduction module de site internet
$translation["loadingscreen"] = "Écran de chargement";
$translation["loadingscreens"] = "Écrans de chargement";
$translation["loadingscreen_create"] = "Créer un loadingscreen";
$translation["loadingscreen_modify"] = "Modifier un loadingscreen";
$translation["loadingscreens_list"] = "Liste des loadingscreens";
$translation["loadingscreens_themes"] = "Thèmes";
$translation["sample"] = "sample";
$translation["sample"] = "sample";
$translation["sample"] = "sample";
?>
\ No newline at end of file
<?php
// Page d'initialisation
adminNavbarAddCategory("vbcms-loadingscreen-system", "loadingscreen");
adminNavbarAddItem("vbcms-loadingscreen-system", "fa-plus-circle", "loadingscreen_create", "/vbcms-admin/loadingscreen/create");
adminNavbarAddItem("vbcms-loadingscreen-system", "fa-list", "loadingscreens_list", "/vbcms-admin/loadingscreen/list");
adminNavbarAddItem("vbcms-loadingscreen-system", "fa-brush", "loadingscreens_themes", "/vbcms-admin/loadingscreen/themes");
//Création des tables
$bdd->query("CREATE TABLE IF NOT EXISTS `vbcms-loadingscreeens` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`themeId` INT(11) NOT NULL,
`name` INT(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;");
$bdd->query("CREATE TABLE IF NOT EXISTS `vbcms-tempLoadingscreeens` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`themeId` INT(11) NOT NULL,
`name` INT(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;");
$bdd->query("CREATE TABLE IF NOT EXISTS `vbcms-loadingscreensParameters` (
`loadingScreenId` INT(11) NOT NULL,
`name` VARCHAR(128) NOT NULL,
`value` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`loadingScreenId`, `name`)
) ENGINE = InnoDB;");
?>
\ No newline at end of file
vbcms-content/modules/vbcms-loadingscreen/module-logo.jpg

1.6 KiB

{
"workshopId" : "6",
"requiredModules" : "[3]",
"name": "vbcms-loadingscreen-system",
"showname": "Système d'écran de chargement",
"version": "1.0",
"compatible": "2.0",
"author": "76561198148455403",
"description": "Il s'agit du système d'écran de chargement de base de VBcms.",
"clientAccess": "loadingscreen",
"adminAccess": "loadingscreen"
}
\ No newline at end of file
<?php
// Je rappel qu'on a $type et $params
$params = $moduleParams;
$uploadFolderPath = $GLOBALS['vbcmsRootPath'].'/vbcms-content/uploads';
if($type=="admin") {
// Variables nécessaire à création d'une page
$pageDepedencies = '<link href="'.$websiteUrl.'vbcms-content/modules/vbcms-loadingscreen/assets/css/admin.css" rel="stylesheet">';
if ($params[1]=="create") {
// Variables Modifier la navbar à création d'une page
$pageTitle = $translation["loadingscreen_create"];
$pageToInclude = $GLOBALS['vbcmsRootPath']."/vbcms-content/modules/vbcms-loadingscreen/admin/create.php";
createModulePage($pageTitle, "", $pageDepedencies, $pageToInclude, 0);
}elseif ($params[1]=="list") {
// Variables Modifier la navbar à création d'une page
$pageTitle = $translation["loadingscreens_list"];
$pageToInclude = $GLOBALS['vbcmsRootPath']."/vbcms-content/modules/vbcms-loadingscreen/admin/list.php";
createModulePage($pageTitle, "", $pageDepedencies, $pageToInclude, 0);
}elseif ($params[1]=="themes") {
// Variables Modifier la navbar à création d'une page
$pageTitle = $translation["loadingscreens_themes"];
$pageToInclude = $GLOBALS['vbcmsRootPath']."/vbcms-content/modules/vbcms-loadingscreen/admin/themes.php";
createModulePage($pageTitle, "", $pageDepedencies, $pageToInclude, 0);
}
}elseif($type=="client"){
if (!empty($params[0])) {
echo $params[0];
}
}
// Fonctions publiques
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment