diff --git a/core/core.php b/core/core.php index b925132..f253a93 100644 --- a/core/core.php +++ b/core/core.php @@ -50,7 +50,7 @@ class common const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '1.0.69'; + const ZWII_VERSION = '1.0.70'; // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/'; diff --git a/core/module/course/course.php b/core/module/course/course.php index 9965651..7f9d141 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -26,6 +26,7 @@ class course extends common 'delete' => self::GROUP_ADMIN, 'category' => self::GROUP_ADMIN, 'categoryAdd' => self::GROUP_ADMIN, + 'categoryEdit' => self::GROUP_ADMIN, 'categoryDelete' => self::GROUP_ADMIN, 'user' => self::GROUP_ADMIN, 'userAdd' => self::GROUP_ADMIN, @@ -312,13 +313,11 @@ class course extends common self::$courseCategories[] = [ $categoryId, $categoryTitle, - /** template::button('categoryEdit' . $categoryId, [ 'href' => helper::baseUrl() . 'course/categoryEdit/' . $categoryId, 'value' => template::ico('pencil'), 'help' => 'Éditer' ]), - */ template::button('courseDelete' . $categoryId, [ 'class' => 'categoryDelete buttonRed', 'href' => helper::baseUrl() . 'course/categoryDelete/' . $categoryId, @@ -363,6 +362,35 @@ class course extends common ]); } + public function categoryEdit() + { + + // Soumission du formulaire + if ( + $this->getUser('permission', __CLASS__, __FUNCTION__) === true && + $this->isPost() + ) { + $categoryId = $this->getUrl(2); + $this->setData([ + 'category', + $categoryId, + $this->getInput('categoryEditTitle', helper::FILTER_STRING_SHORT, true) + ]); + // Valeurs en sortie + $this->addOutput([ + 'redirect' => helper::baseUrl() . 'course/category', + 'notification' => helper::translate('Catégorie éditée'), + 'state' => true + ]); + } + + // Valeurs en sortie + $this->addOutput([ + 'title' => helper::translate('Éditer une catégorie'), + 'view' => 'categoryEdit' + ]); + } + public function categoryDelete() { diff --git a/core/module/course/view/category/category.php b/core/module/course/view/category/category.php index 30fb450..a8a99e4 100644 --- a/core/module/course/view/category/category.php +++ b/core/module/course/view/category/category.php @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/core/module/course/view/categoryEdit/categoryEdit.css b/core/module/course/view/categoryEdit/categoryEdit.css new file mode 100644 index 0000000..ec84629 --- /dev/null +++ b/core/module/course/view/categoryEdit/categoryEdit.css @@ -0,0 +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 + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @author Frédéric Tempez + * @copyright Copyright (C) 2018-2023, Frédéric Tempez + * @license CC Attribution-NonCommercial-NoDerivatives 4.0 International + * @link http://zwiicms.fr/ + */ + + +/** NE PAS EFFACER +* admin.css +*/ \ No newline at end of file diff --git a/core/module/course/view/categoryEdit/categoryEdit.php b/core/module/course/view/categoryEdit/categoryEdit.php new file mode 100644 index 0000000..6861ce9 --- /dev/null +++ b/core/module/course/view/categoryEdit/categoryEdit.php @@ -0,0 +1,31 @@ + +
+
+ 'buttonGrey', + 'href' => helper::baseUrl() . 'course/category', + 'value' => template::ico('left') + ]); ?> +
+
+ +
+
+
+
+
+

+ +

+
+
+ 'Nom de la catégorie', + 'value' => $this->getData(['category',$this->getUrl(2)]) + ]); ?> +
+
+
+
+
\ No newline at end of file