Mise à jour module Download

This commit is contained in:
Fred Tempez 2021-09-08 06:27:32 +02:00
parent 0f0ae30621
commit d7d2d67480
4 changed files with 12 additions and 13 deletions

View File

@ -14,7 +14,7 @@
class download extends common {
const VERSION = '2.2';
const VERSION = '2.4';
const REALNAME = 'Téléchargement';
const DELETE = true;
const UPDATE = '0.0';
@ -946,11 +946,6 @@ class download extends common {
$this->addOutput([
'display' => self::DISPLAY_RAW
]);
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'view' => 'index'
]);
} else {
// Valeurs en sortie
$this->addOutput([

View File

@ -64,7 +64,8 @@
<div class="col3">
<?php if ($module::$categories) {
echo template::select('downloadEditCategorie', $module::$categories, [
'label' => 'Catégorie'
'label' => 'Catégorie',
'selected' => $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(2), 'category'])
]);
} else {
echo template::select('downloadEditCategorie', [''=>''], [

View File

@ -10,6 +10,13 @@
* @link http://zwiicms.fr/
*/
/**
* Incrément les stats
*/
$('#downloadItemFile').click(function() {
$('#downloadStats').html(function(i, val) { return val*1+1 });
});
/**
* Affiche le bloc pour rédiger un commentaire
*/

View File

@ -20,19 +20,17 @@
switch ($this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'ressourceType'])) {
case 'file':
$href = helper::baseUrl() . $this->getUrl(0) . '/downloadFile/' . $this->getUrl(1) . '/' . $_SESSION['csrf'];
$value = 'Télécharger';
$target = '_self';
break;
case 'url' :
$href = $this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'url']);
$value = 'Visiter';
$target = '_blank';
break;
}
?>
<?php echo template::button('downloadItemFile', [
'href' => $href,
'value' => $value,
'value' => 'Télécharger',
'target'=> $target
]);
?>
@ -74,9 +72,7 @@
<?php if ($this->getData(['module', $this->getUrl(0), 'items', $this->getUrl(1), 'file'])): ?>
<div class="row">
<div class="col12 textAlignCenter">
<span>Téléchargements :
<?php echo $module::$statSum; ?>
</span>
<span>Téléchargements : <span id="downloadStats"><?php echo $module::$statSum;'<span>'?></span>
</div>
</div>
<?php endif; ?>