Fixe nouveau cours vide

This commit is contained in:
Fred Tempez 2023-10-04 07:04:58 +02:00
parent 5597449ddc
commit 0181843682
3 changed files with 3 additions and 15 deletions

View File

@ -48,7 +48,7 @@ class course extends common
public static $swapMessage = [];
public static $pagesList = [];
public static $pagesList = ['accueil'=> 'Accueil'];
public function index()
@ -152,18 +152,6 @@ class course extends common
// Liste des catégories de cours
self::$courseCategories = $this->getData(['category']);
// Liste des pages disponibles
$this->initDB('page', $this->getUrl(2));
self::$pagesList = $this->getData(['page']);
foreach (self::$pagesList as $page => $pageId) {
if (
$this->getData(['page', $page, 'block']) === 'bar' ||
$this->getData(['page', $page, 'disable']) === true
) {
unset(self::$pagesList[$page]);
}
}
// Valeurs en sortie
$this->addOutput([
'title' => helper::translate('Ajouter un cours'),

View File

@ -38,7 +38,7 @@
</div>
<div class="row">
<div class="col6">
<?php echo template::select('courseaDDHomePageId', helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC'), [
<?php echo template::select('courseaDDHomePageId', $module::$pagesList, [
'label' => 'Accueil du cours',
]); ?>
</div>

View File

@ -2,7 +2,7 @@
<div class="col1">
<?php echo template::button('courseCategoryModulesBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(2),
'href' => helper::baseUrl() . 'course',
'value' => template::ico('left')
]); ?>
</div>