Merge branch 'master_dev_07'

This commit is contained in:
fredtempez 2019-03-17 21:51:08 +01:00
commit 517e926c5f
5 changed files with 51 additions and 7 deletions

View File

@ -1,5 +1,11 @@
# ChangeLog # ChangeLog
## Version 9.0.07
- Correction :
- Disparition du menu quand la bannière est masquée
- Modifications :
- Barre d'administration, pages organisées
## Version 9.0.06 ## Version 9.0.06
- Correction : - Correction :
- Configuration des modes de codemirror - Configuration des modes de codemirror

View File

@ -118,7 +118,7 @@ class common {
'barLeft' => '', 'barLeft' => '',
'barRight' => '' 'barRight' => ''
], ],
'cachee' => [ 'privee' => [
'typeMenu' => 'text', 'typeMenu' => 'text',
'iconUrl' => '', 'iconUrl' => '',
'disable' => false, 'disable' => false,
@ -137,7 +137,7 @@ class common {
'position' => 2, 'position' => 2,
'group' => self::GROUP_MEMBER, 'group' => self::GROUP_MEMBER,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Cachée', 'title' => 'Privée',
'block' => '12', 'block' => '12',
'barLeft' => '', 'barLeft' => '',
'barRight' => '' 'barRight' => ''
@ -1076,7 +1076,6 @@ class common {
* Mises à jour * Mises à jour
*/ */
private function update() { private function update() {
echo "pop";
// Version 8.1.0 // Version 8.1.0
if($this->getData(['core', 'dataVersion']) < 810) { if($this->getData(['core', 'dataVersion']) < 810) {
$this->setData(['config', 'timezone', 'Europe/Paris']); $this->setData(['config', 'timezone', 'Europe/Paris']);
@ -2338,13 +2337,38 @@ class layout extends common {
if($this->getUser('group') >= self::GROUP_MODERATOR) { if($this->getUser('group') >= self::GROUP_MODERATOR) {
$leftItems .= '<li><select id="barSelectPage">'; $leftItems .= '<li><select id="barSelectPage">';
$leftItems .= '<option value="">Choisissez une page</option>'; $leftItems .= '<option value="">Choisissez une page</option>';
$leftItems .= '<optgroup label="Pages orphelines">';
$orpheline = true ;
$currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2);
foreach($this->getHierarchy(null, false) as $parentPageId => $childrenPageIds) { foreach($this->getHierarchy(null,false) as $parentPageId => $childrenPageIds) {
if ($this->getData(['page', $parentPageId, 'position']) !== 0 &&
$orpheline ) {
$orpheline = false;
$leftItems .= '<optgroup label="Pages du menu">';
}
// Exclure les barres
if ($this->getData(['page', $parentPageId, 'block']) !== 'bar') {
$leftItems .= '<option value="' .
helper::baseUrl() .
$parentPageId . '"' .
($parentPageId === $currentPageId ? ' selected' : false) .
($this->getData(['page', $parentPageId, 'disable']) === true ? ' class="inactive"' : false) .
'>' .
$this->getData(['page', $parentPageId, 'title']) .
'</option>';
foreach($childrenPageIds as $childKey) {
$leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $this->getData(['page', $childKey, 'title']) . '</option>';
}
}
}
// Afficher les barres
$leftItems .= '<optgroup label="Barres latérales">';
foreach($this->getHierarchy(null, false,true) as $parentPageId => $childrenPageIds) {
$leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'title']) . '</option>'; $leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'title']) . '</option>';
foreach($childrenPageIds as $childKey) { foreach($childrenPageIds as $childKey) {
$leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $this->getData(['page', $childKey, 'title']) . '</option>'; $leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $this->getData(['page', $childKey, 'title']) . '</option>';
} }
} }
$leftItems .= '</select></li>'; $leftItems .= '</select></li>';
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" data-tippy-content="Créer une page ou<br>une barre latérale">' . template::ico('plus') . '</a></li>'; $leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" data-tippy-content="Créer une page ou<br>une barre latérale">' . template::ico('plus') . '</a></li>';
if( if(

View File

@ -63,6 +63,10 @@ li ul {
margin: 0; margin: 0;
} }
option.inactive {
color: darkred;
}
/* Séparateur */ /* Séparateur */
hr { hr {
border: 0; border: 0;

View File

@ -414,6 +414,9 @@ $("#pageEditModuleConfig").on("click", function() {
*/ */
var hierarchy = <?php echo json_encode($this->getHierarchy()); ?>; var hierarchy = <?php echo json_encode($this->getHierarchy()); ?>;
var pages = <?php echo json_encode($this->getData(['page'])); ?>; var pages = <?php echo json_encode($this->getData(['page'])); ?>;
// 9.0.07 corrige une mauvaise sélection d'une page orpheline avec enfant
var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>;
// 9.0.07
$("#pageEditParentPageId").on("change", function() { $("#pageEditParentPageId").on("change", function() {
var positionDOM = $("#pageEditPosition"); var positionDOM = $("#pageEditPosition");
positionDOM.empty().append( positionDOM.empty().append(
@ -428,7 +431,7 @@ $("#pageEditParentPageId").on("change", function() {
// Liste des pages sans parents // Liste des pages sans parents
for(var key in hierarchy) { for(var key in hierarchy) {
if(hierarchy.hasOwnProperty(key)) { if(hierarchy.hasOwnProperty(key)) {
// Sélectionne la page avant si il s'agit de la page courante // Sélectionne la page avant s'il s'agit de la page courante
if(key === "<?php echo $this->getUrl(2); ?>") { if(key === "<?php echo $this->getUrl(2); ?>") {
positionSelected = positionPrevious; positionSelected = positionPrevious;
} }
@ -443,6 +446,11 @@ $("#pageEditParentPageId").on("change", function() {
} }
} }
} }
// 9.0.07 corrige une mauvaise sélection d'une page orpheline avec enfant
if (positionInitial === 0) {
positionSelected = 0;
}
// 9.0.07
} }
// Un page parent est selectionnée // Un page parent est selectionnée
else { else {

View File

@ -323,8 +323,10 @@ class theme extends common {
$position = str_replace ('body','site',$this->getData(['theme','menu','position'])); $position = str_replace ('body','site',$this->getData(['theme','menu','position']));
break; break;
case 'body' : case 'body' :
$position = str_replace ('site','body',$this->getData(['theme','menu','position'])); $position = str_replace ('site','body',$this->getData(['theme','menu','position']));
break; break;
default:
$position = $this->getData(['theme','menu','position']);
} }
$this->setData(['theme', 'menu', [ $this->setData(['theme', 'menu', [
'backgroundColor' => $this->getData(['theme', 'menu', 'backgroundColor']), 'backgroundColor' => $this->getData(['theme', 'menu', 'backgroundColor']),