[9.2.13] Ouverte dans une poup lity

This commit is contained in:
Fred Tempez 2019-12-02 13:20:19 +01:00
parent 2696720745
commit b950b54ebc
4 changed files with 35 additions and 5 deletions

View File

@ -2167,7 +2167,8 @@ class layout extends common {
// Passer les entrées masquées // Passer les entrées masquées
// 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, 'targetLity']) && $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')) ? ' rel="data-lity"' : '';
// Mise en page de l'item // Mise en page de l'item
$items .= '<li>'; $items .= '<li>';
@ -2176,7 +2177,7 @@ class layout extends common {
{$items .= '<a href="'.$this->getUrl(1).'">'; {$items .= '<a href="'.$this->getUrl(1).'">';
} else { } else {
$items .= '<a href="' . helper::baseUrl() . $parentPageId . '"' . $active . $targetBlank . '>'; $items .= '<a href="' . helper::baseUrl() . $parentPageId . '"' . $active . $targetBlank . $targetLity . '>';
} }
switch ($this->getData(['page', $parentPageId, 'typeMenu'])) { switch ($this->getData(['page', $parentPageId, 'typeMenu'])) {
@ -2224,13 +2225,14 @@ 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, 'targetLity']) && $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')) ? ' rel="data-lity"' : '';
// Mise en page du sous-item // Mise en page du sous-item
$items .= '<li>'; $items .= '<li>';
if ( $this->getData(['page',$childKey,'disable']) === true if ( $this->getData(['page',$childKey,'disable']) === true
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() . $childKey . '"' . $active . $targetBlank . '>'; $items .= '<a href="' . helper::baseUrl() . $childKey . '"' . $active . $targetBlank . $targetLity . '>';
} }
switch ($this->getData(['page', $childKey, 'typeMenu'])) { switch ($this->getData(['page', $childKey, 'typeMenu'])) {
@ -2323,6 +2325,7 @@ 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, 'targetLity']) && $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) {
@ -2331,7 +2334,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 . '"' . $active . $targetBlank . '>'; $items .= '<a href="' . helper::baseUrl() . $parentPageId . '"' . $active . $targetBlank . $targetLity . '>';
} }
$items .= $this->getData(['page', $parentPageId, 'title']); $items .= $this->getData(['page', $parentPageId, 'title']);
$items .= '</a>'; $items .= '</a>';
@ -2346,6 +2349,7 @@ 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, 'targetLity']) && $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">';
@ -2353,7 +2357,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 . '"' . $active . $targetBlank . '>'; $itemsChildren .= '<a href="' . helper::baseUrl() . $childKey . '"' . $active . $targetBlank . $targetLity . '>';
} }
$itemsChildren .= $this->getData(['page', $childKey, 'title']); $itemsChildren .= $this->getData(['page', $childKey, 'title']);

View File

@ -81,6 +81,7 @@ class page extends common {
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'group' => self::GROUP_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'targetLity' => false,
'title' => $pageTitle, 'title' => $pageTitle,
'block' => '12', 'block' => '12',
'barLeft' => '', 'barLeft' => '',
@ -258,6 +259,7 @@ class page extends common {
'position' => $position, 'position' => $position,
'group' => $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0, 'group' => $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0,
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN), 'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
'targetLity' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN) === true ? false : $this->getInput('pageEditTargetLity', helper::FILTER_BOOLEAN),
'title' => htmlspecialchars_decode($this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT, true), ENT_QUOTES), 'title' => htmlspecialchars_decode($this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT, true), ENT_QUOTES),
'block' => $this->getinput('pageEditBlock'), 'block' => $this->getinput('pageEditBlock'),
'barLeft' => $barLeft, 'barLeft' => $barLeft,

View File

@ -203,6 +203,24 @@ $( document ).ready(function() {
}); });
/**
* Empêche la double sélection Blank et Lity
*/
var pageEditTargetBlankDOM = $("#pageEditTargetBlank");
pageEditTargetBlankDOM.on("change", function() {
if ($(this).is(':checked') &&
$("#pageEditTargetLity").is(':checked') ) {
$("#pageEditTargetLity").prop("checked", false);
}
});
var pageEditTargetLityDOM = $("#pageEditTargetLity");
pageEditTargetLityDOM.on("change", function() {
if ($(this).is(':checked') &&
$("#pageEditTargetBlank").is(':checked') ) {
$("#pageEditTargetBlank").prop("checked", false);
}
});
/** /**
* Cache le l'option "ne pas afficher les pages enfants dans le menu horizontal" lorsque la page est désactivée * Cache le l'option "ne pas afficher les pages enfants dans le menu horizontal" lorsque la page est désactivée
*/ */

View File

@ -171,6 +171,12 @@ echo template::formOpen('pageEditForm'); ?>
'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank']) 'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank'])
]); ?> ]); ?>
</div> </div>
<div class="col6">
<?php echo template::checkbox('pageEditTargetLity', true, 'Popup Intégrée', [
'checked' => $this->getData(['page', $this->getUrl(2), 'targetLity'])
]); ?>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">