Deltacms/core/module/user/view/edit/edit.php

210 lines
7.6 KiB
PHP

<?php echo template::formOpen('userEditForm');
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Prénom';
$text[3] = 'Nom';
$text[4] = 'Pseudo';
$text[5] = 'Signature';
$text[6] = 'Adresse mail';
$text[7] = 'Groupe';
$text[8] = 'Partage de fichiers autorisé';
$text[9] = 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers';
$text[10] = 'Autorisations :';
$text[11] = 'Accès aux pages privées membres';
$text[12] = 'Accès aux pages privées membres et éditeurs';
$text[13] = 'Informations générales';
$text[14] = 'Ajout / Édition / Suppression de pages';
$text[15] = 'Ajout / Édition / Suppression de fichiers';
$text[16] = 'Accès à toutes les pages privées';
$text[17] = 'Ajout / Édition / Suppression de dossiers';
$text[18] = 'Ajout / Édition / Suppression d\'utilisateurs';
$text[19] = 'Configuration du site';
$text[20] = 'Personnalisation du thème';
$text[21] = 'Authentification';
$text[22] = 'Identifiant';
$text[23] = 'Ancien mot de passe';
$text[24] = 'Confirmation';
$text[25] = 'Prévenir l\'utilisateur par mail';
$text[26] = 'Redirection';
$text[27] = 'Redirection après connexion';
$text[28] = 'Choisir Aucune si vous ne souhaitez pas de redirection.';
$text[29] = 'Enregistrer';
$text[30] = 'Impossible de modifier votre propre groupe.';
$text[31] = 'L\'identifiant est défini lors de la création du compte, il ne peut pas être modifié.';
$text[32] = 'Nouveau mot de passe';
$signature = $module::$signature;
$groupEdits = self::$groupEdits;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Vorname';
$text[3] = 'Name';
$text[4] = 'Pseudo';
$text[5] = 'Signature';
$text[6] = 'Email address';
$text[7] = 'Group';
$text[8] = 'File sharing allowed';
$text[9] = 'This member will be able to upload or download files to the \'partage\' folder and its subfolders';
$text[10] = 'Authorisations :';
$text[11] = 'Access to private member pages';
$text[12] = 'Access to members\' and editors\' private pages';
$text[13] = 'General information';
$text[14] = 'Add / Edit / Delete pages';
$text[15] = 'Add / Edit / Delete files';
$text[16] = 'Access to all private pages';
$text[17] = 'Add / Edit / Delete folders';
$text[18] = 'Add / Edit / Delete users';
$text[19] = 'Site configuration';
$text[20] = 'Theme customisation';
$text[21] = 'Authentification';
$text[22] = 'Identifier';
$text[23] = 'Old Password';
$text[24] = 'Confirmation';
$text[25] = 'Notify the user by email';
$text[26] = 'Redirection';
$text[27] = 'Redirection after login';
$text[28] = 'Select \'Aucune\' if you do not want a redirection.';
$text[29] = 'Register';
$text[30] = 'You cannot change your own group.';
$text[31] = 'The username is defined when the account is created and cannot be changed.';
$text[32] = 'New password';
$signature = $module::$signature_en;
$groupEdits = self::$groupEdits_en;
break;
}
?>
<div class="row">
<div class="col2">
<?php if($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::button('userEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'user',
'ico' => 'left',
'value' => $text[0]
]); ?>
<?php else: ?>
<?php echo template::button('userEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl(false),
'ico' => 'home',
'value' => $text[0]
]); ?>
<?php endif; ?>
</div>
<div class="col2 offset8">
<?php echo template::submit('userEditSubmit', [
'value'=> $text[29]
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<div class="block">
<h4><?php echo $text[13]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::text('userEditFirstname', [
'autocomplete' => 'off',
'disabled' => $this->getUser('group') > 2 ? false : true,
'label' => $text[2],
'value' => $this->getData(['user', $this->getUrl(2), 'firstname'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('userEditLastname', [
'autocomplete' => 'off',
'disabled' => $this->getUser('group') > 2 ? false : true,
'label' => $text[3],
'value' => $this->getData(['user', $this->getUrl(2), 'lastname'])
]); ?>
</div>
</div>
<?php echo template::text('userEditPseudo', [
'autocomplete' => 'off',
'label' => $text[4],
'value' => $this->getData(['user', $this->getUrl(2), 'pseudo'])
]); ?>
<?php echo template::select('userEditSignature', $signature, [
'label' => $text[5],
'selected' => $this->getData(['user', $this->getUrl(2), 'signature'])
]); ?>
<?php echo template::mail('userEditMail', [
'autocomplete' => 'off',
'label' => $text[6],
'value' => $this->getData(['user', $this->getUrl(2), 'mail'])
]); ?>
<?php if($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::select('userEditGroup', $groupEdits, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? $text[30] : ''),
'label' => $text[7],
'selected' => $this->getData(['user', $this->getUrl(2), 'group'])
]); ?>
<div id="userEditMemberFiles" class="displayNone">
<?php echo template::checkbox('userEditFiles', true, $text[8], [
'checked' => $this->getData(['user', $this->getUrl(2), 'files']),
'help' => $text[9]
]); ?>
</div>
<div id="userEditLabelAuth"><?php echo $text[10]; ?></div>
<ul id="userEditGroupDescription<?php echo self::GROUP_MEMBER; ?>" class="userEditGroupDescription displayNone">
<li><?php echo $text[11]; ?></li>
</ul>
<ul id="userEditGroupDescription<?php echo self::GROUP_MODERATOR; ?>" class="userEditGroupDescription displayNone">
<li><?php echo $text[12]; ?></li>
<li><?php echo $text[14]; ?></li>
<li><?php echo $text[15]; ?></li>
</ul>
<ul id="userEditGroupDescription<?php echo self::GROUP_ADMIN; ?>" class="userEditGroupDescription displayNone">
<li><?php echo $text[16]; ?></li>
<li><?php echo $text[14]; ?></li>
<li><?php echo $text[15]; ?></li>
<li><?php echo $text[17]; ?></li>
<li><?php echo $text[18]; ?></li>
<li><?php echo $text[19]; ?></li>
<li><?php echo $text[20]; ?></li>
</ul>
<?php endif; ?>
</div>
</div>
<div class="col6">
<div class="block">
<h4><?php echo $text[21]; ?></h4>
<?php echo template::text('userEditId', [
'autocomplete' => 'off',
'help' => $text[31],
'label' => $text[22],
'readonly' => true,
'value' => $this->getUrl(2)
]); ?>
<?php echo template::password('userEditOldPassword', [
'autocomplete' => 'new-password', // remplace 'off' pour éviter le pré remplissage auto
'label' => $text[23]
]); ?>
<?php echo template::password('userEditNewPassword', [
'autocomplete' => 'off',
'label' => $text[32]
]); ?>
<?php echo template::password('userEditConfirmPassword', [
'autocomplete' => 'off',
'label' => $text[24]
]); ?>
</div>
<div class="block">
<h4><?php echo $text[26]; ?></h4>
<?php echo template::select('userRedirectPageId', helper::arrayCollumn($module::$pagesList, 'title'), [
'label' => $text[27],
'selected' =>$this->getData(['user', $this->getUrl(2),'redirectPageId']),
'help' => $text[28]
]); ?>
</div>
</div>
</div>
<?php echo template::formClose(); ?>