v70 Edition de catégorie
This commit is contained in:
parent
98a08b0362
commit
a8d2acd17c
@ -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.70';
|
||||||
|
|
||||||
// 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>
|
Loading…
Reference in New Issue
Block a user