groupEdit WIP

This commit is contained in:
Fred Tempez 2023-03-10 16:49:49 +01:00
parent 6641556084
commit 7dce2beb3b
3 changed files with 174 additions and 44 deletions

View File

@ -962,7 +962,7 @@ class layout extends common
$rightItems = ''; $rightItems = '';
if ($this->getUser('group') >= self::GROUP_MODERATOR) { if ($this->getUser('group') >= self::GROUP_MODERATOR) {
$rightItems .= '<li>' . template::ico('folder', [ $rightItems .= '<li>' . template::ico('folder', [
'help' => 'Gérer les fichiers', 'help' => 'Fichiers',
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']), 'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']),
'attr' => 'data-lity' 'attr' => 'data-lity'
]) . '</li>'; ]) . '</li>';
@ -973,7 +973,7 @@ class layout extends common
'href' => helper::baseUrl() . 'theme' 'href' => helper::baseUrl() . 'theme'
]) . '</li>'; ]) . '</li>';
$rightItems .= '<li>' . template::ico('puzzle', [ $rightItems .= '<li>' . template::ico('puzzle', [
'help' => 'Gérer les modules', 'help' => 'Modules',
'href' => helper::baseUrl() . 'plugin' 'href' => helper::baseUrl() . 'plugin'
]) . '</li>'; ]) . '</li>';
$rightItems .= '<li>' . template::ico('flag', [ $rightItems .= '<li>' . template::ico('flag', [

View File

@ -1,13 +1,13 @@
<?php echo template::formOpen('userEditForm'); ?> <?php echo template::formOpen('userEditForm'); ?>
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
<?php if ($this->getUser('group') === self::GROUP_ADMIN) : ?> <?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::button('userEditBack', [ <?php echo template::button('userEditBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'user', 'href' => helper::baseUrl() . 'user',
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
<?php else : ?> <?php else: ?>
<?php echo template::button('userEditBack', [ <?php echo template::button('userEditBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl(false), 'href' => helper::baseUrl(false),
@ -22,7 +22,8 @@
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<div class="block"> <div class="block">
<h4><?php echo helper::translate('Identité'); ?> <h4>
<?php echo helper::translate('Identité'); ?>
</h4> </h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
@ -60,7 +61,8 @@
</div> </div>
<div class="col6"> <div class="col6">
<div class="block"> <div class="block">
<h4><?php echo helper::translate('Authentification'); ?> <h4>
<?php echo helper::translate('Authentification'); ?>
</h4> </h4>
<?php echo template::text('userEditId', [ <?php echo template::text('userEditId', [
'autocomplete' => 'off', 'autocomplete' => 'off',
@ -70,7 +72,8 @@
'value' => $this->getUrl(2) 'value' => $this->getUrl(2)
]); ?> ]); ?>
<?php echo template::password('userEditOldPassword', [ <?php echo template::password('userEditOldPassword', [
'autocomplete' => 'new-password', // remplace 'off' pour éviter le pré remplissage auto 'autocomplete' => 'new-password',
// remplace 'off' pour éviter le pré remplissage auto
'label' => 'Ancien mot de passe' 'label' => 'Ancien mot de passe'
]); ?> ]); ?>
<?php echo template::password('userEditNewPassword', [ <?php echo template::password('userEditNewPassword', [
@ -87,45 +90,59 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4><?php echo helper::translate('Paramètres'); ?> <h4>
<?php echo helper::translate('Paramètres'); ?>
</h4> </h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::select('userEditLanguage', $module::$languagesInstalled, [ <?php echo template::select('userEditLanguage', $module::$languagesInstalled, [
'label' => 'Langues', 'label' => 'Langues',
'selected' => $this->getData(['user', $this->getUser('id'), 'language']) 'selected' => $this->getData(['user', $this->getUser('id'), 'language'])
]); ?>
</div>
<div class="col6">
<?php if ($this->getUser('group') === self::GROUP_ADMIN) : ?>
<?php echo template::select('userEditGroup', self::$groupEdits, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
'label' => 'Groupe',
'selected' => $this->getData(['user', $this->getUrl(2), 'group'])
]); ?> ]); ?>
<div id="userEditMemberFiles" class="displayNone"> </div>
<?php echo template::checkbox('userEditFiles', true, 'Partage de fichiers autorisé', [ <div class="col6">
'checked' => $this->getData(['user', $this->getUrl(2), 'files']), <?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
'help' => 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers' <?php echo template::select('userEditGroup', self::$groupEdits, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
'label' => 'Groupe',
'selected' => $this->getData(['user', $this->getUrl(2), 'group'])
]); ?> ]); ?>
</div> <div id="userEditMemberFiles" class="displayNone">
<div id="userEditLabelAuth"> <?php echo template::checkbox('userEditFiles', true, 'Partage de fichiers autorisé', [
<?php echo helper::translate('Permissions :'); ?> 'checked' => $this->getData(['user', $this->getUrl(2), 'files']),
</div> 'help' => 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers'
<ul id="userEditGroupDescription<?php echo self::GROUP_MEMBER; ?>" class="userEditGroupDescription displayNone"> ]); ?>
<li><?php echo helper::translate('Accès aux pages privées'); ?></li> </div>
</ul> <div id="userEditLabelAuth">
<ul id="userEditGroupDescription<?php echo self::GROUP_MODERATOR; ?>" class="userEditGroupDescription displayNone"> <?php echo helper::translate('Permissions :'); ?>
<li><?php echo helper::translate('Accès aux pages privées'); ?></li> </div>
<li><?php echo helper::translate('Ajout - Édition - Suppression de pages'); ?></li> <ul id="userEditGroupDescription<?php echo self::GROUP_MEMBER; ?>"
<li><?php echo helper::translate('Ajout - Édition - Suppression de fichiers'); ?></li> class="userEditGroupDescription displayNone">
</ul> <li>
<ul id="userEditGroupDescription<?php echo self::GROUP_ADMIN; ?>" class="userEditGroupDescription displayNone"> <?php echo helper::translate('Accès aux pages privées'); ?>
<li><?php echo helper::translate('Administration complète du site'); ?></li> </li>
</ul> </ul>
<?php endif; ?> <ul id="userEditGroupDescription<?php echo self::GROUP_MODERATOR; ?>"
</div> class="userEditGroupDescription displayNone">
<li>
<?php echo helper::translate('Accès aux pages privées'); ?>
</li>
<li>
<?php echo helper::translate('Ajout - Édition - Suppression de pages'); ?>
</li>
<li>
<?php echo helper::translate('Ajout - Édition - Suppression de fichiers'); ?>
</li>
</ul>
<ul id="userEditGroupDescription<?php echo self::GROUP_ADMIN; ?>"
class="userEditGroupDescription displayNone">
<li>
<?php echo helper::translate('Administration complète du site'); ?>
</li>
</ul>
<?php endif; ?>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<?php echo template::formOpen('groupEditForm'); ?> <?php echo template::formOpen('groupEditForm'); ?>
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
<?php echo template::button('userEditBack', [ <?php echo template::button('groupEditBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'user', 'href' => helper::baseUrl() . 'user',
'value' => template::ico('left') 'value' => template::ico('left')
@ -11,3 +11,116 @@
<?php echo template::submit('groupEditSubmit'); ?> <?php echo template::submit('groupEditSubmit'); ?>
</div> </div>
</div> </div>
<div class="row">
<div class="col12">
<div class="block">
<h4>
<?php echo helper::translate('Opérations sur les fichiers'); ?>
</h4>
<div class="row">
<div class="col12">
<div class="row">
<div class="col2">
<?php echo template::checkbox('groupEditDownload', true, 'Téléchargement', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'download'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditEdit', true, 'Edition', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'edit'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditCreate', true, 'Création', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'create'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditRename', true, 'Nommage', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'rename'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditUpload', true, 'Téléversement', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'upload'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditDelete', true, 'Effacement', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'delete'])
]); ?>
</div>
</div>
<div class="row">
<div class="col2">
<?php echo template::checkbox('groupEditPreview', true, 'Prévisualisation', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'preview'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditDuplicate', true, 'Duplication', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'duplicate'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditExtract', true, 'Extraction', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'extract'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditCopycut', true, 'Coupé collé', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'copycut'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditPermission', true, 'Permissions', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'permission'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>
<?php echo helper::translate('Opérations sur les dossiers'); ?>
</h4>
<div class="row">
<div class="col12">
<div class="row">
<div class="col2">
<?php echo template::checkbox('groupEditFolderCreate', true, 'Création', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'create'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditFolderDelete', true, 'Effacement', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'delete'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditFolderRename', true, 'Nommage', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'rename'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditFolderCopycut', true, 'Coupé collé', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'copycut'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('groupEditFolderPermission', true, 'Permissions', [
'checked' => $this->getData(['group', $this->getUrl(2), 'file', 'permission'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>