Titres courts

This commit is contained in:
Fred Tempez 2021-11-04 13:55:23 +01:00
parent 6028cd4d0a
commit 0779284c5f
6 changed files with 79 additions and 42 deletions

View File

@ -3,7 +3,9 @@
## Version 11.2.00
- Modifications :
- Disposition des options de configuration du site.
- Pages : il est désormais possible de donner un nom de page court qui sera utilisé dans le menu du site, dans les abrres latérales et dans les sélecteurs de page (éditeur / lien). En revanche le nom de la page affiché en haut de celle-ci est inchangé. Dans la plupart des cas le titre court sera identique au titre.
- Les écrans d'aide renvoient vers le site doc.zwiicms.fr
- Mise en évidence du statut des pages dans la liste de la barre d'administration. Rouge italique : page orpheline ; Orange gras page inactive.
## Version 11.1.01
- Corrections :

View File

@ -800,23 +800,23 @@ class common {
if ($this->getData(['page', $parentId, 'block']) !== 'bar' ) {
// Boucler sur les enfants et récupérer le tableau children avec la liste des enfants
foreach($childIds as $childId) {
$children [] = [ 'title' => ' » '. html_entity_decode($this->getData(['page', $childId, 'title']), ENT_QUOTES) ,
$children [] = [ 'title' => ' » '. html_entity_decode($this->getData(['page', $childId, 'shortTitle']), ENT_QUOTES) ,
'value'=> $rewrite.$childId
];
}
// Traitement
if (empty($childIds)) {
// Pas d'enfant, uniquement l'entrée du parent
$parents [] = ['title' => html_entity_decode($this->getData(['page', $parentId, 'title']), ENT_QUOTES) ,
$parents [] = ['title' => html_entity_decode($this->getData(['page', $parentId, 'shortTitle']), ENT_QUOTES) ,
'value'=> $rewrite.$parentId
];
} else {
// Des enfants, on ajoute la page parent en premier
array_unshift ($children , ['title' => html_entity_decode($this->getData(['page', $parentId, 'title']), ENT_QUOTES) ,
array_unshift ($children , ['title' => html_entity_decode($this->getData(['page', $parentId, 'shortTitle']), ENT_QUOTES) ,
'value'=> $rewrite.$parentId
]);
// puis on ajoute les enfants au parent
$parents [] = ['title' => html_entity_decode($this->getData(['page', $parentId, 'title']), ENT_QUOTES) ,
$parents [] = ['title' => html_entity_decode($this->getData(['page', $parentId, 'shortTitle']), ENT_QUOTES) ,
'value'=> $rewrite.$parentId ,
'menu' => $children
];
@ -1584,24 +1584,24 @@ class common {
switch ($this->getData(['page', $parentPageId, 'typeMenu'])) {
case '' :
$itemsLeft .= $this->getData(['page', $parentPageId, 'title']);
$itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']);
break;
case 'text' :
$itemsLeft .= $this->getData(['page', $parentPageId, 'title']);
$itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']);
break;
case 'icon' :
if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $parentPageId, 'iconUrl']).'" />';
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'shortTitle']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $parentPageId, 'iconUrl']).'" />';
} else {
$itemsLeft .= $this->getData(['page', $parentPageId, 'title']);
$itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']);
}
break;
case 'icontitle' :
if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") {
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $parentPageId, 'iconUrl']).'" data-tippy-content="';
$itemsLeft .= $this->getData(['page', $parentPageId, 'title']).'"/>';
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'titlshortTitlee']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $parentPageId, 'iconUrl']).'" data-tippy-content="';
$itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']).'"/>';
} else {
$itemsLeft .= $this->getData(['page', $parentPageId, 'title']);
$itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']);
}
break;
}
@ -1644,32 +1644,32 @@ class common {
switch ($this->getData(['page', $childKey, 'typeMenu'])) {
case '' :
$itemsLeft .= $this->getData(['page', $childKey, 'title']);
$itemsLeft .= $this->getData(['page', $childKey, 'shortTitle']);
break;
case 'text' :
$itemsLeft .= $this->getData(['page', $childKey, 'title']);
$itemsLeft .= $this->getData(['page', $childKey, 'shortTitle']);
break;
case 'icon' :
if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $childKey, 'iconUrl']).'" />';
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'shortTitle']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $childKey, 'iconUrl']).'" />';
} else {
$itemsLeft .= $this->getData(['page', $parentPageId, 'title']);
$itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']);
}
break;
case 'icontitle' :
if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $childKey, 'iconUrl']).'" data-tippy-content="';
$itemsLeft .= $this->getData(['page', $childKey, 'title']).'"/>';
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'shortTitle']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $childKey, 'iconUrl']).'" data-tippy-content="';
$itemsLeft .= $this->getData(['page', $childKey, 'shortTitle']).'"/>';
} else {
$itemsLeft .= $this->getData(['page', $childKey, 'title']);
$itemsLeft .= $this->getData(['page', $childKey, 'shortTitle']);
}
break;
case 'icontext' :
if ($this->getData(['page', $childKey, 'iconUrl']) != "") {
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'title']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $childKey, 'iconUrl']).'" />';
$itemsLeft .= $this->getData(['page', $childKey, 'title']);
$itemsLeft .= '<img alt="'.$this->getData(['page', $parentPageId, 'shortTitle']).'" src="'. helper::baseUrl(false) .self::FILE_DIR.'source/'.$this->getData(['page', $childKey, 'iconUrl']).'" />';
$itemsLeft .= $this->getData(['page', $childKey, 'shortTitle']);
} else {
$itemsLeft .= $this->getData(['page', $childKey, 'title']);
$itemsLeft .= $this->getData(['page', $childKey, 'shortTitle']);
}
break;
}
@ -1757,7 +1757,7 @@ class common {
} else {
$items .= '<a href="'. helper::baseUrl() . $parentPageId . '"' . $targetBlank . $active .'>';
}
$items .= $this->getData(['page', $parentPageId, 'title']);
$items .= $this->getData(['page', $parentPageId, 'shortTitle']);
$items .= '</a>';
}
$itemsChildren = '';
@ -1780,7 +1780,7 @@ class common {
$itemsChildren .= '<a href="' . helper::baseUrl() . $childKey . '"' . $targetBlank . $active . '>';
}
$itemsChildren .= $this->getData(['page', $childKey, 'title']);
$itemsChildren .= $this->getData(['page', $childKey, 'shortTitle']);
$itemsChildren .= '</a></li>';
}
// Concatène les items enfants
@ -1844,7 +1844,6 @@ class common {
$notificationClass = 'notificationSuccess';
}
if(common::$inputNotices) {
var_dump ( common::$inputNotices );
$notification = 'Impossible de soumettre le formulaire, car il contient des erreurs';
$notificationClass = 'notificationError';
}
@ -1898,22 +1897,22 @@ class common {
helper::baseUrl() .
$parentPageId . '"' .
($parentPageId === $currentPageId ? ' selected' : false) .
'class="' .
' class="' .
($this->getData(['page', $parentPageId, 'disable']) === true ? 'pageInactive' : '') .
($this->getData(['page', $parentPageId, 'position']) === 0 ? ' pageHidden' : '') .
'">' .
$this->getData(['page', $parentPageId, 'title']) .
$this->getData(['page', $parentPageId, 'shortTitle']) .
'</option>';
foreach($childrenPageIds as $childKey) {
$leftItems .= '<option value="' .
helper::baseUrl() .
$childKey . '"' .
($childKey === $currentPageId ? ' selected' : false) .
'class="' .
' class="' .
($this->getData(['page', $childKey, 'disable']) === true ? 'pageInactive' : '') .
($this->getData(['page', $childKey, 'position']) === 0 ? ' pageHidden' : '') .
'">&nbsp;&nbsp;&nbsp;&nbsp;' .
$this->getData(['page', $childKey, 'title']) .
$this->getData(['page', $childKey, 'shortTitle']) .
'</option>';
}
}
@ -1922,9 +1921,9 @@ class common {
// 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, 'shortTitle']) . '</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>';
$leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $this->getData(['page', $childKey, 'shortTitle']) . '</option>';
}
}
$leftItems .= '</optgroup>';

View File

@ -681,6 +681,17 @@ if ($this->getData(['core', 'dataVersion']) < 11200) {
$this->setData(['config', 'connect', 'autoDisconnect', $this->getData(['config', 'autoDisconnect'])]);
$this->deleteData(['config', 'autoDisconnect']);
// Ajout de la variable shortTitle basée sur Title
foreach ($this->getHierarchy(null,null,null) as $parentKey=>$parentValue) {
$pageList [] = $parentKey;
foreach ($parentValue as $childKey) {
$pageList [] = $childKey;
}
}
foreach ($pageList as $parentKey => $parent) {
$this->setData(['page', $parent, 'shortTitle', $this->getData(['page', $parent, 'title']) ]);
}
// Mise à jour
$this->setData(['core', 'dataVersion', 11200]);
}

View File

@ -92,6 +92,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Accueil',
'shortTitle' => 'Accueil',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -245,6 +246,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Accueil',
'shortTitle' => 'Accueil',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -267,7 +269,8 @@ class init extends common {
'position' => 1,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Enfant',
'title' => 'Page Enfant',
'shortTitle' => 'Enfant',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -290,7 +293,8 @@ class init extends common {
'position' => 2,
'group' => self::GROUP_MEMBER,
'targetBlank' => false,
'title' => 'Privée',
'title' => 'Page privée',
'shortTitle' => 'Privée',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -314,6 +318,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Mise en page',
'shortTitle' => 'Mise en page',
'block' => '4-8',
'barLeft' => 'barre',
'barRight' => '',
@ -336,7 +341,8 @@ class init extends common {
'position' => 3,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Menu latéral',
'title' => 'Barre latérale avec menu',
'shortTitle' => 'Menu latéral',
'block' => '9-3',
'barLeft' => '',
'barRight' => 'barrelateraleavecmenu',
@ -360,6 +366,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Blog',
'shortTitle' => 'Blog',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -382,7 +389,8 @@ class init extends common {
'position' => 4,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Galeries',
'title' => 'Galeries d\'images',
'shortTitle' => 'Galeries',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -407,6 +415,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => true,
'title' => 'Site de Zwii',
'shortTitle' => 'Site de Zwii',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -430,6 +439,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Contact',
'shortTitle' => 'Contact',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -453,6 +463,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Barre latérale',
'shortTitle' => 'Barre latérale',
'block' => 'bar',
'barLeft' => '',
'barRight' => '',
@ -476,6 +487,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Barre latérale avec menu',
'shortTitle' => 'Barre latérale avec menu',
'block' => 'bar',
'barLeft' => '',
'barRight' => '',
@ -499,6 +511,7 @@ class init extends common {
'group' => 0,
'targetBlank' => false,
'title' => 'Mentions légales',
'shortTitle' => 'Mentions légales',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -523,6 +536,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Maintenance en cours',
'shortTitle' => 'Maintenance en cours',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -547,6 +561,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Erreur 403',
'shortTitle' => 'Erreur 403',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -570,6 +585,7 @@ class init extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Erreur 404',
'shortTitle' => 'Erreur 404',
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -592,7 +608,8 @@ class init extends common {
'position' => 7,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Recherche',
'title' => 'Recherche dans le site',
'shortTitle' => 'Rechercher',
'block' => '12',
'barLeft' => '',
'barRight' => '',

View File

@ -142,6 +142,7 @@ class page extends common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => $pageTitle,
'shortTitle' => $pageTitle,
'block' => '12',
'barLeft' => '',
'barRight' => '',
@ -426,6 +427,7 @@ class page extends common {
'group' => $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0,
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
'shortTitle' => $this->getInput('pageEditShortTitle', helper::FILTER_STRING_SHORT, true),
'block' => $this->getinput('pageEditBlock'),
'barLeft' => $barLeft,
'barRight' => $barRight,
@ -495,6 +497,8 @@ class page extends common {
self::$pagesBarId[$parentPageId] = $this->getData(['page', $parentPageId, 'title']);
}
}
// Mise à jour de la liste des pages pour TinyMCE
$this->pages2Json();
// Valeurs en sortie
$this->addOutput([
'title' => $this->getData(['page', $this->getUrl(2), 'title']),

View File

@ -1,9 +1,6 @@
<?php
echo template::formOpen('pageEditForm');
// Mise à jour de la liste des pages pour TinyMCE
$this->pages2Json(); ?>
<?php echo template::formOpen('pageEditForm'); ?>
<div class="row">
<div class="col2">
<div class="col2">
<?php $href = helper::baseUrl() . $this->getUrl(2); ?>
<?php if ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code')$href = helper::baseUrl(); ?>
<?php echo template::button('pageEditBack', [
@ -68,13 +65,20 @@ echo template::formOpen('pageEditForm');
</div>
</div>
<div class="row">
<div class="col4">
<div class="col2">
<?php echo template::text('pageEditShortTitle', [
'label' => 'Titre Court',
'value' => $this->getData(['page', $this->getUrl(2), 'shortTitle']),
'help' => 'Le titre court est affiché dans les menus. Il peut être identique au titre de la page.'
]); ?>
</div>
<div class="col3">
<?php echo template::select('pageTypeMenu', $module::$typeMenu,[
'label' => 'Aspect du lien',
'selected' => $this->getData(['page', $this->getUrl(2), 'typeMenu'])
]); ?>
</div>
<div class="col4">
<div class="col3">
<?php echo template::file('pageIconUrl', [
'help' => 'Sélectionnez une image ou une icône de petite dimension',
'label' => 'Icône',