diff --git a/core/module/course/course.php b/core/module/course/course.php index 7addb61..2e12995 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -241,8 +241,25 @@ class course extends common */ public function category() { - self::$courseCategories = $this->getData(['category']); - var_dump(self::$courseCategories); + $categories = $this->getData(['category']); + 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 $this->addOutput([ 'title' => helper::translate('Catégorie'), diff --git a/core/module/course/view/category/category.php b/core/module/course/view/category/category.php index 21daaee..3cad89a 100644 --- a/core/module/course/view/category/category.php +++ b/core/module/course/view/category/category.php @@ -14,4 +14,9 @@ ]); ?> - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/core/module/course/view/index/index.php b/core/module/course/view/index/index.php index de38ef2..5d7b7cb 100644 --- a/core/module/course/view/index/index.php +++ b/core/module/course/view/index/index.php @@ -21,4 +21,8 @@ ]); ?> - \ No newline at end of file + + + + +