diff --git a/core/core.php b/core/core.php index b925132..cce4a3a 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.72'; // 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 diff --git a/core/module/user/user.php b/core/module/user/user.php index 401c6d2..fc74811 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -421,19 +421,14 @@ class user extends common null, $this->getData(['config', 'smtp', 'from']) ); - // Valeurs en sortie - $this->addOutput([ - 'notification' => ($sent === true ? helper::translate('Un mail a été envoyé pour confirmer la réinitialisation') : $sent), - 'state' => ($sent === true ? true : null) - ]); - } - // L'utilisateur n'existe pas - else { - // Valeurs en sortie - $this->addOutput([ - 'notification' => helper::translate('Utilisateur inexistant') - ]); + } + // L'utilisateur n'existe pas, on ne le précise pas + // Valeurs en sortie + $this->addOutput([ + 'notification' => helper::translate('Un mail a été envoyé pour confirmer la réinitialisation'), + 'state' => ($sent === true ? true : null) + ]); } // Valeurs en sortie $this->addOutput([ @@ -1129,6 +1124,7 @@ class user extends common $this->addOutput([ 'redirect' => helper::baseUrl(), 'notification' => 'Invalide : '. $message + 'state' => false, ]); } // Accès autorisé diff --git a/core/vendor/tinymce/init.js b/core/vendor/tinymce/init.js index 4660f9b..f9bbb94 100644 --- a/core/vendor/tinymce/init.js +++ b/core/vendor/tinymce/init.js @@ -7,52 +7,65 @@ /** * Quand tinyMCE est invoqué hors connexion, initialiser privateKey */ -if (typeof (privateKey) == 'undefined') { +if (typeof (privateKey) == "undefined") { var privateKey = null; }; tinymce.init({ - // Classe où appliquer l'éditeur + // Classe où appliquer l"éditeur selector: ".editorWysiwyg", // Aperçu dans le pied de page setup: function (ed) { - ed.on('change', function (e) { - if (ed.id === 'themeFooterText') { - $("#footerText").html(tinyMCE.get('themeFooterText').getContent()); + ed.on("change", function (e) { + if (ed.id === "themeFooterText") { + $("#footerText").html(tinyMCE.get("themeFooterText").getContent()); } - if (ed.id === 'themeHeaderText') { - $("#featureContent").html(tinyMCE.get('themeHeaderText').getContent()); + if (ed.id === "themeHeaderText") { + $("#featureContent").html(tinyMCE.get("themeHeaderText").getContent()); } }); }, // Langue - language: getCookie('ZWII_UI') === null ? "fr_FR" : getCookie('ZWII_UI'), + language: getCookie("ZWII_UI") === null ? "fr_FR" : getCookie("ZWII_UI"), // Plugins plugins: "advlist anchor autolink autoresize autosave codemirror contextmenu colorpicker fullscreen hr image imagetools link lists media paste searchreplace tabfocus table template textcolor visualblocks nonbreaking emoticons charmap", // Contenu du menu menu: { - edit: {title: 'Edit', items: 'undo redo | selectall searchreplace | cut copy paste pastetext | style'}, - insert: {title: 'Insert', items: 'template | nonbreaking hr charmap anchor | abbr insertdatetime '}, - format: {title: 'Format', items: 'underline strikethrough superscript subscript | forecolor backcolor | formats | removeformat'}, - table: {title: 'Table', items: 'inserttable tableprops deletetable | cell row column'}, + edit: { + title: "Edit", + items: "undo redo | selectall searchreplace | cut copy paste pastetext" + }, + insert: { + title: "Insert", + items: "template | nonbreaking hr charmap anchor" + }, + format: { + title: "Format", + items: " bold underline strikethrough superscript subscript | | formats | removeformat" + }, + tools: { + title: "Tools", + items: "" + }, + table: { + title: "Table", + items: "inserttable tableprops deletetable | cell row column" + }, }, // Contenu de la barre d'outils toolbar: [ - "fontselect fontsizeselect formatselect | bold italic strikethrough forecolor backcolor", - "link image ImgPen media | alignleft aligncenter alignright alignjustify | " + - "numlist bullist | outdent indent removeformat" - ], + "undo redo | fontsizeselect | h1 h2 h3 | alignleft aligncenter alignright alignjustify | bold forecolor backcolor| bullist numlist | link image media | outdent indent removeformat | fullscreen", + ], toolbar_sticky: true, - fontsize_formats: - "8pt 9pt 10pt 11pt 12pt 14pt 18pt 24pt 30pt 36pt 48pt 60pt 72pt 96pt", + fontsize_formats: "8pt 9pt 10pt 11pt 12pt 14pt 18pt 24pt 30pt 36pt 48pt 60pt 72pt 96pt", theme: "silver", max_height: 600, // CodeMirror codemirror: { indentOnInit: true, // Whether or not to indent code on init. - path: 'codemirror', // Path to CodeMirror distribution - saveCursorPosition: false, // Insert caret marker - config: { // CodeMirror config object + path: "codemirror", // Path to CodeMirror distribution + saveCursorPosition: false, // Insert caret marker + config: { // CodeMirror config object fullscreen: true, /*mode: 'application/x-httpd-php',*/ lineNumbers: true, @@ -60,32 +73,45 @@ tinymce.init({ mode: "htmlmixed" }, jsFiles: [ - 'mode/php/php.js', - 'mode/css/css.js', - 'mode/htmlmixed/htmlmixed.js', - 'mode/htmlembedded/htmlembedded.js', - 'mode/javascript/javascript.js', - 'mode/xml/xml.js', - 'addon/search/searchcursor.js', - 'addon/search/search.js', + "mode/php/php.js", + "mode/css/css.js", + "mode/htmlmixed/htmlmixed.js", + "mode/htmlembedded/htmlembedded.js", + "mode/javascript/javascript.js", + "mode/xml/xml.js", + "addon/search/searchcursor.js", + "addon/search/search.js", ], /* cssFiles: [ 'theme/cobalt.css', ],*/ - width: 800, // Default value is 800 - height: 500 // Default value is 550 + width: 800, // Default value is 800 + height: 500 // Default value is 550 }, // Cibles de la target - target_list: [ - { title: 'None', value: '' }, - { title: 'Nouvel onglet', value: '_blank' } + target_list: [{ + title: 'None', + value: '' + }, + { + title: 'Nouvel onglet', + value: '_blank' + } ], // Target pour lightbox - rel_list: [ - { title: 'None', value: '' }, - { title: 'Une popup (Lity)', value: 'data-lity' }, - { title: 'Une galerie d\'images (SimpleLightbox)', value: 'gallery' } + rel_list: [{ + title: 'None', + value: '' + }, + { + title: 'Une popup (Lity)', + value: 'data-lity' + }, + { + title: 'Une galerie d\'images (SimpleLightbox)', + value: 'gallery' + } ], // Titre des image image_title: true, @@ -141,29 +167,57 @@ tinymce.init({ // Contenu du bouton insérer insert_button_items: "anchor hr table", // Contenu du bouton formats - style_formats: [ - { - title: "Headers", items: [ - { title: "Header 1", format: "h1" }, - { title: "Header 2", format: "h2" }, - { title: "Header 3", format: "h3" }, - { title: "Header 4", format: "h4" }, - { title: "Header 5", format: "h5" }, - { title: "Header 6", format: "h6" } + style_formats: [{ + title: "Headers", + items: [{ + title: "Header 1", + format: "h1" + }, + { + title: "Header 2", + format: "h2" + }, + { + title: "Header 3", + format: "h3" + }, + { + title: "Header 4", + format: "h4" + }, + { + title: "Header 5", + format: "h5" + }, + { + title: "Header 6", + format: "h6" + } ] }, { - title: "Blocks", items: [ - { title: "Paragraph", format: "p" }, - { title: "Citation", format: "blockquote" }, - { title: "Div", format: "div" }, - { title: "Pre", format: "pre" } + title: "Blocks", + items: [{ + title: "Paragraph", + format: "p" + }, + { + title: "Citation", + format: "blockquote" + }, + { + title: "Div", + format: "div" + }, + { + title: "Pre", + format: "pre" + } ] } ], // Templates - templates: [ - { + templates: [{ title: "Lien de retour", url: baseUrl + "core/vendor/tinymce/templates/back_home.html", description: "Insère un lien de retour à l'accueil de la plate-forme." @@ -239,7 +293,9 @@ tinymce.init({ var id_alarm = "#blogArticleContentAlarm" var contentLength = 0; ed.on("keydown", function (e) { - contentLength = ed.getContent({ format: 'text' }).length; + contentLength = ed.getContent({ + format: 'text' + }).length; if (contentLength > maxlength) { $(id_alarm).html("Vous avez atteint le maximum de " + maxlength + " caractères ! "); if (e.keyCode != 8 && e.keyCode != 46) { @@ -247,19 +303,19 @@ tinymce.init({ e.stopPropagation(); return false; } - } - else { + } else { if (maxlength - contentLength < alarmCaraMin) { $(id_alarm).html((maxlength - contentLength) + " caractères restants"); - } - else { + } else { $(id_alarm).html(" "); } } }); // Limitation y compris lors d'un copier/coller ed.on("paste", function (e) { - contentLeng = ed.getContent({ format: 'text' }).length - 16; + contentLeng = ed.getContent({ + format: 'text' + }).length - 16; var data = e.clipboardData.getData('Text'); if (data.length > (maxlength - contentLeng)) { $(id_alarm).html("Vous alliez dépasser le maximum de " + maxlength + " caractères ! "); @@ -267,8 +323,7 @@ tinymce.init({ } else { if (maxlength - contentLeng < alarmCaraMin) { $(id_alarm).html((maxlength - contentLeng - data.length) + " caractères restants"); - } - else { + } else { $(id_alarm).html(" "); } return true;