Skip to content

Commit 35693f7

Browse files
committed
Update
Ajout de check download pour le future téléchargement de fichiers
1 parent 2dfa157 commit 35693f7

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

assets/controllers/table_check_controller.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { Controller } from "@hotwired/stimulus";
22

3+
/**
4+
* Update 20250917
5+
* assets/controllers/table_check_controller.js
6+
*/
37
export default class extends Controller {
4-
static targets = ["rowInputs", "itemDelete", "itemDirDelete"];
8+
static targets = ["rowInputs", "itemDownload", "itemDirDownload", "itemDelete", "itemDirDelete"];
59
static values = {
610
check: Array,
711
checkDir: Array
@@ -10,9 +14,11 @@ export default class extends Controller {
1014
connect()
1115
{
1216
console.log("Contrôleur table-check connecté !");
17+
// this.checkValue = []; // Initialise le tableau
1318
}
1419

1520
changes(event) {
21+
// console.log(event.target.closest('table'));
1622
this.checks(event.target.checked);
1723
}
1824

@@ -30,6 +36,7 @@ export default class extends Controller {
3036
this.checkValue = check; // Met à jour la valeur réactive
3137

3238
this.updateHiddenInput();
39+
// console.log(this.checkValue);
3340
}
3441

3542
check(event) {
@@ -42,12 +49,16 @@ export default class extends Controller {
4249
}
4350

4451
this.updateHiddenInput();
52+
// console.log(this.checkValue);
4553
}
4654

4755
updateHiddenInput() {
4856
if (this.hasItemDeleteTarget) {
4957
this.itemDeleteTarget.value = JSON.stringify(this.checkValue);
5058
}
59+
if (this.hasItemDownloadTarget) {
60+
this.itemDownloadTarget.value = JSON.stringify(this.checkValue);
61+
}
5162
}
5263

5364
checkDir(event) {
@@ -60,11 +71,15 @@ export default class extends Controller {
6071
}
6172

6273
this.updateHiddenDirInput();
74+
// console.log(this.checkDirValue);
6375
}
6476

6577
updateHiddenDirInput() {
6678
if (this.hasItemDirDeleteTarget) {
6779
this.itemDirDeleteTarget.value = JSON.stringify(this.checkDirValue);
6880
}
81+
if (this.hasItemDirDownloadTarget) {
82+
this.itemDirDownloadTarget.value = JSON.stringify(this.checkDirValue);
83+
}
6984
}
7085
}

src/Controller/FileManagerController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3+
/**
4+
* Update 20250917
5+
* src/Controller/FileManagerController.php
6+
*/
37
namespace Anfallnorr\FileManagerSystem\Controller;
48

59
use Anfallnorr\FileManagerSystem\Form\CreateFolderType;

src/Service/FileManagerService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
/**
4+
* Update 20250917
45
* Gestionnaire de fichiers pour récupérer les informations des fichiers et dossiers.
56
*/
67

0 commit comments

Comments
 (0)