This commit is contained in:
Fred Tempez 2023-03-28 13:20:32 +02:00
commit 8194ef7c67
3 changed files with 133 additions and 89 deletions

View File

@ -1306,5 +1306,9 @@ class common
} }
$zip->close(); $zip->close();
} }
<<<<<<<<< Temporary merge branch 1
} }
=========
}
>>>>>>>>> Temporary merge branch 2

View File

@ -56,6 +56,10 @@ class user extends common
public static $languagesInstalled = []; public static $languagesInstalled = [];
public static $sharePath = [
'/site/file/source/'
];
/** /**
* Ajout * Ajout
*/ */
@ -488,12 +492,15 @@ class user extends common
]); ]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'user/group', 'redirect' => helper::baseUrl() . 'user/group',
'notification' => helper::translate('Modifications enregistrées'), 'notification' => helper::translate('Modifications enregistrées'),
'state' => true 'state' => true
]); ]);
} }
self::$sharePath = $this->getSubdirectories('./site/file/source');
self::$sharePath = array_flip(self::$sharePath);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => helper::translate('Editer groupe'), 'title' => helper::translate('Editer groupe'),
@ -878,4 +885,35 @@ class user extends common
exit(); exit();
} }
/**
* Liste les dossier contenus dans RFM
*/
function getSubdirectories($dir, $basePath = '') {
$subdirs = array();
// Ouvrez le répertoire spécifié
$dh = opendir($dir);
// Parcourez tous les fichiers et répertoires dans le répertoire
while (($file = readdir($dh)) !== false) {
// Ignorer les entrées de répertoire parent et actuel
if ($file == '.' || $file == '..') {
continue;
}
// Construisez le chemin complet du fichier ou du répertoire
$path = $dir . '/' . $file;
// Vérifiez si c'est un répertoire
if (is_dir($path)) {
// Construisez la clé et la valeur pour le tableau associatif
$key = $basePath . '/' . $file;
$value = $path . '/';
// Ajouter la clé et la valeur au tableau associatif
$subdirs[$key] = $value;
// Appeler la fonction récursivement pour ajouter les sous-répertoires
$subdirs = array_merge($subdirs, $this->getSubdirectories($path, $key));
}
}
// Fermez le gestionnaire de dossier
closedir($dh);
return $subdirs;
}
} }

View File

@ -18,66 +18,62 @@
<?php echo helper::translate('Opérations sur les fichiers'); ?> <?php echo helper::translate('Opérations sur les fichiers'); ?>
</h4> </h4>
<div class="row"> <div class="row">
<div class="col12"> <div class="col2">
<div class="row"> <?php echo template::checkbox('groupEditDownload', true, 'Téléchargement', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'download'])
<?php echo template::checkbox('groupEditDownload', true, 'Téléchargement', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'download']) </div>
]); ?> <div class="col2">
</div> <?php echo template::checkbox('groupEditEdit', true, 'Edition', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'edit'])
<?php echo template::checkbox('groupEditEdit', true, 'Edition', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'edit']) </div>
]); ?> <div class="col2">
</div> <?php echo template::checkbox('groupEditCreate', true, 'Création', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'create'])
<?php echo template::checkbox('groupEditCreate', true, 'Création', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'create']) </div>
]); ?> <div class="col2">
</div> <?php echo template::checkbox('groupEditRename', true, 'Nommage', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'rename'])
<?php echo template::checkbox('groupEditRename', true, 'Nommage', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'rename']) </div>
]); ?> <div class="col2">
</div> <?php echo template::checkbox('groupEditUpload', true, 'Téléversement', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'upload'])
<?php echo template::checkbox('groupEditUpload', true, 'Téléversement', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'upload']) </div>
]); ?> <div class="col2">
</div> <?php echo template::checkbox('groupEditDelete', true, 'Effacement', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'delete'])
<?php echo template::checkbox('groupEditDelete', true, 'Effacement', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'delete']) </div>
]); ?> </div>
</div> <div class="row">
</div> <div class="col2">
<div class="row"> <?php echo template::checkbox('groupEditPreview', true, 'Prévisualisation', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'preview'])
<?php echo template::checkbox('groupEditPreview', true, 'Prévisualisation', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'preview']) </div>
]); ?> <div class="col2">
</div> <?php echo template::checkbox('groupEditDuplicate', true, 'Duplication', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'duplicate'])
<?php echo template::checkbox('groupEditDuplicate', true, 'Duplication', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'duplicate']) </div>
]); ?> <div class="col2">
</div> <?php echo template::checkbox('groupEditExtract', true, 'Extraction', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'extract'])
<?php echo template::checkbox('groupEditExtract', true, 'Extraction', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'extract']) </div>
]); ?> <div class="col2">
</div> <?php echo template::checkbox('groupEditCopycut', true, 'Coupé collé', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'copycut'])
<?php echo template::checkbox('groupEditCopycut', true, 'Coupé collé', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'copycut']) </div>
]); ?> <div class="col2">
</div> <?php echo template::checkbox('groupEditPermission', true, 'Permissions', [
<div class="col2"> 'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'permission'])
<?php echo template::checkbox('groupEditPermission', true, 'Permissions', [ ]); ?>
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'permission'])
]); ?>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -90,34 +86,40 @@
<?php echo helper::translate('Opérations sur les dossiers'); ?> <?php echo helper::translate('Opérations sur les dossiers'); ?>
</h4> </h4>
<div class="row"> <div class="row">
<div class="col12">
<div class="row"> <div class="col2">
<div class="col2"> <?php echo template::checkbox('groupEditFolderCreate', true, 'Création', [
<?php echo template::checkbox('groupEditFolderCreate', true, 'Création', [ 'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'create'])
'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'create']) ]); ?>
]); ?> </div>
</div> <div class="col2">
<div class="col2"> <?php echo template::checkbox('groupEditFolderDelete', true, 'Effacement', [
<?php echo template::checkbox('groupEditFolderDelete', true, 'Effacement', [ 'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'delete'])
'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'delete']) ]); ?>
]); ?> </div>
</div> <div class="col2">
<div class="col2"> <?php echo template::checkbox('groupEditFolderRename', true, 'Nommage', [
<?php echo template::checkbox('groupEditFolderRename', true, 'Nommage', [ 'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'rename'])
'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'rename']) ]); ?>
]); ?> </div>
</div> <div class="col2">
<div class="col2"> <?php echo template::checkbox('groupEditFolderCopycut', true, 'Coupé collé', [
<?php echo template::checkbox('groupEditFolderCopycut', true, 'Coupé collé', [ 'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'copycut'])
'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'copycut']) ]); ?>
]); ?> </div>
</div> <div class="col2">
<div class="col2"> <?php echo template::checkbox('groupEditFolderPermission', true, 'Permissions', [
<?php echo template::checkbox('groupEditFolderPermission', true, 'Permissions', [ 'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'permission'])
'checked' => $this->getData(['group', $this->getUrl(2), 'folder', 'permission']) ]); ?>
]); ?> </div>
</div>
</div> </div>
<div class="row">
<div class="col6">
<?php echo template::select('connectAttempt', $module::$sharePath, [
'label' => 'Racinde du dossier partagé',
'selected' => $this->getData(['group', $this->getUrl(2), 'path'])
]); ?>
</div> </div>
</div> </div>
</div> </div>