This commit is contained in:
Deltacms 2022-11-09 11:08:45 +01:00
parent 23e33f7f89
commit 0727a52f6f
4 changed files with 67 additions and 63 deletions

View File

@ -27,12 +27,12 @@ class form extends common {
public static $actions = [
'config' => self::GROUP_EDITOR,
'update' => self::GROUP_EDITOR,
'data' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'deleteall' => self::GROUP_EDITOR,
'data' => self::GROUP_MODERATOR,
'delete' => self::GROUP_MODERATOR,
'deleteall' => self::GROUP_MODERATOR,
'index' => self::GROUP_VISITOR,
'export2csv' => self::GROUP_EDITOR,
'output2csv' => self::GROUP_EDITOR
'export2csv' => self::GROUP_MODERATOR,
'output2csv' => self::GROUP_MODERATOR
];
public static $data = [];
@ -85,8 +85,8 @@ class form extends common {
$this->setData(['module', $this->getUrl(0), 'config', 'uploadTxt',false]);
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.1']);
}
if( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.4', '<') ){
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '4.4']);
if( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.5', '<') ){
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '4.5']);
}
}

View File

@ -83,7 +83,8 @@ $signature = [
if( $param === 'form_view'){
$groupNews = [
self::GROUP_MEMBER => 'Member',
self::GROUP_MODERATOR => 'Editor',
self::GROUP_EDITOR => 'Editor',
self::GROUP_MODERATOR => 'Moderator',
self::GROUP_ADMIN => 'Administrator'
];
$types = [

View File

@ -83,7 +83,8 @@ $signature = [
if( $param === 'form_view'){
$groupNews = [
self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur',
self::GROUP_EDITOR => 'Éditeur',
self::GROUP_MODERATOR => 'Modérateur',
self::GROUP_ADMIN => 'Administrateur'
];
$types = [

View File

@ -63,13 +63,13 @@ include('./module/form/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) .
'value' => $text['form_view']['config'][4]
]); ?>
</div>
<div class="col3 offset5">
<div class="col3 offset5" <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo '<div style="display: none;">'; ?>>
<?php echo template::button('formConfigData', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/data',
'value' => $text['form_view']['config'][5]
]); ?>
</div>
<div class="col2">
<div class="col2 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'offset8'; ?>">
<?php echo template::submit('formConfigSubmit',[
'value' => $text['form_view']['config'][30]
]); ?>
@ -84,58 +84,60 @@ include('./module/form/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) .
'label' => $text['form_view']['config'][8],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'button'])
]); ?>
<?php echo template::checkbox('formConfigMailOptionsToggle', true, $text['form_view']['config'][9], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) ||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])),
'help' => $text['form_view']['config'][10]
]); ?>
<div id="formConfigMailOptions" class="displayNone">
<div class="row">
<div class="col11 offset1">
<?php echo template::text('formConfigSubject', [
'help' => $text['form_view']['config'][11],
'label' => $text['form_view']['config'][12],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'subject'])
]); ?>
</div>
</div>
<?php
// Element 0 quand aucun membre a été sélectionné
$groupMembers = [''] + $groupNews;
?>
<div class="row">
<div class="col3 offset1">
<?php echo template::select('formConfigGroup', $groupMembers, [
'label' => $text['form_view']['config'][13],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']),
'help' => $text['form_view']['config'][14]
]); ?>
</div>
<div class="col3">
<?php echo template::select('formConfigUser', $module::$listUsers, [
'label' => $text['form_view']['config'][15],
'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']),$module::$listUsers)
]); ?>
</div>
<div class="col4">
<?php echo template::text('formConfigMail', [
'label' => $text['form_view']['config'][16],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'mail']),
'help' => $text['form_view']['config'][17]
]); ?>
</div>
</div>
<div class="row">
<div class="col6 offset1">
<?php echo template::checkbox('formConfigMailReplyTo', true, $text['form_view']['config'][18], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'replyto']),
'help' => $text['form_view']['config'][19]
<div <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo '<div style="display: none;">'; ?> >
<?php echo template::checkbox('formConfigMailOptionsToggle', true, $text['form_view']['config'][9], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) ||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])),
'help' => $text['form_view']['config'][10]
]); ?>
<div id="formConfigMailOptions" class="displayNone">
<div class="row">
<div class="col11 offset1">
<?php echo template::text('formConfigSubject', [
'help' => $text['form_view']['config'][11],
'label' => $text['form_view']['config'][12],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'subject'])
]); ?>
</div>
</div>
<?php
// Element 0 quand aucun membre a été sélectionné
$groupMembers = [''] + $groupNews;
?>
<div class="row">
<div class="col3 offset1">
<?php echo template::select('formConfigGroup', $groupMembers, [
'label' => $text['form_view']['config'][13],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']),
'help' => $text['form_view']['config'][14]
]); ?>
</div>
<div class="col3">
<?php echo template::select('formConfigUser', $module::$listUsers, [
'label' => $text['form_view']['config'][15],
'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']),$module::$listUsers)
]); ?>
</div>
<div class="col4">
<?php echo template::text('formConfigMail', [
'label' => $text['form_view']['config'][16],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'mail']),
'help' => $text['form_view']['config'][17]
]); ?>
</div>
</div>
<div class="row">
<div class="col6 offset1">
<?php echo template::checkbox('formConfigMailReplyTo', true, $text['form_view']['config'][18], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'replyto']),
'help' => $text['form_view']['config'][19]
]); ?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="row" <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo '<div style="display: none;">'; ?> >
<div class="col4">
<?php echo template::select('formConfigSignature', $signature, [
'label' => $text['form_view']['config'][20],
@ -156,7 +158,7 @@ include('./module/form/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) .
]); ?>
</div>
</div>
<div class="row">
<div class="row" <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo '<div style="display: none;">'; ?>>
<div class="col6">
<?php echo template::checkbox('formConfigPageIdToggle', true, $text['form_view']['config'][24], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
@ -170,14 +172,14 @@ include('./module/form/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) .
]); ?>
</div>
</div>
<div class="row">
<div class="row" <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo '<div style="display: none;">'; ?>>
<div class="col6">
<?php echo template::checkbox('formConfigCaptcha', true, $text['form_view']['config'][26], [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'captcha'])
]); ?>
</div>
</div>
<div class="row">
<div class="row" <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo '<div style="display: none;">'; ?>>
<div class="col4">
<?php echo template::select('formConfigMaxSize', $module::$maxSizeUpload, [
'label' => $text['form_view']['config'][31],
@ -222,7 +224,7 @@ include('./module/form/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) .
</div>
</div>
</div>
<div class="block">
<div class="block" <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo '<div style="display: none;">'; ?>>
<h4><?php echo $text['form_view']['config'][27]; ?></h4>
<div id="formConfigNoInput">
<?php echo template::speech($text['form_view']['config'][28]); ?>