News editeur + corrections blog

This commit is contained in:
Deltacms 2022-11-10 09:00:05 +01:00
parent 90ad87f1cb
commit 9c9688ad63
8 changed files with 29 additions and 25 deletions

View File

@ -2,7 +2,9 @@
## Version 4.4.01 de Deltacms
- Modifications :
- Ajout du groupe éditeur
- Ajout du groupe éditeur, autorisations limitées à l'édition des pages, l'ajout de fichiers, l'accès aux pages privées membre et éditeur,
- Adaptation des modules de page à ce nouveau groupe avec des actions autorisées très limitées,
-
## Version 4.3.08 de Deltacms
- Modifications :

View File

@ -88,11 +88,10 @@ echo template::formOpen('blogAddForm'); ?>
<div class="block">
<h4><?php echo $text['blog_view']['add'][11]; ?></h4>
<div class="row">
<div class="col4">
<div class="col4 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<?php echo template::select('blogAddUserId', $module::$users, [
'label' => $text['blog_view']['add'][12],
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
'selected' => $this->getUser('id')
]); ?>
</div>
<div class="col4">
@ -102,12 +101,11 @@ echo template::formOpen('blogAddForm'); ?>
'value' => time()
]); ?>
</div>
<div class="col4">
<div class="col4 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<?php echo template::select('blogAddConsent', $articleConsent , [
'label' => $text['blog_view']['add'][15],
'selected' => $module::EDIT_ALL,
'help' => $text['blog_view']['add'][16],
'disabled' => $this->getUser('group') >= self::GROUP_MODERATOR ? false : true
'help' => $text['blog_view']['add'][16]
]); ?>
</div>
</div>

View File

@ -13,21 +13,21 @@ echo template::formOpen('blogConfig'); ?>
'value' => $text['blog_view']['config'][0]
]); ?>
</div>
<div class="col2 offset4">
<?php if($this->getUser('group') >= self::GROUP_MODERATOR) { echo template::button('blogConfigTexts', [
<div class="col2 offset4 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<?php echo template::button('blogConfigTexts', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/texts',
'ico' => '',
'value' => $text['blog_view']['config'][13]
]); } ?>
]); ?>
</div>
<div class="col2">
<div class="col2 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'offset8'; ?>">
<?php echo template::button('blogConfigAdd', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/add',
'ico' => 'plus',
'value' => $text['blog_view']['config'][1]
]); ?>
</div>
<div class="col2">
<div class="col2 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<?php echo template::submit('blogConfigSubmit',[
'value' => $text['blog_view']['config'][2]
]); ?>

View File

@ -93,11 +93,10 @@ echo template::formOpen('blogEditForm'); ?>
<div class="block">
<h4><?php echo $text['blog_view']['edit'][11]; ?></h4>
<div class="row">
<div class="col4">
<div class="col4 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<?php echo template::select('blogEditUserId', $module::$users, [
'label' => $text['blog_view']['edit'][12],
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
'selected' => $this->getUser('id')
]); ?>
</div>
<div class="col4">
@ -107,12 +106,11 @@ echo template::formOpen('blogEditForm'); ?>
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn'])
]); ?>
</div>
<div class="col4">
<div class="col4 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<?php echo template::select('blogEditConsent', $articleConsent , [
'label' => $text['blog_view']['edit'][15],
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => $text['blog_view']['edit'][16],
'disabled' => $this->getUser('group') >= self::GROUP_MODERATOR ? false : true
'help' => $text['blog_view']['edit'][16]
]); ?>
</div>
</div>

View File

@ -265,7 +265,8 @@ class news extends common {
template::button('newsConfigDelete' . $newsIds[$i], [
'class' => 'newsConfigDelete buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $newsIds[$i] . '/' . $_SESSION['csrf'],
'value' => template::ico('cancel')
'value' => template::ico('cancel'),
'disabled' => $this->getUser('group') >= self::GROUP_MODERATOR ? false : true
])
];
}
@ -579,6 +580,11 @@ class news extends common {
$this->setData(['module',$this->getUrl(0),'config', 'noMargin', true ]);
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.2' ]);
}
// Mise à jour 4.4
if (version_compare($versionData, '4.4', '<') ) {
// Mettre à jour la version
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '4.4' ]);
}
}
/**

View File

@ -54,7 +54,7 @@ echo template::formOpen('newsAddForm'); ?>
<div class="block">
<h4><?php echo $text['news_view']['add'][6]; ?></h4>
<div class="row">
<div class="col4">
<div class="col4 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<?php echo template::select('newsAddUserId', $module::$users, [
'label' => $text['news_view']['add'][4],
'selected' => $this->getUser('id')

View File

@ -12,20 +12,20 @@ echo template::formOpen('newsConfig'); ?>
'value' => $text['news_view']['config'][0]
]); ?>
</div>
<div class="col2 offset6">
<div class="col2 <?php echo ($this->getUser('group') < self::GROUP_MODERATOR ? 'offset8' : 'offset6'); ?> ">
<?php echo template::button('newsConfigAdd', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/add',
'ico' => 'plus',
'value' => $text['news_view']['config'][1]
]); ?>
</div>
<div class="col2">
<div class="col2 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?>">
<?php echo template::submit('newsConfigSubmit',[
'value' => $text['news_view']['config'][2]
]); ?>
</div>
</div>
<div class="row">
<div class="row <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<div class="col12">
<div class="block">
<h4><?php echo $text['news_view']['config'][3]; ?></h4>
@ -87,7 +87,7 @@ echo template::formOpen('newsConfig'); ?>
</div>
</div>
</div>
<div class="row">
<div class="row <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<div class="col12">
<div class="block">
<h4><?php echo $text['news_view']['config'][10]; ?></h4>

View File

@ -56,7 +56,7 @@ echo template::formOpen('newsEditForm'); ?>
<div class="block">
<h4><?php echo $text['news_view']['edit'][5]; ?></h4>
<div class="row">
<div class="col4">
<div class="col4 <?php if($this->getUser('group') < self::GROUP_MODERATOR) echo 'displayNone'; ?> ">
<?php echo template::select('newsEditUserId', $module::$users, [
'label' => $text['news_view']['edit'][6],
'selected' => $this->getUser('id')