forked from ZwiiCMS-Team/ZwiiCampus
Catégorie WIP
This commit is contained in:
parent
e3286aee8e
commit
d8b551e8a0
@ -210,7 +210,7 @@ class common
|
||||
'language' => '',
|
||||
'profil' => '',
|
||||
'enrolment' => '',
|
||||
'categorie' => '',
|
||||
'category' => '',
|
||||
];
|
||||
|
||||
private $configFiles = [
|
||||
@ -225,7 +225,7 @@ class common
|
||||
'language' => '',
|
||||
'profil' => '',
|
||||
'enrolment' => '',
|
||||
'categorie' => '',
|
||||
'category' => '',
|
||||
];
|
||||
|
||||
private $contentFiles = [
|
||||
|
@ -17,12 +17,14 @@ class course extends common
|
||||
{
|
||||
|
||||
public static $actions = [
|
||||
'swap' => self::GROUP_VISITOR,
|
||||
'enrol' => self::GROUP_VISITOR,
|
||||
'index' => self::GROUP_ADMIN,
|
||||
'edit' => self::GROUP_ADMIN,
|
||||
'add' => self::GROUP_ADMIN,
|
||||
'delete' => self::GROUP_ADMIN,
|
||||
'swap' => self::GROUP_VISITOR,
|
||||
'enrol' => self::GROUP_VISITOR,
|
||||
'category' => self::GROUP_ADMIN,
|
||||
'categoryAdd' => self::GROUP_ADMIN,
|
||||
];
|
||||
|
||||
public static $courseAccess = [
|
||||
@ -70,7 +72,7 @@ class course extends common
|
||||
|
||||
];
|
||||
}
|
||||
//var_dump($this->getCourseHierarchy(1, 1));
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Cours'),
|
||||
@ -137,6 +139,9 @@ class course extends common
|
||||
}
|
||||
}
|
||||
|
||||
// Liste des catégories de cours
|
||||
self::$courseCategories = $this->getData(['category']);
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Ajouter un cours'),
|
||||
@ -144,7 +149,6 @@ class course extends common
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Edite un cours
|
||||
*/
|
||||
@ -189,7 +193,9 @@ class course extends common
|
||||
self::$courseTeachers[$teacherId] = $teacherInfo["firstname"] . ' ' . $teacherInfo["lastname"];
|
||||
}
|
||||
}
|
||||
self::$courseCategories = $this->getData(['categorie']);
|
||||
|
||||
// Liste des catégories de cours
|
||||
self::$courseCategories = $this->getData(['category']);
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -230,41 +236,22 @@ class course extends common
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Affiche un écran de connexion à un cours
|
||||
/**
|
||||
* Liste les catégories d'un cours
|
||||
*/
|
||||
|
||||
public function change()
|
||||
public function category()
|
||||
{
|
||||
// Soumission du formulaire
|
||||
if (
|
||||
$this->isPost() ||
|
||||
$this->getUrl(2) === 'home'
|
||||
|
||||
) {
|
||||
$this->swap();
|
||||
}
|
||||
|
||||
// Bouton de connexion ou d'inscription
|
||||
// C'est un prof ou un admin
|
||||
self::$changeMessages = $this->getUser('group') >= self::GROUP_EDITOR
|
||||
? 'Se connecter'
|
||||
// C'est un étudiant ou un visiteur
|
||||
: '';
|
||||
|
||||
self::$courseCategories = $this->getData(['category']);
|
||||
var_dump(self::$courseCategories);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => sprintf(helper::translate('Accéder au cours %s'), $this->getData(['course', $this->getUrl(2), 'shortTitle'])),
|
||||
'view' => 'change',
|
||||
'display' => self::DISPLAY_LAYOUT_LIGHT,
|
||||
'title' => helper::translate('Catégorie'),
|
||||
'view' => 'category'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Traitement du changement de langue
|
||||
* Fonction utilisée par le noyau
|
||||
*/
|
||||
public function swap()
|
||||
{
|
||||
@ -319,7 +306,7 @@ class course extends common
|
||||
$state = true;
|
||||
} else {
|
||||
$message = helper::translate('Vous devez disposer d\'un compte pour accéder à ce cours');
|
||||
$state = false;
|
||||
$state = false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1,16 +1,18 @@
|
||||
/**
|
||||
* 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-2023, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
/** @import url("site/data/admin.css"); */
|
||||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
*/
|
17
core/module/course/view/category/category.php
Normal file
17
core/module/course/view/category/category.php
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseCategoryModulesBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset10">
|
||||
<?php echo template::button('courseCategoryModulesAdd', [
|
||||
'class' => 'buttonGreen',
|
||||
'href' => helper::baseUrl() . 'courseCategoryadd',
|
||||
'value' => template::ico('plus')
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::table([12], $module::$courseCategories, ['Titre']); ?>
|
@ -6,7 +6,14 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset10">
|
||||
<div class="col1 offset9">
|
||||
<?php echo template::button('courseGroup', [
|
||||
'href' => helper::baseUrl() . 'course/category',
|
||||
'value' => template::ico('table'),
|
||||
'help' => 'Catégories de cours'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 ">
|
||||
<?php echo template::button('courseModulesAdd', [
|
||||
'class' => 'buttonGreen',
|
||||
'href' => helper::baseUrl() . 'course/add',
|
||||
|
@ -669,8 +669,8 @@ class init extends common
|
||||
],
|
||||
'course' => [],
|
||||
'enrolment' => [],
|
||||
'categorie' => [
|
||||
'Générale'
|
||||
'category' => [
|
||||
'general' => 'Générale'
|
||||
]
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user