categories okay maque CRUD
This commit is contained in:
parent
d8b551e8a0
commit
07cb5d313f
@ -241,8 +241,25 @@ class course extends common
|
|||||||
*/
|
*/
|
||||||
public function category()
|
public function category()
|
||||||
{
|
{
|
||||||
self::$courseCategories = $this->getData(['category']);
|
$categories = $this->getData(['category']);
|
||||||
var_dump(self::$courseCategories);
|
ksort($categories);
|
||||||
|
foreach ($categories as $categoryId => $categoryTitle) {
|
||||||
|
self::$courseCategories[] = [
|
||||||
|
$categoryId,
|
||||||
|
$categoryTitle,
|
||||||
|
template::button('courseEdit' . $categoryId, [
|
||||||
|
'href' => helper::baseUrl() . 'course/categoryEdit/' . $categoryId,
|
||||||
|
'value' => template::ico('pencil'),
|
||||||
|
'help' => 'Éditer'
|
||||||
|
]),
|
||||||
|
template::button('courseDelete' . $categoryId, [
|
||||||
|
'class' => 'courseDelete buttonRed',
|
||||||
|
'href' => helper::baseUrl() . 'course/categoryDelete/' . $categoryId,
|
||||||
|
'value' => template::ico('trash'),
|
||||||
|
'help' => 'Supprimer'
|
||||||
|
])
|
||||||
|
];
|
||||||
|
}
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => helper::translate('Catégorie'),
|
'title' => helper::translate('Catégorie'),
|
||||||
|
@ -14,4 +14,9 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo template::table([12], $module::$courseCategories, ['Titre']); ?>
|
|
||||||
|
<?php if($module::$courseCategories): ?>
|
||||||
|
<?php echo template::table([5,5,1,1], $module::$courseCategories, ['Id', 'Titre', '', '']); ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php echo template::speech('Aucune catégorie'); ?>
|
||||||
|
<?php endif; ?>
|
@ -21,4 +21,8 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo template::table([3 , 3, 4, 1, 1], $module::$courses, ['Titre court', 'Auteur', 'Description', '', '']); ?>
|
<?php if($module::$courses): ?>
|
||||||
|
<?php echo template::table([3 , 3, 4, 1, 1], $module::$courses, ['Titre court', 'Auteur', 'Description', '', '']); ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php echo template::speech('Aucun Cours'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user