Folder 1.02 simplifications

This commit is contained in:
Fred Tempez 2024-03-28 08:03:27 +01:00
parent 894dde1522
commit 95e1f738fb
2 changed files with 14 additions and 13 deletions

View File

@ -1,4 +1,6 @@
1.02
- Options d'ouverture des fichiers
1.01
- Affiche uniqument les images dans Lity, force le téléchargement des autres ressources. Une option est à prévoir dans la configuration.
- Affiche uniquement les images dans Lity, force le téléchargement des autres ressources. Une option est à prévoir dans la configuration.
1.0
- Version initiale publiée

View File

@ -39,26 +39,25 @@ class folder extends common
'sqo' => 'Carré',
'viv' => 'Vivid'
];
public static $iconSize = [
'md' => 'Standard',
'lg' => 'Moyenne',
'xl' => 'Grande'
];
public static $openingTarget = [
'data-lity' => 'Images dans une lightbox (lity), sinon téléchargement',
'_blank' => 'Nouvel onglet',
'download' => 'Téléchargement forcé',
];
public function index()
{
// Configuration de l'affichage
$config['showsubfolder'] = $this->getData(['module', $this->getUrl(0), 'subfolder']);
$config['sort'] = $this->getData(['module', $this->getUrl(0), 'sort']);
$config['showdetails'] = $this->getData(['module', $this->getUrl(0), 'details']);
$config['initialfolderstate'] = $this->getData(['module', $this->getUrl(0), 'folderstate']);
$config['iconpack'] = $this->getData(['module', $this->getUrl(0), 'iconpack']);
$config['iconsize'] = $this->getData(['module', $this->getUrl(0), 'iconsize']);
// Générer l'affichage
self::$folders = $this->getFolderContent($this->getData(['module', $this->getUrl(0), 'path']), $config);
self::$folders = $this->getFolderContent($this->getData(['module', $this->getUrl(0), 'path']), $this->getData(['module', $this->getUrl(0)]));
// Valeurs en sortie
$this->addOutput([
@ -112,10 +111,10 @@ class folder extends common
private function getFolderContent($chemin, $config = [])
{
$showSubFolder = isset($config['showsubfolder']) ? $config['showsubfolder'] : true;
$showSubFolder = isset($config['subfolder']) ? $config['subfolder'] : true;
$sort = isset($config['sort']) ? $config['sort'] : true;
$showDetails = isset($config['showdetails']) ? $config['showdetails'] : false;
$initialFolderState = isset($config['initialfolderstate']) ? $config['initialfolderstate'] : 'collapsed';
$showDetails = isset($config['details']) ? $config['details'] : false;
$initialFolderState = isset($config['folderstate']) ? $config['folderstate'] : 'collapsed';
$iconPack = isset($config['iconpack']) || !empty($config['iconpack']) ? $config['iconpack'] : 'classic';
$iconSize = isset($config['iconsize']) || !empty($config['iconsize']) ? $config['iconsize'] : 'md';