Les pages gèrent les profils
This commit is contained in:
parent
03504a6402
commit
fa4fb40872
@ -65,6 +65,8 @@ class page extends common
|
|||||||
true => 'Menu accessoire'
|
true => 'Menu accessoire'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public static $userProfils = [];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duplication
|
* Duplication
|
||||||
@ -439,6 +441,18 @@ class page extends common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Détermine le groupe selon que la page est une barre ou une page standard
|
||||||
|
$group = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
|
||||||
|
|
||||||
|
//Détermine le profil d'utilisateur en fonction du groupe sinon le groupe vaut 0
|
||||||
|
$profil = 0;
|
||||||
|
if (
|
||||||
|
$this->getinput('pageEditBlock') !== 'bar' ||
|
||||||
|
$group === 1 ||
|
||||||
|
$group === 2
|
||||||
|
) {
|
||||||
|
$profil = $this->getInput('pageEditProfil' . $group, helper::FILTER_INT);
|
||||||
|
}
|
||||||
|
|
||||||
// Modifie la page ou en crée une nouvelle si l'id a changé
|
// Modifie la page ou en crée une nouvelle si l'id a changé
|
||||||
$this->setData([
|
$this->setData([
|
||||||
@ -457,7 +471,8 @@ class page extends common
|
|||||||
'modulePosition' => $this->getInput('pageModulePosition'),
|
'modulePosition' => $this->getInput('pageModulePosition'),
|
||||||
'parentPageId' => $this->getInput('pageEditParentPageId'),
|
'parentPageId' => $this->getInput('pageEditParentPageId'),
|
||||||
'position' => $position,
|
'position' => $position,
|
||||||
'group' => $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0,
|
'group' => $group,
|
||||||
|
'profil' => $profil,
|
||||||
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
|
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
|
||||||
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
|
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
|
||||||
'shortTitle' => $this->getInput('pageEditShortTitle', helper::FILTER_STRING_SHORT, true),
|
'shortTitle' => $this->getInput('pageEditShortTitle', helper::FILTER_STRING_SHORT, true),
|
||||||
@ -528,7 +543,20 @@ class page extends common
|
|||||||
self::$pagesBarId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
|
self::$pagesBarId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Profils installés
|
||||||
|
// Profils disponibles
|
||||||
|
foreach ($this->getData(['profil']) as $profilId => $profilData) {
|
||||||
|
if ($profilId < self::GROUP_MEMBER) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($profilId === self::GROUP_ADMIN) {
|
||||||
|
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
foreach ($profilData as $key => $value) {
|
||||||
|
self::$userProfils[$profilId][$key] = $profilData[$key]['name'];
|
||||||
|
}
|
||||||
|
}
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => $this->getData(['page', $this->getUrl(2), 'title']),
|
'title' => $this->getData(['page', $this->getUrl(2), 'title']),
|
||||||
|
@ -44,3 +44,7 @@
|
|||||||
background-color: #00BFFF;
|
background-color: #00BFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pageEditProfil1Wrapper,
|
||||||
|
#pageEditProfil2Wrapper {
|
||||||
|
padding: 0;
|
||||||
|
}
|
@ -54,6 +54,16 @@ function protectModule() {
|
|||||||
*/
|
*/
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
|
|
||||||
|
// Changement de profil
|
||||||
|
$(".pageEditGroupProfil").hide();
|
||||||
|
$("#pageEditGroupProfil" + $("#pageEditGroup").val()).show();
|
||||||
|
|
||||||
|
$("#pageEditGroup").on("change", function () {
|
||||||
|
$(".pageEditGroupProfil").hide();
|
||||||
|
$("#pageEditGroupProfil" + $(this).val()).show();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sélection des onglets
|
* Sélection des onglets
|
||||||
*/
|
*/
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php $href = helper::baseUrl() . $this->getUrl(2); ?>
|
<?php $href = helper::baseUrl() . $this->getUrl(2); ?>
|
||||||
<?php if ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code') $href = helper::baseUrl(); ?>
|
<?php if ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code')
|
||||||
|
$href = helper::baseUrl(); ?>
|
||||||
<?php echo template::button('pageEditBack', [
|
<?php echo template::button('pageEditBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => $href,
|
'href' => $href,
|
||||||
@ -11,12 +12,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php /**echo template::button('pageEditHelp', [
|
<?php /**echo template::button('pageEditHelp', [
|
||||||
'href' => 'https://doc.zwiicms.fr/edition-des-pages',
|
'href' => 'https://doc.zwiicms.fr/edition-des-pages',
|
||||||
'target' => '_blank',
|
'target' => '_blank',
|
||||||
'value' => template::ico('help'),
|
'value' => template::ico('help'),
|
||||||
'class' => 'buttonHelp',
|
'class' => 'buttonHelp',
|
||||||
'help' => 'Consulter l\'aide en ligne'
|
'help' => 'Consulter l\'aide en ligne'
|
||||||
]); */ ?>
|
]); */?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col1 offset6">
|
<div class="col1 offset6">
|
||||||
<?php echo template::button('pageEditDelete', [
|
<?php echo template::button('pageEditDelete', [
|
||||||
@ -67,7 +68,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Titres'); ?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Titres'); ?>
|
||||||
<!--<span id="infoHelpButton" class="helpDisplayButton">
|
<!--<span id="infoHelpButton" class="helpDisplayButton">
|
||||||
<a href="https://doc.zwiicms.fr/informations-generales" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
<a href="https://doc.zwiicms.fr/informations-generales" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||||
@ -119,7 +121,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Emplacement dans le menu'); ?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Emplacement dans le menu'); ?>
|
||||||
<!--<span id="positionHelpButton" class="helpDisplayButton">
|
<!--<span id="positionHelpButton" class="helpDisplayButton">
|
||||||
<a href="https://doc.zwiicms.fr/emplacement-dans-le-menu" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
<a href="https://doc.zwiicms.fr/emplacement-dans-le-menu" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||||
@ -135,11 +138,11 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php if ($this->getHierarchy($this->getUrl(2), false)) : ?>
|
<?php if ($this->getHierarchy($this->getUrl(2), false)): ?>
|
||||||
<?php echo template::hidden('pageEditParentPageId', [
|
<?php echo template::hidden('pageEditParentPageId', [
|
||||||
'value' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
|
'value' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php else : ?>
|
<?php else: ?>
|
||||||
<?php echo template::select('pageEditParentPageId', $module::$pagesNoParentId, [
|
<?php echo template::select('pageEditParentPageId', $module::$pagesNoParentId, [
|
||||||
'label' => 'Page parent',
|
'label' => 'Page parent',
|
||||||
'selected' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
|
'selected' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
|
||||||
@ -174,7 +177,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Options avancées'); ?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Options avancées'); ?>
|
||||||
<!--<span id="advancedHelpButton" class="helpDisplayButton">
|
<!--<span id="advancedHelpButton" class="helpDisplayButton">
|
||||||
<a href="https://doc.zwiicms.fr/options-d-emplacement-avancee" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
<a href="https://doc.zwiicms.fr/options-d-emplacement-avancee" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||||
@ -221,7 +225,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Module'); ?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Module'); ?>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col10">
|
<div class="col10">
|
||||||
@ -258,7 +263,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Contenu avancé');?></h4>
|
<h4>
|
||||||
|
<?php echo helper::translate('Contenu avancé'); ?>
|
||||||
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6 offset3">
|
<div class="col6 offset3">
|
||||||
<?php echo template::button('pageEditCssEditor', [
|
<?php echo template::button('pageEditCssEditor', [
|
||||||
@ -286,7 +293,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Mise en page'); ?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Mise en page'); ?>
|
||||||
<!--<span id="layoutHelpButton" class="helpDisplayButton">
|
<!--<span id="layoutHelpButton" class="helpDisplayButton">
|
||||||
<a href="https://doc.zwiicms.fr/mise-en-page-2" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
<a href="https://doc.zwiicms.fr/mise-en-page-2" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||||
@ -308,21 +316,21 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<!-- Sélection des barres latérales -->
|
<!-- Sélection des barres latérales -->
|
||||||
<?php if ($this->getHierarchy($this->getUrl(2), false, true)) : ?>
|
<?php if ($this->getHierarchy($this->getUrl(2), false, true)): ?>
|
||||||
<?php echo template::hidden('pageEditBarLeft', [
|
<?php echo template::hidden('pageEditBarLeft', [
|
||||||
'value' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
'value' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php else : ?>
|
<?php else: ?>
|
||||||
<?php echo template::select('pageEditBarLeft', $module::$pagesBarId, [
|
<?php echo template::select('pageEditBarLeft', $module::$pagesBarId, [
|
||||||
'label' => 'Barre latérale gauche :',
|
'label' => 'Barre latérale gauche :',
|
||||||
'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($this->getHierarchy($this->getUrl(2), false, true)) : ?>
|
<?php if ($this->getHierarchy($this->getUrl(2), false, true)): ?>
|
||||||
<?php echo template::hidden('pageEditBarRight', [
|
<?php echo template::hidden('pageEditBarRight', [
|
||||||
'value' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
'value' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php else : ?>
|
<?php else: ?>
|
||||||
<?php echo template::select('pageEditBarRight', $module::$pagesBarId, [
|
<?php echo template::select('pageEditBarRight', $module::$pagesBarId, [
|
||||||
'label' => 'Barre latérale droite :',
|
'label' => 'Barre latérale droite :',
|
||||||
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
||||||
@ -345,7 +353,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Permission et référencement');?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Permission et référencement'); ?>
|
||||||
<!--<span id="seoHelpButton" class="helpDisplayButton">
|
<!--<span id="seoHelpButton" class="helpDisplayButton">
|
||||||
<a href="https://doc.zwiicms.fr/permission-et-referencement" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
<a href="https://doc.zwiicms.fr/permission-et-referencement" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||||
@ -356,10 +365,31 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class='col6'>
|
<div class='col6'>
|
||||||
<?php echo template::select('pageEditGroup', self::$groupPublics, [
|
<?php echo template::select('pageEditGroup', self::$groupPublics, [
|
||||||
'label' => 'Groupe requis pour accéder à la page :',
|
'label' => 'Groupe minimal pour accéder à la page',
|
||||||
'selected' => $this->getData(['page', $this->getUrl(2), 'group'])
|
'selected' => $this->getData(['page', $this->getUrl(2), 'group']),
|
||||||
|
'help' => 'Les groupes de niveau supérieur accèdent à la page.'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col6">
|
||||||
|
<div class="pageEditGroupProfil displayNone"
|
||||||
|
id="pageEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
|
||||||
|
<?php echo template::select('pageEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
|
||||||
|
'label' => 'Profil minimal pour accéder à la page',
|
||||||
|
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
|
||||||
|
'help' => 'Les profils de niveau supérieur accèdent à la page.',
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="pageEditGroupProfil displayNone"
|
||||||
|
id="pageEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
|
||||||
|
<?php echo template::select('pageEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
|
||||||
|
'label' => 'Profil minimal pour accéder à la page',
|
||||||
|
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
|
||||||
|
'help' => 'Les profils de niveau supérieur accèdent à la page.',
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
<div class='col12'>
|
<div class='col12'>
|
||||||
<?php echo template::text('pageEditMetaTitle', [
|
<?php echo template::text('pageEditMetaTitle', [
|
||||||
'label' => 'Méta-titre',
|
'label' => 'Méta-titre',
|
||||||
|
Loading…
Reference in New Issue
Block a user