Merge branch 'master' of https://forge.chapril.org/fredtempez/ZwiiLMS
This commit is contained in:
commit
c41c504afd
@ -50,7 +50,7 @@ class common
|
|||||||
const ACCESS_TIMER = 1800;
|
const ACCESS_TIMER = 1800;
|
||||||
|
|
||||||
// Numéro de version
|
// Numéro de version
|
||||||
const ZWII_VERSION = '1.0.69';
|
const ZWII_VERSION = '1.0.72';
|
||||||
|
|
||||||
// URL autoupdate
|
// URL autoupdate
|
||||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
|
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
|
||||||
|
@ -26,6 +26,7 @@ class course extends common
|
|||||||
'delete' => self::GROUP_ADMIN,
|
'delete' => self::GROUP_ADMIN,
|
||||||
'category' => self::GROUP_ADMIN,
|
'category' => self::GROUP_ADMIN,
|
||||||
'categoryAdd' => self::GROUP_ADMIN,
|
'categoryAdd' => self::GROUP_ADMIN,
|
||||||
|
'categoryEdit' => self::GROUP_ADMIN,
|
||||||
'categoryDelete' => self::GROUP_ADMIN,
|
'categoryDelete' => self::GROUP_ADMIN,
|
||||||
'user' => self::GROUP_ADMIN,
|
'user' => self::GROUP_ADMIN,
|
||||||
'userAdd' => self::GROUP_ADMIN,
|
'userAdd' => self::GROUP_ADMIN,
|
||||||
@ -312,13 +313,11 @@ class course extends common
|
|||||||
self::$courseCategories[] = [
|
self::$courseCategories[] = [
|
||||||
$categoryId,
|
$categoryId,
|
||||||
$categoryTitle,
|
$categoryTitle,
|
||||||
/**
|
|
||||||
template::button('categoryEdit' . $categoryId, [
|
template::button('categoryEdit' . $categoryId, [
|
||||||
'href' => helper::baseUrl() . 'course/categoryEdit/' . $categoryId,
|
'href' => helper::baseUrl() . 'course/categoryEdit/' . $categoryId,
|
||||||
'value' => template::ico('pencil'),
|
'value' => template::ico('pencil'),
|
||||||
'help' => 'Éditer'
|
'help' => 'Éditer'
|
||||||
]),
|
]),
|
||||||
*/
|
|
||||||
template::button('courseDelete' . $categoryId, [
|
template::button('courseDelete' . $categoryId, [
|
||||||
'class' => 'categoryDelete buttonRed',
|
'class' => 'categoryDelete buttonRed',
|
||||||
'href' => helper::baseUrl() . 'course/categoryDelete/' . $categoryId,
|
'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()
|
public function categoryDelete()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if($module::$courseCategories): ?>
|
<?php if($module::$courseCategories): ?>
|
||||||
<?php echo template::table([5,6,1], $module::$courseCategories, ['Id', 'Titre', '']); ?>
|
<?php echo template::table([5,5,1,1], $module::$courseCategories, ['Id', 'Titre', '','']); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php echo template::speech('Aucune catégorie'); ?>
|
<?php echo template::speech('Aucune catégorie'); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
18
core/module/course/view/categoryEdit/categoryEdit.css
Normal file
18
core/module/course/view/categoryEdit/categoryEdit.css
Normal file
@ -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 <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/
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** NE PAS EFFACER
|
||||||
|
* admin.css
|
||||||
|
*/
|
31
core/module/course/view/categoryEdit/categoryEdit.php
Normal file
31
core/module/course/view/categoryEdit/categoryEdit.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php echo template::formOpen('categoryEditForm'); ?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col1">
|
||||||
|
<?php echo template::button('categoryEditBack', [
|
||||||
|
'class' => 'buttonGrey',
|
||||||
|
'href' => helper::baseUrl() . 'course/category',
|
||||||
|
'value' => template::ico('left')
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col2 offset9">
|
||||||
|
<?php echo template::submit('categoryEditSubmit'); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col12">
|
||||||
|
<div class="block">
|
||||||
|
<h4>
|
||||||
|
<?php echo helper::translate('Paramètres'); ?>
|
||||||
|
</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col12">
|
||||||
|
<?php
|
||||||
|
echo template::text('categoryEditTitle', [
|
||||||
|
'label' => 'Nom de la catégorie',
|
||||||
|
'value' => $this->getData(['category',$this->getUrl(2)])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -421,19 +421,14 @@ class user extends common
|
|||||||
null,
|
null,
|
||||||
$this->getData(['config', 'smtp', 'from'])
|
$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
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -1129,6 +1124,7 @@ class user extends common
|
|||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'redirect' => helper::baseUrl(),
|
'redirect' => helper::baseUrl(),
|
||||||
'notification' => 'Invalide : '. $message
|
'notification' => 'Invalide : '. $message
|
||||||
|
'state' => false,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// Accès autorisé
|
// Accès autorisé
|
||||||
|
179
core/vendor/tinymce/init.js
vendored
179
core/vendor/tinymce/init.js
vendored
@ -7,52 +7,65 @@
|
|||||||
/**
|
/**
|
||||||
* Quand tinyMCE est invoqué hors connexion, initialiser privateKey
|
* Quand tinyMCE est invoqué hors connexion, initialiser privateKey
|
||||||
*/
|
*/
|
||||||
if (typeof (privateKey) == 'undefined') {
|
if (typeof (privateKey) == "undefined") {
|
||||||
var privateKey = null;
|
var privateKey = null;
|
||||||
};
|
};
|
||||||
tinymce.init({
|
tinymce.init({
|
||||||
// Classe où appliquer l'éditeur
|
// Classe où appliquer l"éditeur
|
||||||
selector: ".editorWysiwyg",
|
selector: ".editorWysiwyg",
|
||||||
// Aperçu dans le pied de page
|
// Aperçu dans le pied de page
|
||||||
setup: function (ed) {
|
setup: function (ed) {
|
||||||
ed.on('change', function (e) {
|
ed.on("change", function (e) {
|
||||||
if (ed.id === 'themeFooterText') {
|
if (ed.id === "themeFooterText") {
|
||||||
$("#footerText").html(tinyMCE.get('themeFooterText').getContent());
|
$("#footerText").html(tinyMCE.get("themeFooterText").getContent());
|
||||||
}
|
}
|
||||||
if (ed.id === 'themeHeaderText') {
|
if (ed.id === "themeHeaderText") {
|
||||||
$("#featureContent").html(tinyMCE.get('themeHeaderText').getContent());
|
$("#featureContent").html(tinyMCE.get("themeHeaderText").getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// Langue
|
// Langue
|
||||||
language: getCookie('ZWII_UI') === null ? "fr_FR" : getCookie('ZWII_UI'),
|
language: getCookie("ZWII_UI") === null ? "fr_FR" : getCookie("ZWII_UI"),
|
||||||
// Plugins
|
// 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",
|
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
|
// Contenu du menu
|
||||||
menu: {
|
menu: {
|
||||||
edit: {title: 'Edit', items: 'undo redo | selectall searchreplace | cut copy paste pastetext | style'},
|
edit: {
|
||||||
insert: {title: 'Insert', items: 'template | nonbreaking hr charmap anchor | abbr insertdatetime '},
|
title: "Edit",
|
||||||
format: {title: 'Format', items: 'underline strikethrough superscript subscript | forecolor backcolor | formats | removeformat'},
|
items: "undo redo | selectall searchreplace | cut copy paste pastetext"
|
||||||
table: {title: 'Table', items: 'inserttable tableprops deletetable | cell row column'},
|
},
|
||||||
|
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
|
// Contenu de la barre d'outils
|
||||||
toolbar: [
|
toolbar: [
|
||||||
"fontselect fontsizeselect formatselect | bold italic strikethrough forecolor backcolor",
|
"undo redo | fontsizeselect | h1 h2 h3 | alignleft aligncenter alignright alignjustify | bold forecolor backcolor| bullist numlist | link image media | outdent indent removeformat | fullscreen",
|
||||||
"link image ImgPen media | alignleft aligncenter alignright alignjustify | " +
|
],
|
||||||
"numlist bullist | outdent indent removeformat"
|
|
||||||
],
|
|
||||||
toolbar_sticky: true,
|
toolbar_sticky: true,
|
||||||
fontsize_formats:
|
fontsize_formats: "8pt 9pt 10pt 11pt 12pt 14pt 18pt 24pt 30pt 36pt 48pt 60pt 72pt 96pt",
|
||||||
"8pt 9pt 10pt 11pt 12pt 14pt 18pt 24pt 30pt 36pt 48pt 60pt 72pt 96pt",
|
|
||||||
theme: "silver",
|
theme: "silver",
|
||||||
max_height: 600,
|
max_height: 600,
|
||||||
// CodeMirror
|
// CodeMirror
|
||||||
codemirror: {
|
codemirror: {
|
||||||
indentOnInit: true, // Whether or not to indent code on init.
|
indentOnInit: true, // Whether or not to indent code on init.
|
||||||
path: 'codemirror', // Path to CodeMirror distribution
|
path: "codemirror", // Path to CodeMirror distribution
|
||||||
saveCursorPosition: false, // Insert caret marker
|
saveCursorPosition: false, // Insert caret marker
|
||||||
config: { // CodeMirror config object
|
config: { // CodeMirror config object
|
||||||
fullscreen: true,
|
fullscreen: true,
|
||||||
/*mode: 'application/x-httpd-php',*/
|
/*mode: 'application/x-httpd-php',*/
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
@ -60,32 +73,45 @@ tinymce.init({
|
|||||||
mode: "htmlmixed"
|
mode: "htmlmixed"
|
||||||
},
|
},
|
||||||
jsFiles: [
|
jsFiles: [
|
||||||
'mode/php/php.js',
|
"mode/php/php.js",
|
||||||
'mode/css/css.js',
|
"mode/css/css.js",
|
||||||
'mode/htmlmixed/htmlmixed.js',
|
"mode/htmlmixed/htmlmixed.js",
|
||||||
'mode/htmlembedded/htmlembedded.js',
|
"mode/htmlembedded/htmlembedded.js",
|
||||||
'mode/javascript/javascript.js',
|
"mode/javascript/javascript.js",
|
||||||
'mode/xml/xml.js',
|
"mode/xml/xml.js",
|
||||||
'addon/search/searchcursor.js',
|
"addon/search/searchcursor.js",
|
||||||
'addon/search/search.js',
|
"addon/search/search.js",
|
||||||
],
|
],
|
||||||
/*
|
/*
|
||||||
cssFiles: [
|
cssFiles: [
|
||||||
'theme/cobalt.css',
|
'theme/cobalt.css',
|
||||||
],*/
|
],*/
|
||||||
width: 800, // Default value is 800
|
width: 800, // Default value is 800
|
||||||
height: 500 // Default value is 550
|
height: 500 // Default value is 550
|
||||||
},
|
},
|
||||||
// Cibles de la target
|
// Cibles de la target
|
||||||
target_list: [
|
target_list: [{
|
||||||
{ title: 'None', value: '' },
|
title: 'None',
|
||||||
{ title: 'Nouvel onglet', value: '_blank' }
|
value: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Nouvel onglet',
|
||||||
|
value: '_blank'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
// Target pour lightbox
|
// Target pour lightbox
|
||||||
rel_list: [
|
rel_list: [{
|
||||||
{ title: 'None', value: '' },
|
title: 'None',
|
||||||
{ title: 'Une popup (Lity)', value: 'data-lity' },
|
value: ''
|
||||||
{ title: 'Une galerie d\'images (SimpleLightbox)', value: 'gallery' }
|
},
|
||||||
|
{
|
||||||
|
title: 'Une popup (Lity)',
|
||||||
|
value: 'data-lity'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Une galerie d\'images (SimpleLightbox)',
|
||||||
|
value: 'gallery'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
// Titre des image
|
// Titre des image
|
||||||
image_title: true,
|
image_title: true,
|
||||||
@ -141,29 +167,57 @@ tinymce.init({
|
|||||||
// Contenu du bouton insérer
|
// Contenu du bouton insérer
|
||||||
insert_button_items: "anchor hr table",
|
insert_button_items: "anchor hr table",
|
||||||
// Contenu du bouton formats
|
// Contenu du bouton formats
|
||||||
style_formats: [
|
style_formats: [{
|
||||||
{
|
title: "Headers",
|
||||||
title: "Headers", items: [
|
items: [{
|
||||||
{ title: "Header 1", format: "h1" },
|
title: "Header 1",
|
||||||
{ title: "Header 2", format: "h2" },
|
format: "h1"
|
||||||
{ title: "Header 3", format: "h3" },
|
},
|
||||||
{ title: "Header 4", format: "h4" },
|
{
|
||||||
{ title: "Header 5", format: "h5" },
|
title: "Header 2",
|
||||||
{ title: "Header 6", format: "h6" }
|
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: "Blocks",
|
||||||
{ title: "Paragraph", format: "p" },
|
items: [{
|
||||||
{ title: "Citation", format: "blockquote" },
|
title: "Paragraph",
|
||||||
{ title: "Div", format: "div" },
|
format: "p"
|
||||||
{ title: "Pre", format: "pre" }
|
},
|
||||||
|
{
|
||||||
|
title: "Citation",
|
||||||
|
format: "blockquote"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Div",
|
||||||
|
format: "div"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Pre",
|
||||||
|
format: "pre"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
// Templates
|
// Templates
|
||||||
templates: [
|
templates: [{
|
||||||
{
|
|
||||||
title: "Lien de retour",
|
title: "Lien de retour",
|
||||||
url: baseUrl + "core/vendor/tinymce/templates/back_home.html",
|
url: baseUrl + "core/vendor/tinymce/templates/back_home.html",
|
||||||
description: "Insère un lien de retour à l'accueil de la plate-forme."
|
description: "Insère un lien de retour à l'accueil de la plate-forme."
|
||||||
@ -239,7 +293,9 @@ tinymce.init({
|
|||||||
var id_alarm = "#blogArticleContentAlarm"
|
var id_alarm = "#blogArticleContentAlarm"
|
||||||
var contentLength = 0;
|
var contentLength = 0;
|
||||||
ed.on("keydown", function (e) {
|
ed.on("keydown", function (e) {
|
||||||
contentLength = ed.getContent({ format: 'text' }).length;
|
contentLength = ed.getContent({
|
||||||
|
format: 'text'
|
||||||
|
}).length;
|
||||||
if (contentLength > maxlength) {
|
if (contentLength > maxlength) {
|
||||||
$(id_alarm).html("Vous avez atteint le maximum de " + maxlength + " caractères ! ");
|
$(id_alarm).html("Vous avez atteint le maximum de " + maxlength + " caractères ! ");
|
||||||
if (e.keyCode != 8 && e.keyCode != 46) {
|
if (e.keyCode != 8 && e.keyCode != 46) {
|
||||||
@ -247,19 +303,19 @@ tinymce.init({
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (maxlength - contentLength < alarmCaraMin) {
|
if (maxlength - contentLength < alarmCaraMin) {
|
||||||
$(id_alarm).html((maxlength - contentLength) + " caractères restants");
|
$(id_alarm).html((maxlength - contentLength) + " caractères restants");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$(id_alarm).html(" ");
|
$(id_alarm).html(" ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Limitation y compris lors d'un copier/coller
|
// Limitation y compris lors d'un copier/coller
|
||||||
ed.on("paste", function (e) {
|
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');
|
var data = e.clipboardData.getData('Text');
|
||||||
if (data.length > (maxlength - contentLeng)) {
|
if (data.length > (maxlength - contentLeng)) {
|
||||||
$(id_alarm).html("Vous alliez dépasser le maximum de " + maxlength + " caractères ! ");
|
$(id_alarm).html("Vous alliez dépasser le maximum de " + maxlength + " caractères ! ");
|
||||||
@ -267,8 +323,7 @@ tinymce.init({
|
|||||||
} else {
|
} else {
|
||||||
if (maxlength - contentLeng < alarmCaraMin) {
|
if (maxlength - contentLeng < alarmCaraMin) {
|
||||||
$(id_alarm).html((maxlength - contentLeng - data.length) + " caractères restants");
|
$(id_alarm).html((maxlength - contentLeng - data.length) + " caractères restants");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$(id_alarm).html(" ");
|
$(id_alarm).html(" ");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user