download 4.2 le template file affiche le dossier du fichier ou de l'image sélectionnée

This commit is contained in:
Fred Tempez 2024-09-05 10:32:08 +02:00
parent 201a5bba8d
commit 6a46dd3b0d
4 changed files with 303 additions and 297 deletions

View File

@ -1,3 +1,5 @@
# Version 4.2
- Le sélecteur de fichier affiche par défaut le chemin vers le fichier présent dans le champ.
# Version 4.1 # Version 4.1
- Correction fonction signature dans core.php - Correction fonction signature dans core.php
# Version 4.0 # Version 4.0

View File

@ -15,7 +15,7 @@
class download extends common class download extends common
{ {
const VERSION = '4.1'; const VERSION = '4.2';
const REALNAME = 'Téléchargement'; const REALNAME = 'Téléchargement';
const DELETE = true; const DELETE = true;
const UPDATE = '0.0'; const UPDATE = '0.0';

View File

@ -1,5 +1,5 @@
<?php echo template::formOpen('downloadAddForm'); ?> <?php echo template::formOpen('downloadAddForm'); ?>
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
<?php echo template::button('downloadAddBack', [ <?php echo template::button('downloadAddBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
@ -21,8 +21,8 @@
'value' => 'Publier' 'value' => 'Publier'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Informations sur la ressource</h4> <h4>Informations sur la ressource</h4>
@ -66,7 +66,7 @@
'label' => 'Catégorie' 'label' => 'Catégorie'
]); ]);
} else { } else {
echo template::select('downloadAddCategorie', [''=>''], [ echo template::select('downloadAddCategorie', ['' => ''], [
'label' => 'Pas de catégorie', 'label' => 'Pas de catégorie',
'disabled' => true 'disabled' => true
]); ]);
@ -77,7 +77,7 @@
<?php echo template::file('downloadAddThumb', [ <?php echo template::file('downloadAddThumb', [
'label' => 'Capture d\'écran', 'label' => 'Capture d\'écran',
'language' => $this->getData(['user', $this->getUser('id'), 'language']), 'language' => $this->getData(['user', $this->getUser('id'), 'language']),
'type' => 1 'type' => 1,
]); ?> ]); ?>
</div> </div>
</div> </div>
@ -94,7 +94,8 @@
<?php echo template::file('downloadAddFile', [ <?php echo template::file('downloadAddFile', [
'label' => 'Fichier', 'label' => 'Fichier',
'language' => $this->getData(['user', $this->getUser('id'), 'language']), 'language' => $this->getData(['user', $this->getUser('id'), 'language']),
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']) 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']),
'folder' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']) ? dirname($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file'])) : ''
]); ?> ]); ?>
</div> </div>
<div class="col12"> <div class="col12">
@ -137,7 +138,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('downloadAddConsent', $module::$itemConsent , [ <?php echo template::select('downloadAddConsent', $module::$itemConsent, [
'label' => 'Edition - Suppression', 'label' => 'Edition - Suppression',
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']), 'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction' 'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction'
@ -164,7 +165,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadAddCommentMaxlength', $module::$commentLength,[ <?php echo template::select('downloadAddCommentMaxlength', $module::$commentLength, [
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.', 'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.',
'label' => 'Caractères par commentaire', 'label' => 'Caractères par commentaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength']) 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
@ -188,4 +189,5 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>

View File

@ -1,5 +1,5 @@
<?php echo template::formOpen('downloadEditForm'); ?> <?php echo template::formOpen('downloadEditForm'); ?>
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
<?php echo template::button('downloadEditBack', [ <?php echo template::button('downloadEditBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
@ -22,8 +22,8 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Informations sur la ressource</h4> <h4>Informations sur la ressource</h4>
@ -80,7 +80,7 @@
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'category']) 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'category'])
]); ]);
} else { } else {
echo template::select('downloadEditCategorie', [''=>''], [ echo template::select('downloadEditCategorie', ['' => ''], [
'label' => 'Pas de catégorie', 'label' => 'Pas de catégorie',
'disabled' => true 'disabled' => true
]); ]);
@ -92,7 +92,8 @@
'label' => 'Capture d\'écran', 'label' => 'Capture d\'écran',
'language' => $this->getData(['user', $this->getUser('id'), 'language']), 'language' => $this->getData(['user', $this->getUser('id'), 'language']),
'type' => 1, 'type' => 1,
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb']) 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb']),
'folder' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb']) ? dirname($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb'])) : ''
]); ?> ]); ?>
</div> </div>
</div> </div>
@ -109,7 +110,8 @@
<?php echo template::file('downloadEditFile', [ <?php echo template::file('downloadEditFile', [
'label' => 'Fichier', 'label' => 'Fichier',
'language' => $this->getData(['user', $this->getUser('id'), 'language']), 'language' => $this->getData(['user', $this->getUser('id'), 'language']),
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']) 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']),
'folder' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']) ? dirname($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file'])) : ''
]); ?> ]); ?>
</div> </div>
<div class="col12"> <div class="col12">
@ -124,16 +126,16 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php echo template::textarea('downloadEditContent', [ <?php echo template::textarea('downloadEditContent', [
'class' => 'editorWysiwyg', 'class' => 'editorWysiwyg',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content']) 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content'])
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Options de publication</h4> <h4>Options de publication</h4>
@ -154,7 +156,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('downloadEditConsent', $module::$itemConsent , [ <?php echo template::select('downloadEditConsent', $module::$itemConsent, [
'label' => 'Edition - Suppression', 'label' => 'Edition - Suppression',
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']), 'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction' 'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction'
@ -163,8 +165,8 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Commentaires</h4> <h4>Commentaires</h4>
@ -181,7 +183,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col4 commentOptionsWrapper"> <div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadEditCommentMaxlength', $module::$commentLength,[ <?php echo template::select('downloadEditCommentMaxlength', $module::$commentLength, [
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.', 'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.',
'label' => 'Caractères par commentaire', 'label' => 'Caractères par commentaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength']) 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
@ -204,5 +206,5 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>