course export Boutons tout et rien sélectionner
Portée sélection excluant les barres
This commit is contained in:
parent
e687f26d2d
commit
b78e52c5d4
@ -313,13 +313,26 @@ class course extends common
|
||||
|
||||
// Liste des pages disponibles
|
||||
$this->initDB('page', $courseId);
|
||||
|
||||
// Pointer RFM sur le dossier de l'espace
|
||||
self::$siteContent = $courseId;
|
||||
|
||||
// Ordonne les pages par position
|
||||
$this->buildHierarchy();
|
||||
|
||||
// Données pour le formulaire
|
||||
self::$pagesList = $this->getData(['page']);
|
||||
|
||||
// Exclure les barres et les pages désactivées
|
||||
foreach (self::$pagesList as $pageId => $page) {
|
||||
if (
|
||||
$page['block'] === 'bar' ||
|
||||
$page['disable'] === true
|
||||
) {
|
||||
unset(self::$pagesList[$pageId]);
|
||||
}
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => sprintf('%s id : %s', helper::translate('Éditer l\'espace'), $this->getUrl(2)),
|
||||
@ -359,12 +372,25 @@ class course extends common
|
||||
|
||||
// Liste des pages disponibles
|
||||
$this->initDB('page', $courseId);
|
||||
|
||||
// Pointer RFM sur le dossier de l'espace
|
||||
self::$siteContent = $courseId;
|
||||
|
||||
// Ordonne les pages par position
|
||||
$this->buildHierarchy();
|
||||
|
||||
// Données pour le formulaire
|
||||
self::$pagesList = $this->getData(['page']);
|
||||
|
||||
// Exclure les barres et les pages désactivées
|
||||
foreach (self::$pagesList as $pageId => $page) {
|
||||
if (
|
||||
$page['block'] === 'bar' ||
|
||||
$page['disable'] === true
|
||||
) {
|
||||
unset(self::$pagesList[$pageId]);
|
||||
}
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -1702,24 +1728,35 @@ class course extends common
|
||||
|
||||
// Liste des pages disponibles
|
||||
$this->initDB('page', $courseId);
|
||||
|
||||
// Pointer RFM sur le dossier de l'espace
|
||||
self::$siteContent = $courseId;
|
||||
|
||||
// Ordonne les pages par position
|
||||
$this->buildHierarchy();
|
||||
|
||||
// Tableau de retour
|
||||
self::$pagesList = [];
|
||||
|
||||
// Construction du formulaire
|
||||
// Exclure les barres et les pages désactivées
|
||||
foreach ($this->getData(['page']) as $pageId => $page) {
|
||||
self::$pagesList[] = template::checkbox('courseManageExport' . $pageId, true, $page['title']);
|
||||
if (
|
||||
$this->getData(['page', $pageId, 'block']) !== 'bar' &&
|
||||
$this->getData(['page', $pageId, 'disable']) !== true
|
||||
) {
|
||||
self::$pagesList[] = template::checkbox('courseManageExport' . $pageId, true, $page['title'], [
|
||||
'class' => 'courseManageCheckbox'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Soumission du formulaire
|
||||
if ($this->isPost()) {
|
||||
$datas = '';
|
||||
$resources = [];
|
||||
|
||||
foreach ($this->getData(['page']) as $pageId => $page) {
|
||||
foreach (self::$pagesList as $pageId => $page) {
|
||||
if ($this->getInput('courseManageExport' . $pageId, helper::FILTER_BOOLEAN) === true) {
|
||||
$pageContent = $this->getPage($pageId, $courseId);
|
||||
|
||||
|
27
core/module/course/view/export/export.js.php
Normal file
27
core/module/course/view/export/export.js.php
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* This file is part of Zwii.
|
||||
*
|
||||
* For full copyright and license information, please see the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
// Quand le bouton "Cocher toutes" est cliqué
|
||||
$('#courseExportSelectAll').on('click', function() {
|
||||
// Cocher toutes les checkboxes avec la classe 'courseManageCheckbox'
|
||||
$('.courseManageCheckbox').prop('checked', true);
|
||||
});
|
||||
|
||||
// Quand le bouton "Décocher toutes" est cliqué
|
||||
$('#courseExportSelectNone').on('click', function() {
|
||||
// Décocher toutes les checkboxes avec la classe 'courseManageCheckbox'
|
||||
$('.courseManageCheckbox').prop('checked', false);
|
||||
});
|
||||
});
|
@ -7,7 +7,19 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<div class="col1 offset7">
|
||||
<?php echo template::button('courseExportSelectAll', [
|
||||
'value' => template::ico('square-check'),
|
||||
'help' => 'Tout sélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseExportSelectNone', [
|
||||
'value' => template::ico('square-check-empty'),
|
||||
'help' => 'Tout désélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::submit('courseExportSubmit', [
|
||||
'value' => 'Valider'
|
||||
]); ?>
|
||||
|
Loading…
Reference in New Issue
Block a user