Lity in progess

This commit is contained in:
fredtempez 2021-04-02 15:01:19 +02:00
parent 9d97c0a75f
commit ab95e70846
1 changed files with 3200 additions and 3201 deletions

View File

@ -2076,8 +2076,16 @@ 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']) ? self:: DISPLAY_LAYOUT_LITY : $this->output['display']
]); ]);
// Mode connecté, désactiver lity
if ( $this->getData(['page', $this->getUrl(0), 'lity']) === true && $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') ) {
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_MAIN
]);
}
} }
// Importe le module // Importe le module
else { else {
// Id du module, et valeurs en sortie de la page si il s'agit d'un module de page // Id du module, et valeurs en sortie de la page si il s'agit d'un module de page
@ -2095,10 +2103,10 @@ class core extends common {
'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']),
'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), 'display']),
]); ]);
$pageContent = $this->getData(['page', $this->getUrl(0), 'content']); $pageContent = $this->getData(['page', $this->getUrl(0), 'content']);
//echo $this->output['display'];
} }
else { else {
$moduleId = $this->getUrl(0); $moduleId = $this->getUrl(0);
@ -2173,10 +2181,15 @@ class core extends common {
} }
// Données en sortie applicables même lorsqu'une notice est présente // Données en sortie applicables même lorsqu'une notice est présente
// Affichage // Affichage
if($output['display']) { if ( $this->getData(['page', $this->getUrl(0), 'lity']) === true
$this->addOutput([ && $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) {
'display' => $output['display'] $this->addOutput(['display' => self:: DISPLAY_LAYOUT_LITY]);
]); } else {
if($output['display']) {
$this->addOutput([
'display' => $output['display']
]);
}
} }
// Contenu brut // Contenu brut
if($output['content']) { if($output['content']) {
@ -2343,54 +2356,40 @@ class core extends common {
$this->addOutput([ $this->addOutput([
'metaDescription' => $this->getData(['locale', 'metaDescription']) 'metaDescription' => $this->getData(['locale', 'metaDescription'])
]); ]);
} };
// Layout Lity lorsque l'option est active. switch($this->output['display']) {
if ( $this->getData(['page', $this->getUrl(0), 'lity']) === true ) { // Layout brut
// Mode connecté pas de menu en mode connecté case self::DISPLAY_RAW:
if ( $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') ) { echo $this->output['content'];
$this->addOutput([ break;
'display' => self::DISPLAY_LAYOUT_MAIN // Layout vide
]); case self::DISPLAY_LAYOUT_BLANK:
} else { require 'core/layout/blank.php';
$this->addOutput([ break;
'display' => self::DISPLAY_LAYOUT_LITY // Affichage en JSON
]); case self::DISPLAY_JSON:
} header('Content-Type: application/json');
} echo json_encode($this->output['content']);
switch($this->output['display']) { break;
// Layout brut // RSS feed
case self::DISPLAY_RAW: case self::DISPLAY_RSS:
echo $this->output['content']; header('Content-type: application/rss+xml; charset=UTF-8');
break; echo $this->output['content'];
// Layout vide break;
case self::DISPLAY_LAYOUT_BLANK: // Layout allégé
require 'core/layout/blank.php'; case self::DISPLAY_LAYOUT_LIGHT:
break; require 'core/layout/light.php';
// Affichage en JSON break;
case self::DISPLAY_JSON: // Layout principal
header('Content-Type: application/json'); case self::DISPLAY_LAYOUT_MAIN:
echo json_encode($this->output['content']); require 'core/layout/main.php';
break; break;
// RSS feed // Layout Lity
case self::DISPLAY_RSS: case self::DISPLAY_LAYOUT_LITY:
header('Content-type: application/rss+xml; charset=UTF-8'); require 'core/layout/lity.php';
echo $this->output['content']; break;
break;
// Layout allégé
case self::DISPLAY_LAYOUT_LIGHT:
require 'core/layout/light.php';
break;
// Layout principal
case self::DISPLAY_LAYOUT_MAIN:
require 'core/layout/main.php';
break;
// Layout Lity
case self::DISPLAY_LAYOUT_LITY:
require 'core/layout/lity.php';
break;
} }
} }
} }
class layout extends common { class layout extends common {