Tri des pages selon la position
This commit is contained in:
parent
769808ca4e
commit
e687f26d2d
@ -747,7 +747,7 @@ class common
|
||||
* Fonction pour construire le tableau des pages
|
||||
*/
|
||||
|
||||
private function buildHierarchy()
|
||||
public function buildHierarchy()
|
||||
{
|
||||
|
||||
$pages = helper::arrayColumn($this->getData(['page']), 'position', 'SORT_ASC');
|
||||
|
@ -86,7 +86,7 @@ class course extends common
|
||||
{
|
||||
// Tableau à transmettre à la fvue
|
||||
self::$courses = array();
|
||||
|
||||
|
||||
// Pointer RFM sur le dossier de l'espace
|
||||
self::$siteContent = 'home';
|
||||
|
||||
@ -179,6 +179,8 @@ class course extends common
|
||||
|
||||
// Pointer RFM sur le dossier de l'espace
|
||||
self::$siteContent = $courseId;
|
||||
// Ordonne les pages par position
|
||||
$this->buildHierarchy();
|
||||
|
||||
// BDD des inscrits
|
||||
$this->setData([
|
||||
@ -313,15 +315,10 @@ class course extends common
|
||||
$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']);
|
||||
foreach (self::$pagesList as $pageId => $page) {
|
||||
if (
|
||||
$page['block'] === 'bar' ||
|
||||
$page['disable'] === true
|
||||
) {
|
||||
unset(self::$pagesList[$pageId]);
|
||||
}
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -364,15 +361,10 @@ class course extends common
|
||||
$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']);
|
||||
foreach (self::$pagesList as $pageId => $page) {
|
||||
if (
|
||||
$page['block'] === 'bar' ||
|
||||
$page['disable'] === true
|
||||
) {
|
||||
unset(self::$pagesList[$pageId]);
|
||||
}
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -1712,14 +1704,14 @@ class course extends common
|
||||
$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
|
||||
foreach ($this->getData(['page']) as $pageId => $page) {
|
||||
if (
|
||||
$page['block'] !== 'bar' &&
|
||||
$page['disable'] !== true
|
||||
) {
|
||||
self::$pagesList[] = template::checkbox('courseManageExport' . $pageId, true, $page['title']);
|
||||
}
|
||||
self::$pagesList[] = template::checkbox('courseManageExport' . $pageId, true, $page['title']);
|
||||
}
|
||||
|
||||
// Soumission du formulaire
|
||||
@ -2115,5 +2107,4 @@ class course extends common
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -33,7 +33,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseEditHomePageId', helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC'), [
|
||||
<?php echo template::select('courseEditHomePageId', helper::arrayColumn($module::$pagesList, 'title'), [
|
||||
'label' => 'Page d\'accueil',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'homePageId']),
|
||||
]); ?>
|
||||
|
Loading…
Reference in New Issue
Block a user