Option de layout datality

This commit is contained in:
fredtempez 2021-03-26 21:52:02 +01:00
parent 02d3a41e26
commit 993089841b
4 changed files with 46 additions and 8 deletions

View File

@ -2074,6 +2074,10 @@ class core extends common {
'disable' => $this->getData(['page', $this->getUrl(0), 'disable']), 'disable' => $this->getData(['page', $this->getUrl(0), 'disable']),
'contentRight' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'content']), 'contentRight' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barRight']),'content']),
'contentLeft' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'content']), 'contentLeft' => $this->getData(['page',$this->getData(['page',$this->getUrl(0),'barLeft']),'content']),
'display' => $this->getData(['page', $this->getUrl(0), 'lity']) === true
&& $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
? self::DISPLAY_LAYOUT_LITY
: $this->output['display']
]); ]);
} }
// Importe le module // Importe le module
@ -2656,6 +2660,9 @@ class layout extends common {
// Propriétés de l'item // Propriétés de l'item
$active = ($parentPageId === $currentPageId OR in_array($currentPageId, $childrenPageIds)) ? 'active ' : ''; $active = ($parentPageId === $currentPageId OR in_array($currentPageId, $childrenPageIds)) ? 'active ' : '';
$targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank"' : ''; $targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank"' : '';
$targetLity = $this->getData(['page', $parentPageId, 'lity'])
&& $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
? ' rel="data-lity" ' : '';
// Mise en page de l'item // Mise en page de l'item
$itemsLeft .= '<li>'; $itemsLeft .= '<li>';
@ -2669,7 +2676,7 @@ class layout extends common {
){ ){
$itemsLeft .= '<a class="' . $parentPageId . '" href="'. helper::baseUrl() . $this->getUrl(0).'">'; $itemsLeft .= '<a class="' . $parentPageId . '" href="'. helper::baseUrl() . $this->getUrl(0).'">';
} else { } else {
$itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . helper::baseUrl() . $parentPageId . '"' . $targetBlank . '>'; $itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . helper::baseUrl() . $parentPageId . '"' . $targetBlank . $targetLity . '>';
} }
switch ($this->getData(['page', $parentPageId, 'typeMenu'])) { switch ($this->getData(['page', $parentPageId, 'typeMenu'])) {
@ -2717,6 +2724,9 @@ class layout extends common {
// Propriétés de l'item // Propriétés de l'item
$active = ($childKey === $currentPageId) ? 'active ' : ''; $active = ($childKey === $currentPageId) ? 'active ' : '';
$targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : ''; $targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : '';
$targetLity = $this->getData(['page', $childKey, 'lity'])
&& $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
? ' rel="data-lity" ' : '';
// Mise en page du sous-item // Mise en page du sous-item
$itemsLeft .= '<li>'; $itemsLeft .= '<li>';
if ( ( $this->getData(['page',$childKey,'disable']) === true if ( ( $this->getData(['page',$childKey,'disable']) === true
@ -2729,7 +2739,7 @@ class layout extends common {
){ ){
$itemsLeft .= '<a class="' . $parentPageId . '" href="'.helper::baseUrl() . $this->getUrl(0).'">'; $itemsLeft .= '<a class="' . $parentPageId . '" href="'.helper::baseUrl() . $this->getUrl(0).'">';
} else { } else {
$itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . helper::baseUrl() . $childKey . '"' . $targetBlank . '>'; $itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . helper::baseUrl() . $childKey . '"' . $targetBlank . $targetLity . '>';
} }
switch ($this->getData(['page', $childKey, 'typeMenu'])) { switch ($this->getData(['page', $childKey, 'typeMenu'])) {
@ -2832,7 +2842,10 @@ class layout extends common {
} }
// Propriétés de l'item // Propriétés de l'item
$active = ($parentPageId === $currentPageId OR in_array($currentPageId, $childrenPageIds)) ? ' class="active"' : ''; $active = ($parentPageId === $currentPageId OR in_array($currentPageId, $childrenPageIds)) ? ' class="active"' : '';
$targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank"' : ''; $targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank" ' : '';
$targetLity = $this->getData(['page', $parentPageId, 'lity'])
&& $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
? ' rel="data-lity" ' : '';
// Mise en page de l'item; // Mise en page de l'item;
// Ne pas afficher le parent d'une sous-page quand l'option est sélectionnée. // Ne pas afficher le parent d'une sous-page quand l'option est sélectionnée.
if ($onlyChildren === false) { if ($onlyChildren === false) {
@ -2841,7 +2854,7 @@ class layout extends common {
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) { AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) {
$items .= '<a href="'.$this->getUrl(1).'">'; $items .= '<a href="'.$this->getUrl(1).'">';
} else { } else {
$items .= '<a href="'. helper::baseUrl() . $parentPageId . '"' . $targetBlank . $active .'>'; $items .= '<a href="'. helper::baseUrl() . $parentPageId . '"' . $targetBlank . $targetLity . $active .'>';
} }
$items .= $this->getData(['page', $parentPageId, 'title']); $items .= $this->getData(['page', $parentPageId, 'title']);
$items .= '</a>'; $items .= '</a>';
@ -2856,6 +2869,9 @@ class layout extends common {
// Propriétés de l'item // Propriétés de l'item
$active = ($childKey === $currentPageId) ? ' class="active"' : ''; $active = ($childKey === $currentPageId) ? ' class="active"' : '';
$targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : ''; $targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : '';
$targetLity = $this->getData(['page', $childKey, 'lity'])
&& $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
? ' rel="data-lity" ' : '';
// Mise en page du sous-item // Mise en page du sous-item
$itemsChildren .= '<li class="menuSideChild">'; $itemsChildren .= '<li class="menuSideChild">';
@ -2863,7 +2879,7 @@ class layout extends common {
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) { AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) {
$itemsChildren .= '<a href="'.$this->getUrl(1).'">'; $itemsChildren .= '<a href="'.$this->getUrl(1).'">';
} else { } else {
$itemsChildren .= '<a href="' . helper::baseUrl() . $childKey . '"' . $targetBlank . $active . '>'; $itemsChildren .= '<a href="' . helper::baseUrl() . $childKey . '"' . $targetBlank . $targetLity . $active . '>';
} }
$itemsChildren .= $this->getData(['page', $childKey, 'title']); $itemsChildren .= $this->getData(['page', $childKey, 'title']);

View File

@ -145,7 +145,8 @@ class page extends common {
'displayMenu' => '0', 'displayMenu' => '0',
'hideMenuSide' => false, 'hideMenuSide' => false,
'hideMenuHead' => false, 'hideMenuHead' => false,
'hideMenuChildren' => false 'hideMenuChildren' => false,
'lity' => false
] ]
]); ]);
// Met à jour le site map // Met à jour le site map
@ -400,6 +401,7 @@ class page extends common {
'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN), 'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN),
'hideMenuHead' => $this->getinput('pageEditHideMenuHead', helper::FILTER_BOOLEAN), 'hideMenuHead' => $this->getinput('pageEditHideMenuHead', helper::FILTER_BOOLEAN),
'hideMenuChildren' => $this->getinput('pageEditHideMenuChildren', helper::FILTER_BOOLEAN), 'hideMenuChildren' => $this->getinput('pageEditHideMenuChildren', helper::FILTER_BOOLEAN),
'lity' => $this->getinput('pageEditLity', helper::FILTER_BOOLEAN)
] ]
]); ]);
// Barre renommée : changement le nom de la barre dans les pages mères // Barre renommée : changement le nom de la barre dans les pages mères

View File

@ -540,6 +540,19 @@ pageTypeMenuDOM.on("change", function() {
}); });
/**
* Désactive targeblank si datality et inversement
*/
$("#pageEditLity").on("click", function() {
if( $("#pageEditTargetBlank").is(':checked')){
$("#pageEditTargetBlank").prop('checked', false)
}
});
$("#pageEditTargetBlank").on("click", function() {
if( $("#pageEditLity").is(':checked')){
$("#pageEditLity").prop('checked', false)
}
});
/** /**

View File

@ -191,17 +191,24 @@ echo template::formOpen('pageEditForm');
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col4">
<?php echo template::checkbox('pageEditDisable', true, 'Désactivée', [ <?php echo template::checkbox('pageEditDisable', true, 'Désactivée', [
'checked' => $this->getData(['page', $this->getUrl(2), 'disable']), 'checked' => $this->getData(['page', $this->getUrl(2), 'disable']),
'help' => 'Une page désactivée n\'est pas cliquable en mode déconnecté, les pages enfants sont visibles et accessibles. La page d\'accueil n\'est pas désactivable.' 'help' => 'Une page désactivée n\'est pas cliquable en mode déconnecté, les pages enfants sont visibles et accessibles. La page d\'accueil n\'est pas désactivable.'
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col4">
<?php echo template::checkbox('pageEditTargetBlank', true, 'Nouvel onglet', [ <?php echo template::checkbox('pageEditTargetBlank', true, 'Nouvel onglet', [
'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank']) 'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank'])
]); ?> ]); ?>
</div> </div>
<div class="col4">
<?php echo template::checkbox('pageEditLity', true, 'Fenêtre superposée', [
'checked' => $this->getData(['page', $this->getUrl(2), 'lity']),
'help' => 'Affiche la page dans une fenêtre superposée, cette option ne s\'applique pas en mode connecté.'
]); ?>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">